コード例 #1
0
ファイル: main.php プロジェクト: JexIboy/lis-pglu
<body style="background-image:url('images/bg2.png'); background-size: cover; background-size:100%; background-repeat:no-repeat;
background-attachment:fixed;">

<div id="header">

        <div id="logo"><img src="images/banner.png" style="width: 100vw;"/></div>
       
</div><!-- header -->
 
<div class="container" id="page"  >


        
    <?php 
$countNotif = count(ForumQuestion::model()->findAll(array('condition' => 'confirmation=0')));
$notif = $this->widget('bootstrap.widgets.TbBadge', array('type' => $countNotif == 0 ? 'info' : 'important', 'label' => $countNotif), true);
$receiving = count(Communication::model()->findAll(array('condition' => 'type_comm = 2 and now() >= date_agenda  ')));
$notifRC = $this->widget('bootstrap.widgets.TbBadge', array('type' => $receiving == 0 ? 'info' : 'important', 'label' => $receiving), true);
$referralCount = count(Communication::model()->findAll(array('condition' => 'archive=0 and comm_stat=0 and type_comm<>2')));
$referralduedateCount = count(Referral::model()->findAll(array('condition' => 'referral_stat = 0 and now() > duedate')));
$meetingResoCount = count(Referral::model()->countCommMeetingReso());
$meetingOrdiCount = count(Referral::model()->countCommMeetingOrdi());
$rfTotal = 0;
$rfTotal = $referralCount + $meetingOrdiCount + $meetingResoCount + $referralduedateCount;
$notifRFTotal = $this->widget('bootstrap.widgets.TbBadge', array('type' => $rfTotal == 0 ? 'info' : 'important', 'label' => $rfTotal), true);
$notifRFrefduedate = $this->widget('bootstrap.widgets.TbBadge', array('type' => $referralduedateCount == 0 ? 'info' : 'important', 'label' => $referralduedateCount), true);
$notifRFref = $this->widget('bootstrap.widgets.TbBadge', array('type' => $referralCount == 0 ? 'info' : 'important', 'label' => $referralCount), true);
$notifRFreso = $this->widget('bootstrap.widgets.TbBadge', array('type' => $meetingResoCount == 0 ? 'info' : 'important', 'label' => $meetingResoCount), true);
$notifRFordi = $this->widget('bootstrap.widgets.TbBadge', array('type' => $meetingOrdiCount == 0 ? 'info' : 'important', 'label' => $meetingOrdiCount), true);
$resoCount = count(Status::model()->countResolution());
コード例 #2
0
ファイル: SiteController.php プロジェクト: JexIboy/lis-pglu
 public function actionIndex()
 {
     $reso = new Resolution('searchIndex');
     $reso->unsetAttributes();
     // clear any default values
     if (isset($_GET['Resolution'])) {
         $reso->attributes = $_GET['Resolution'];
     }
     $ordi = new Ordinance('search');
     $ordi->unsetAttributes();
     // clear any default values
     if (isset($_GET['Ordinance'])) {
         $ordi->attributes = $_GET['Ordinance'];
     }
     $fquestion = new ForumQuestion('searchPosted');
     $fquestion->unsetAttributes();
     // clear any default values
     if (isset($_GET['ForumQuestion'])) {
         $model->attributes = $_GET['ForumQuestion'];
     }
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
     $jan = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-01%"')));
     $feb = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-02%"')));
     $mar = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-03%"')));
     $apr = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-04%"')));
     $may = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-05%"')));
     $jun = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-06%"')));
     $jul = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-07%"')));
     $aug = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-08%"')));
     $sep = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-09%"')));
     $oct = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-10%"')));
     $nov = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-11%"')));
     $dec = count(Resolution::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-12%"')));
     $months_data = array($jan, $feb, $mar, $apr, $may, $jun, $jul, $aug, $sep, $oct, $nov, $dec);
     $jan1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-01%"')));
     $feb1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-02%"')));
     $mar1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-03%"')));
     $apr1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-04%"')));
     $may1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-05%"')));
     $jun1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-06%"')));
     $jul1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-07%"')));
     $aug1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-08%"')));
     $sep1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-09%"')));
     $oct1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-10%"')));
     $nov1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-11%"')));
     $dec1 = count(Ordinance::model()->findAll(array('condition' => 'date_passed like "' . date('Y') . '-12%"')));
     $months_dataOrd = array($jan1, $feb1, $mar1, $apr1, $may1, $jun1, $jul1, $aug1, $sep1, $oct1, $nov1, $dec1);
     $sql = 'select distinct substring(res_no,6,9) as reso from tbl_resolution order by date_passed asc';
     $connection = Yii::app()->db;
     $command = $connection->createCommand($sql);
     $years = $command->queryAll();
     $sql1 = 'select distinct substring(ord_no,6,9) as ordi from tbl_ordinance order by date_passed asc';
     $connection1 = Yii::app()->db;
     $command1 = $connection->createCommand($sql1);
     $yearsOrd = $command1->queryAll();
     $y = array();
     foreach ($years as $value) {
         array_push($y, count(Resolution::model()->findAll(array('condition' => 'res_no like "%' . $value['reso'] . '"'))));
     }
     $yOrd = array();
     foreach ($yearsOrd as $value) {
         array_push($yOrd, count(Ordinance::model()->findAll(array('condition' => 'ord_no like "%' . $value['ordi'] . '"'))));
     }
     if (!empty(User::model()->findByPK(Yii::app()->user->name)->emp_id)) {
         date_default_timezone_set("Asia/Manila");
         $activity = new Activity();
         $activity->act_desc = 'Return to Homepage';
         $activity->act_datetime = date('Y-m-d G:i:s');
         $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id;
         $activity->save();
     }
     $this->render('index', array('months_dataOrd' => $months_dataOrd, 'months' => $months, 'months_data' => $months_data, 'years' => $years, 'yOrd' => $yOrd, 'years_data' => $y, 'reso' => $reso, 'ordi' => $ordi, 'fquestion' => $fquestion));
 }
コード例 #3
0
 /**
  * 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 ForumQuestion the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = ForumQuestion::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
コード例 #4
0
ファイル: BaseForumQuestionPeer.php プロジェクト: rayku/rayku
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      ForumQuestion $value A ForumQuestion object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(ForumQuestion $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }