Exemple #1
0
<?php

$x = CommMeetingOrdi::model()->findByPK($model->meeting_ordi_id);
?>
<script type="text/javascript">    

       $(document).ready(function(){
    var act = '<?php 
echo $x->action_taken;
?>
';

    var comm = '<?php 
echo $x->comm_report;
?>
';
        
        
        
        if((act==0)){
        	$('#modalButton').hide();
        }
        else if((act!=0) && (comm.length != 0)){
        	$('#modalButton').hide();
        }
        else if((comm.length!=0) && (act==0)){
        	$('#modalButton').hide();
        }
        
        
        
Exemple #2
0
?>

<?php 
$box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Advanced Search', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:98%;')));
?>
<br>
<div class="span8">
<div class="wide form">

<?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get'));
CHtml::$afterRequiredLabel = '';
?>

	<?php 
echo $form->dropDownListRow($model, 'meeting_ordi_id', CHtml::listData(CommMeetingOrdi::model()->findAll(), 'meeting_ordi_id', 'meeting_ordi_id'), array('class' => 'span3', 'prompt' => 'Committee Meeting ID'));
?>

	<?php 
echo $form->dropDownListRow($model, 'ref_id', CHtml::listData(Referral::model()->findAll(), 'ref_id', 'ctrl_no'), array('class' => 'span3', 'prompt' => 'Control Number'));
?>

	<?php 
echo $form->dropDownListRow($model, 'action_taken', array(0 => 'Pending', 1 => 'Approved', 2 => 'Return to Origin'), array('class' => 'span3', 'prompt' => 'Action Taken'));
?>

	<?php 
echo $form->datepickerRow($model, 'date_meeting', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd')));
?>

	<?php 
Exemple #3
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());
$ordiCount = count(CommMeetingOrdi::model()->findAll(array('condition' => 'archive=0 and comm_meeting_stat=1 and ord_remark=0 and action_taken=1')));
$tTotal = 0;
$tTotal = $resoCount + $ordiCount;
$notifTtotal = $this->widget('bootstrap.widgets.TbBadge', array('type' => $tTotal == 0 ? 'info' : 'important', 'label' => $tTotal), true);
$notifTreso = $this->widget('bootstrap.widgets.TbBadge', array('type' => $resoCount == 0 ? 'info' : 'important', 'label' => $resoCount), true);
$notifTordi = $this->widget('bootstrap.widgets.TbBadge', array('type' => $ordiCount == 0 ? 'info' : 'important', 'label' => $ordiCount), true);
$role = Yii::app()->user->getState("roles");
switch ($role) {
    case 'SCR-RC':
        $this->widget('bootstrap.widgets.TbNavbar', array('type' => 'inverse', 'brand' => 'Home', 'fixed' => false, 'type' => 'inverse', 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array(array('label' => 'Communications', 'url' => array('communication/viewTypeComm')), array('label' => 'Referrals', 'url' => array('referral/index')), array('label' => 'Committee Meetings', 'url' => array('#'), 'items' => array(array('label' => 'Committee Meeting for Ordinances', 'url' => array('commMeetingOrdi/index')), array('label' => 'Committee Meeting for Resolutions', 'url' => array('commMeetingReso/index')))), array('label' => 'Legislative Enactments', 'url' => array('#'), 'items' => array(array('label' => 'Resolution', 'url' => array('/resolution/index')), array('label' => 'Ordinance', 'url' => array('/ordinance/index')))), array('label' => 'Monitor Ordinances', 'url' => array('/monitorOrd/index')), array('label' => 'Reports', 'url' => array('#'), 'items' => array(array('label' => 'Resolution Reports', 'url' => array('/reportsresolution/index')), array('label' => 'Ordinance Reports', 'url' => array('/reportsordinance/index')), array('label' => 'Other Reports', 'url' => array('/reportsOthers/commReportMonthly')))), array('label' => 'Forum', 'url' => array('/site/main_forum')), array('label' => 'Gallery', 'url' => array('/site/viewphotosPage'), 'visible' => Yii::app()->user->isGuest))), array('class' => 'bootstrap.widgets.TbMenu', 'encodeLabel' => false, 'htmlOptions' => array('class' => 'pull-right'), 'items' => array(array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest), array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Notifications ' . $notifRC, 'url' => array('#'), 'icon' => 'icon-bell icon-white', 'items' => array(array('label' => 'For Referral ' . $notifRC, 'url' => array('/communication/viewTypeComm')))))))));
        break;
    case 'SCR-T':
        $this->widget('bootstrap.widgets.TbNavbar', array('type' => 'inverse', 'fixed' => true, 'brand' => 'Home', 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array(array('label' => 'Communications', 'url' => array('communication/index')), array('label' => 'Referrals', 'url' => array('referral/index')), array('label' => 'Committee Meetings', 'url' => array('#'), 'items' => array(array('label' => 'Committee Meeting for Ordinances', 'url' => array('commMeetingOrdi/index')), array('label' => 'Committee Meeting for Resolutions', 'url' => array('commMeetingReso/index')))), array('label' => 'Legislative Enactments', 'url' => array('#'), 'items' => array(array('label' => 'Resolution', 'url' => array('/resolution/resolutionList')), array('label' => 'Ordinance', 'url' => array('/ordinance/ordinanceList')))), array('label' => 'Monitor Ordinances', 'url' => array('/monitorOrd/index')), array('label' => 'Reports', 'url' => array('#'), 'items' => array(array('label' => 'Resolution Reports', 'url' => array('/reportsresolution/index')), array('label' => 'Ordinance Reports', 'url' => array('/reportsordinance/index')), array('label' => 'Other Reports', 'url' => array('/reportsOthers/commReportMonthly')))), array('label' => 'Forum', 'url' => array('/site/main_forum')), array('label' => 'Gallery', 'url' => array('/site/viewphotosPage'), 'visible' => Yii::app()->user->isGuest))), array('class' => 'bootstrap.widgets.TbMenu', 'encodeLabel' => false, 'htmlOptions' => array('class' => 'pull-right'), 'items' => array(array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest), array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Notifications ' . $notifTtotal, 'url' => array('#'), 'icon' => 'icon-bell icon-white', 'items' => array(array('label' => 'For Ordinance ' . $notifTordi, 'url' => array('/ordinance/ordinanceList')), array('label' => 'For Resolution ' . $notifTreso, 'url' => array('/resolution/resolutionList')))))))));
        break;
    case 'SCR-RF':
        $this->widget('bootstrap.widgets.TbNavbar', array('type' => 'inverse', 'fixed' => false, 'brand' => 'Home', 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array(array('label' => 'Communications', 'url' => array('communication/index')), array('label' => 'Referrals', 'url' => array('referral/referralList')), array('label' => 'Committee Meetings', 'url' => array('#'), 'items' => array(array('label' => 'Committee Meeting for Ordinances', 'url' => array('commMeetingOrdi/commMeetingList')), array('label' => 'Committee Meeting for Resolutions', 'url' => array('commMeetingReso/commMeetingList')))), array('label' => 'Legislative Enactments', 'url' => array('#'), 'items' => array(array('label' => 'Resolution', 'url' => array('/resolution/index')), array('label' => 'Ordinance', 'url' => array('/ordinance/index')))), array('label' => 'Monitor Ordinances', 'url' => array('/monitorOrd/index')), array('label' => 'Reports', 'url' => array('#'), 'items' => array(array('label' => 'Resolution Reports', 'url' => array('/reportsresolution/index')), array('label' => 'Ordinance Reports', 'url' => array('/reportsordinance/index')), array('label' => 'Other Reports', 'url' => array('/reportsOthers/commReportMonthly')))), array('label' => 'Forum', 'url' => array('/site/main_forum')), array('label' => 'Gallery', 'url' => array('/site/viewphotosPage'), 'visible' => Yii::app()->user->isGuest))), array('class' => 'bootstrap.widgets.TbMenu', 'encodeLabel' => false, 'htmlOptions' => array('class' => 'pull-right'), 'items' => array(array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest), array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Notifications ' . $notifRFTotal, 'url' => array('#'), 'icon' => 'icon-bell icon-white', 'items' => array(array('label' => 'For Referral ' . $notifRFref, 'url' => array('/referral/referralList')), array('label' => 'Referrals without action' . $notifRFrefduedate, 'url' => array('/referral/referraldue')), array('label' => 'Meeting for Resolution ' . $notifRFreso, 'url' => array('/commMeetingReso/commMeetingList')), array('label' => 'Meeting for Ordinance ' . $notifRFordi, 'url' => array('/commMeetingOrdi/commMeetingList')))))))));
Exemple #4
0
<div class="span8">
<div class="wide form">

<?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get'));
CHtml::$afterRequiredLabel = '';
?>

	<?php 
echo $form->dropDownListRow($model, 'ord_no', CHtml::listData(Ordinance::model()->findAll(), 'ord_no', 'ord_no'), array('class' => 'span3', 'empty' => 'Choose Ordinance Number'));
?>
    

	
	<?php 
echo $form->dropDownListRow($model, 'meeting_ordi_id', $model->isNewRecord ? CHtml::listData(CommMeetingOrdi::model()->findAll(array('condition' => 'comm_meeting_stat=1 and ord_remark=0')), 'meeting_ordi_id', 'ControlNumber') : CHtml::listData(CommMeetingOrdi::model()->findAll(), 'meeting_ordi_id', 'ControlNumber'), array('class' => 'span3', 'empty' => $model->isNewRecord ? '------ Select Control No.   ------' : $model->meetingOrdi->ControlNumber));
?>

	<?php 
echo $form->textFieldRow($model, 'subj_matter', array('class' => 'span4'));
?>
 

	<?php 
echo $form->select2Row($model, 'author', array('asDropDownList' => true, 'data' => CHtml::listData(Officials::model()->findAll(''), 'off_id', 'Fullname'), 'multiple' => 'multiple', 'options' => array('width' => '40%', 'placeholder' => '        ------------ Choose Author ------------', 'tokenSeparators' => array(',', ' '))));
?>

    <?php 
echo $form->select2Row($model, 'imp_agency', array('asDropDownList' => true, 'data' => CHtml::listData(Agency::model()->findAll(), 'agency_id', 'agency_name'), 'multiple' => 'multiple', 'options' => array('width' => '40%', 'placeholder' => '        ------------ Choose Agency ------------', 'tokenSeparators' => array(',', ' '))));
?>
 $meetings1 = new DateTime($meetings, $timezone);
 if ($meetings == '0000-00-00') {
     $tbl .= '<td style="border-top-style: 1px solid black;"> : N/A </td>';
 } else {
     $tbl .= '<td style="border-top-style: 1px solid black;">: ' . $meetings1->format('M j, Y') . '</td>';
 }
 $tbl .= '</tr>';
 $tbl .= '<tr nobr="true">
          <td style="border-top-style: 1px solid black; font-size:16px; font-weight:bold;">E) Public Hearing/s</td>';
 $hearing = '';
 if (!empty($model->meeting_ordi_id)) {
     $y = CommMeetingOrdi::model()->findByPK($model->meeting_ordi_id);
     if (!empty($y)) {
         $hearing = 'N/A';
     } else {
         $phearing = CommMeetingOrdi::model()->findAll(array('condition' => 'public_hearing <> "0000-00-00" and ref_id = "' . $y->ref_id . '"', 'order' => 'date_meeting asc'));
         $meet = CHtml::listData($phearing, 'public_hearing', 'public_hearing');
         foreach ($meet as $val) {
             $hearing = $val . '<br/>' . $hearing;
         }
     }
     if ($hearing == '0000-00-00<br/>') {
         $hearing = 'N/A';
     }
 } else {
     $hearing = ' N/A';
 }
 $tbl .= '<td style="border-top-style: 1px solid black;">: ' . $hearing . '</td>';
 $tbl .= '</tr>';
 if ($date_report == '0000-00-00') {
     $tbl .= '<tr nobr="true">
 public function actionPrintCommReportYearly($model)
 {
     $data = explode(',', $model);
     $comm_name = $data[0];
     $year = $data[1];
     $x = Committee::model()->findByPK($comm_name);
     $referrals = CHtml::listData(Referral::model()->findAll(array('condition' => 'lead_committee = :lcomm', 'params' => array(':lcomm' => $x->comm_id))), 'ref_id', 'ref_id');
     $criteria = new CDbCriteria();
     $criteria->condition = "action_taken <> 0 and comm_report like :comm_rep";
     $criteria->params = array(':comm_rep' => $year . '%');
     $criteria->addInCondition("ref_id", $referrals);
     $listReso = CommMeetingReso::model()->findAll($criteria);
     $listOrd = CommMeetingOrdi::model()->findAll($criteria);
     date_default_timezone_set("Asia/Manila");
     $activity = new Activity();
     $activity->act_desc = 'Searched Yearly Committe Report of ' . $x->comm_name;
     $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->renderPartial('printCommReportYearly', array('listOrd' => $listOrd, 'listReso' => $listReso, 'comm_name' => $x->comm_name, 'year' => $year));
 }
Exemple #7
0
 public function getReportDate($ctrl)
 {
     if ($ctrl) {
         return CommMeetingOrdi::model()->findByAttributes(array('meeting_ordi_id' => $ctrl))->comm_report;
     } else {
         return 'No Report Date';
     }
 }
Exemple #8
0
 public function getTitle($d)
 {
     $x = Referral::model()->findByAttributes(array('ctrl_no' => $d));
     if (!empty($x->ref_id)) {
         if ($this->cat->cat_name == 'Provincial Ordinance') {
             $ord = CommMeetingOrdi::model()->findAll(array('condition' => 'ref_id=' . $x->ref_id, 'order' => 'date_meeting desc', 'limit' => 1));
             $y = '';
             foreach ($ord as $key) {
                 $y = $key->meeting_ordi_id;
             }
             if (!empty(Ordinance::model()->findByAttributes(array('meeting_ordi_id' => $y))->ord_no)) {
                 echo 'Ord No. ' . Ordinance::model()->findByAttributes(array('meeting_ordi_id' => $y))->ord_no;
             } else {
                 echo 'None';
             }
         } else {
             $reso = CommMeetingReso::model()->findAll(array('condition' => 'ref_id=' . $x->ref_id, 'order' => 'date_meeting desc', 'limit' => 1));
             foreach ($reso as $key) {
                 if (!empty($key->comm_report)) {
                     if (!empty(Resolution::model()->findByAttributes(array('ctrl_no' => $d))->res_no)) {
                         echo 'Res No. ' . Resolution::model()->findByAttributes(array('ctrl_no' => $d))->res_no;
                     } else {
                         echo 'None';
                     }
                 } else {
                     echo 'None';
                 }
             }
         }
     } else {
         if (!empty(Resolution::model()->findByAttributes(array('ctrl_no' => $d))->res_no)) {
             echo 'Res No. ' . Resolution::model()->findByAttributes(array('ctrl_no' => $d))->res_no;
         } else {
             echo 'None';
         }
     }
 }
 public function actionCreate($id)
 {
     $model = new Ordinance();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     $count = count(Ordinance::model()->findAll()) + 1;
     if ($count <= 99) {
         if ($count <= 9) {
             $count = '00' . $count . ' - ' . date('Y');
         } else {
             $count = '0' . $count . ' - ' . date('Y');
         }
     } else {
         $count = $count . ' - ' . date('Y');
     }
     if (isset($_POST['Ordinance'])) {
         $model->attributes = $_POST['Ordinance'];
         $x = CommMeetingOrdi::model()->find(array('condition' => 'comm_report IS NOT NULL and ref_id = ' . Referral::model()->findByAttributes(array('ctrl_no' => $model->meeting_ordi_id))->ref_id))->meeting_ordi_id;
         $model->meeting_ordi_id = $x;
         $model->archive = 0;
         $picture_name = '';
         $picture_file = CUploadedFile::getInstance($model, 'ordi_file');
         $model->ordi_file = $picture_file;
         if ($picture_file) {
             $picture_name = $picture_file->name;
             if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/ordinance/' . substr($model->ord_no, 6, 9))) {
                 mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/ordinance/' . substr($model->ord_no, 6, 9));
             }
             if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/ordinance/' . substr($model->ord_no, 6, 9) . '/' . $model->ord_no)) {
                 mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/ordinance/' . substr($model->ord_no, 6, 9) . '/' . $model->ord_no);
                 $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/ordinance/' . substr($model->ord_no, 6, 9) . '/' . $model->ord_no . '/' . $picture_file->getName());
             } else {
                 $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/ordinance/' . substr($model->ord_no, 6, 9) . '/' . $model->ord_no . '/' . $picture_file->getName());
             }
         }
         $model->author = implode(',', $model->author);
         $model->imp_agency = implode(',', $model->imp_agency);
         $model->input_by = User::model()->findByPK(Yii::app()->user->name)->emp_id;
         //-------------------------------------------------
         $stat = Status::model()->findByAttributes(array('ctrl_no' => $model->meetingOrdi->ref->ctrl_no));
         $stat->remarks = 1;
         $stat->save();
         CommMeetingOrdi::model()->updateByPK($model->meeting_ordi_id, array('comm_meeting_stat' => 1, 'ord_remark' => 1));
         if ($model->save() && $model->validate()) {
             date_default_timezone_set("Asia/Manila");
         }
         $activity = new Activity();
         $activity->act_desc = 'Added Another Ordinance';
         $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->redirect(array('view', 'id' => $model->ord_no));
     }
     $this->render('create', array('model' => $model, 'count' => $count, 'id' => $id));
 }
 /**
  * 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 CommMeetingOrdi the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = CommMeetingOrdi::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }