/**
  * 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 $id the ID of the model to be loaded
  * @return Lectures the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Lectures::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Esempio n. 2
0
 public function get($lecture_id = NULL)
 {
     $lecture_id = $this->security->xss_clean($lecture_id);
     if ($lecture_id == NULL || !is_numeric($lecture_id)) {
         $this->index();
         return;
     }
     $filename = $this->_isValidLectureID($lecture_id);
     if ($filename == NULL) {
         $this->index();
         return;
     }
     $contents = read_file(Lectures::getLectureCachePath() . $filename);
     $contents = str_replace("---", "!", $contents);
     echo $contents;
 }
 public function set_assoc_array(array $arr, $id_present = false)
 {
     // Initialize Success Variable
     $suc = parent::set_assoc_array($arr, $id_present);
     foreach ($this as $key => $val) {
         $suc[$key] = false;
     }
     // Trim Values
     array_walk($arr, array($this, 'trim_value'));
     // Validation
     if (isset($arr['lec_id']) && ctype_digit($arr['lec_id'])) {
         $this->lec_id = $arr['lec_id'];
         $suc['lec_id'] = true;
     }
     if (isset($arr['stud_id']) && ctype_digit($arr['stud_id'])) {
         $this->stud_id = $arr['stud_id'];
         $suc['stud_id'] = true;
     }
     $suc['presence'] = true;
     if (isset($arr['presence']) && intval($arr['presence']) == 1) {
         $this->presence = 1;
     }
     return $suc;
 }
Esempio n. 4
0
	<ul>
		<li><a href="#" onclick="console.log(1)"><span>ВИДЕО</span></a></li>
		<li><a href="#" onclick="console.log(2)"><span>АУДИО</span></a></li>
		<li><a href="#" onclick="console.log(3)"><span>ОБОИ</span></a></li>
		<li><a href="#" onclick="console.log(4)"><span>APPS</span></a></li>
	 </ul>
</div>
</div>
</div>

<div class="col-xs-12 col-sm-12 col-md-2">
<div id="main_lectorii" class="v-center">
<div id="main_lectorii_content">

<?php 
$lectorus = Lectures::model()->findAll(array('condition' => 'DATE(date)=DATE(CURDATE())'));
if ($lectorus) {
    if (count($lectorus) > 1) {
        ?>
	<div id="goToNextSlideLectore"></div>
	<?php 
    }
    ?>

	<ul id="main-lectorus-slider">
	<?php 
    foreach ($lectorus as $lectoria) {
        $src = $lectoria->getOrigFilePath() . $lectoria->image;
        echo '<li style="width:100%;height:100%;">
		<a href="' . Yii::app()->createUrl('lectures/view', array('id' => $lectoria->id)) . '" class="a-lectures-slider"><div class="lect_img" style="background-image:url(' . $src . ')"></div>
				<div class="lect_txt"><div class="lect_txt_zag">' . MHelper::String()->truncate($lectoria->title, 25) . '</div><div class="m-t-5">' . MHelper::String()->truncate($lectoria->short_desc, 90) . '</div></div></a></li>';