Exemple #1
0
 private function parse($program)
 {
     //echo $program->{'program-line'} . "\n";
     //exit;
     $p = new Programme();
     $p->id = (int) $program->pid;
     $content = $p->createContent($program);
     $contentId = $this->dbSimple->setTable("content")->setData($content)->insert();
     $route = $p->createRoute((string) $program->title, $contentId, $p->sectionId);
     $routeId = $this->dbSimple->setTable("route")->setData($route)->insert();
     $p->contentId = $contentId;
     $p->typeId = $p->toType((string) $program->type);
     $p->genreId = $this->dbSimple->getId("programgenre", (string) $program->{'program-line'});
     $p->roomId = $p->toLocation((string) $program->location);
     $p->timeFrom = date("Y-m-d G:i:s", strtotime($program->{'start-time'}));
     $p->timeTo = date("Y-m-d G:i:s", strtotime($program->{'end-time'}));
     $p->length = 0;
     $p->reprise = 0;
     //   print_R($p);
     //   exit;
     $newProgramme = (array) $p;
     $programId = $this->dbSimple->setTable("program")->setData($newProgramme)->insert();
     echo $programId . " OK\n";
     //exit;
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Programme the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Programme::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemple #3
0
<?php

require_once "inc/initialize.php";
require_once "inc/vendor/autoload.php";
use Carbon\Carbon;
// Instance of Carbon Class with the current time
$date_now = new Carbon('now');
if (!$session->is_logged_in()) {
    header("location: index.php");
}
$user = User::find_by_id($session->id);
if (isset($user->programme_id)) {
    $prog = Programme::find_by_id($user->programme_id);
}
if (isset($prog->department_id)) {
    $dept = Department::find_by_id($prog->department_id);
}
if (isset($dept->faculty_id)) {
    $fac = Faculty::find_by_id($dept->faculty_id);
}
?>
<!DOCTYPE HTML>
    <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>University of Jos, Nigeria - Transcript System</title>
        <?php 
require_once LIB_PATH . DS . 'javascript.php';
require_once LIB_PATH . DS . 'css.php';
?>
        <style type="text/css">
<?php

ob_start();
$faculties = Faculty::all();
$programmes = Programme::all();
$races = Student::races();
?>
	
	<div class="text-center">
		<h1><?php 
echo APPNAME;
?>
</h1>
		<hr />
	</div>
	
	<div class="row">
		<div class="col-md-6 col-sm-6 col-xs-12">
			<div class="text-center">
				<a href="#student-login" data-toggle="modal">
					<span style="font-size:32px"><i class="fa fa-user"></i></span>
					<h2>Pelajar</h2>
				</a>
			</div>
		</div>
		<div class="col-md-6 col-sm-6 col-xs-12">
			<div class="text-center">
				<a href="#administrator-login" data-toggle="modal">
					<span style="font-size:32px"><i class="fa fa-key"></i></span>
					<h2>Penyelaras</h2>
				</a>	
}, School::all());
$subjeks = array();
array_map(function ($subjek) {
    global $subjeks;
    $subjeks[$subjek['id']] = $subjek['nama'];
}, Subject::ofSchool($app->id_sekolah));
$statuses = array();
array_map(function ($status) {
    global $statuses;
    $statuses[$status['id']] = $status['nama'];
}, Application::statuses());
$programmes = array();
array_map(function ($programme) {
    global $programmes;
    return $programmes[$programme['id']] = $programme['nama_panjang'];
}, Programme::all());
?>
<div>
	<table class="table">
		<tbody>
			<tr>
				<th colspan="2">Butiran Pelajar</th>
			</tr>
			<tr><td>Nama</td><td>: <?php 
echo $pelajar->nama_penuh;
?>
</td></tr>
			<tr><td>No. Matrik</td><td>: <?php 
echo $pelajar->no_matrik;
?>
</td></tr>
 /**
  * Populate programme object 
  *
  * @param array $programme
  * @return object
  */
 protected function getProgrammeObject($programme)
 {
     if (empty($programme)) {
         throw new BuyatException('Malformed response from server');
     }
     $programmeObject = new Programme();
     $programmeObject->setProgrammeID($programme['programme_id']);
     $programmeObject->setProgrammeName($programme['programme_name']);
     $programmeObject->setProgrammeURL($programme['programme_url']);
     $programmeObject->setHasFeed($programme['has_feed']);
     return $programmeObject;
 }