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); }
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)); }
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 '-'; } }
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(); }
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 <*****@*****.**> * @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-->
</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">
<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(); ?>
<?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
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; } }
/** * 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; }
?> <?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>
<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>';
?> </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>
<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
<?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']));
Yii::app()->clientScript->registerScript('ajax-link-handler2', "\n\$('#loaddrop_link a').live('click', function(event){\n\t \$.ajax({\n 'type':'get',\n 'url':\$(this).attr('href'),\n 'dataType': 'html',\n 'success':function(data){\n \$('#student_panel_handler').html(data);\n\t\t\t\t\t\t\n }\n });\n event.preventDefault();\n});\n"); Yii::app()->clientScript->registerScript('ajax-link-handler2-user', "\n\$('#userloaddrop_link a').live('click', function(event){\n\t \$.ajax({\n 'type':'get',\n 'url':\$(this).attr('href'),\n 'dataType': 'html',\n 'success':function(data){\n \$('#user_panel_handler').html(data);\n\t\t\t\t\t\t\n }\n });\n event.preventDefault();\n});\n"); Yii::app()->clientScript->registerScript('ajax-link-handler1', "\n\$('#student_div a').live('click', function(event){\n\t\$.ajax({\n 'type':'get',\n 'url':\$(this).attr('href'),\n 'dataType': 'html',\n 'success':function(data){\n\t\t\t\t\tvar label = data.split('@#\$`')[0];\n\t\t\t\t\tvar id = data.split('@#\$`')[1];\n\t\t\t\t\t\n \$('#name_widget').val(label);\n\t\t\t\t\t\t\$('#id_widget').val(id);\n\t\t\t\t\t\t\$('#explorer_handler').html('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n }\n });\n event.preventDefault();\n});\n"); Yii::app()->clientScript->registerScript('ajax-link-handler1-user', "\n\$('#user_div a').live('click', function(event){\n\t\$.ajax({\n 'type':'get',\n 'url':\$(this).attr('href'),\n 'dataType': 'html',\n 'success':function(data){\n\t\t\t\t\tvar label = data.split('@#\$`')[0];\n\t\t\t\t\tvar id = data.split('@#\$`')[1];\n\t\t\t\t\t\n \$('#name_widget').val(label);\n\t\t\t\t\t\t\$('#id_widget').val(id);\n\t\t\t\t\t\t\$('#explorer_handler').html('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n }\n });\n event.preventDefault();\n});\n"); $setup_stu = false; $setup_emp = false; $setup_cou = false; $setup_fee = false; $setup_tim = false; $setup_lib = false; $setup_hos = false; $setup_tra = false; $setups = 0; $exp_stu = Students::model()->findAll(); $exp_emp = Employees::model()->findAll(); $exp_cou = Courses::model()->findAll(); $exp_fee = FinanceFeeCategories::model()->findAll(); $exp_tim = TimetableEntries::model()->findAll(); Yii::app()->getModule('library'); $exp_lib = Book::model()->findAll(); Yii::app()->getModule('hostel'); $exp_hos = Hosteldetails::model()->findAll(); Yii::app()->getModule('transport'); $exp_tra = RouteDetails::model()->findAll(); if (count($exp_stu)) { $setup_stu = true; $setups++; } if (count($exp_emp)) { $setup_emp = true; $setups++;
<table width="90%" border="0" cellspacing="0" cellpadding="0" class="s_search"> <tr> <td> </td> <td style="width:200px;"><strong><?php echo Yii::t('report', 'Select Course'); ?> </strong></td> <td> </td> <?php $model = new Courses(); $criteria = new CDbCriteria(); $criteria->compare('is_deleted', 0); ?> <td> <?php echo CHtml::dropDownList('cid', '', CHtml::listData(Courses::model()->findAllByAttributes(array('is_deleted' => 0), array('order' => 'id DESC')), 'id', 'course_name'), array('prompt' => 'Select Course', 'style' => 'width:190px;', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('/report/default/batchname'), 'update' => '#batchid', 'data' => 'js:$(this).serialize()'), 'options' => array($_REQUEST['cid'] => array('selected' => true)), 'onchange' => 'resetall()')); ?> </td> </tr> <tr> <td colspan="4"> </td> </tr> <tr> <td> </td> <td><strong><?php echo Yii::t('report', 'Select Batch'); ?> </strong></td> <td> </td> <td> <?php
<?php foreach ($posts as $posts_1) { ?> <div class="mcbrow" id="jobDialog1"> <ul> <li class="gtcol1" onclick="details('<?php echo $posts_1->id; ?> ');" style="cursor:pointer;"> <?php echo $posts_1->course_name; ?> <?php $course = Courses::model()->findByAttributes(array('id' => $posts_1->id, 'is_deleted' => 0)); $batch = Batches::model()->findAll("course_id=:x AND is_deleted=:y AND is_active=:z", array(':x' => $posts_1->id, ':y' => 0, ':z' => 1)); ?> <span><?php echo count($batch); ?> - Batch(es)</span> </li> <li class="col2"> <?php echo CHtml::ajaxLink(Yii::t('Courses', 'Edit'), $this->createUrl('courses/Edit'), array('onclick' => '$("#jobDialog11").dialog("open"); return false;', 'update' => '#jobDialog1', 'type' => 'GET', 'data' => array('val1' => $posts_1->id), 'dataType' => 'text'), array('id' => 'showJobDialog123' . $posts_1->id, 'class' => 'edit')); ?> </li> <li class="col3"><?php echo CHtml::link(Yii::t('Courses', 'Delete'), array('deactivate', 'id' => $posts_1->id), array('confirm' => "Are you sure?\n\n Note: All details (batches, students, timetable, fees, exam) related to this course will be deleted.", 'class' => 'delete')); ?>
public function actionFillDb() { set_time_limit(0); ini_set('mysqli.reconnect', 'on'); ini_set('mysql.connect_timeout', 400); // foreach (glob("C:/Users/fabio/git/qea/webapp/protected/vendors/qea/qa-include/*.php") as $filename) // { // inclde $filename; // } $tag = ""; $criteria = new CDbCriteria(); $criteria->condition = "post_type_l1 like '%useful%' AND post_type_l3 like '%si%' "; // $criteria->condition = "fbpid = 143370932459708"; $posts = FbPost::model()->findAll($criteria); foreach ($posts as $p) { $blob_id = null; if ($this->addFakeName($p->author_id)) { $qa_user_id = $this->addAuthor($p->author_id); } if (is_array($qa_user_id)) { $qa_user_id = $qa_user_id[0]; } // $tag = str_replace("_baseline", "",$p->post_type_l2); // $tag = str_replace("_", "-",$p->post_type_l2); //categories if (isset($p->degree_group_id)) { $category_id = $this->setSecondLevelCategory($p->degree_group_id, 1); } else { if (isset($p->exam_group_id)) { $exam_group = ExamGroup::model()->findByPk($p->exam_group_id); $course = Courses::model()->findByPk($exam_group->courses_id); $parent = $this->setSecondLevelCategory($course->degree_id, 0); $category_id = $this->setThirdLevelCategory($course->name, $parent); // $exam_group = ExamGroup::model()->findByPk($p->exam_group_id); // $course = Courses::model()->findByPk($exam_group->courses_id); $tag = $course->name; $tag = str_replace(" ", "-", $tag); // $tag = $tag.","; } } $photo = PhotoFbPost::model()->findByAttributes(array('element_id' => $p->fbpid)); if (isset($photo)) { $photo->medium = str_replace("/" . $photo->fid . "jpeg", "", $photo->medium); $blob_id = qa_upload_file($photo->medium, $photo->fid . 'jpeg'); } $tag_hold = ""; $substrmessage = substr($p->message, 0, 50); if (is_int(strpos($substrmessage, "["))) { for ($i = strpos($substrmessage, "[") + 1; $i < strlen($p->message); $i++) { if ($p->message[$i] == "]") { break; } $tag_hold = $tag_hold . $p->message[$i]; } if ($tag == "") { $tag = str_replace(" ", "-", $tag_hold); } else { $tag = $tag . "," . str_replace(" ", "-", $tag_hold); } } $title = substr($p->message, 0, 100); $title = $title . "..."; //posts if (qa_post_check_by_fb_id($p->fbpid) == null) { if ($blob_id != null) { $p->message = '<p><img alt="" src="http://www.universitree.com/?qa=blob&qa_blobid=' . $blob_id['blobid'] . '" style="height:250px;"><br>' . $p->message . '</p>'; //RIVEDI $question_id = qa_post_create_with_data("Q", null, $title, $p->message, 'html', $p->created_time, $category_id, $tag, $qa_user_id); qa_post_set_hidden($question_id, true); } else { $question_id = qa_post_create_with_data("Q", null, $title, $p->message, '', $p->created_time, $category_id, $tag, $qa_user_id); } qa_post_create_fb_mapping($question_id, $p->fbpid); $this->addLikes($p->fbpid, $question_id); $this->addAnswer($p->fbpid, $question_id); // $this->deletePost($p->fbpid); } // $comments = FbPostComment::model()->findAllByAttributes(array("ref_entity_id" => $p->fbpid)); // foreach ($comments as $c){ // if($this->addFakeName($c->author_id)) // if(!$this->addAuthor($c->author_id)) // echo "problemi di inconsistenza nei commenti"; // } //inserire qui gli unset unset($blob_id); unset($qa_user_id); unset($category_id); unset($exam_group); unset($course); unset($photo); $p->post_type_l1 = "ut_base"; $p->save(); } //$this->deleteUselessPost(); }
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'weekdays-form', 'enableAjaxValidation' => true)); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <div class="row"> <?php $data = CHtml::listData(Courses::model()->findAll(array('order' => 'course_name DESC')), 'id', 'course_name'); echo Yii::t('weekdays', 'Course'); echo CHtml::dropDownList('cid', '', $data, array('prompt' => 'Select', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('Weekdays/batch'), 'update' => '#batch_id', 'data' => 'js:$(this).serialize()'))); echo ' '; echo Yii::t('weekdays', 'Batch'); $data1 = CHtml::listData(Batches::model()->findAll(array('order' => 'name DESC')), 'id', 'name'); echo CHtml::activeDropDownList($model, 'batch_id', $data1, array('prompt' => 'Select', 'id' => 'batch_id')); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'weekday'); ?> <?php
public function getCoursename() { $course = Courses::model()->findByAttributes(array('id' => $this->course_id, 'is_deleted' => 0)); return $this->name . ' (' . $course->course_name . ')'; }
<?php } ?> </div> </div> <div class="row-fluid"> <div class="span8"> <div class="row-fluid"> <div class="span2"> <?php echo $form->labelEx($model, 'CourseID'); ?> <?php echo $form->dropDownList($model, 'CourseID', CHtml::listData(Courses::model()->findAll(), 'idCourse', 'CourseName'), array('empty' => '', 'class' => 'span12', 'disabled' => !$model->isNewRecord || Yii::app()->user->isPkSet("CourseID"))); ?> <?php //echo $form->error($model,'CourseID'); ?> </div> <div class="span3"> <?php echo $form->hiddenField($model, 'QualificationID'); echo $form->labelEx($model, 'QualificationID'); ?> <?php echo $form->dropDownList($model, 'QualificationID', CHtml::listData(Qualifications::model()->findAll("idQualification = 2 or idQualification = 3"), 'idQualification', 'QualificationName'), array('disabled' => !$model->isNewRecord, 'class' => "span12", 'id' => "QualificationID", 'onchange' => "PSN.changeQType(this ,'" . CController::createUrl('personspeciality/create', array("personid" => $personid, "reload" => 1)) . "');")); ?> <?php //echo $form->error($model,'QualificationID');
/** * * Показывает для редактирования и сохраняет курс * * @param id * @return true * **/ public function actionEdit_course($id) { if (!Yii::app()->my->access("edit")) { return false; } $course = Courses::model()->findByPk($id); if (isset($_REQUEST['Courses'])) { foreach ($_REQUEST['Courses'] as $key => $value) { $course->{$key} = $value; } if ($course->save()) { Yii::app()->notify->add("Курс сохранен. <a href='/course/" . $course->code . "' target='blank'>Перейти к курсу</a>"); } else { Yii::app()->notify->addErrors($course->getErrors()); Yii::app()->notify->add("Не удалось сохранить", "danger"); } } $this->render("course", array("course" => $course)); }
protected function detectAcronym($acronym, $cdl_id) { // $possible_exams = array(); $possible_exams = ''; $stop_words = array('dello', 'della', 'negli', 'degli', 'dell\'', 'all\'', 'agli', 'alle', 'del'); $exams_list = Courses::model()->findAllByAttributes(array('degree_id' => $cdl_id)); // $exams_list = Courses::model()->findAllByAttributes(array('name'=> 'Metodi avanzati di programmazione')); foreach ($exams_list as $key => $el) { $current_word = $el->name; $acronym = strtolower($acronym); $current_word = strtolower($current_word); foreach ($stop_words as $sw) { $current_word = str_replace($sw, '', $current_word); } $words = str_word_count($current_word, 1); for ($j = 0; $j < count($words); $j++) { if (strlen($words[$j]) <= 3) { array_splice($words, $j, 1); } } if (strlen($acronym) == count($words)) { $index = 1; for ($i = 0; $i < count($words); $i++) { if ($acronym[$i] != $words[$i][0]) { $index = 0; break; } } if ($index == 1) { // array_push($possible_exams,$el->name); $possible_exams = $el->name; } } } return $possible_exams; }
<?php $course = Courses::model()->findByAttributes(array('id' => $val, 'is_deleted' => 0)); $batch = Batches::model()->findAll("course_id=:x AND is_deleted=:y", array(':x' => $val, ':y' => 0)); ?> <div class="cbtablebx" id="dropwin"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr class="cbtablebx_topbg"> <td><?php echo Yii::t('Courses', 'Batch Name'); ?> </td> <td><?php echo Yii::t('Courses', 'Start Date'); ?> </td> <td><?php echo Yii::t('Courses', 'End Date'); ?> </td> <td style="border-right:none;">Actions</td> </tr> <tr class="even"> <td><?php echo $course->course_name; ?> (21 Students) </td> <td>12/10/2010</td> <td>10/10/2010</td> <td style="border-right:none;"><a href="#">EDIT</a> | <a href="#">DELETE</a> | <a href="#">ADD STUDENT</a></td>
<!-- Week Timetable --> <?php if ($_REQUEST['mode'] == 1) { $this->renderPartial('/weekdays/viewtable', array('course_id' => $course, 'batch_id' => $batch->id, 'mode' => $_REQUEST['mode'])); } elseif ($_REQUEST['mode'] == 2) { $this->renderPartial('/weekdays/viewtable', array('course_id' => $course, 'batch_id' => $batch->id, 'mode' => $_REQUEST['mode'], 'day' => $_REQUEST['day'])); } ?> <!-- END Week Timetable --> <?php } // END foreach($batches as $batch) } // END foreach($courses as $course) } else { $course = Courses::model()->findByAttributes(array('id' => $_REQUEST['cid'])); //echo 'Individual Course - '.count($course).' : '.$course->course_name.'<br />'; if ($_REQUEST['bid'] == 0) { //echo 'All Batches'; $batches = Batches::model()->findAllByAttributes(array('course_id' => $course->id, 'is_active' => 1, 'is_deleted' => 0)); foreach ($batches as $batch) { ?> <!-- Batch Details --> <div class="formCon"> <div class="formConInner"> <table style="text-align:center;"> <tr> <td style="width:auto; min-width:200px;"> <?php echo Yii::t('timetable', 'Course') . ' : ' . ucfirst($course->course_name); ?>
</td> <td align="center"><?php echo Yii::t('Courses', 'Course'); ?> </td> <td align="center"><?php echo Yii::t('Courses', 'Action'); ?> </td> </tr> <?php if ($course != NULL) { foreach ($course as $course_1) { $profile = Profile::model()->findByAttributes(array('user_id' => $course_1->user_id)); if ($course_1->course != 0) { $course_name = Courses::model()->findByAttributes(array('id' => $course_1->course)); $name = $course_name->course_name; } else { $name = 'All Courses'; } ?> <tr> <td align="center"><?php echo $profile->firstname . ' ' . $profile->lastname; ?> </td> <td align="center"><?php echo $name; ?> </td> <?php
<?php if ($batch != NULL) { ?> <li class="img_text"> <?php echo '<strong>' . Yii::t('Batch', 'Batch: ') . '</strong>'; echo $batch->name; ?> <br> <span><strong><?php echo Yii::t('Batch', 'Course:'); ?> </strong> <?php $course = Courses::model()->findByAttributes(array('id' => $batch->course_id)); if ($course != NULL) { echo $course->course_name; } ?> </span> </li> </ul> <div class="clear"></div> </div> <div class="status_bx"> <ul> <li style="border-right:1px #d9e1e7 solid"><span><?php echo count(Students::model()->findAll("batch_id=:x", array(':x' => $_REQUEST['id']))); ?>
</a> </li> <li> <a href="/courses"> <i class="entypo-layout"></i> <span>Курсы</span> </a> <ul> <?php $settings = json_decode($_SESSION['settings'], true); ?> <?php if (isset($settings['courses'])) { $courses = Courses::model()->findAll("id IN (" . implode(",", $settings['courses']) . ")"); } else { $courses = array(); } ?> <?php foreach ($courses as $course) { ?> <li> <a href="/course/<?php echo $course->code; ?> "> <span><?php