|
PHP复制代码 public function edit_post ($id=null)
{
/*增加请修级别*/
$bxjb_class = explode('-',trim($this->input->post('bxjb_class_id')));
$bxjb_class_id = $bxjb_class;
$bxjb_class_name = $bxjb_class;
$bxsheet = $this->filter_post();
$bxsheet['bxjb_class_id'] = $bxjb_class_id;
/*增加设备类别*/
$bxsb_class = $this->input->post('bxsb_class_name');
$bxsb_class_id = $bxsb_class;
$bxsb_class_name = $bxsb_class;
$bxsheet = $this->filter_post();
$bxsheet['bxsb_class_id'] = $bxsb_class_id;
//请修类别
$bxsheet_class = explode('-',trim($this->input->post('bxsheet_class_id')));
$bxsheet_class_id = $bxsheet_class[0];
$bxsheet_class_name = $bxsheet_class[1];
$bxsheet = $this->filter_post();
$bxsheet['bxsheet_class_id'] = $bxsheet_class_id;
$this->check_data($bxsheet);
$this->db->trans_begin();
print_r($bxsheet);exit;
if($id==null)
{
$bxsheet_number = $this->build_bxsheet_number($bxsheet_class_id,$bxsheet_class_name,$bxjb_class_id,$bxjb_class_name,$bxjb_class_id,$bxjb_class_name);
$bxsheet['number'] = $bxsheet_number;
$bxsheet['create_time'] = Date('Y-m-d H:i');
if($this->current_user!=null)
{
$bxsheet['creater_id'] = $this->current_user->id;
}
$this->db->insert("bxsheet",$bxsheet);
}
else
{
$this->db->update("bxsheet",$bxsheet,array('id' => $id));
}
if ($this->db->trans_status() === FALSE)
{
echo "出现错误,事务已回滚";
$this->db->trans_rollback();
}
else
{
$this->db->trans_commit();
echo "success";
if($id==null)
{
$sys = $this->config->item('sys');
if($sys['prompt_type_audio'])
{
$this->send_tts();
}
if($sys['prompt_type_email'])
{
$this->send_email();
}
}
}
} 复制代码PHP复制代码 <select name="bxsb_class_name">
<?php foreach($bxsb_classs as $bxsb_class):?>
<option name="p_bxsb_name" id="bxsb_name" value=" <?=$bxsb_class->id."-".str_replace("-","",$bxsb_class->name)?>" <?= $bxsb_class_id==$bxsb_class->id? "selected" : ""?>>
+ <?=$bxsb_class->name?>
</option>
<?php endforeach;?>
</select> 复制代码PHP复制代码 <select name="bxjb_class_id">
<?php foreach($bxjb_classs as $bxjb_class):?>
<option value=" <?=$bxjb_class->id."-".str_replace("-","",$bxjb_class->name)?>" <?= $bxjb_class_id==$bxjb_class->id? "selected" : ""?>>
+ <?=$bxjb_class->name?>
</option>
<?php endforeach;?>
</select> 复制代码PHP复制代码 <select name="bxsheet_class_id">
<?php foreach($bxsheet_classs as $bxsheet_class):?>
<option value=" <?=$bxsheet_class->id."-".str_replace("-","",$bxsheet_class->name)?>" <?= $bxsheet_class_id==$bxsheet_class->id? "selected" : ""?>>
+ <?=$bxsheet_class->name?>
</option>
<?php endforeach;?>
</select> 复制代码
|
|