本文整理汇总了PHP中ClassInfo::model方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassInfo::model方法的具体用法?PHP ClassInfo::model怎么用?PHP ClassInfo::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassInfo
的用法示例。
在下文中一共展示了ClassInfo::model方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getClasses
public function getClasses()
{
return ClassInfo::model()->findAllBySql('select class_info.*
from class_info
left join instructor_assignment
on instructor_assignment.class_id = class_info.id
where instructor_assignment.instructor_id = :iid
and class_info.session_id = :sid', array('sid' => ClassSession::savedSessionId(), 'iid' => $this->id));
}
示例2: getClasses
public function getClasses()
{
return ClassInfo::model()->findAllBySql('select class_info.*
from signup
left join class_info
on signup.class_id = class_info.id
where signup.student_id = :stid
and class_info.session_id = :ssid', array('ssid' => ClassSession::savedSessionId(), 'stid' => $this->id));
}
示例3: actionAutoPopulate
public function actionAutoPopulate()
{
foreach (ClassInfo::model()->findAllBySQL("select class_info.* from class_info where session_id = :sess", array('sess' => ClassSession::savedSessionId())) as $model) {
if ($model->active_mtg_count < 1) {
$model->populate_meetings(Yii::app()->params['defaultNumMeetings']);
}
}
//TODO: flash it!
$this->redirect($this->redirect(Yii::app()->user->returnUrl));
}
示例4: array
<div class="row">
<?php
echo $form->labelEx($model, 'class_id');
if (isset($model->class_id) && !$model->hasErrors()) {
echo CHtml::encode($model->class->summary);
echo $form->hiddenField($model, "class_id");
} else {
$classparams = array();
$constraint = "";
if (isset($model->instructor_id)) {
$classparams = array('condition' => 'company_id = :coid', 'params' => array(':coid' => $model->instructor->company_id));
$constraint = " (this instructor is " . $model->instructor->company->name . ')';
}
echo $form->dropDownList($model, 'class_id', CHtml::listData(ClassInfo::model()->findAll($classparams), 'id', 'summary'));
echo $constraint;
}
echo $form->error($model, 'class_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'percentage');
?>
<?php
echo $form->textField($model, 'percentage', array('size' => 3, 'maxlength' => 3));
echo CHtml::encode(' %');
?>
示例5: array
<h3>Choose class to copy from <?php
echo $fromsession->summary;
?>
to <?php
echo ClassSession::current()->summary;
?>
</h3>
<?php
echo CHtml::form();
echo CHtml::dropDownList('ClassInfo[id]', '', CHtml::listData(ClassInfo::model()->findAllBySql('select class_info.* from class_info where session_id = :sid', array('sid' => $fromsession->id)), 'id', 'summary'), array('submit' => '', 'empty' => 'Choose One'));
echo CHtml::submitButton('Change');
echo CHtml::endForm();
示例6: array
<?php
return array('title' => 'Enter a check', 'showErrorSummary' => true, 'elements' => array('check' => array('type' => 'form', 'title' => 'Check Details', 'showErrorSummary' => true, 'elements' => array('amount' => array('type' => 'text', 'maxlength' => 20), 'check_num' => array('type' => 'text', 'maxlength' => 10), 'check_date' => array('type' => 'zii.widgets.jui.CJuiDatePicker', 'attribute' => 'check_date', 'model' => 'check', 'options' => array('showAnim' => 'fold', 'showButtonPanel' => true, 'autoSize' => true, 'dateFormat' => 'yy-mm-dd')), 'payee_id' => array('items' => CHtml::listData(Company::model()->findAll(), 'id', 'name'), 'type' => 'dropdownlist'), 'payer' => array('type' => 'text', 'maxlength' => 128), 'deposit_id' => array('items' => CHtml::listData(DepositDetails::model()->findAll(), 'id', 'deposited_date'), 'type' => 'dropdownlist'))), 'income' => array('type' => 'form', 'title' => 'Apply Payment', 'showErrorSummary' => true, 'elements' => array('student_id' => array('maxlength' => 10, 'prompt' => "Choose student...", 'items' => CHtml::listData(Student::model()->findAll(), 'id', 'full_name'), 'type' => 'dropdownlist'), 'class_id' => array('maxlength' => 10, 'prompt' => "Choose class...", 'items' => CHtml::listData(ClassInfo::model()->findAll(), 'id', 'class_name'), 'type' => 'dropdownlist'), 'amount' => array('type' => 'text', 'maxlength' => 10)))), 'buttons' => array('entry_form' => array('type' => 'submit', 'label' => 'Save')));
示例7: array
<?php
$es = $form->errorSummary($model);
if (isset($es)) {
echo '<tr><td colspan="5">' . $es . '</td></tr>';
}
?>
<tr>
<td>
<?php
// I cannot use the multiendeddropdown here, because of the odd dropdown
if (isset($model->class_id) && !$model->hasErrors()) {
echo CHtml::encode($model->class->summary);
echo $form->hiddenField($model, "[{$index}]class_id");
} else {
echo $form->dropDownList($model, "[{$index}]class_id", array('In Grade Range' => CHtml::listData(ClassInfo::model()->findAll('(:grade >= min_grade_allowed and :grade <= max_grade_allowed) and session_id = :sid', array('grade' => $model->student->grade, 'sid' => ClassSession::savedSessionId())), 'id', 'summary'), 'Outside Grade Range' => CHtml::listData(ClassInfo::model()->findAll('(:grade < min_grade_allowed or :grade > max_grade_allowed) and session_id = :sid', array('grade' => $model->student->grade, 'sid' => ClassSession::savedSessionId())), 'id', 'summary')), array('class' => 'chzn-select', 'empty' => "Choose a class"));
}
echo $form->error($model, "[{$index}]class_id");
echo '<div id="Signup_' . $index . '_additional_info" >';
?>
</td>
<td>
<?php
echo $form->textField($model, "[{$index}]signup_date", array('size' => 20));
echo $form->error($model, "[{$index}]signup_date");
?>
</td>
示例8: actionIntegrityCheck
public function actionIntegrityCheck()
{
$unassigned = CheckIncome::model()->findAllBySql("select check_income.*\nfrom check_income\nleft join (select sum(income.amount) as total, \n income.check_id as check_id\n from income\n group by income.check_id) as assigned\non assigned.check_id = check_income.id\nwhere coalesce(assigned.total,0) != coalesce(check_income.amount,0)\nand (check_income.returned is null or check_income.returned < '2000-01-01')\nand check_income.session_id = :sid\n", array('sid' => ClassSession::savedSessionId()));
$instructorbalance = ClassInfo::model()->findAllBySql("select class_info.*\nfrom class_info\nleft join (select sum(instructor_assignment.percentage) as total, \n instructor_assignment.class_id as class_id\n from instructor_assignment\n group by instructor_assignment.class_id) as assigned\non assigned.class_id = class_info.id\nwhere coalesce(assigned.total,0) != 100\nand class_info.session_id = :sid\n", array('sid' => ClassSession::savedSessionId()));
$this->render('integrity_check', array('unassigned' => $unassigned, 'instructorbalance' => $instructorbalance));
}
示例9: findAllWeekdays
public static function findAllWeekdays($weekdays, $session)
{
$classes = array();
// only weekdays, no sat/sun
foreach ($weekdays as $n) {
// XXX the current session is hardcoded in here!
// needs to be defaulted programatically and saved in cookie!
foreach (ClassInfo::model()->findAllBySql("select class_info.* \nfrom class_info\nwhere class_info.day_of_week = :wkd\n and class_info.session_id = :sess\norder by class_info.class_name\n; ", array('wkd' => $n, 'sess' => $session)) as $c) {
$classes[$n][] = $c;
}
}
return $classes;
}
示例10: getClasses
function getClasses()
{
return ClassInfo::model()->findAllBySql("select class_info.*\nfrom class_info\nleft join instructor_assignment\n on instructor_assignment.class_id = class_info.id\nleft join instructor\n on instructor_assignment.instructor_id = instructor.id\nwhere instructor.company_id = :id\n and class_info.session_id = :sid\norder by class_info.class_name asc", array('id' => $this->id, 'sid' => ClassSession::savedSessionId()));
}
示例11: actionJson
/**
* Gives the class status as json
*/
public function actionJson()
{
$model = ClassInfo::model()->findByPk($_POST['id']);
echo CJSON::encode(array('min_grade_allowed' => $model->min_grade_allowed, 'max_grade_allowed' => $model->max_grade_allowed, 'min_students' => $model->min_students, 'max_students' => $model->max_students, 'cost_per_class' => $model->cost_per_class, 'enrolled_count' => $model->enrolled_count));
}