<?php /* @var $this ScheduleController */ /* @var $model Schedule */ /* @var $form CActiveForm */ $dataProgram = Programs::model()->findAll(); $optionArrayPrograms = CHtml::listData($dataProgram, 'program_Id', 'program_Name'); $dataProfessor = Professors::model()->findAll(); $professorData = CHtml::listData($dataProfessor, 'professor_Id', 'fullName'); $roomData = ClassType::model()->with('room')->findAll(); $roomArray = CHtml::listData($roomData, 'class_Type_Id', 'room.room_Number'); ?> <div class="form"> <?php $form = $this->beginWidget('CActiveForm', array('id' => 'schedule-form', 'enableAjaxValidation' => false)); $ajax = array('type' => 'GET', 'url' => $this->createUrl('schedule/getProfessorCource'), 'data' => array('id' => 'js:$(this).val()'), 'update' => '#Schedule_professor_Course_Id'); $ajax2 = array('type' => 'GET', 'url' => $this->createUrl('schedule/getClassType'), 'data' => array('id' => 'js:$(this).val()'), 'update' => '#Schedule_class_Type_Id'); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary(array($model, $model2)); ?> <div class="row"> <?php echo $form->labelEx($model, 'program_Id'); ?>
/** * 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 Programs the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Programs::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php require_once './classes/Programs.php'; $pr = new Programs(); $cat_name = $_POST['cat_name']; $list = $pr->get_school_page($cat_name); echo $list;
<?php require_once './classes/Programs.php'; $pr = new Programs(); $cat_name = $_POST['cat_name']; $list = $pr->get_category_items($cat_name); echo $list;
<?php $obj = new Programs(); //echo date('Y-m-d'); //echo ( $day+1).$strday; $list = $obj->getToday(1, 4); $data['data'] = $list; $data['prefix'] = $obj->getPrefix(); //var_dump($data); echo defaultModule($strModuleName, $data);