Ignore:
Timestamp:
12/15/11 17:09:49 (13 years ago)
Author:
fpvanagthoven
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/createObject.php

    r166 r185  
    66    if (!empty($_POST['objectToCreate'])) {
    77        $otc = $_POST['objectToCreate'];
    8     }
    9     else {
     8    } else {
    109        //die ("Invalid arguments passed!");
    1110    }
    12 }
    13 else {
     11} else {
    1412    //die ("No arguments passed!");
    1513}
    1614
    1715$dbi = new DatabaseInterface();
    18 $creator_results = $dbi->get("User", array("name"=>$_SESSION['username']));
     16$creator_results = $dbi->get("User", array("name" => $_SESSION['username']));
    1917if (count($creator_results) > 0) {
    2018    $creator = $creator_results[0];
    21 }
    22 else {
    23     //die ("Invalid creator, make sur0e you are logged in!");
     19} else {
     20    //die ("Invalid creator, make sure you are logged in!");
    2421}
    2522
     
    3936        //TODO
    4037        break;
     38    case "question":
     39        $newQuestion = new Question(null, "new Question", "int", "Default description", "Standard category", array());
     40        $dbi->set($newQuestion);
     41        $uid = $newQuestion->uid;
     42        break;
    4143    default:
    4244        //die ("Variable \$otc: $otc does not match a compatible object type!");
     
    4547
    4648echo $uid;
    47 
    4849?>
Note: See TracChangeset for help on using the changeset viewer.