Changeset 152 for Dev/trunk/selectSession.php
- Timestamp:
- 11/09/11 17:14:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/selectSession.php
r151 r152 5 5 redirect("index.php"); 6 6 } 7 8 if (isset($_SESSION['message'])) { 9 echo $_SESSION['message']; 10 unset($_SESSION['message']); 11 } 12 7 13 $dbi = new DatabaseInterface(); 14 8 15 if (isset($_POST['createSession'])) { 9 16 //check if name is set … … 11 18 // check if name is available 12 19 if (!empty($_POST['newSessionName'])) { 13 $matching Names= $dbi->get("Session", array("title" => $_POST['newSessionName']));14 if (count($matching Names) == 0) {20 $matching = $dbi->get("Session", array("title" => $_POST['newSessionName'])); 21 if (count($matching) == 0) { 15 22 // make new session! 23 unset($matching); 16 24 $session = new Session(null, $_POST['newSessionName'], null, null, null); 17 25 $dbi->set($session); … … 25 33 } 26 34 35 if (isset($_POST['deleteSession'])) { 36 if (isset($_POST['sessionUID'])) { 37 //Kan de database al objecten verwijderen? 38 } 39 } 40 41 if (isset($_POST['editSession'])) { 42 if (isset($_POST['sessionUID'])) { 43 $matching = $dbi->get("SESSION", array("uid" => $_POST['sessionUID'])); 44 if (count($matching) == 1 && $matching[0] != null) { 45 $_SESSION['currentSession'] = $_POST['sessionUID']; 46 redirect("pipelineEditor.php"); 47 } 48 } 49 } 50 27 51 //Get available sessions for current user 28 //$sessions = $dbi->get("Session", array("creator"=>$_SESSION['username'])); // Dit werkt niet, SessionConnector/Session.php hebben nog geen creator property29 $sessions = $dbi->get("Session", array()); // In plaats daarvan maar gewoon alles laden dan... lol30 var_dump($sessions);52 //$sessions = $dbi->get("Session", array("creator"=>$_SESSION['username'])); //This does not work, session.php does not yet have a property 'creator' 53 $sessions = $dbi->get("Session", array()); // Let's just load everything then... 54 //var_dump($sessions); 31 55 ?> 32 56 … … 37 61 <title>Select a session</title> 38 62 <?php new StyleSheet("awesome"); ?> 63 <script type="text/javascript" src="js/sequencerScripts.js"></script> 39 64 </head> 40 65 <body> 41 66 <form action="selectSession.php" method="POST"> 42 67 <fieldset name="selectionMenu"> 43 <select name="sessionName" style="float: left;"> 68 <!-- onchange van volgende select linkt deze aan de ajax-based info panel, script staat in sequencerScripts.js --> 69 <select name="sessionUID" style="float: left;" onChange="ajaxInfoRequest(this.value, document.getElementById('sessionDescription'));"> 44 70 <?php 45 71 foreach ($sessions as $session) { 46 echo '<option value="' . $session->uid . '">' . $session->title . '</option>' ;72 echo '<option value="' . $session->uid . '">' . $session->title . '</option>' . "\n"; 47 73 } 48 74 ?> … … 63 89 </fieldset> 64 90 <fieldset id="sessionDescription"> 65 91 Info goes here: 66 92 </fieldset> 67 93 </form>
Note: See TracChangeset
for help on using the changeset viewer.