Example #1
0
 public static function find($id)
 {
     $event_query = getEvent($id);
     $event = new Event();
     $event->setId($event_query["id"]);
     $event->setDate($event_query["date"]);
     $event->setDescription($event_query["description"]);
     $event->setName($event_query["name"]);
     $event->setPublic($event_query["public"]);
     $event->setOwner($event_query["owner"]);
     $event->setImagePath($event_query["imagePath"]);
     return $event;
 }
Example #2
0
        } else {
            $status = 200;
            $response["code"] = $status;
            $response["error"] = 1;
            $response["error_message"] = "Some error occured while updating contingent {$contingent->getId()}.";
        }
    } else {
        $response["error"] = 1;
        $response["error_message"] = "Invalid ID,Expecting numeric ID";
    }
    print json_encode($response);
});
$app->put('/event/:id', function ($id) use($app, $eventMapper) {
    verifyRequiredParams(array('id', 'logo'));
    $event = new Event();
    $event->setId($id);
    $event->setName($app->request()->put('name'));
    $event->setDetails($app->request()->put('details'));
    $event->setSlogan($app->request()->put('slogan'));
    $event->setCategory($app->request()->put('type'));
    $event->setRules($app->request()->put('rules'));
    $event->setStartDate($app->request()->put('start_date'));
    $event->setEndDate($app->request()->put('end_date'));
    $event->setStartTime($app->request()->put('start_time'));
    $event->setEndTime($app->request()->put('end_time'));
    $event->setGroupSize($app->request()->put('group_size'));
    $event->setLogo($app->request()->put('logo'));
    # --Getting the put vars and typecasting to int. Blehhh. Can't help, its PHP xD
    $feeHome = $app->request()->put('fee_home');
    settype($feeHome, "integer");
    $feeRemote = $app->request()->put('fee_remote');
Example #3
0
 function find($criteria = null, $order = null, $limit = 1000, $from = 0)
 {
     $result = $this->database->query($this->buildFindQuery($criteria, $order, $limit, $from));
     if (!is_null($result->getError())) {
         return $result->getError();
     }
     $events = array();
     while ($row = $result->fetchRow()) {
         $event = new Event();
         $value = $row[0];
         $event->setId($value);
         $value = $row[1];
         $event->setPid($value);
         $value = $row[2];
         $event->setCid($value);
         $value = $row[3];
         $event->setSid($value);
         $value = $row[4];
         $event->setValid_date($value);
         $value = $row[5];
         $event->setReminde_date($value);
         $value = $row[6];
         $event->setAmount($value);
         $value = $row[7];
         $event->setState($value);
         $value = $row[8];
         $event->setMoved($value);
         $value = $row[9];
         $value = $this->database->toBoolean($value);
         $event->setDelay($value);
         $value = $row[10];
         $event->setDelays($value);
         $value = $row[11];
         $event->setComment($value);
         $value = $row[12];
         $event->setIncome($value);
         $value = $row[13];
         $event->setCost($value);
         $value = $row[14];
         $event->setProfit($value);
         $value = $row[15];
         $event->setWasted_time($value);
         $value = $row[16];
         $event->setR_date($value);
         $value = $row[17];
         $event->setDate($value);
         if ($order != null) {
             array_push($events, $event);
         } else {
             $events[$event->getId()] = $event;
         }
     }
     return $events;
 }
Example #4
0
 $cinfo = $c->getInfo($_GET['id']);
 $events = $c->getEvents();
 $e = new Event();
 echo '<tr><td>Catagory </td><td><b>', $c->escape(ucwords($cinfo['name'])), '</b></td></tr><tr><td>Info</td><td>', $c->escape($cinfo['info']), '</td></tr><tr><td>Catagory Head(s) </td><td>';
 $count = 0;
 $cheads = $c->getHeads();
 foreach ($cheads as $chead) {
     if ($count) {
         echo ", ";
     }
     echo "<a href='head.php?id={$chead['userid']}'>", $c->escape($chead['name']), "</a>";
     $count++;
 }
 echo '</td></tr><tr><td><br><br></td></tr';
 foreach ($events as $event) {
     $e->setId($event['eventid']);
     echo '<tr><td>Event</td><td><b>', $e->escape($event['name']), '</b></td></tr><tr><td>Info</td><td>', $e->escape($event['info']), '</td></tr><tr><td>Event Head(s) </td><td>';
     $heads = $e->getHeads("head");
     //event heads
     $count = 0;
     foreach ($heads as $head) {
         if ($count) {
             echo ", ";
         }
         echo "<a href='head.php?id={$head['userid']}'>", $e->escape($head['name']), "</a>";
         $count++;
     }
     if ($count == 0) {
         echo ' None Assigned';
     }
     echo '</td></tr><tr><td>Organiser(s)</td><td>';
Example #5
0
     echo '<h3>', ucwords($eventInfo['name']), ' Regestration</h3>';
     $r = new Registeration();
     $delInfo = $r->getDelInfo($_POST['delno']);
     if ($delInfo) {
         // if we have info of the selected delegate number
         echo "<form method='POST'><center><table>";
         echo "<tr><td>Del no</td><td> {$delInfo['delno']}</td></tr><tr><td>Reg No.</td><td>{$delInfo['regno']}</td></tr><tr><td>Name</td><td> {$delInfo['name']}</td></tr><tr><td>College</td><td> {$delInfo['cllg']}</td></tr><tr><td>Phone</td><td> {$delInfo['phone']}</td></tr></table><input type='hidden' name='delno' value='{$delInfo['delno']}' /><input type='hidden' name='event' value='{$_POST['event']}' />";
         echo '<br>Confirm Registeration<br><input type="submit" name="confirm" value="Confirm"/><input type="submit" name="cancel" value="Cancel" />';
         echo '</center></form>';
     } else {
         echo 'Sorry the Delegate Number does not exists<br>' . $goBack;
     }
 } else {
     if (isset($_POST['event']) and isset($_POST['delno']) and isset($_POST['confirm'])) {
         $e = new Event();
         $e->setId($_POST['event']);
         $result = $e->addUser($_POST['delno']);
         if ($result) {
             // if we have a result
             if ($result == "regDone") {
                 echo "Already Registered<br>" . $goBack;
             } else {
                 echo "Done<br>" . $goBack;
             }
         }
     } else {
         $c = new Catagory();
         //get the catagory info
         $catInfo = $c->getInfo($_GET['id']);
         if ($catInfo) {
             // if catagoty present display welcome message