本文整理汇总了PHP中Division::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Division::model方法的具体用法?PHP Division::model怎么用?PHP Division::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Division
的用法示例。
在下文中一共展示了Division::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDivList
/**
*
* @return Division[]
*/
public function getDivList()
{
if ($this->_divList === FALSE) {
if (($rec = $this->getRec()) != NULL) {
$this->_divList = Division::model()->findAllByRecId($rec->id);
} else {
// FIXME null ??
$this->_divList = array();
}
}
return $this->_divList;
}
示例2: actionDivision
public function actionDivision()
{
$divisions = Division::model()->findAllByRecId($this->rec->id);
if (!O::app()->user->isGuest) {
$userId = O::app()->user->id;
$model = new DivisionChoiceForm('', $this->rec, $divisions);
if (isset($_POST['DivisionChoiceForm'])) {
$model->attributes = $_POST['DivisionChoiceForm'];
if ($model->validate() && $model->save($userId)) {
//if ($this->isWizard) $this->redirect($this->getURL('form', array('wiz' => 1)));
if ($this->afterSave('form')) {
return;
}
//return;
}
} else {
$model->setUserId($userId);
}
$this->render('division', array('divisions' => $divisions, 'model' => $model));
} else {
$this->render('division', array('divisions' => $divisions));
}
}
示例3: array
<span class="status"> </span>
<?php
echo $form->error($model, 'div');
?>
</div>
<!--<div class="row">
<?php
echo $form->labelEx($model, 'batch');
?>
<?php
echo $form->dropDownList($model, 'batch', Batch::items(), array('empty' => '---------------Select-------------', 'tabindex' => 7));
?>
<!--<?php
if (isset($model->batch)) {
echo $form->dropDownList($model, 'batch', CHtml::listData(Division::model()->findAll(array('condition' => 'batch_id=' . $model->batch)), 'batch_id', 'batch_name'));
} else {
echo $form->dropDownList($model, 'batch', array('prompt' => '---------------Select-------------'), array('tabindex' => 3));
}
?>
<span class="status"> </span>
<?php
echo $form->error($model, 'batch');
?>
</div>-->
<div class="row">
<?php
echo $form->labelEx($model, 'subject');
?>
<?php
示例4: array
}')));
?>
<span class="status"> </span>
<?php
echo $form->error($model, 'student_transaction_branch_id');
?>
</div>
<div class="row-right">
<?php
echo $form->labelEx($model, 'student_transaction_division_id');
?>
<?php
if (isset($model->student_transaction_division_id)) {
echo $form->dropDownList($model, 'student_transaction_division_id', CHtml::listData(Division::model()->findAll(array('condition' => 'academic_name_id=' . $model->student_academic_term_name_id . ' and branch_id=' . $model->student_transaction_branch_id . ' and division_organization_id=' . $org_id)), 'division_id', 'division_code'), array('prompt' => '-----------Select-----------', 'tabindex' => 12, 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('dependent/getStudbatch'), 'update' => '#StudentTransaction_student_transaction_batch_id')));
} else {
echo $form->dropDownList($model, 'student_transaction_division_id', array(), array('prompt' => '-----------Select-----------', 'tabindex' => 12, 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('dependent/getStudbatch'), 'update' => '#StudentTransaction_student_transaction_batch_id')));
}
?>
<span class="status"> </span>
<?php
echo $form->error($model, 'student_transaction_division_id');
?>
</div>
</div>
<div class="row">
<div class="row-left">
<?php
echo $form->labelEx($model, 'student_transaction_batch_id');
示例5: actiongetelectivedivision
public function actiongetelectivedivision()
{
$subject_id = $_REQUEST['ElectiveSubjectDetails']['elective_subject_id'];
$subject_branch = SubjectMaster::model()->findByAttributes(array('subject_master_id' => $subject_id));
$org_id = Yii::app()->user->getState('org_id');
$data = array();
$data = Division::model()->findAll(array('condition' => 'division_organization_id=' . $org_id . ' and branch_id=' . $subject_branch['subject_master_branch_id'] . ' and academic_name_id=' . $subject_branch['subject_master_academic_terms_name_id']));
$data = CHtml::listData($data, 'division_id', 'division_code');
echo "<option value=''>Select Division</option>";
foreach ($data as $value => $name) {
echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);
}
}
示例6: renderContent
protected function renderContent()
{
$day = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
if (Yii::app()->user->getState('stud_id')) {
$date = date('Y-m-d');
$ts = strtotime($date);
$week_number = date('W', $ts);
$year = date('Y');
for ($day1 = 1; $day1 < 7; $day1++) {
$alldate[] = date('d-m-Y', strtotime($year . "W" . $week_number . $day1));
}
$criteria = new CDbCriteria();
//$criteria->select = 'academic_term_id'; // select fields which you want in output
$criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
$semname = AcademicTerm::model()->findAll($criteria);
$data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
$stud_model = StudentTransaction::model()->findByPk(Yii::app()->user->getState('stud_id'));
$check_sem = in_array($stud_model->student_academic_term_name_id, $data);
//var_dump($check_sem); exit;
$timetableid = 0;
if (!$check_sem) {
echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
} else {
$check_timetable = TimeTableDetail::model()->findByAttributes(array('acdm_name_id' => $stud_model->student_academic_term_name_id, 'division_id' => $stud_model->student_transaction_division_id));
if (empty($check_timetable)) {
echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
} else {
$timetableid = $check_timetable->timetable_id;
$model = TimeTable::model()->findByPk($timetableid);
$nooflec = $model->No_of_Lec;
$sum = $nooflec;
$lec_duration = LecDuration::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id ', $params = array(':table_id' => $timetableid));
$lec = array();
foreach ($lec_duration as $l) {
$lec[] = $l['duration'];
}
$createdate = date_create($model->creation_date);
$starti = 1;
if ($model->zero_lec == 1) {
$starti = 0;
}
$time = $model->clg_start_time;
$time = date('H:i A', strtotime($time));
$timestamp = strtotime($time);
$time = date('g:i A', $timestamp);
?>
<table id="time-table-struc" bgcolor="#CBE7ED" border="2" style= width:auto;font-size:8px;border-collapse:collapse; height:auto;" align="center">
<th align=center>
Day/Time
</th>
<?php
$i = 0;
while ($i < 6) {
echo "<th>" . $day[$i] . "</br>(" . $alldate[$i] . ")</th>";
$i++;
}
$break = "";
$l = 0;
$count = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);
for ($i = $starti; $i <= $nooflec; $i++) {
$days = count($day);
echo "<tr>";
$duration = NoOfBreakTable::model()->findByAttributes(array('timetable_id' => $timetableid, 'after_lec_break' => $i));
$dur = $duration['duration'];
if ($dur) {
$dur1 = date('i', strtotime($dur));
}
if ($break) {
echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + $dur1 * 60) . "</td><td colspan=7 align=center><font color='green'><b>Break</b></font></td></tr>";
$break = "";
$timestamp = strtotime($time) + $dur1 * 60;
$time = date('g:i A', $timestamp);
$i--;
continue;
} else {
echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + 60 * $lec[$l]) . "</td>";
$timestamp = strtotime($time) + 60 * $lec[$l];
$l++;
$time = date('g:i A', $timestamp);
}
for ($j = 1; $j <= $days; ++$j) {
$subname = "";
$room = "";
$faculty = "";
$batch = "";
if ($count[$j] > 0) {
$count[$j]--;
continue;
}
$result = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id AND day = :day AND lec = :lec AND division_id = :div_id AND lecture_date = :lecdate and proxy_status <> :proxy_status', $params = array(':table_id' => $timetableid, ':day' => $j, ':lec' => $i, ':div_id' => $stud_model->student_transaction_division_id, ':lecdate' => date('Y-m-d', strtotime($alldate[$j - 1])), ':proxy_status' => 2));
$break = NoOfBreakTable::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id AND after_lec_break = :lec', $params = array(':table_id' => $timetableid, ':lec' => $i));
if ($result) {
foreach ($result as $list) {
if ($list['lect_hour'] > 1) {
$count[$j] = $list['lect_hour'] - 1;
}
echo "<td rowspan=" . $list['lect_hour'] . " align=center style=background:#C0CCCC; width:100px;>";
break;
//.........这里部分代码省略.........
示例7: array
<?php
$this->breadcrumbs = array('Division Report');
?>
<?php
echo CHtml::link('GO BACK', Yii::app()->createUrl('/student/attendence/attendencedivisionreport'));
$m = 1;
if ($subject) {
$this->menu[] = array('label' => '', 'url' => array('attendencedivisionreport', 'pdf' => 'pdf', 'div_id' => $div_id), 'linkOptions' => array('class' => 'export-pdf', 'title' => 'Export to PDF', 'target' => '_blank'));
$this->menu[] = array('label' => '', 'url' => array('attendencedivisionreport', 'excel' => 'excel', 'div_id' => $div_id), 'linkOptions' => array('class' => 'export-excel', 'title' => 'Export to Excel', 'target' => '_blank'));
$div_model = Division::model()->findByPk($div_id);
$acd_model = AcademicTerm::model()->findByPk($div_model->academic_name_id);
?>
<table border="2px" id="twoColThinTable">
<tr class="row">
<td class="col1">Division </td>
<td class="col2"><?php
echo $div_model->division_code;
?>
</td>
</tr>
<tr class="row">
<td class="col1">Semester </td>
<td class="col2"> <?php
echo $acd_model->academic_term_name;
?>
</td>
</tr>
<tr class="row">
示例8: actionShowstudentview
public function actionShowstudentview()
{
$model = new Attendence();
$count = 0;
$row1 = array();
$div = Division::model()->findByPk($_REQUEST['division_id']);
$branch_id = $div->branch_id;
$period_no = $_REQUEST['lec_no'];
$sub_id = $_REQUEST['subject_id'];
$sem_id = $div->academic_period_id;
$date = date('Y-m-d', strtotime($_REQUEST['date']));
$sem_name = $div->academic_name_id;
$shift_id = 1;
$div_id = $_REQUEST['division_id'];
$subject_type = SubjectMaster::model()->findByPk($sub_id)->subject_master_type_id;
$subject_type_name = SubjectType::model()->findByPk($subject_type)->subject_type_name;
if ($subject_type_name == 'Elective') {
$row1 = Yii::app()->db->createCommand()->select('student_transaction_id,student_transaction_student_id, student_enroll_no,student_first_name')->from('student_transaction st')->join('student_info', 'student_info_transaction_id=student_transaction_id')->join('elective_subject_details esd', 'esd.elective_subject_student_id =st.student_transaction_student_id')->where('st.student_transaction_division_id=' . $div_id . ' and esd.elective_subject_sem_id=' . $sem_name . ' and esd.elective_subject_id=' . $sub_id . ' order by student_enroll_no')->queryAll();
$all_array = array('branch_id' => $branch_id, 'period_no' => $period_no, 'shift_id' => $shift_id, 'faculty_id' => $_REQUEST['faculty_id'], 'div_id' => $div_id, 'sub_id' => $sub_id, 'sem_id' => $sem_id, 'date' => $date, 'sem_name' => $sem_name);
} else {
if ($_REQUEST['batch'] != 0) {
$batch_id = $_REQUEST['batch'];
$row1 = Yii::app()->db->createCommand()->select('student_transaction_id,student_transaction_student_id, student_enroll_no,student_first_name')->from('student_transaction')->join('student_info', 'student_info_transaction_id=student_transaction_id')->where('student_transaction_branch_id=' . $branch_id . ' and student_transaction_division_id=' . $div_id . ' and student_transaction_batch_id=' . $batch_id . ' and student_academic_term_name_id=' . $sem_name . ' and student_academic_term_period_tran_id =' . $sem_id . ' and student_transaction_detain_student_flag <> 2 order by student_enroll_no')->queryAll();
$all_array = array('branch_id' => $branch_id, 'period_no' => $period_no, 'shift_id' => $shift_id, 'faculty_id' => $_REQUEST['faculty_id'], 'div_id' => $div_id, 'batch_id' => $batch_id, 'sub_id' => $sub_id, 'sem_id' => $sem_id, 'date' => $date, 'sem_name' => $sem_name);
} else {
$row1 = Yii::app()->db->createCommand()->select('student_transaction_id,student_transaction_student_id, student_enroll_no,student_first_name')->from('student_transaction')->join('student_info', 'student_info_transaction_id=student_transaction_id')->where('student_transaction_branch_id=' . $branch_id . ' and student_transaction_division_id=' . $div_id . ' and student_academic_term_name_id=' . $sem_name . ' and student_academic_term_period_tran_id =' . $sem_id . ' and student_transaction_detain_student_flag <> 2 order by student_enroll_no')->queryAll();
$all_array = array('branch_id' => $branch_id, 'shift_id' => $shift_id, 'div_id' => $div_id, 'batch_id' => "", 'sub_id' => $sub_id, 'sem_id' => $sem_id, 'date' => $date, 'sem_name' => $sem_name, 'period_no' => $period_no, 'faculty_id' => $_REQUEST['faculty_id']);
}
}
if ($date > date('Y-m-d') || $date < date('Y-m-d', strtotime('-1 days'))) {
echo "you can not take attendance of before date of yesterday or future date!";
exit;
}
if ($_REQUEST['batch'] != 0) {
$check = Attendence::model()->findByAttributes(array('employee_id' => $_REQUEST['faculty_id'], 'batch_id' => $_REQUEST['batch'], 'attendence_date' => $date, 'div_id' => $div_id, 'attendence_organization_id' => Yii::app()->user->getState('org_id')));
} else {
$check = Attendence::model()->findByAttributes(array('student_attendence_period_id' => $period_no, 'attendence_date' => $date, 'div_id' => $div_id, 'attendence_organization_id' => Yii::app()->user->getState('org_id')));
}
if ($check) {
echo "you can not take attendance more than one time.!";
exit;
}
$count = count($row1);
if ($count == 0) {
Yii::app()->user->setFlash('not-select-attendece', "No Student Found for this Criteria");
}
Yii::app()->user->setState('stud_array', $row1);
Yii::app()->user->setState('all_array', $all_array);
if (isset($_POST['save'])) {
$model->employee_id = $all_array['faculty_id'];
$model->branch_id = $all_array['branch_id'];
$model->shift_id = $all_array['shift_id'];
$model->div_id = $all_array['div_id'];
$model->batch_id = $all_array['batch_id'];
$model->sub_id = $all_array['sub_id'];
$model->sem_id = $all_array['sem_id'];
$model->sem_name_id = $all_array['sem_name'];
$model->attendence_date = $all_array['date'];
$model->student_attendence_period_id = $all_array['period_no'];
$model->attendence_organization_id = Yii::app()->user->getState('org_id');
foreach ($_POST['Attendence']['st_id'] as $index => $student_id) {
$model->setIsNewRecord(true);
$model->attendence = 'A';
if ($student_id != 0) {
$model->attendence = 'P';
}
$model->st_id = $index;
$model->id = null;
$model->save();
}
$this->redirect(array('admin'));
}
$this->render('show_student_view', array('model' => $model, 'row1' => $row1));
}
示例9: array_search
<?php
if ($subject) {
$key = array_search($_REQUEST['sb_id'], $subjectid);
echo "<h4>Subject Name:-" . $subject[$key] . "</h4>";
echo "<h4>Division :-" . Division::model()->findByPk($_REQUEST['div_id'])->division_code . "</h4>";
$t = -1;
$m = 0;
$sel_month = $_REQUEST['month'];
if (!empty($_REQUEST['sb_id']) && $_REQUEST['sb_id'] != '') {
echo '<table class="table_data" >';
foreach ($all_data as $list) {
if ($t % 2 == 0) {
$class = "odd";
} else {
$class = "even";
}
if ($t == -1) {
echo '<tr class="table_header"><th>Sr No.</th><th>En.No.</th><th>Name</th>';
echo '<th>Total</th><th>Present</th><th>%</th>';
echo '</tr>';
++$t;
}
$tcon = count(Attendence::model()->findAll(array('condition' => 'sub_id=' . $_REQUEST['sb_id'] . ' and st_id=' . $list['st_id'] . ' and month(attendence_date) in(' . $sel_month . ')')));
$pcon = count(Attendence::model()->findAll(array('condition' => 'sub_id=' . $_REQUEST['sb_id'] . ' and st_id=' . $list['st_id'] . ' and attendence="P" and month(attendence_date) in(' . $sel_month . ')')));
$perc = 0;
if ($pcon > 0) {
$perc = (double) ($pcon * 100 / $tcon);
$perc = round($perc, 2);
}
$stud_model = StudentInfo::model()->findByAttributes(array('student_info_transaction_id' => $list['st_id']));
示例10: array
<?php echo CHtml::button('Submit', array('submit' => array('studentTransaction/studentMultipleDivisionAssign'), 'class'=>'submit')); ?>
</div>
</div>
<?php $this->endWidget(); ?>
</fieldset>
<?php $div = new Division; $batch = new Batch; ?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'division-form',
'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); ?>
<fieldset style="min-width: 360px ! important; width: 425px; border: 1px solid rgb(204, 204, 204); border-radius: 5px 5px 5px 5px;padding: 15px;"> <legend>Assign Division & Batch</legend>
<div class="row">
<?php echo $form->labelEx($div,'division_name'); ?>
<?php if(!empty($_REQUEST['StudentTransaction']['student_transaction_branch_id']) && !empty($_REQUEST['StudentTransaction']['student_academic_term_name_id'])) { ?>
<?php echo $form->dropDownList($div,'division_name', CHtml::listData(Division::model()->findAll('branch_id ='.$_REQUEST['StudentTransaction']['student_transaction_branch_id'].' AND academic_name_id ='.$_REQUEST['StudentTransaction']['student_academic_term_name_id']),'division_id','division_code'), array('tabindex'=>4,
'prompt' => 'Select Division',
'ajax' => array(
'type'=>'POST',
'url'=>CController::createUrl('dependent/getAssignBatch'),
'update'=>'#Batch_batch_name'
))); ?><span class="status"> </span>
<?php }
else { ?>
<?php echo $form->dropDownList($div,'division_name', array(), array('empty'=>'Select Division')); }?><span class="status"> </span>
<?php echo $form->error($div,'division_name'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($batch,'batch_name'); ?>
<?php echo $form->dropDownList($batch,'batch_name', array(), array('empty' => 'Select Batch','tabindex'=>4)); ?><span class="status"> </span>
<?php echo $form->error($batch,'batch_name'); ?>
示例11: actionUpdate
/**
* Updates a particular model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
*/
public function actionUpdate($id)
{
$model = $this->loadModel($id);
// Uncomment the following line if AJAX validation is needed
$this->performAjaxValidation($model);
if (isset($_POST['Batch'])) {
$model->attributes = $_POST['Batch'];
$model->batch_code = '';
$batchname = $model->batch_name;
$branch_code = Branch::model()->findByPk($model->branch_id)->branch_alias;
$division_name = Division::model()->findByPk($model->div_id)->division_name;
$acdm_name = AcademicTerm::model()->findByPk($model->academic_name_id)->academic_term_name;
$concatdivname = $batchname . '-' . $branch_code . '-' . $acdm_name . '-' . $division_name;
$model->batch_code = $concatdivname;
if ($model->save()) {
$this->redirect(array('admin'));
}
//$this->redirect(array('view','id'=>$model->batch_id));
}
$this->render('update', array('model' => $model));
}
示例12: renderContent
protected function renderContent()
{
$current_date = date('Y-m-d');
if (Yii::app()->user->getState('stud_id')) {
$criteria = new CDbCriteria();
//$criteria->select = 'academic_term_id'; // select fields which you want in output
$criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
$semname = AcademicTerm::model()->findAll($criteria);
$data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
$stud_model = StudentTransaction::model()->findByPk(Yii::app()->user->getState('stud_id'));
$check_sem = in_array($stud_model->student_academic_term_name_id, $data);
$timetableid = 0;
if (!$check_sem) {
echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
} else {
$check_timetable = TimeTableDetail::model()->findAllByAttributes(array('acdm_name_id' => $stud_model->student_academic_term_name_id, 'division_id' => $stud_model->student_transaction_division_id, 'lecture_date' => $current_date), 'proxy_status <> :status', array(':status' => 1));
if (empty($check_timetable)) {
echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
} else {
$timetable = TimeTable::model()->findByPk($check_timetable[0]->timetable_id);
$time1 = date('H:i A', strtotime($timetable['clg_start_time']));
if ($timetable->zero_lec == 1) {
$time[] = $time1;
} else {
$time[1] = $time1;
}
$lec_dur = LecDuration::model()->findAll(array('condition' => 'timetable_id=' . $timetable['timetable_id']));
foreach ($lec_dur as $list) {
$break = NoOfBreakTable::model()->findByAttributes(array('after_lec_break' => $list['lecture'], 'timetable_id' => $timetable['timetable_id']));
if ($break) {
$dur1 = date('i', strtotime($break['duration']));
$timestamp = strtotime($time1) + 60 * $dur1;
$time1 = date('g:i A', $timestamp);
$timestamp = strtotime($time1) + 60 * $list['duration'];
$time1 = date('g:i A', $timestamp);
$time[] = $time1;
} else {
$timestamp = strtotime($time1) + 60 * $list['duration'];
$time1 = date('g:i A', $timestamp);
$time[] = $time1;
}
}
print '<table id="time-table-struc" style="font-size:10px;">';
print '<tr>';
print '<th>Lecture No.</th>';
print '<th>Subject</th>';
print '<th>Faculty Name</th>';
print '<th>Room No.</th>';
print '<th>Time</th>';
foreach ($check_timetable as $list) {
if ($list->subject_type != 1 && $list->batch_id != $stud_model->student_transaction_batch_id) {
continue;
}
print '<tr>';
print '<td>' . $list->lec . '</td>';
print '<td>' . SubjectMaster::model()->findByPk($list->subject_id)->subject_master_alias . '</td>';
print '<td>' . EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name . '</td>';
print '<td>' . RoomDetailsMaster::model()->findByPk($list->room_id)->room_name . '</td>';
print '<td>' . $time[$list->lec] . '</td></tr>';
}
print '</table>';
}
}
} else {
if (Yii::app()->user->getState('emp_id')) {
$criteria = new CDbCriteria();
//$criteria->select = 'academic_term_id';
$criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
$semname = AcademicTerm::model()->findAll($criteria);
$data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
$data_arr = implode(',', $data);
$timetable_criteria = new CDbCriteria();
$timetable_criteria->condition = 'acdm_name_id in (' . $data_arr . ') AND faculty_emp_id = ' . Yii::app()->user->getState('emp_id') . ' AND lecture_date = "' . date('Y-m-d') . '"';
$time_table_details = TimeTableDetail::model()->findAll($timetable_criteria);
if ($time_table_details) {
$timetable = TimeTable::model()->findByPk($time_table_details[0]->timetable_id);
$time1 = date('H:i A', strtotime($timetable['clg_start_time']));
if ($timetable->zero_lec == 1) {
$time[] = $time1;
} else {
$time[1] = $time1;
}
$lec_dur = LecDuration::model()->findAll(array('condition' => 'timetable_id=' . $timetable['timetable_id']));
foreach ($lec_dur as $list) {
$break = NoOfBreakTable::model()->findByAttributes(array('after_lec_break' => $list['lecture'], 'timetable_id' => $timetable['timetable_id']));
if ($break) {
$dur1 = date('i', strtotime($break['duration']));
$timestamp = strtotime($time1) + 60 * $dur1;
$time1 = date('g:i A', $timestamp);
$timestamp = strtotime($time1) + 60 * $list['duration'];
$time1 = date('g:i A', $timestamp);
$time[] = $time1;
} else {
$timestamp = strtotime($time1) + 60 * $list['duration'];
$time1 = date('g:i A', $timestamp);
$time[] = $time1;
}
}
print '<table id="time-table-struc" style="font-size:10px;">';
print '<tr>';
//.........这里部分代码省略.........
示例13: if
else if($s=='division_code')
$label = "<b id=\"label_info\">Division Name :</b>";
else
$label = CHtml::activeLabel($student_info,$s)." :";
echo $label;
?>
</span>
<span>
<?php //echo $name->$s;
if($s=='quota_name')
$field_value = Quota::model()->findByPk($info['student_transaction_quota_id'])->quota_name;
else if($s=='branch_name')
$field_value = Branch::model()->findByPk($info['student_transaction_branch_id'])->branch_name;
else if($s=='division_code')
$field_value = Division::model()->findByPk($info['student_transaction_division_id'])->$s;
else if($s=='sem')
$field_value = AcademicTerm::model()->findByPk($info['student_academic_term_name_id'])->academic_term_name;
else if($s=='student_address_c_line1')
{ $field_value = StudentAddress::model()->findByPk($info['student_transaction_student_address_id'])->student_address_c_line1." ".StudentAddress::model()->findByPk($info['student_transaction_student_address_id'])->student_address_c_line2;
}
else if($s=='student_address_p_line1')
{ $field_value = StudentAddress::model()->findByPk($info['student_transaction_student_address_id'])->student_address_p_line1." ".StudentAddress::model()->findByPk($info['student_transaction_student_address_id'])->student_address_p_line2;
}
else if($s=='category_name')
$field_value = Category::model()->findByPk($info['student_transaction_category_id'])->category_name;
else if($s=='city')
$field_value = City::model()->findByPk(StudentAddress::model()->findByPk($info['student_transaction_student_address_id'])->student_address_c_city)->city_name;
else
{ $field_value = StudentInfo::model()->findByPk($info['student_transaction_student_id'])->$s;
}
示例14: actiongetSmsDivision
public function actiongetSmsDivision()
{
$org_id = Yii::app()->user->getState('org_id');
$data = array();
$data = Division::model()->findAll(array('condition' => 'branch_id=' . (int) $_REQUEST['StudentSmsEmailDetails']['branch_id'] . ' and academic_name_id=' . (int) $_REQUEST['StudentSmsEmailDetails']['academic_name_id'] . ' and division_organization_id=' . $org_id));
$data = CHtml::listData($data, 'division_id', 'division_code');
echo "<option value=''>Select Division</option>";
foreach ($data as $value => $name) {
echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);
}
}
示例15: Nationality
} else {
$Nationality = new Nationality();
}
if ($student_transaction[0]->student_transaction_quota_id != null) {
$Quota = Quota::model()->findByPk($student_transaction[0]->student_transaction_quota_id);
} else {
$Quota = new Quota();
}
if ($student_transaction[0]->student_transaction_religion_id != null) {
$Religion = Religion::model()->findByPk($student_transaction[0]->student_transaction_religion_id);
} else {
$Religion = new Religion();
}
$Branch = Branch::model()->findByPk($student_transaction[0]->student_transaction_branch_id);
$Shift = Shift::model()->findByPk($student_transaction[0]->student_transaction_shift_id);
$Division = Division::model()->findByPk($student_transaction[0]->student_transaction_division_id);
$Batch = Batch::model()->findByPk($student_transaction[0]->student_transaction_batch_id);
$Organization = Organization::model()->findByPk($student_transaction[0]->student_transaction_organization_id);
if ($student_transaction[0]->student_transaction_languages_known_id != null) {
$LanguagesKnown = LanguagesKnown::model()->findByPk($student_transaction[0]->student_transaction_languages_known_id);
} else {
$LanguagesKnown = new $LanguagesKnown();
}
if ($student_transaction[0]->student_transaction_languages_known_id != null) {
$StudentAddress = StudentAddress::model()->findByPk($student_transaction[0]->student_transaction_student_address_id);
} else {
$StudentAddress = new $StudentAddress();
}
?>
<h3>Student Detail</h3>
<h4>Personal Info</h4>