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));
 }
              <td style="border-top-style: 1px solid black; font-size:16px; font-weight:bold;">C) Referral Date</td>
              <td style="border-top-style: 1px solid black;">' . $refer1->format('M j, Y') . '</td>';
 }
 $tbl .= '</tr>';
 $tbl .= '<tr nobr="true">
          <td style="border-top-style: 1px solid black; font-size:15px; font-weight:bold;">D) Date Meeting/s</td>';
 $meetings = '';
 $temp = Referral::model()->findByAttributes(array('ctrl_no' => $model->ctrl_no));
 if (empty($temp)) {
     $meetings = '0000-00-00';
 } else {
     $x = CommMeetingReso::model()->find(array('condition' => 'ref_id = "' . $temp->ref_id . '"'));
     if ($x == null) {
         $meetings = '0000-00-00';
     } else {
         $IAs = CommMeetingReso::model()->findAll(array('condition' => 'ref_id = "' . $temp->ref_id . '"', 'order' => 'date_meeting desc'));
         $iaName = CHtml::listData($IAs, 'date_meeting', 'date_meeting');
         foreach ($iaName as $val) {
             $meetings = $val . '' . $meetings;
         }
     }
 }
 $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>';
 if ($date_report == '0000-00-00') {
     $tbl .= '<tr nobr="true">
 /**
  * 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 CommMeetingReso the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = CommMeetingReso::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Esempio n. 4
0
 public function actionCreate($id)
 {
     $model = new Resolution();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     $count = count(Resolution::model()->findAll(array('condition' => 'res_no like "%' . date('Y') . '"'))) + 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['Resolution'])) {
         $model->attributes = $_POST['Resolution'];
         $model->archive = 0;
         $picture_name = '';
         $picture_file = CUploadedFile::getInstance($model, 'reso_file');
         $model->reso_file = $picture_file;
         if ($picture_file) {
             $picture_name = $picture_file->name;
             if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/resolution/' . substr($model->ctrl_no, 0, 4))) {
                 mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/resolution/' . substr($model->ctrl_no, 0, 4));
             }
             if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/resolution/' . substr($model->ctrl_no, 0, 4) . '/' . $model->res_no)) {
                 mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/resolution/' . substr($model->ctrl_no, 0, 4) . '/' . $model->res_no);
                 $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/resolution/' . substr($model->ctrl_no, 0, 4) . '/' . $model->res_no . '/' . $picture_file->getName());
             } else {
                 $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/resolution/' . substr($model->ctrl_no, 0, 4) . '/' . $model->res_no . '/' . $picture_file->getName());
             }
         }
         $model->author = implode(',', $model->author);
         $model->input_by = User::model()->findByPK(Yii::app()->user->name)->emp_id;
         //-------------------------------------------------
         $stat = Status::model()->findByAttributes(array('ctrl_no' => $model->ctrl_no));
         $stat->remarks = 1;
         $stat->save();
         if (!empty(Referral::model()->findByAttributes(array('ctrl_no' => $model->ctrl_no))->ref_id)) {
             $temp = Referral::model()->findByAttributes(array('ctrl_no' => $model->ctrl_no))->ref_id;
             $meeting = CommMeetingReso::model()->find(array('condition' => 'ref_id = ' . $temp . ' and action_taken=1 or action_taken=2'));
             $meeting->comm_meeting_stat = 1;
             $meeting->remark = 1;
             $meeting->save();
         }
         if ($model->save()) {
             date_default_timezone_set("Asia/Manila");
             $activity = new Activity();
             $activity->act_desc = 'Added Another Resolution';
             $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->res_no));
         }
     }
     $this->render('create', array('model' => $model, 'count' => $count, 'id' => $id));
 }
Esempio n. 5
0
 public function getCommMeetings($d)
 {
     $temp = Referral::model()->findByAttributes(array('ctrl_no' => $d));
     if (empty($temp)) {
         echo 'No Committee Meeting';
     } else {
         $x = CommMeetingReso::model()->find(array('condition' => 'ref_id = "' . $temp->ref_id . '"'));
         if ($x == null) {
             echo '0000-00-00';
         } else {
             $IAs = CommMeetingReso::model()->findAll(array('condition' => 'ref_id = "' . $temp->ref_id . '"', 'order' => 'date_meeting desc'));
             $iaName = CHtml::listData($IAs, 'date_meeting', 'date_meeting');
             foreach ($iaName as $val) {
                 echo $val . '<br/>';
             }
         }
     }
 }
Esempio n. 6
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';
         }
     }
 }
Esempio n. 7
0
<?php

/* @var $this CommMeetingResoController */
/* @var $model CommMeetingReso */
$role = Yii::app()->user->getState("roles");
$this->breadcrumbs = array('Comm Meeting Resos' => array('index'), $model->meeting_reso_id);
$this->menu = array(array('label' => 'List Committee Meeting', 'url' => array('index')), array('label' => 'For Committee Meeting', 'url' => array('commMeetingList'), 'visible' => $role == 'SCR-RF' || $role == 'SYSAD' ? true : false), array('label' => 'Update Committee Meeting', 'url' => array('update', 'id' => $model->meeting_reso_id)), array('label' => 'Delete Committee Meeting', 'url' => '#', 'visible' => $role == 'SYSAD' ? true : false, 'linkOptions' => array('submit' => array('delete', 'id' => $model->meeting_reso_id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'View Archived Committee Meeting', 'url' => array('viewArchive'), 'visible' => $role == 'SCR-RF' || $role == 'SYSAD' ? true : false));
?>


<?php 
$x = CommMeetingReso::model()->findByPK($model->meeting_reso_id);
$act = '';
if ($x->action_taken == 0) {
    $act = 'disabled';
}
$box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'View Committee Meeting # ' . $x->meeting_reso_id, 'headerIcon' => 'icon-th-list', 'headerButtons' => array(array('class' => 'bootstrap.widgets.TbButton', 'type' => 'primary', 'label' => 'Insert Committee Report', 'disabled' => $act, 'htmlOptions' => array('id' => 'modalButton', 'data-toggle' => 'modal', 'data-target' => '#myModal'))), 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:98%;')));
?>
<br>

<div class="span8">


<?php 
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $x, 'attributes' => array(array('label' => 'Control No.', 'value' => $x->ref->ctrl_no), array('name' => 'action_taken', 'value' => $x->ActionTaken), 'date_meeting', array('name' => 'input_by', 'value' => $x->inputBy->Fullname), 'comm_report', array('name' => 'comm_rep_file', 'type' => 'raw', 'value' => CHtml::link($model->comm_rep_file, array("commMeetingReso/download", "id" => $model->meeting_reso_id))))));
?>
</div>

<?php 
$this->endWidget();
?>
Esempio n. 8
0
/* @var $form CActiveForm */
?>

<?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_reso_id', CHtml::listData(CommMeetingReso::model()->findAll(), 'meeting_reso_id', 'meeting_reso_id'), array('class' => 'span3', 'value' => ''));
?>

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

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

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