コード例 #1
0
ファイル: addAction.class.php プロジェクト: Jiangyoung/chifan
 function getPostDataForInsert()
 {
     $model = $this->getModelForInsert();
     $typeTexts = $model->getTypeTexts();
     $place = new Place();
     $places = $place->getList(array(), " WHERE `deleted`='n' ", false);
     return array('name' => '', 'locationText' => '', 'typeTexts' => $typeTexts, 'model' => '', 'description' => '', 'remark' => '', 'amount' => 1, 'place' => 0, 'photo_path' => '', 'places' => $places['rows']);
 }
コード例 #2
0
 function execute()
 {
     $place = new Place();
     $list = $place->getList(array(), " WHERE `deleted`='n' ", false);
     header("Content-Type:text/html;charset=utf-8");
     $optionTpl = '<option value="%s">%s(%s)</option>';
     if ($list) {
         foreach ($list as $row) {
             $row['locationText'] = $place->getLocationText($row['location']);
             echo sprintf($optionTpl, $row['id'], $row['name'], $row['locationText']);
         }
     }
 }
コード例 #3
0
 function formatListForList($params)
 {
     $model = $this->getModelForList();
     $placeModel = new Place();
     foreach ($params as $k => $row) {
         $params[$k]['typeText'] = $model->getTypeText($row['type']);
         $params[$k]['stateText'] = $model->getStateText($row['state']);
         $extra = " WHERE `id`='{$row['p_id']}' ";
         $place = $placeModel->getOne(array(), 'ASC', $extra);
         $params[$k]['placeText'] = $placeModel->getLocationText($place['location']);
     }
     return $params;
 }
コード例 #4
0
 function execute()
 {
     $this->setRenderValues('listName', '概况管理');
     $count = array();
     $user = new User();
     $params = array(array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['user_all'] = $user->getCount($params);
     $params = array(array('field' => 'type', 'sign' => '=', 'value' => 1), array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['user_type1'] = $user->getCount($params);
     $params[0]['value'] = 2;
     $count['user_type2'] = $user->getCount($params);
     $params[0]['value'] = 3;
     $count['user_type3'] = $user->getCount($params);
     $equipment = new Equipment();
     $params = array(array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['equipment_all'] = $equipment->getCount($params);
     $params = array(array('field' => 'state', 'sign' => '=', 'value' => 1), array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['equipment_state1'] = $equipment->getCount($params);
     $params[0]['value'] = 2;
     $count['equipment_state2'] = $equipment->getCount($params);
     $params[0]['value'] = 3;
     $count['equipment_state3'] = $equipment->getCount($params);
     $params[0]['value'] = 4;
     $count['equipment_state4'] = $equipment->getCount($params);
     $params = array(array('field' => 'type', 'sign' => '=', 'value' => 2), array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['equipment_type2'] = $equipment->getCount($params);
     $params[0]['value'] = 3;
     $count['equipment_type3'] = $equipment->getCount($params);
     $params[0]['value'] = 4;
     $count['equipment_type4'] = $equipment->getCount($params);
     $place = new Place();
     $params = array(array('field' => 'deleted', 'sign' => '=', 'value' => 'n'));
     $count['place_all'] = $place->getCount($params);
     $this->setRenderValues('count', $count);
     $this->render('index/index_list.php');
 }