本文整理汇总了PHP中Courses::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Courses::model方法的具体用法?PHP Courses::model怎么用?PHP Courses::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Courses
的用法示例。
在下文中一共展示了Courses::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionBycode
public function actionBycode($code, $student = null)
{
$course = Courses::model()->findByAttributes(array("code" => $code));
if (!$course) {
Yii::app()->notify->add("Курс не найден");
return false;
}
$this->actionByid($course->id);
}
示例2: actionBycourse
public function actionBycourse($code)
{
$course = Courses::model()->with("Tracks.Algorithms")->findByAttributes(array("code" => $code));
if (!$course) {
Yii::app()->notify->add("Курс не найден", "warning");
$this->render('/site/index');
return false;
}
$this->render('bycourse', array('course' => $course));
}
示例3: GetCourse
public function GetCourse($data, $row)
{
if ($data->course) {
$course = Courses::model()->findByAttributes(array('id' => $data->course));
if ($course->course_name) {
return ucfirst($course->course_name);
} else {
echo '-';
}
} else {
echo '-';
}
}
示例4: actionSearch
public function actionSearch($q)
{
$result = array();
$term = trim(addcslashes($q, '%_'));
// escape LIKE's special characters
if (!empty($term)) {
$param = new CDbCriteria(array('condition' => "name LIKE :match AND degree_id=" . $_SESSION['did'], 'params' => array(':match' => "%{$term}%")));
$cursor = Courses::model()->findAll($param);
if (!empty($cursor)) {
foreach ($cursor as $id => $value) {
$result[] = array('id' => $value['cid'], 'name' => $value['name']);
}
}
}
echo json_encode($result);
Yii::app()->end();
}
示例5: array
You should have received a copy of the GNU General Public License
along with Open-School. If not, see <http://www.gnu.org/licenses/>.*/
/**
* $Id$
*
* @author Open-School team <contact@Open-School.org>
* @link http://www.Open-School.org/
* @copyright Copyright © 2009-2012 wiwo inc.
* @Matthew George,@Rajith Ramachandran,@Arun Kumar,
* @Anupama,@Laijesh V Kumar.
* @license http://www.Open-School.org/
*/
?>
<?php
$courses = Courses::model()->findAll("is_deleted=:x", array(':x' => '1'));
foreach ($courses as $course) {
$batches = Batches::model()->findAll("course_id=:x", array(':x' => $course->id));
foreach ($batches as $batche) {
$batche->is_deleted = 1;
$batche->save();
}
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="247" valign="top">
<!--left-col starts Here-->
示例6: array
</table>
</div>
<div class="inner_new_formCon_row">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><?php
echo $form->labelEx($model, 'course');
?>
</td>
<td width="80%"> <?php
$data = CHtml::listData(Courses::model()->findAll('is_deleted=:x', array(':x' => '0'), array('order' => 'course_name DESC')), 'id', 'course_name');
echo $form->dropDownList($model, 'course', $data, array('prompt' => 'Select', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('fileUploads/batch'), 'update' => '#batch_id', 'data' => 'js:$(this).serialize()')));
?>
<?php
echo $form->error($model, 'course');
?>
</td>
</tr>
</table>
</div>
<div class="inner_new_formCon_row">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
示例7: Settings
<hr>
<h4>Подписаться на треки</h4>
<?php
$settings = new Settings();
$settings->findByPk(Yii::app()->my->id);
?>
<?php
$form = $this->beginWidget('CActiveForm');
?>
<?php
$list = CHtml::listData(Courses::model()->findAll(), 'id', 'title');
?>
<?php
echo $form->checkboxList($settings, 'courses', $list, array("multiple" => true));
?>
<hr>
<button type="submit " class="btn btn-success ">Сохранить</button>
<?php
$this->endWidget();
?>
示例8: array
<?php
/* @var $this ProfessorCourseController */
/* @var $model ProfessorCourse */
/* @var $form CActiveForm */
//$modelname = new Professors();
$dataProfessor = Professors::model()->findAll();
$optionsArrayProfessor = CHtml::listData($dataProfessor, 'professor_Id', 'first_Name');
$dataCourse = Courses::model()->findAll();
$optionArrayCourse = CHtml::listData($dataCourse, 'course_Id', 'course_Name');
//print_r($data);
//exit;
?>
<div class="form">
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'professor-course-form', 'enableAjaxValidation' => false, 'enableClientValidation' => true, 'clientOptions' => array('validateOnSubmit' => true)));
?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php
echo $form->errorSummary($model);
?>
<div class="row">
<?php
echo $form->labelEx($model, 'professor_Id');
?>
<?php
示例9: actionAjax_Create
public function actionAjax_Create()
{
if (isset($_POST['FinanceFeeCategories'])) {
//$model=new FinanceFeeCategories;
//set the submitted values
$model->attributes = $_POST['FinanceFeeCategories'];
$list = $_POST['FinanceFeeCategories'];
$count = sizeof($list['batch_id']);
for ($i = 0; $i < $count; $i++) {
$batch = Batches::model()->findByAttributes(array('id' => $list['batch_id'][$i]));
$course = Courses::model()->findByAttributes(array('id' => $batch->course_id));
$model = new FinanceFeeCategories();
$model->name = $list['name'];
$model->description = $list['name'] . ' for ' . $batch->name . '( ' . $course->course_name . ') ' . $list['description'];
$model->batch_id = $list['batch_id'][$i];
$model->is_deleted = $list['is_deleted'];
$model->is_master = $list['is_master'];
$model->created_at = $list['created_at'];
$model->updated_at = $list['updated_at'];
$model->save();
}
echo json_encode(array('success' => true));
exit;
}
}
示例10: loadModel
/**
* 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 the ID of the model to be loaded
*/
public function loadModel($id)
{
$model = Courses::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例11: array
?>
<?php
echo $form->textFieldRow($model, 'idPk', array('class' => 'span5'));
?>
<?php
echo $form->textFieldRow($model, 'PkName', array('class' => 'span5'));
?>
<?php
echo $form->dropDownListRow($model, 'DepartmentID', CHtml::listData(SysDepartments::model()->findAll(), "idDepartment", "DepartmentName"), array('empty' => '', 'class' => 'span5'));
?>
<?php
echo $form->dropDownListRow($model, 'CourseID', CHtml::listData(Courses::model()->findAll(), "idCourse", "CourseName"), array('empty' => '', 'class' => 'span5'));
?>
<?php
echo $form->dropDownListRow($model, 'QualificationID', CHtml::listData(Qualifications::model()->findAll(), "idQualification", "QualificationName"), array('empty' => '', 'class' => 'span5'));
?>
<?php
echo $form->textFieldRow($model, 'SpecMask', array('class' => 'span5'));
?>
<div class="form-actions">
<?php
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => 'Search'));
?>
</div>
示例12: array
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="247" valign="top">
<?php
$this->renderPartial('/batches/left_side');
?>
</td>
<td valign="top">
<div class="cont_right">
<div class="row">
<?php
echo CHtml::dropDownList('mydropdownlist', 'mydropdownlist', CHtml::listData(Courses::model()->findAll(), 'id', 'course_name'), array('onchange' => 'getid();', 'id' => 'drop', 'prompt' => 'Select Course'));
?>
<?php
// echo $searchForm->dropDownList($model, 'category_id', CHtml::listData(Category::model()->findAll(), 'id', 'name'));
?>
</div>
<?php
if (isset($_REQUEST['id'])) {
$posts = Batches::model()->findAll("course_id=:x", array(':x' => $_REQUEST['id']));
?>
<table>
<?php
foreach ($posts as $posts_1) {
echo '<tr><td>' . CHtml::link($posts_1->name, array('batchstudents', 'id' => $posts_1->id)) . '</td></tr>';
示例13: Courses
?>
</td>
</td></tr>
<tr>
<td> </td>
<td><strong><?php
echo Yii::t('Courses', 'Select Course');
?>
</strong></td>
<td> </td>
<td><?php
$model = new Courses();
$course = Courses::model()->findByAttributes(array('id' => $cid->course));
$criteria = new CDbCriteria();
$criteria->compare('is_deleted', 0);
$course_names = CHtml::listData(Courses::model()->findAllByAttributes(array('is_deleted' => 0), array('order' => 'id DESC')), 'id', 'course_name');
$course_list = CMap::mergeArray(array(0 => 'All Courses'), $course_names);
echo CHtml::dropDownList('cid', $course->id, array($course_list), array('style' => 'width:190px;'));
?>
</td></td> </tr>
</td> </tr>
<tr><td><?php
echo '<br/><br/>' . CHtml::submitButton(Yii::t('Courses', 'Update'), array('name' => 'update', 'class' => 'formbut'));
?>
</td>
</tr>
</td>
</tr>
</table>
</td>
示例14: array
<div class='span12'>
<div class="span6">
<?php
echo $form->label($model, 'QualificationID', array('style' => 'font-size: 8pt; font-family: Tahoma; text-align: left;'));
?>
<?php
echo $form->dropDownList($model, 'QualificationID', array("" => "", "1" => "Бакалавр", "2" => "Магістр", "3" => "Спеціаліст"), array('style' => 'font-family: Tahoma; '));
?>
</div>
<div class="span6">
<?php
echo $form->label($model, 'CourseID', array('style' => 'font-size: 8pt; font-family: Tahoma; text-align: left;'));
?>
<?php
echo $form->dropDownList($model, 'CourseID', array_merge(array(0 => ""), CHtml::listData(Courses::model()->findAll(), 'idCourse', 'CourseName')), array('style' => 'font-family: Tahoma;'));
?>
</div>
</div>
<div class="span12">
<div class="span6">
<?php
echo $form->label($model, 'searchID', array('style' => 'font-size: 8pt; font-family: Tahoma; text-align: left;'));
?>
<?php
echo $form->textField($model, 'searchID', array('style' => 'font-size: 8pt; font-family: Tahoma; height: 12px;'));
?>
</div>
<div class="span6">
<?php
示例15:
<?php
echo $college->config_value;
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
if (isset($_REQUEST['id'])) {
$batch = Batches::model()->findByAttributes(array('id' => $_REQUEST['id']));
$batchname = $batch->name;
$courseid = $batch->course_id;
$course = Courses::model()->findByAttributes(array('id' => $courseid));
$name = $course->course_name;
//echo $batchname;
}
?>
<h4>Student Assessment Report</h4>
<h5>Course : <?php
echo $name;
?>
<br/>
Batch : <?php
echo $batchname;
?>
</h5>
<?php
$allscores = ExamScores::model()->findAllByAttributes(array('exam_id' => $_REQUEST['examid']));