当前位置: 首页>>代码示例>>PHP>>正文


PHP Calendar::getErrors方法代码示例

本文整理汇总了PHP中Calendar::getErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::getErrors方法的具体用法?PHP Calendar::getErrors怎么用?PHP Calendar::getErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Calendar的用法示例。


在下文中一共展示了Calendar::getErrors方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionIndex

 public function actionIndex()
 {
     // Обработка формы календаря
     $data = array('person' => array('fname' => '', 'lname' => '', 'sex' => 'f', 'date' => '', 'hour' => -1, 'minute' => -1, 'notime' => true, 'city' => '', 'city_id' => 0), 'event' => array('date' => '', 'hour' => -1, 'minute' => -1, 'notime' => true, 'city' => '', 'city_id' => 0));
     $templateData = array('data' => $data);
     // Запуск калькулятора
     if (isset($_GET['data'])) {
         // Обработка данных персоны
         $data = $_GET['data'];
         $this->_processingData($data['person']);
         $this->_processingData($data['event']);
         // Калькулятор
         $calendar = new Calendar($data);
         if ($calendar->validate()) {
             // Запуск расчета
             $calendar->run();
             // Вывод в шаблон
             $this->render('chart', array('data' => $data, 'calendar' => $calendar));
             Yii::app()->end();
         } else {
             $templateData['person_errors'] = $calendar->getErrors('person');
             $templateData['event_errors'] = $calendar->getErrors('event');
         }
     }
     // Вывод в шаблон
     $this->render('index', $templateData);
 }
开发者ID:kuzmina-mariya,项目名称:happy-end,代码行数:27,代码来源:CalculatorController_1.php

示例2: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Calendar'])) {
         $pn = Project::model()->findByPk($_POST['Calendar']['project_id'])->project_name;
         $model = new Calendar();
         $model->attributes = $_POST['Calendar'];
         $model->description = $_POST['Calendar']['description'] . " of";
         if ($model->save()) {
             echo "sukses";
         } else {
             print_r($model->getErrors());
         }
         // $this->redirect(array('view','id'=>$model->id));
     }
     // $this->render('create',array(
     // 'model'=>$model,
     // ));
 }
开发者ID:Dvionst,项目名称:vvfy,代码行数:24,代码来源:CalendarController.php

示例3: actionCreate

 public function actionCreate()
 {
     // echo "masuk";
     $transaction = Yii::app()->db->beginTransaction();
     try {
         $model = new Project();
         if (isset($_POST['Project'])) {
             $id = Yii::app()->user->id;
             $model->scenario = "user_create";
             $model->attributes = $_POST['Project'];
             $idm = Member::model()->find("email = '{$id}'")->id;
             $model->start_date = date('Y-m-d');
             $model->id_member = $idm;
             $model->status = 1;
             // $this->redirect(array('client/index'));
             if ($model->save()) {
                 $calendar = new Calendar();
                 $calendar->project_id = $model->id;
                 $calendar->start_date = $model->start_date;
                 $calendar->due_date = $_POST['Project']['due_date'];
                 $calendar->description = $_REQUEST['descriptionca'] . " of ";
                 $calendar->type = "due";
                 if ($calendar->save()) {
                     $transaction->commit();
                     echo "sukses";
                 } else {
                     echo json_encode($calendar->getErrors());
                 }
             } else {
                 echo json_encode($model->getErrors());
             }
         } else {
             echo "not isset";
         }
     } catch (Exception $e) {
         $transaction->rollBack();
         // other actions to perform on fail (redirect, alert, etc.)
     }
 }
开发者ID:Dvionst,项目名称:vvfy,代码行数:39,代码来源:ProjectController.php

示例4: explode

 /**
  * Подтверждает список операций
  */
 function accept_all()
 {
     $ids = explode(',', @$_POST['ids']);
     $accepted_array = array();
     foreach ($ids as $id) {
         if ((int) $id > 0) {
             $accepted_array[] = $id;
         }
     }
     if (count($accepted_array) > 0) {
         $calendar = new Calendar(Core::getInstance()->user);
         if ($calendar->acceptEvents($accepted_array)) {
             $this->tpl->assign('result', array('text' => 'Операции успешно подтверждены'));
         } else {
             $this->tpl->assign('error', array('text' => implode(",\n", $calendar->getErrors())));
         }
     } else {
         $this->tpl->assign('error', array('text' => 'Не указаны операции для подтверждения!'));
     }
 }
开发者ID:ru-easyfinance,项目名称:EasyFinance,代码行数:23,代码来源:calendar.controller.php

示例5: actionCalendarChange

 public function actionCalendarChange()
 {
     $action = Yii::app()->request->getParam('action', '');
     $date = Yii::app()->request->getParam('date', '');
     $m = Yii::app()->request->getParam('m', '');
     $returnArray = array();
     $status = false;
     $switch = false;
     $msg = '';
     $dateObject = DateTime::createFromFormat('Y-m-d', $date);
     if ($dateObject) {
         $modelDate = new DateTime($date);
         switch ($action) {
             case 'makeUnavailable':
                 $switch = true;
                 $modelStatus = 1;
                 $modelType = 3;
                 break;
             case 'makeAvailable':
                 $switch = true;
                 $modelStatus = 0;
                 $modelType = 3;
                 break;
             case 'removeFlag':
                 $switch = true;
                 $modelStatus = 0;
                 $modelType = 1;
                 break;
             case 'addFlag':
                 $switch = true;
                 $modelStatus = 1;
                 $modelType = 1;
                 break;
         }
         if ($switch) {
             $model = Calendar::model()->find('calendar_date = "' . $modelDate->format('Y-m-d H:i:s') . '" AND calendar_type = "' . $modelType . '" AND created_by = ' . Yii::app()->user->getInfo());
             if ($model == null) {
                 $model = new Calendar();
             }
             $model->status = $modelStatus;
             $model->message = $m;
             $model->calendar_type = $modelType;
             $model->calendar_date = $modelDate->format('Y-m-d H:i:s');
             $model->created_by = Yii::app()->user->getInfo();
             if ($model->save()) {
                 $status = true;
                 $msg = 'Success';
             } else {
                 $msg = $model->getErrors();
             }
         }
     }
     $returnArray['status'] = $status;
     $returnArray['msg'] = $msg;
     header('Content-Type: application/json');
     $return = json_encode($returnArray);
     echo $return;
     Yii::app()->end();
 }
开发者ID:VanyaAvchyan,项目名称:Pol,代码行数:59,代码来源:ApiController.php


注:本文中的Calendar::getErrors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。