Exemplo n.º 1
0
 /**
  * 选择培训机构列表
  * @param   int     multisel    GET参数,若为1表多选,否则表单选
  */
 public function seltilist()
 {
     $param = array();
     if (isset($_GET['page'])) {
         $page = intval($_GET['page']);
         if ($page < 1) {
             $page = 1;
         }
     } else {
         $page = 1;
     }
     $param['ti_name'] = $this->input->get('ti_name');
     $param['ti_provid'] = intval($this->input->get('ti_provid'));
     $param['ti_cityid'] = intval($this->input->get('ti_cityid'));
     $param['ti_areaid'] = intval($this->input->get('ti_areaid'));
     $data = array();
     $data['param'] = $param;
     $data['province_list'] = RegionModel::get_regions(1);
     $data['city_list'] = RegionModel::get_regions($param['ti_provid'], FALSE, 2);
     $data['area_list'] = RegionModel::get_regions($param['ti_cityid'], FALSE, 3);
     $data['ti_list'] = TrainingInstitutionModel::trainingInstitutionList('*', $param, $page);
     $data['ti_list_count'] = TrainingInstitutionModel::trainingInstitutionListCount($param);
     $this->load->view('traininginstitution/seltilist', $data);
 }
Exemplo n.º 2
0
 public function baseFetchTIListFunc($param)
 {
     $resp = new AjaxResponse();
     $param = Func::param_copy($param, 'uid', 'ti_typeid', 'ti_provid', 'ti_cityid', 'ti_areaid', 'ti_name');
     $uid = $param['uid'];
     unset($param['uid']);
     if ($param['ti_provid'] == 0) {
         $resp->alert('请选择省');
         return $resp;
     }
     if ($param['ti_cityid'] == 0) {
         unset($param['ti_cityid']);
     }
     if ($param['ti_areaid'] == 0) {
         unset($param['ti_areaid']);
     }
     if (empty($param['ti_typeid'])) {
         unset($param['ti_typeid']);
     }
     try {
         $ti_list = TrainingInstitutionModel::trainingInstitutionList('ti_id,ti_name', $param);
         $resp->call('fnSetTIListDiv', $ti_list);
     } catch (Exception $e) {
         $resp->alert($e->getMessage());
     }
     return $resp;
 }