本文整理汇总了PHP中Status::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::model方法的具体用法?PHP Status::model怎么用?PHP Status::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
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;
}
}
示例2: actionSummary
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);
}
示例3: renderButtons
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))));
}
示例4: actiongetStatus
/**
* 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'));
}
}
示例5: actionUpdatest
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);
}
示例6: actionUpdate
/**
* 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));
}
示例7: print_r
<?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')); ?>
示例8: array
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();
示例9: countResolution
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);
}
示例10: actionGetdetailproject
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')));
}
示例11: actionIndex
/**
* 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'));
}
}
示例12: actionCreate
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));
}
示例13: actionIndex
/**
* 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'));
}
}
示例14: actionCreate
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));
}
示例15: array
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()));