public function run() { $this->showActive($this->_controller, $this->_action); switch ($this->_controller) { case $this->_controller == 'site' && $this->_action != 'cadastro' && $this->_action != 'cadastro_editar' && $this->_action != 'esqueci' && $this->_action != 'ativarcadastro': $this->render('sideMenuHome'); break; case $this->_controller == 'quemsomos': $this->render('sideMenuQuemSomos'); break; case $this->_controller == 'areasdeatuacao': $this->render('sideMenuMercadosAtendidos'); break; case $this->_controller == 'compradores': $this->render('sideMenuCompradores'); break; case $this->_controller == 'avaliesuaempresa': $this->render('sideMenuAvalieSuaEmpresa'); break; case $this->_controller == 'negociosavenda' || $this->_action == 'cadastro' || $this->_action == 'cadastro_editar' || $this->_action == 'esqueci' || $this->_action == 'ativarcadastro': $criteria = new CDbCriteria(); $criteria->condition = 'status_excluido=\'S\''; $criteria->order = 'status_ordem'; $this->_status = Status::model()->findAll($criteria); $this->_model = new LoginForm(); $this->render('sideMenuNegociosaVenda'); break; case $this->_controller == 'contato': $this->render('sideMenuContato'); break; } }
public function actionSummary() { $a = array(); $rows = Status::model()->findAll(); $run_num = 0; $fault_num = 0; $stop_num = 0; $comp_num = 0; $total_num = count($rows); for ($i = 0; $i < $total_num; $i++) { switch ($rows[$i]['frstatus']) { case 1: case 2: case 4: case 8: $fault_num++; break; case 32: $run_num++; break; case 201: $comp_num++; break; default: $stop_num++; } } $a['run_num'] = $run_num; $a['fault_num'] = $fault_num; $a['stop_num'] = $stop_num; $a['comp_num'] = $comp_num; $total_num = Loominfo::model()->count(); $a['total_num'] = $total_num; //effect $day_start = strtotime(date('Y-m-d')); $week_start = strtotime("-7 days"); $week_start = strtotime(date("Y-m-d", $week_start)); $month_start = strtotime("-1 month"); $month_start = strtotime(date("Y-m-d", $month_start)); $c = array('select' => 'AVG(fpowersec) AS fpowersec, AVG(frunsec) AS frunsec, AVG(frpmnum) AS frpmnum, SUM(frpmnum) AS frlength', 'condition' => "fhourid>:start"); $c['params'] = array(':start' => $day_start); $day = Hourdata::model()->find($c); $c['params'] = array(':start' => $week_start); $week = Hourdata::model()->find($c); $c['params'] = array(':start' => $month_start); $month = Hourdata::model()->find($c); $a['effect_day'] = $day['fpowersec'] > 0 ? round($day['frunsec'] / $day['fpowersec'] * 100, 2) . '%' : '-'; $a['effect_week'] = $week['fpowersec'] > 0 ? round($week['frunsec'] / $week['fpowersec'] * 100, 2) . '%' : '-'; $a['effect_month'] = $month['fpowersec'] > 0 ? round($month['frunsec'] / $month['fpowersec'] * 100, 2) . '%' : '-'; $a['rpm_day'] = $day['frpmnum'] == null ? '-' : $day['frpmnum']; $a['rpm_week'] = $week['frpmnum'] == null ? '-' : $week['frpmnum']; $a['rpm_month'] = $month['frpmnum'] == null ? '-' : $month['frpmnum']; $rollinfo = Rollinfo::model()->find(); $fdensity = $rollinfo->fweft->fdensity; $a['output_day'] = $day['frlength'] > 0 ? round($day['frlength'] / $fdensity, 2) : '-'; $a['output_week'] = $week['frlength'] > 0 ? round($week['frlength'] / $fdensity, 2) : '-'; $a['output_month'] = $month['frlength'] > 0 ? round($month['frlength'] / $fdensity, 2) : '-'; echo CJSON::encode($a); }
public function renderButtons($data, $row) { //$getAllocatedItem = Allocate::model()->findByAttributes(array('cons_id'=>$data->id,'date_out'=>NULL)); $getAllocatedItem = Allocate::model()->find('cons_id = :cons_id AND (date_out IS NULL OR date_out = :date_out)', array(':cons_id' => $data->id, ':date_out' => '0000-00-00')); $getConsStatus = Consumable::model()->find('id = :id', array(':id' => $data->id)); $status = Status::model()->find('id = :id', array(':id' => $getConsStatus['status_id'])); $canAllocate = $getAllocatedItem['allocate_id'] && $status['status'] != 'blocked' ? true : false; $this->widget('bootstrap.widgets.TbButtonGroup', array('size' => 'small', 'type' => 'inverse', 'buttons' => array(array('label' => 'Manage Group', 'url' => 'http://localhost/asset_management/index.php/usergroup/listbuilder?groupId=' . $data->id . '&groupName=' . $data->name)))); }
/** * Return all Status required by modules with concepts * @return json object with status list */ public function actiongetStatus() { if (Yii::app()->request->isAjaxRequest) { $Status = Status::model()->findAllRequired($_POST['required']); $output = array(); foreach ($Status as $clave) { array_push($output, array('iux' => $clave->status_id, 'nux' => $clave->status_name)); } echo CJSON::encode($output); Yii::app()->end(); } else { throw new CHttpException(403, Yii::t('site', '403_Error')); } }
public function actionUpdatest() { //TODO $arr = array(); /*for ($i = 1; $i <= 200; $i++) { $key = sprintf("A%03d", $i); $arr[$key] = array( 'rpm' => 600, 'effect' => sprintf('%.0d.%0d%%', rand() % 100, rand() % 100), 'runtime' => 32423 ); }*/ $arr = Status::model()->findAll(); echo CJSON::encode($arr); }
/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionUpdate($id) { $model = $this->loadModel($id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); $model->cat_id = explode(',', $model->cat_id); $model->orig_id = explode(',', $model->orig_id); if (isset($_POST['Communication'])) { $model->attributes = $_POST['Communication']; $model->archive = 0; $model->cat_id = implode(',', $model->cat_id); $model->orig_id = implode(',', $model->orig_id); $picture_name = ''; $picture_file = CUploadedFile::getInstance($model, 'comm_letter'); $model->comm_letter = $picture_file; if ($picture_file) { $picture_name = $picture_file->name; if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/communication/' . substr($model->ctrl_no, 0, 4) . '/' . $model->comm_letter)) { mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/communication/' . substr($model->ctrl_no, 0, 4) . '/' . $model->comm_letter); } if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/communication/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no)) { mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/communication/' . substr($model->ctrl_no, 0, 4) . '/' . $model->comm_letter); $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/communication/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no . '/' . $picture_file->getName()); } else { $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/communication/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no . '/' . $picture_file->getName()); //fwrite('/protected/document/communication/'.substr($model->ctrl_no,0,4).'/'.$model->ctrl_no,$model->comm_letter); } } $model->input_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; if ($model->type_comm == 1) { $model->comm_stat = 0; } else { $model->comm_stat = 1; } if ($model->save()) { date_default_timezone_set("Asia/Manila"); $activity = new Activity(); $activity->act_desc = 'Updated Communication ID: ' . $id; $activity->act_datetime = date('Y-m-d G:i:s'); $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; $activity->save(); if ($model->type_comm == 1) { $stat = Status::model()->findByAttributes(array('ctrl_no' => $model->ctrl_no)); if (!empty($stat)) { $stat->ctrl_no = $model->ctrl_no; $stat->comm_stat = 0; $stat->referral_stat = 0; $stat->comm_meeting_stat = 0; $stat->save(); $activity->save(); } else { $stat = new Status(); $stat->ctrl_no = $model->ctrl_no; $stat->comm_stat = 0; $stat->referral_stat = 0; $stat->comm_meeting_stat = 0; $stat->save(); $activity->save(); } } else { $stat = Status::model()->findByAttributes(array('ctrl_no' => $model->ctrl_no)); if (!empty($stat)) { $stat->ctrl_no = $model->ctrl_no; $stat->comm_stat = 1; $stat->referral_stat = 1; $stat->comm_meeting_stat = 1; $stat->save(); $activity->save(); } else { $stat = new Status(); $stat->ctrl_no = $model->ctrl_no; $stat->comm_stat = 1; $stat->referral_stat = 1; $stat->comm_meeting_stat = 1; $stat->save(); $activity->save(); } } $this->redirect(array('view', 'id' => $model->ctrl_no)); } } $this->render('update', array('model' => $model)); }
<?php $id_peserta = $absensi[$i]['id_peserta']; $peserta = Peserta::model()->findByPk($id_peserta); print_r($peserta['nomor_peserta']); ?> </td> <td> <?php print_r($peserta['nama']); ?> </td> <td > <?php $status= Status::model()->findByPk($absensi[$i]['id_status']); ?> <?php echo $status->keterangan; ?> </td> <td> <?php echo $absensi[$i]['alasan']; ?> </td> </tr> <?php }; ?> </tbody> </table> </div> </div> <?php echo CHtml::link('Back', array('absensi/index')); ?>
padding:0 0 10px 0; clear:both; } </style> <br> <div class="row" style="color:#2E598A;"> <strong>STATUS</strong> </div> <div class="row"> <ul class="status"> <?php //Magic here $modelSU->status_id = $sts_selected; echo $form->checkBoxList($modelSU, 'status_id', CHtml::listData(Status::model()->findAll(array('condition' => 'status_excluido = \'N\'', 'order' => 'status_id')), 'status_id', 'status_titulo'), array('separator' => '', 'template' => '<li style=\'float:left;margin:0 0 0 10px;\'>{input} {label}</li>'), array('multiple' => 'multiple')); ?> </ul> <?php echo $form->error($model, 'category_id'); ?> </div> <div class="row buttons" style="clear:both; padding-top:10px;"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Criar' : 'Salvar'); ?> </div> <?php $this->endWidget();
public function countResolution() { // @todo Please modify the following code to remove attributes that should not be searched. $cat = Category::model()->findByAttributes(array('cat_name' => 'Provincial Ordinance'))->cat_id; $result = CHtml::listData(Communication::model()->findAll(array('condition' => 'cat_id <> ' . $cat . ' and comm_stat=1')), 'ctrl_no', 'ctrl_no'); $criteria = new CDbCriteria(); $criteria->condition = 'comm_meeting_stat = 1 and remarks =0'; $criteria->addInCondition("ctrl_no", $result); return Status::model()->findAll($criteria); }
public function actionGetdetailproject($id) { // $model = Project::model()->findByPk($id); // echo $gambar; $sql = "SELECT \n\t\tp.id,p.due_date due_date , pch.datetime latest_upload,\n\t\tpv.jumlah_v number_views ,p.status status, p.worker worker\n\n\t\tFROM \n\t\tproject p\n\t\tleft JOIN \n\t\tproject_comment_head pch\n\t\tON \n\t\tp.id = pch.project_id\n\t\tleft JOIN\n\t\t(\n\t\t\tSELECT COUNT(*) jumlah_v,project_id FROM project_views WHERE \n\t\t\tproject_id = '{$id}'\n\t\t) AS pv\n\t\tON \n\t\tp.id = pv.project_id\n\t\twhere p.id = '{$id}'\n\n\t\tGROUP BY p.id\n\t\tORDER BY pch.datetime DESC\n\t\t"; $model = Yii::app()->db->createCommand($sql)->queryRow(); // print_r($model); $array = array(); $array["id"] = $model["id"]; $array["due_date"] = $model["due_date"]; $array["latest_upload"] = $model["latest_upload"]; $array["budget"] = 0; $array["number_views"] = $model["number_views"]; $array["status"] = Status::model()->findByPk($model["status"])->name; $array["team"] = $model["worker"]; // echo "masuk"; echo json_encode($array); // echo json_encode($model->getAttributes(array('id','project_name','start_date','due_date','id_member','username'))); }
/** * Lists all models. * @return index view */ public function actionIndex() { // check if user has permission to indexInvoices if (Yii::app()->user->checkAccess('indexInvoices')) { // create Expense form search $model = new InvoicesSearchForm(); $model->search(); $model->unsetAttributes(); // clear any default values $Budgets = Budgets::model()->findBudgetsByProjects(Yii::app()->user->getState('project_selected')); // set model attributes from invoices form if (isset($_GET['InvoicesSearchForm'])) { $model->attributes = $_GET['InvoicesSearchForm']; } $this->render('index', array('model' => $model, 'status' => Status::model()->findAllRequired(true), 'budgets' => $Budgets)); } else { throw new CHttpException(403, Yii::t('site', '403_Error')); } }
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)); }
/** * Lists all models. * @return index view */ public function actionIndex() { // check if user has permission to indexCases if (Yii::app()->user->checkAccess('indexCases')) { // create Cases form search $model = new CasesSearchForm(); $model->search(); $model->unsetAttributes(); // clear any default values // set model attributes from Cases form if (isset($_GET['CasesSearchForm'])) { $model->attributes = $_GET['CasesSearchForm']; } $this->render('index', array('model' => $model, 'status' => Status::model()->findAllRequired(true))); } else { throw new CHttpException(403, Yii::t('site', '403_Error')); } }
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)); }
echo CHtml::ajaxLink(Yii::t('user', TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT))), $this->createUrl('user/addnew'), array('onclick' => '$("#divDialog3").dialog("open"); return false;', 'update' => '#divDialog3'), array('id' => uniqid())); ?> <div id="divDialog3"></div> </div> </div> </div> </tr> <tr> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="span2"><?php echo $form->labelEx($model, 'status_id', array('class' => 'inline-labels')); ?> </div> <div class="span3"><?php echo $form->dropDownList($model, 'status_id', CHtml::listData(Status::model()->findAll(), 'id', 'status'), array('span' => 2, 'prompt' => '---')); ?> <?php echo CHtml::ajaxLink(Yii::t('status', TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT))), $this->createUrl('status/addnew'), array('onclick' => '$("#divDialog2").dialog("open"); return false;', 'update' => '#divDialog2'), array('id' => uniqid())); ?> <div id="divDialog2"></div> </div> <div class="span2"><?php echo $form->labelEx($model, 'manufacturer_id', array('class' => 'inline-labels')); ?> </div> <div class="span3"><?php echo $form->dropDownList($model, 'manufacturer_id', CHtml::listData(Manufacturer::model()->findAll(), 'id', 'name'), array('span' => 2, 'prompt' => '---')); ?> <?php echo CHtml::ajaxLink(Yii::t('manufacturer', TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT))), $this->createUrl('manufacturer/addnew'), array('onclick' => '$("#divDialog4").dialog("open"); return false;', 'update' => '#divDialog4'), array('id' => uniqid()));
display:block; } .dash-editabble-project,.dash-editabble-date{ display:none; } #edit-team:hover{ color:black; } </style> <table style="text-align:center;color:white;width:90%;font-size:22px" > <?php $dataProvider = Yii::app()->db->createCommand()->select('t.id idt,p.id idp,t.name namew,p.project_name,p.username, p.due_date,p.status sp,pd.task_id pts')->from('project_detail pd')->rightjoin('team t', ' t.id = pd.worker_id ')->leftjoin('project p', ' p.id = pd.project_id and p.status = 1 ')->group('t.id')->queryAll(); ?> <?php $listproject = Project::model()->findAll('t.status=1'); $liststatus = Status::model()->findAll(); ?> <?php foreach ($dataProvider as $d) { ?> <tr class="size-15" style="" > <td style="width:30px"> <?php echo $d['namew']; ?> </td> <td > <div class="dash-non-editabble-project" > <?php echo $d['project_name']; ?> </div>
</p> <?php //echo TbHtml::textField('text',$affiliate->payment_cycle,array('disabled' => true)); ?> <?php echo $form->dropDownList($affiliate, 'payment_cycle', array(Yii::t('traveller', 'Select'), 'Quincenal', 'Mensual'), array('disabled' => true)); ?> </div> <div class="span4"> <p><?php echo Yii::t('traveller', 'Status'); ?> </p> <?php echo $form->dropDownList($affiliate, 'status', CHtml::listData(Status::model()->findAll(), 'idstatu', 'name'), array('disabled' => true)); ?> </div> </div> <?php } } ?> </fieldset> <?php echo TbHtml::formActions(array(TbHtml::submitButton(Yii::t('traveller', 'Save'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY)))); ?>
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate($id) { $model = new Referral(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Referral'])) { $model->attributes = $_POST['Referral']; $model->lead_committee = implode(',', $model->lead_committee); $model->archive = 0; $picture_name = ''; // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); $picture_file = CUploadedFile::getInstance($model, 'ind_letter'); $model->ind_letter = $picture_file; // has the user uploaded a new file? if ($picture_file) { $picture_name = $picture_file->name; if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4))) { mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4)); mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no); $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no . '/' . $picture_file->getName()); } else { mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no); $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/referral/' . substr($model->ctrl_no, 0, 4) . '/' . $model->ctrl_no . '/' . $picture_file->getName()); } } if (!empty($model->joint_committee)) { $b = implode(',', $model->joint_committee); $model->joint_committee = $b; } $model->referral_stat = 0; $model->input_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; if ($model->save()) { date_default_timezone_set("Asia/Manila"); $activity = new Activity(); $activity->act_desc = 'Added Another Referral'; $activity->act_datetime = date('Y-m-d G:i:s'); $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; $activity->save(); $stat = Status::model()->findByAttributes(array('ctrl_no' => $model->ctrl_no)); $stat->comm_stat = 1; $stat->save(); $activity->save(); Communication::model()->updateByPk($model->ctrl_no, array('comm_stat' => 1)); $this->redirect(array('view', 'id' => $model->ref_id)); } } $this->render('create', array('model' => $model, 'id' => $id)); }
/** * Lists all models. */ public function actionIndex() { if (Yii::app()->user->checkAccess('indexTasks')) { $view = Yii::app()->user->getState('view') != null ? Yii::app()->user->getState('view') : 'list'; if (isset($_GET['view']) && !empty($_GET['view'])) { if ($_GET['view'] == 'grid') { $view = 'grid'; } elseif ($_GET['view'] == 'kanban') { $view = 'kanban'; } else { $view = 'list'; } } Yii::app()->user->setState('view', $view); $model = new TasksSearchForm(); //$model->search(); //$model->unsetAttributes(); // clear any default values $Milestones = Milestones::model()->with('Projects.Company.Cusers')->together()->findAll(array('condition' => 'Cusers.user_id = :user_id AND t.project_id = :project_id', 'params' => array(':user_id' => Yii::app()->user->id, ':project_id' => Yii::app()->user->getState('project_selected')))); $Cases = Cases::model()->with('Projects.Company.Cusers')->together()->findAll(array('condition' => 'Cusers.user_id = :user_id AND t.project_id = :project_id', 'params' => array(':user_id' => Yii::app()->user->id, ':project_id' => Yii::app()->user->getState('project_selected')))); if (isset($_GET['TasksSearchForm'])) { $model->attributes = $_GET['TasksSearchForm']; } if ($view == 'kanban') { $this->layout = 'column1'; } $this->render('index', array('model' => $model, 'status' => Status::model()->findAllOrdered(), 'types' => TaskTypes::model()->findAll(), 'stages' => TaskStages::model()->findAll(), 'milestones' => $Milestones, 'cases' => $Cases, 'users' => Projects::model()->findAllUsersByProject(Yii::app()->user->getState('project_selected')))); } else { throw new CHttpException(403, Yii::t('site', '403_Error')); } }
$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()); $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':
public static function getListaStatus() { return CHtml::listData(Status::model()->findAll(array('order' => 'nome')), 'id', 'nome'); }
<?php /* @var $this EssaysController */ /* @var $model Essays */ /* @var $form TbActiveForm */ ?> <div class="form"> <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'status-form', 'enableAjaxValidation' => false)); ?> <legend>Status de Essay</legend> <?php echo TbHtml::dropDownList('Status', '', CHtml::listData(Status::model()->findAll(array('order' => 'name ASC')), 'idstatus', 'name')); ?> <?php echo CHtml::hiddenField('idEssay', $essay->id_essay_cruge); ?> <div class="form-actions"> <?php echo TbHtml::submitButton('Actualizar', array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_DEFAULT)); ?> </div> <?php $this->endWidget();
public static function getStatus() { return Status::model()->findAll(); }
value="<?php echo $d[id]; ?> "><?php echo $d[name]; ?> </option> <?php } ?> </select> <?php } else { ?> <?php echo Status::model()->findByPk($de[status])->name; ?> <?php } ?> </td> <td align="center"> <select class="select-user-tambah" name="payments" style="width:250px;display:block"> <option value="0" >ADD</option> <?php $user = Project::model()->findByPk($de[id])->worker; foreach (Team::model()->findAll("position = 2") as $tim) { ?> <?php $filename = Yii::app()->basePath . "/../img/icon-team/{$tim->image}";
/** * 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 Status the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Status::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
background: -ms-linear-gradient(top, rgba(96,108,136,1) 0%,rgba(48,58,81,1) 57%); /* IE10+ */ background: linear-gradient(to bottom, rgba(96,108,136,1) 0%,rgba(48,58,81,1) 57%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#606c88', endColorstr='#303a51',GradientType=0 ); /* IE6-9 */ } </style> <div id="tbl-project" > <div class="filter"> <img id="loader-row" style="width:20px;height:auto;margin-top:3px;position:absolute" src="<?php echo Yii::app()->request->baseUrl; ?> /img/big-loader.gif"> <ul class="filter-data"> <?php $filter = Status::model()->findAll(); ?> <?php foreach ($filter as $f) { ?> <li <?php if ($f->id == 1) { echo "class='default-filter'"; } ?> ><?php echo $f->name; ?> </li> <?php }
?> </option> <?php } ?> </select> <img style="width:20px;display:none" src="<?php echo Yii::app()->request->baseUrl; ?> /img/setting.png" > </td> <td > <select class="combo-s" style="display:inline"> <?php $status = Project::model()->findByPk($de[id])->status; foreach (Status::model()->findAll() as $d) { ?> <option <?php if ($status == $d[id]) { echo "selected"; } ?> value="<?php echo $d[id]; ?> "><?php echo $d[name]; ?> </option> <?php }
/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionUpdate($id) { $model = $this->loadModel($id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['CommMeetingReso'])) { $model->attributes = $_POST['CommMeetingReso']; $model->archive = 0; $ref_id = Referral::model()->findByAttributes(array('ctrl_no' => $model->ref_id))->ref_id; $model->ref_id = $ref_id; $model->remark = 0; if ($model->action_taken != 0) { //Status::model()->updateAll(array('referral_stat' => 1), 'ctrl_no = ' . $model->ref->ctrl_no); Referral::model()->updateByPK($model->ref_id, array('referral_stat' => 1)); $stat = Status::model()->findByAttributes(array('ctrl_no' => $model->ref->ctrl_no)); $stat->ctrl_no = $model->ref->ctrl_no; $stat->comm_meeting_stat = 1; $stat->remarks = 0; $stat->save(); //die('approve'); } else { $stat = Status::model()->findByAttributes(array('ctrl_no' => $model->ref->ctrl_no)); $stat->ctrl_no = $model->ref->ctrl_no; $stat->comm_meeting_stat = 0; $stat->remarks = 0; $stat->save(); //die('pending'); } $picture_name = ''; $picture_file = CUploadedFile::getInstance($model, 'comm_rep_file'); $model->comm_rep_file = $picture_file; $year = substr($model->ref->ctrl_no, 0, 4); if ($picture_file) { $picture_name = $picture_file->name; if (!is_dir(Yii::getPathOfAlias('webroot') . '/protected/document/commMeetingReso/' . $year)) { mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/commMeetingReso/' . $year); mkdir(Yii::getPathOfAlias('webroot') . '/protected/document/commMeetingReso/' . $year . '/' . $model->ref->ctrl_no); $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/commMeetingReso/' . $year . '/' . $model->ref->ctrl_no . '/' . $picture_file->getName()); } else { if (!file_exists(Yii::getPathOfAlias('webroot') . '/protected/document/commMeetingReso/' . $year . '/' . $model->ref->ctrl_no)) { //die('exists'); //mkdir(Yii::getPathOfAlias('webroot').'/protected/document/commMeetingReso/'.$year.'/'.$model->ref->ctrl_no); $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/commMeetingReso/' . $year . '/' . $model->ref->ctrl_no . '/' . $picture_file->getName()); } else { //mkdir(Yii::getPathOfAlias('webroot').'/protected/document/commMeetingReso/'.$year.'/'.$model->ref->ctrl_no); $picture_file->SaveAs(Yii::getPathOfAlias('webroot') . '/protected/document/commMeetingReso/' . $year . '/' . $model->ref->ctrl_no . '/' . $picture_file->getName()); } } } if ($model->save() && $model->validate()) { date_default_timezone_set("Asia/Manila"); $activity = new Activity(); $activity->act_desc = 'Updated Committee Meeting ID: ' . $id; $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->meeting_reso_id)); } } $this->render('update', array('model' => $model)); }
?> " /></div> <br/> <?php } ?> <input id="image" name="Post[image]" type="file"/> </div> <label for="status">Status:</label> <div class="post-status-block"> <select name="Post[status]" id="status"> <?php foreach (Status::model()->getAllStatus() as $status) { ?> <option value="<?php echo $status->id; ?> " <?php echo !empty($post->status) && $post->status === $status->id ? 'selected' : null; ?> ><?php echo $status->label; ?> </option> <?php } ?>
<div class="row"> <div style="float:left;width:200px;" > <?php echo $form->labelEx($model, 'gender'); ?> <?php echo $form->dropDownList($model, 'gender', array('Male' => 'Male', 'Female' => 'Female'), array('span' => 5)); ?> </div> <div style="float:left;width:200px;" > <?php echo $form->labelEx($model, 'status_id'); ?> <?php echo $form->dropDownList($model, 'status_id', CHtml::listData(Status::model()->findAll(array('order' => 'id ASC')), 'id', 'name'), array('empty' => '--Select--', 'span' => 5)); ?> </div> </div> <div class="row"> <label>Load Predefined Template</label> <?php if ($_GET['yt0'] == "load" && !empty($_GET['Challan']['load_temp_name'])) { $data = ReportTemplate::model()->findByPk($_GET['Challan']['load_temp_name']); $options = array(); $d = explode(",", $data['fields']); foreach ($d as $i => $v) { $options[$v] = array("selected" => true); } // print_r($options);exit;