示例#1
0
 protected function build(PageBody &$body, SubMenu &$submenu)
 {
     //var_dump($_SESSION['db']);
     $subPage = isset($_GET['subpage']) ? $_GET['subpage'] : '';
     if (isset($_GET['event'])) {
         $this->event = Database::getRow('Event', $_GET['event']);
         $this->event->id = $_GET['event'];
         // for testing
         $this->pageName = $this->event->name;
         //var_dump($this->event);
     }
     if ($this->event == null) {
         $body->addToTop(new Message("No Event", Message::DANGER));
     }
     $submenu->addLink("Event Details", "?page=Event&event=" . $this->event->id, $subPage == '');
     $submenu->addLink("Update Event", "?page=Event&event=" . $this->event->id . "&subpage=update", $subPage == 'update');
     $submenu->addSplitter();
     $submenu->addLink("Send Email Invitation", "?page=Event&event=" . $this->event->id . "&subpage=send", $subPage == 'send');
     $submenu->addLink("Add VIP Participant", "#");
     $submenu->addSplitter();
     $submenu->addLink("Show All Participants", "#", false, false, 100);
     $submenu->addLink("Show Missing Participants", "#", false, false, 90);
     $submenu->addLink("Show Event Attendances", "#", false, false, 10);
     $submenu->addSplitter();
     $submenu->addLink("Build Schedule", "#");
     $submenu->addLink("Send Schedule", "#");
     $submenu->addLink("Start Timer", "#");
     $submenu->addSplitter();
     $submenu->addDangerLink("Delete Event", "#");
     $body->addToTop(new CustomHTML("\n            <div class='page-header'>\n                <h1> " . $this->event->name . " <small>" . $this->event->address . "</small></h1>\n            </div>\n        "));
     if ($subPage == '') {
         $body->addToCenter(new CustomHTML("\n                <dl class='dl-horizontal' style='font-size:18px'>\n                    <dt>Name</dt>\n                    <dd>" . $this->event->name . "</dd>\n                    <dt>Address</dt>\n                    <dd>" . $this->event->address . "</dd>\n                </dl>\n            "));
     } else {
         if ($subPage == 'update') {
             $form = new Form("Event");
             $form->addInput(Input::textInput("eventName", "Event Name", $this->event->name));
             $form->addInput(Input::textareaInput("eventAddress", "Event Address", $this->event->address));
             $body->addToCenter($form);
         } else {
             if ($subPage == 'send') {
                 $form = new Form("Event");
                 $form->addInput(Input::tokenInput("emails", "Send To:"));
                 $form->addInput(Input::textInput("subject", "Subject", "Invitation to " . $this->event->name));
                 $form->addInput(Input::textareaInput("message", "Message"));
                 $body->addToCenter($form);
             }
         }
     }
     //        $table = new HtmlTable();
     //        $table->addRow(["Name",  $this->event->name]);
     //        $table->addRow(["Address",  $this->event->address]);
     //
     //        $body->addToCenter($table);
 }
示例#2
0
 protected function build(PageBody &$body, SubMenu &$submenu)
 {
     $submenu->addLink("Sign in", "#", TRUE);
     $submenu->addLink("Sign up", "#");
     $submenu->addLink("Forget Password", "#");
     $loginForm = new Form("login");
     $loginForm->addInput(Input::textInput("email", "Enter your Email:"));
     $loginForm->addInput(Input::textInput("password", "Enter your Password:"));
     $body->addToCenter($loginForm);
 }
示例#3
0
 protected function build(PageBody &$body, SubMenu &$submenu)
 {
     $this->pageName = "Event List";
     $submenu->addLink("Add new Event", "#");
     $submenu->addLink("Show Event", "#");
     $submenu->addLink("Edit", "#");
     $submenu->addLink("Delete", "#");
     // show a list of events on a table
     $events = Database::get("Event");
     if (isset($events)) {
         $table = new HtmlTable();
         $table->setHead(["#", "Name", "Info"]);
         foreach ($events as $id => $event) {
             $table->addRow([$id, '<a href="?page=Event&event=' . $id . '">' . $event->name . '</a>', $event->address]);
         }
         $body->addToCenter($table);
     } else {
         $body->addToCenter(new Message("There is no event to show", Message::INFO));
     }
 }
示例#4
0
 protected function build(PageBody &$body, SubMenu &$submenu)
 {
     $this->pageName = "New Event";
     $form = new Form("Event");
     $form->addInput(Input::textInput("eventName", "Event Name"));
     $form->addInput(Input::textareaInput("eventAddress", "Address"));
     $form->addInput(Input::createGroupInput([Input::dateInput("eventDay", "Day"), Input::timeInput("eventTime", "time")]));
     $form->addInput(Input::createGroupInput([Input::dateInput("eventDeadline", "Registration Deadline"), Input::timeInput("eventDeadlineTime", "Registration Deadline Time")]));
     $form->addInput(Input::textInput("eventFee", "Registration Fee"));
     $form->addInput(Input::textInput("eventStuFee", "Student Fee"));
     $form->addInput(Input::tokenInput("organizations", "Organizations"));
     $body->addToCenter($form);
 }
示例#5
0
    protected function build(PageBody &$body, SubMenu &$submenu)
    {
        $c = new CustomHTML('
<div class="jumbotron">
  <h1>This is the home page!</h1>
  <p>Join S2ERC and register now</p>
  <p><a href="?page=login" class="btn btn-primary btn-lg" role="button">Register</a></p>
</div>
');
        $body->addToCenter($c);
        $body->addToTop(new Message("This is the home page", Message::WARNING));
        $body->addToTop(new Message("You have to login", Message::DANGER));
    }
示例#6
0
    protected function build(PageBody &$body, SubMenu &$submenu)
    {
        $form = new Form("Test");
        //$form->addInput("list1", "list", "Exsample List:", ["1", "2", "3"]);
        $form->addInput(Input::textInput("input1", "Enter your name: "));
        $form->addInput(Input::selectInput("list1", "Example List:", ["A", "B", "C"]));
        //$form->addInput(Input::dateInput("date", "choose a date: "));
        $left = new CustomHTML('
<div class="list-group">
  <a href="#" class="list-group-item active">Home</a>
  <a href="#" class="list-group-item">Profile</a>
  <a href="#" class="list-group-item">Messages</a>
</div>');
        $submenu->addLink("Home", "?page=home");
        $submenu->addLink("Login", "?page=login");
        $submenu->addLink("Top", "#top");
        $submenu->addLink("Down", "#down");
        $right = new CustomHTML('
<div class="panel panel-default">
  <div class="panel-heading">Panel heading without title</div>
  <div class="panel-body">
    Panel content
  </div>
</div>

<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">Panel title</h3>
  </div>
  <div class="panel-body">
    Panel content
  </div>
</div>');
        $body->addToLeft($left);
        $body->addToRight($right);
        $body->addToCenter($form);
        $body->addToTop(new Message("This is a test page", Message::INFO));
        if (isset($_POST['list1'])) {
            $body->addToTop(new Message("the value of list1=" . $_POST['list1'], Message::SUCCESS));
        }
    }