コード例 #1
0
 function show($metaPoziadavkaID)
 {
     $res = $this->requirements->load($metaPoziadavkaID);
     $this->set("meta_poziadavka", $res["meta_poziadavka"]);
     $this->set("requirement", $res["requirement"]);
     // doplnujuce informacie, co, kto a kedy
     $subjects = new Subjects();
     $rooms = new Rooms();
     //TODO nenatiahnut to do meta poziadavky rovno aj nazov predmetu ??
     $id_predmet = $res["meta_poziadavka"]["id_predmet"];
     $subject = $subjects->getSubject($id_predmet);
     $student_count = $subjects->getStudentCount($id_predmet);
     $student_count_info = $subjects->getStudentCountInfo($id_predmet);
     $this->set("subject", $subject["nazov"]);
     $this->set('student_count', $student_count['count']);
     $this->set('student_count_info', $student_count_info);
     $this->set('rooms', $rooms->getAll());
     $this->set('metaPoziadavkaID', $metaPoziadavkaID);
     $id_predmet = $res["meta_poziadavka"]["id_predmet"];
     $id_poziadavka_typ = 1;
     $previousMetaID = $this->requirements->getPreviousMetaID($id_predmet, $metaPoziadavkaID);
     $nextMetaID = $this->requirements->getNextMetaID($id_predmet, $metaPoziadavkaID);
     $this->set("previousMetaID", $previousMetaID);
     $this->set("nextMetaID", $nextMetaID);
 }
コード例 #2
0
ファイル: BannerSubjects.php プロジェクト: soundake/pd
 public function renderCategory($category_id)
 {
     $this->render();
     $this->subjects->where('ad_category', $category_id);
     $this->strict = false;
     $this->type = 'category';
 }
コード例 #3
0
ファイル: BannerControl.php プロジェクト: soundake/pd
 public function renderSubjects($args = NULL)
 {
     dump($args);
     if (key_exists('shire', $args)) {
         $this->subjects->where('ad_shire', $args['shire']);
     }
     if (key_exists('locality', $args)) {
         $this->subjects->where('ad_locality', $args['locality']);
     }
     if (key_exists('category', $args)) {
         $this->subjects->where('ad_category', $args['category']);
     }
     $this->subjects->fetchAd($this->strict);
     $this->template->setFile(dirname(__FILE__) . '/subjects.latte');
     $this->render();
 }
コード例 #4
0
 public function actionCreate()
 {
     $model = new Subjects('insert');
     $users_list = CHtml::listData(Users::model()->findAll(), 'id', 'username');
     if (Yii::app()->request->isPostRequest) {
         $classroom = Yii::app()->request->getParam('Subjects');
         $model->setAttributes($classroom);
         if (!Yii::app()->user->checkAccess('admin')) {
             $model->setAttribute('owner_id', Yii::app()->user->id);
         }
         if ($model->save()) {
             Yii::app()->user->setFlash('success', 'Предмет успешно создан');
             $this->redirect(['index']);
         }
     }
     $this->render('form', ['model' => $model, 'users_list' => $users_list]);
 }
コード例 #5
0
 /**
  * Zisti ci dotycna osoba vyucuje dany predmet v danej roli
  * @param int $pedagogID - id pedagoga
  * @param int $predmetID - id rpedmetu
  * @param String $rola - kod roli
  * @param String $akcia - popis akcie tkoru chce vykonat nad predmetom (aktualne see alebo edit)
  * @return boolean - true ak vyucuje predmet, inakk false
  */
 private function __vyucujePredmet($pedagogID, $predmetID, $rola, $akcia)
 {
     $vyucuje = $this->courses->vyucujePredmet($pedagogID, $predmetID, $rola);
     if (!$vyucuje) {
         $subject = Subjects::getSubjectInfo($predmetID);
         $this->controller->log("Pokus o akciu `{$akcia}` neprideleného predmetu `{$subject}` v roli `{$rola}`");
         $this->controller->flash("Tento predmet vám nebol pridelený.", "error");
     }
     return $vyucuje;
 }
コード例 #6
0
ファイル: Subjects.php プロジェクト: akilraj1255/rajeshwari
 public function codes($attribute, $params)
 {
     $flag = 0;
     $subject = Subjects::model()->findAllByAttributes(array('batch_id' => $this->batch_id, 'is_deleted' => 0));
     foreach ($subject as $subject_1) {
         if ($subject_1->name == $this->name) {
             $flag = 1;
         }
     }
     if ($flag == 1) {
         $this->addError($attribute, 'This subject is already added');
     }
 }
コード例 #7
0
 public function edit($id)
 {
     if (Auth::check() && (Auth::user()->id == $id || Auth::user()->access == 1)) {
         $tutor = Tutor::firstOrCreate(['id' => $id]);
         $subjects = Subjects::all();
         $levels = Subjects::getLevels();
         $districts = Districts::all();
         $subject = Input::get('sublevel');
         $district = Input::get('district');
         return View::make('edit_profile')->with(compact(['tutors', 'subjects', 'levels', 'districts']));
     }
     return View::make('login');
 }
コード例 #8
0
 public function actionDelete()
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     $request = \Yii::$app->request;
     $data = $request->post();
     $id = $data['id'];
     try {
         Subjects::findOne(['id' => $id])->delete();
         return ['status' => 1, 'message' => 'Thành công'];
     } catch (Exception $ex) {
         return ['status' => 0, 'message' => 'Có lỗi xảy ra'];
     }
 }
コード例 #9
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Exams();
     $model_1 = new ExamGroups();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Exams'])) {
         //$model->attributes=$_POST['Exams'];
         if (isset($_REQUEST['exam_group_id'])) {
             $insert_id = $_REQUEST['exam_group_id'];
         } else {
             $model_1->attributes = $_POST['ExamGroups'];
             $model_1->batch_id = $_REQUEST['id'];
             $model_1->save();
             $insert_id = Yii::app()->db->getLastInsertID();
         }
         $posts = Subjects::model()->findAll("batch_id=:x AND no_exams=:y", array(':x' => $_REQUEST['id'], ':y' => 0));
         $list = $_POST['Exams'];
         $count = count($list['subject_id']);
         $j = 0;
         for ($i = 0; $i < $count; $i++) {
             if ($list['maximum_marks'][$i] != NULL and $list['minimum_marks'][$i] != NULL and $list['start_time'][$i] != NULL and $list['end_time'][$i] != NULL) {
                 $model = new Exams();
                 $model->exam_group_id = $insert_id;
                 $model->subject_id = $list['subject_id'][$i];
                 $model->maximum_marks = $list['maximum_marks'][$i];
                 $model->minimum_marks = $list['minimum_marks'][$i];
                 $model->start_time = $list['start_time'][$i];
                 $model->end_time = $list['end_time'][$i];
                 if ($model->start_time) {
                     $date1 = date('Y-m-d H:i', strtotime($model->start_time));
                     $model->start_time = $date1;
                 }
                 if ($model->end_time) {
                     $date2 = date('Y-m-d H:i', strtotime($model->end_time));
                     $model->end_time = $date2;
                 }
                 $model->grading_level_id = $list['grading_level_id'];
                 $model->weightage = $list['weightage'];
                 $model->event_id = $list['event_id'];
                 $model->created_at = $list['created_at'];
                 $model->updated_at = $list['updated_at'];
                 $model->save();
             }
         }
         $this->redirect(array('exams/create', 'id' => $_REQUEST['id'], 'exam_group_id' => $_REQUEST['exam_group_id']));
     }
     $this->render('create', array('model' => $model, 'model_1' => $model_1));
 }
コード例 #10
0
 function show($metaPoziadavkaID)
 {
     $res = $this->requirements->load($metaPoziadavkaID);
     $this->set("meta_poziadavka", $res["meta_poziadavka"]);
     $this->set("requirement", $res["requirement"]);
     $subjects = new Subjects();
     $rooms = new Rooms();
     $id_predmet = $res["meta_poziadavka"]["id_predmet"];
     $subject = $subjects->getSubject($id_predmet);
     $student_count = $subjects->getStudentCount($id_predmet);
     $student_count_info = $subjects->getStudentCountInfo($id_predmet);
     $this->set("subject", $subject["nazov"]);
     $this->set('student_count', $student_count['count']);
     $this->set('student_count_info', $student_count_info);
     $this->set('rooms', $rooms->getAll());
     $this->set('types', $rooms->getTypes());
     $this->set('metaPoziadavkaID', $metaPoziadavkaID);
     $id_predmet = $res["meta_poziadavka"]["id_predmet"];
     $id_poziadavka_typ = 2;
     $previousMetaID = $this->requirements->getPreviousMetaID($id_predmet, $metaPoziadavkaID);
     $nextMetaID = $this->requirements->getNextMetaID($id_predmet, $metaPoziadavkaID);
     $this->set("previousMetaID", $previousMetaID);
     $this->set("nextMetaID", $nextMetaID);
 }
コード例 #11
0
ファイル: list.php プロジェクト: hqd276/bigs
 function draw()
 {
     global $display;
     $keyword = Url::get('keyword');
     if (!$keyword) {
         $keyword = Url::get('keyword_mobile');
     }
     $order_str = '';
     $where_class = ' WHERE `name` LIKE "%' . addslashes($keyword) . '%"  AND is_active = 1 ';
     $where_subject = ' WHERE `name` LIKE "%' . addslashes($keyword) . '%"   ';
     $where_lesson = ' WHERE `name` LIKE "%' . addslashes($keyword) . '%"   ';
     $per_page = 21;
     $list_class = Classes::get_collection(' LIMIT 0, ' . $per_page, $where_class, $order_str);
     $list_subject = Subjects::get_collection(' LIMIT 0, ' . $per_page, $where_subject, $order_str);
     $list_lesson = Lessons::get_collection(' LIMIT 0, ' . $per_page, $where_lesson, $order_str);
     $current_url = strtok($_SERVER['REQUEST_URI'], '&');
     if (count($list_class) == $per_page) {
         $is_next_class = 1;
         array_pop($list_class);
     } else {
         $is_next_class = 0;
     }
     if (count($list_subject) == $per_page) {
         $is_next_subject = 1;
         array_pop($list_subject);
     } else {
         $is_next_subject = 0;
     }
     if (count($list_lesson) == $per_page) {
         $is_next_lesson = 1;
         array_pop($list_lesson);
     } else {
         $is_next_lesson = 0;
     }
     $display->add('current_url', $current_url);
     $display->add('is_next_class', $is_next_class);
     $display->add('is_next_subject', $is_next_subject);
     $display->add('is_next_lesson', $is_next_lesson);
     $display->add('list_class', $list_class);
     $display->add('list_subject', $list_subject);
     $display->add('list_lesson', $list_lesson);
     $display->add('keyword_view', htmlspecialchars($keyword));
     $display->add('keyword', $keyword);
     $display->add('keyword_mobile', $keyword);
     // Output
     $display->output("list");
 }
コード例 #12
0
 /**
  * Zabezpeci ulozenie poziadavky. Handluje aj pridanie aj upravu existujucej.
  */
 function save()
 {
     try {
         $crses = new Courses();
         $minule = $crses->getMinulorocne($this->getSemesterID());
         $this->set('minule', $minule);
         $checked = $this->bind($this->requirements);
         if (!$this->canEdit($this->requirements->id, "Garant", $this->redirect)) {
             return;
         }
         $this->requirements->save();
         $courseInfo = Subjects::getSubjectInfo($this->requirements->id);
         //poslat notifikaciu
         $this->notificator->sendCourseAssignedMsg($this->requirements);
         $this->log("Vloženie/editácia garantovej požiadavky na predmet `{$courseInfo}`");
         $this->flash('Požiadavky boli uložené.');
         $this->redirect('garant/requirements/index');
     } catch (dataValidationException $ex) {
         $this->set('requirements', $ex->checked);
         $this->__commonData($this->requirements->id);
     }
 }
コード例 #13
0
ファイル: Subjects.php プロジェクト: upmunspel/abiturient
 public static function DropDown($SepcialityID = 0, $Level = 0)
 {
     $res = array();
     $c = new CDbCriteria();
     $c->order = 'SubjectName';
     //if ($SepcialityID == 0){
     foreach (Subjects::model()->findAll($c) as $record) {
         $res[$record->idSubjects] = $record->SubjectName;
     }
     //           } else {
     //
     //                $ssubj = Specialitysubjects::model()->find("SpecialityID=:SpecialityID and LevelID = :LevelID",
     //                        array(":SpecialityID"=>$SepcialityID,":LevelID"=>$Level));
     //                if (!empty($ssubj->subject)){
     //                      $res[$ssubj->subject->idSubjects] = $ssubj->subject->SubjectName;
     //                } else {
     //                    foreach(Subjects::model()->findAll() as $record) {
     //                         $res[$record->idSubjects] = $record->SubjectName;
     //                    }
     //                }
     //            }
     return $res;
 }
コード例 #14
0
ファイル: timetable.php プロジェクト: akilraj1255/rajeshwari
															<?php 
            for ($i = 0; $i < $count_timing; $i++) {
                echo ' <td class="td">
																<div  onclick="" style="position: relative; ">
																<div class="tt-subject">
																<div class="subject">';
                $set = TimetableEntries::model()->findByAttributes(array('batch_id' => $_REQUEST['id'], 'weekday_id' => $weekdays[6]['weekday'], 'class_timing_id' => $timing[$i]['id']));
                if (count($set) == 0) {
                    $is_break = ClassTimings::model()->findByAttributes(array('id' => $timing[$i]['id'], 'is_break' => 1));
                    if ($is_break == NULL) {
                        echo CHtml::ajaxLink(Yii::t('weekdays', 'Assign'), $this->createUrl('TimetableEntries/settime'), array('onclick' => '$("#jobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'] . '").dialog("open"); return false;', 'update' => '#jobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'], 'type' => 'GET', 'data' => array('batch_id' => $_REQUEST['id'], 'weekday_id' => $weekdays[6]['weekday'], 'class_timing_id' => $timing[$i]['id']), 'dataType' => 'text'), array('id' => 'showJobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday']));
                    } else {
                        echo Yii::t('weekdays', 'Break');
                    }
                } else {
                    $time_sub = Subjects::model()->findByAttributes(array('id' => $set->subject_id));
                    if ($time_sub != NULL) {
                        echo $time_sub->name . '<br>';
                    }
                    $time_emp = Employees::model()->findByAttributes(array('id' => $set->employee_id));
                    if ($time_emp != NULL) {
                        echo '<div class="employee">' . $time_emp->first_name . '</div>';
                    }
                    echo CHtml::link('', array('timetableEntries/remove', 'id' => $set->id, 'batch_id' => $_REQUEST['id']), array('confirm' => 'Are you sure?', 'class' => 'delete'));
                }
                echo '</div>
																</div>
																</div>
																<div id="jobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'] . '"></div>
																</td>';
            }
コード例 #15
0
ファイル: admin.php プロジェクト: upmunspel/abiturient
//	'Specialitysubjects'=>array('index'),
//	'Manage',
//);
$this->menu = array(array('label' => 'Перелік предметів напрямів', 'url' => array('admin'), 'icon' => "icon-plus"), array('label' => 'Додати предмет напрямкку', 'url' => array('create'), 'icon' => "icon-plus"));
Yii::app()->clientScript->registerScript('search', "\r\n\$('.search-button').click(function(){\r\n\t\$('.search-form').toggle();\r\n\treturn false;\r\n});\r\n\$('.search-form form').submit(function(){\r\n\t\$.fn.yiiGridView.update('specialitysubjects-grid', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n");
?>

<h1>Управління предметами напрямків</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<!--
<?php 
echo CHtml::link('Advanced Search', '#', array('class' => 'search-button btn'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div> search-form -->


<?php 
$data = $model->search();
$Specialities = new Specialities();
$d = $Specialities->getSpecialityFullNames();
$this->widget('bootstrap.widgets.TbGroupGridView', array('id' => 'specialitysubjects-grid', 'type' => 'striped bordered condensed', 'dataProvider' => $data, 'filter' => $model, 'mergeColumns' => array('SpecialityID'), 'columns' => array(array('name' => 'SpecialityID', 'value' => '$data->speciality->SpecialityDirectionName." ".$data->speciality->SpecialitySpecializationName." (".
                    (($data->speciality->PersonEducationFormID==1)?("денна"):(($data->speciality->PersonEducationFormID==2)?("заочна"):("екстернат"))).")"', 'filter' => $d), array('name' => 'SubjectID', 'value' => '$data->subject->SubjectName', 'filter' => CHtml::listData(Subjects::model()->findAll(), "idSubjects", "SubjectName")), array('name' => 'LevelID', 'filter' => array("1" => "1", "2" => "2", "3" => "3"), "htmlOptions" => array("style" => "width: 100px")), array('name' => 'isProfile', 'filter' => array('1' => 'так', '0' => 'ні'), "htmlOptions" => array("style" => "width: 100px"), 'value' => '($data->isProfile)? "так":"ні"'), array('class' => 'bootstrap.widgets.TbButtonColumn'))));
コード例 #16
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSubject()
 {
     return $this->hasOne(Subjects::className(), ['id' => 'subject_id']);
 }
コード例 #17
0
 public function sendChatChangedMsg($comments, $urlPart, $role)
 {
     $userChangedChat = $this->controller->session->read("name");
     $courseID = $comments->course_id;
     $courseInfo = Subjects::getSubjectInfo($courseID);
     $default = array('DATE' => date("d.m.Y H:i", time()), 'COURSE' => $courseInfo, 'USER_CHANGED_CHAT' => $userChangedChat, 'REQUIREMENT' => $comments->metaID, 'LAST_COMMENT' => nl2br($comments->commentText), 'URL' => BASE_URL . "/{$urlPart}/{$courseID}#komentare");
     $message = $this->__createTemplate("messages/chatChanged.tpl", $default);
     $toList = $this->__unify($this->maily->getListForComments($courseID, $role));
     $subject_part = $role == "Pract" ? "k cvičeniu" : "k prednáške";
     $ref = $this->__createRef("requirement.{$role}.chat", $courseID);
     $this->sendNotifyMessage($toList, $message, "[{$courseInfo}] zmenený komentár {$subject_part}", $ref);
 }
コード例 #18
0
ファイル: _form.php プロジェクト: akilraj1255/rajeshwari
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><?php 
echo $form->labelEx($model, Yii::t('library', 'subject'));
?>
</td>
    <td>&nbsp;</td>
    <td><?php 
$criteria = new CDbCriteria();
$criteria->compare('is_deleted', 0);
echo $form->dropDownList($model, 'subject', CHtml::listData(Subjects::model()->findAll($criteria), 'id', 'name'), array('prompt' => 'Select'));
?>
		<?php 
//echo $form->error($model,'subject');
?>
</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><?php 
echo $form->labelEx($model, Yii::t('library', 'category'));
?>
コード例 #19
0
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete($id)
 {
     if (Yii::app()->request->isPostRequest) {
         $model = ExamScores::model()->findByAttributes(array('id' => $id));
         $student = Students::model()->findByAttributes(array('id' => $model->student_id));
         $student_name = ucfirst($student->first_name) . ' ' . ucfirst($student->middle_name) . ' ' . ucfirst($student->last_name);
         $exam = Exams::model()->findByAttributes(array('id' => $model->exam_id));
         $subject_name = Subjects::model()->findByAttributes(array('id' => $exam->subject_id));
         $examgroup = ExamGroups::model()->findByAttributes(array('id' => $exam->exam_group_id));
         $batch = Batches::model()->findByAttributes(array('id' => $examgroup->batch_id));
         $exam_name = ucfirst($subject_name->name) . ' - ' . ucfirst($examgroup->name) . ' (' . ucfirst($batch->name) . '-' . ucfirst($batch->course123->course_name) . ')';
         $goal_name = $student_name . ' for the exam ' . $exam_name;
         // we only allow deletion via POST request
         $this->loadModel($id)->delete();
         //Adding activity to feed via saveFeed($initiator_id,$activity_type,$goal_id,$goal_name,$field_name,$initial_field_value,$new_field_value)
         ActivityFeed::model()->saveFeed(Yii::app()->user->Id, '22', $model->id, $goal_name, NULL, NULL, NULL);
         // we only allow deletion via POST request
         //$this->loadModel($id)->delete();
         // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
         if (!isset($_GET['ajax'])) {
             $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
         }
     } else {
         throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
     }
 }
コード例 #20
0
ファイル: RefSex.php プロジェクト: spiro-stathakis/projects
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSubjects()
 {
     return $this->hasMany(Subjects::className(), ['sex_id' => 'id']);
 }
コード例 #21
0
 /**
  * Ziska data poziadavky, nastavi aj predmet aj semester
  * @param unknown_type $courseID
  * @return unknown_type
  */
 private function __getCommonData($courseID)
 {
     $rooms = new Rooms();
     $subjects = new Subjects();
     $student_count = $subjects->getStudentCount($courseID);
     $student_count_info = $subjects->getStudentCountInfo($courseID);
     $this->set('capacities', $rooms->getCapacities());
     $this->set('types', $rooms->getTypes());
     $this->set('type_capacity', $rooms->getCapacitiesForTypes());
     $this->set('rooms', $rooms->getAll());
     // zoradene, len podla nazvu
     $this->set('roomsByName', $rooms->getAll(true));
     $this->set('subject', $subjects->getSubject($courseID));
     $this->set('student_count', $student_count['count']);
     $this->set('student_count_info', $student_count_info);
     $this->set('course_id', $courseID);
     $this->set("semester_id", $this->session->read("semester"));
     // flag blokovania a comment k tomu
     $this->set('blokovanie_preberania', $this->subjects->isBlockedCopying($courseID));
 }
コード例 #22
0
ファイル: _form.php プロジェクト: akilraj1255/rajeshwari
</table>

    
    
   <h3><?php 
        echo Yii::t('examination', ' Enter exam related details here:');
        ?>
</h3>
    
<div class="tableinnerlist">
<table width="95%" cellspacing="0" cellpadding="0">


<?php 
        if (isset($_REQUEST['id'])) {
            $posts = Subjects::model()->findAll("batch_id=:x AND no_exams=:y", array(':x' => $_REQUEST['id'], ':y' => 0));
            if (count($posts) != 0) {
                $c = count($posts);
                $i = 1;
                $j = 0;
                foreach ($posts as $posts_1) {
                    $c--;
                    $checksub = Exams::model()->findByAttributes(array('exam_group_id' => $_REQUEST['exam_group_id'], 'subject_id' => $posts_1->id));
                    if ($checksub == NULL) {
                        if ($j == 0) {
                            ?>
              <?php 
                            echo $form->labelEx($model, 'max_mark');
                            ?>
                  <?php 
                            echo $form->textField($model, 'max_mark', array('id' => 'max_mark'));
コード例 #23
0
 public function actionAjax_delete()
 {
     $id = $_POST['id'];
     $subject = Subjects::model()->findByAttributes(array('elective_group_id' => $id));
     $timetable = TimetableEntries::model()->deleteAllByAttributes(array('subject_id' => $subject->id));
     $examgroup = Exams::model()->deleteAllByAttributes(array('subject_id' => $subject->id));
     EmployeeElectiveSubjects::model()->deleteAllByAttributes(array('subject_id' => $subject->id));
     $subject->delete();
     $deleted = $this->loadModel($id);
     if ($deleted->delete()) {
         echo json_encode(array('success' => true));
         exit;
     } else {
         echo json_encode(array('success' => false));
         exit;
     }
 }
コード例 #24
0
ファイル: Exams.php プロジェクト: SoftScape/open-school-CE
 public function subjectname($data, $row)
 {
     $subject = Subjects::model()->findByAttributes(array('id' => $data->subject_id));
     return $subject->name;
 }
コード例 #25
0
    	<?php 
            echo '<span>' . Yii::t('Batch', 'Notice') . '</span>';
            ?>
       <?php 
            echo Yii::t('Batch', 'Time Table Not Created.');
            ?>
 <br />
        <?php 
            echo CHtml::link(Yii::t('Batch', 'Create Now'), array('weekdays/timetable', 'id' => $_REQUEST['id']));
            ?>
</div>
        <?php 
        }
        ?>
        <?php 
        $sub = Subjects::model()->findByAttributes(array('batch_id' => $batch->id));
        if ($sub == NULL) {
            ?>
        <div class="notifications nt_red">
    	<?php 
            echo '<span>' . Yii::t('Batch', 'Notice') . '</span>';
            ?>
        <?php 
            echo Yii::t('Batch', 'No Subjects Added');
            ?>
.<br />
        <?php 
            echo CHtml::link(Yii::t('Batch', 'Add Now'), array('#'), array('id' => 'add_subjects-side'));
            ?>
</div>
        <?php 
コード例 #26
0
ファイル: _form.php プロジェクト: upmunspel/abiturient
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'specialitysubjects-form', 'enableAjaxValidation' => false));
$form = new TbActiveForm();
?>

	<p class="help-block">Fields with <span class="required">*</span> are required.</p>

	<?php 
if (empty($SpecialityID)) {
    $SpecialityID = 0;
}
echo CHtml::dropDownList("SpecialityID", $SpecialityID, Specialities::DropDown(), array('empty' => "", 'class' => 'span5'));
$c = new CDbCriteria();
$c->order = 'SubjectName';
$c->compare('idZNOSubject', '>0');
$data = CHtml::listData(Subjects::model()->findAll($c), "idSubjects", "SubjectName");
$dataCount = count($data);
?>
        <div class ="row-fluid">
            <?php 
echo $form->error($models[0], "SpecialityID");
?>
        </div>
        
        <div class ="row-fluid">
            <?php 
foreach ($models as $i => $model) {
    ?>
            <div class="span4">
                <?php 
    echo $form->error($model, "[{$i}]SubjectID");
コード例 #27
0
 public function actionPdf()
 {
     $batch_name = Batches::model()->findByAttributes(array('id' => $_REQUEST['id']));
     $exam = Exams::model()->findByAttributes(array('id' => $_REQUEST['examid']));
     $examgroup = ExamGroups::model()->findByAttributes(array('id' => $exam->exam_group_id));
     $subject = Subjects::model()->findByAttributes(array('id' => $exam->subject_id));
     $filename = $batch_name->name . ' ' . $examgroup->name . ' ' . $subject->name . '.pdf';
     # HTML2PDF has very similar syntax
     $html2pdf = Yii::app()->ePdf->HTML2PDF();
     $html2pdf->WriteHTML($this->renderPartial('scorepdf', array(), true));
     $html2pdf->Output($filename);
 }
コード例 #28
0
ファイル: attentstud.php プロジェクト: akilraj1255/rajeshwari
            break;
        case 3:
            return 'W<br>';
            break;
        case 4:
            return 'T<br>';
            break;
        case 5:
            return 'F<br>';
            break;
        case 6:
            return 'S<br>';
            break;
    }
}
$subjects = Subjects::model()->findAll("batch_id=:x", array(':x' => $_REQUEST['id']));
//echo CHtml::dropDownList('batch_id','',CHtml::listData(Subjects::model()->findAll("batch_id=:x",array(':x'=>$_REQUEST['id'])), 'id', 'name'), array('empty'=>'Select Type'));
$model = new EmployeeAttendances();
if (isset($_REQUEST['id'])) {
    if (!isset($_REQUEST['mon'])) {
        $mon = date('F');
        $mon_num = date('n');
        $curr_year = date('Y');
    } else {
        $mon = $model->getMonthname($_REQUEST['mon']);
        $mon_num = $_REQUEST['mon'];
        $curr_year = date('Y');
    }
    $num = cal_days_in_month(CAL_GREGORIAN, $mon_num, $curr_year);
    // 31
    ?>
コード例 #29
0
ファイル: exams.php プロジェクト: akilraj1255/rajeshwari
if ($exam == NULL) {
    echo '<tr><td align="center" colspan="4"><i>' . Yii::t('parentportal', 'No Assessments') . '</i></td></tr>';
} else {
    $displayed_flag = '';
    foreach ($exam as $exams) {
        $exm = Exams::model()->findByAttributes(array('id' => $exams->exam_id));
        $group = ExamGroups::model()->findByAttributes(array('id' => $exm->exam_group_id, 'result_published' => 1));
        $grades = GradingLevels::model()->findAllByAttributes(array('batch_id' => $exams->grading_level_id));
        $t = count($grades);
        if ($group != NULL and count($group) > 0) {
            echo '<tr>';
            if ($exm != NULL) {
                $displayed_flag = 1;
                //$group=ExamGroups::model()->findByAttributes(array('id'=>$exm->exam_group_id));
                echo '<td>' . $group->name . '</td>';
                $sub = Subjects::model()->findByAttributes(array('id' => $exm->subject_id));
                if ($sub->elective_group_id != 0 and $sub->elective_group_id != NULL) {
                    $student_elective = StudentElectives::model()->findByAttributes(array('student_id' => $student->id));
                    if ($student_elective != NULL) {
                        $electname = Electives::model()->findByAttributes(array('id' => $student_elective->elective_id, 'elective_group_id' => $sub->elective_group_id));
                        if ($electname != NULL) {
                            echo '<td>' . $electname->name . '</td>';
                        }
                    }
                } else {
                    echo '<td>' . $sub->name . '</td>';
                }
                if ($group->exam_type == 'Marks') {
                    echo "<td>" . $exams->marks . "</td>";
                } else {
                    if ($group->exam_type == 'Grades') {
コード例 #30
0
 public function actionSubject()
 {
     $data = Subjects::model()->findAll(array('join' => 'JOIN batches ON batch_id = batches.id', 'condition' => 'batches.course_id=:id', 'params' => array(':id' => (int) $_POST['id'])));
     $data = CHtml::listData($data, 'id', 'name');
     foreach ($data as $value => $name) {
         echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);
     }
 }