|
|
|
@ -246,4 +246,114 @@ class pages extends CI_Controller{
|
|
|
|
|
$this->load->view('export');
|
|
|
|
|
$this->load->view('footer');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//预售时间列表
|
|
|
|
|
public function presale_list(){
|
|
|
|
|
$page_size = 10;
|
|
|
|
|
$page = $this->input->get("page");
|
|
|
|
|
$stationcn = $this->input->get("stationcn");
|
|
|
|
|
$web_code = $this->input->get("web_code");
|
|
|
|
|
$where = "1=1";//搜索条件
|
|
|
|
|
$page_parameter = "";//返回的分页条件参数
|
|
|
|
|
if(empty($page) or !is_numeric($page)){
|
|
|
|
|
$page=0;
|
|
|
|
|
}
|
|
|
|
|
if(!empty($stationcn)){
|
|
|
|
|
$where = " TST_station_cn like '%{$stationcn}%' ";
|
|
|
|
|
$list["stationcn"] = $stationcn;
|
|
|
|
|
$page_parameter = "stationcn=".$stationcn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取订单数据
|
|
|
|
|
$data = $this->BIZ_train_model->get_presale_list($page_size,$page,$where);
|
|
|
|
|
// print_r(json_encode($data));die();
|
|
|
|
|
$list["data"]=$data->list;
|
|
|
|
|
|
|
|
|
|
$this->load->library('pagination');
|
|
|
|
|
|
|
|
|
|
$config['base_url'] = site_url("/apps/trainsystem/pages/presale_list?{$page_parameter}");
|
|
|
|
|
$config['total_rows'] = $data->count;
|
|
|
|
|
$config['per_page'] = $page_size;
|
|
|
|
|
$config['page_query_string']=TRUE;
|
|
|
|
|
$config['query_string_segment']="page";
|
|
|
|
|
$config['cur_tag_open'] = '<li class="active"><a href="#">';
|
|
|
|
|
$config['cur_tag_close'] = '</a></li>';
|
|
|
|
|
$config['first_tag_open']=$config['last_tag_open']=$config['next_tag_open']=$config['prev_tag_open']=$config['num_tag_open']="<li>";
|
|
|
|
|
$config['first_tag_close']=$config['lasbt_tag_close']=$config['next_tag_close']=$config['prev_tag_close']=$config['num_tag_close']="</li>";
|
|
|
|
|
|
|
|
|
|
$this->pagination->initialize($config);
|
|
|
|
|
|
|
|
|
|
$list["page_link"]=$this->pagination->create_links();
|
|
|
|
|
|
|
|
|
|
$this->load->view('header');
|
|
|
|
|
$this->load->view('presale_list',$list);
|
|
|
|
|
$this->load->view('footer');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//预售时间编辑
|
|
|
|
|
public function presale_edit(){
|
|
|
|
|
$ordernumber = $tstid=$this->input->get("tstid");
|
|
|
|
|
|
|
|
|
|
if(empty($tstid)){
|
|
|
|
|
exit('参数错误');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据ID号查询信息
|
|
|
|
|
$saletime_detail = $this->BIZ_train_model->get_saletime_detail($tstid);
|
|
|
|
|
|
|
|
|
|
$data["info"] = $saletime_detail;
|
|
|
|
|
$this->load->view('header');
|
|
|
|
|
$this->load->view('presale_edit',$data);
|
|
|
|
|
$this->load->view('footer');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//预售时间编辑保存
|
|
|
|
|
public function presale_editsave(){
|
|
|
|
|
$TST_id = $this->input->get_post("TST_id");
|
|
|
|
|
$TST_station_cn = trim($this->input->get_post("TST_station_cn"));
|
|
|
|
|
$TST_saletime = trim($this->input->get_post("TST_saletime"));
|
|
|
|
|
$TST_station_code = trim($this->input->get_post("TST_station_code"));
|
|
|
|
|
|
|
|
|
|
$data = new stdClass();
|
|
|
|
|
$data->TST_id = $TST_id;
|
|
|
|
|
$data->TST_station_cn = $TST_station_cn;
|
|
|
|
|
$data->TST_saletime = $TST_saletime;
|
|
|
|
|
$data->TST_station_code = $TST_station_code;
|
|
|
|
|
|
|
|
|
|
$this->BIZ_train_model->update_saletime($data);
|
|
|
|
|
|
|
|
|
|
$rUrl = '<script type="text/javascript">';
|
|
|
|
|
$rUrl.= 'alert("修改完成,请查看修改后的信息!!"); window.location.href="/info.php/apps/trainsystem/pages/presale_list";'; // 弹出提示框
|
|
|
|
|
//$rUrl.= 'window.location.href="/info.php/apps/trainsystem/pages/presale_edit?tstid='+$TST_id+'";'; // 跳转到目标页面
|
|
|
|
|
$rUrl.= '</script>';
|
|
|
|
|
echo $rUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function presale_add(){
|
|
|
|
|
$this->load->view('header');
|
|
|
|
|
$this->load->view('presale_add');
|
|
|
|
|
$this->load->view('footer');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function presale_addsave(){
|
|
|
|
|
$TST_station_cn = trim($this->input->get_post("TST_station_cn"));
|
|
|
|
|
$TST_saletime = trim($this->input->get_post("TST_saletime"));
|
|
|
|
|
$TST_station_code = trim($this->input->get_post("TST_station_code"));
|
|
|
|
|
|
|
|
|
|
$data = new stdClass();
|
|
|
|
|
$data->TST_station_cn = $TST_station_cn;
|
|
|
|
|
$data->TST_saletime = $TST_saletime;
|
|
|
|
|
$data->TST_station_code = $TST_station_code;
|
|
|
|
|
|
|
|
|
|
$this->BIZ_train_model->add_saletime($data);
|
|
|
|
|
|
|
|
|
|
$rUrl = '<script type="text/javascript">';
|
|
|
|
|
$rUrl.= 'alert("添加完成!!"); window.location.href="/info.php/apps/trainsystem/pages/presale_list";'; // 弹出提示框
|
|
|
|
|
$rUrl.= '</script>';
|
|
|
|
|
echo $rUrl;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|