Created
January 21, 2012 16:23
-
-
Save summic/1653201 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view: | |
<input name="data[datetime][]" value=""> | |
<input name="data[address][]" value=""> | |
Model | |
<?php | |
function add($data,$datainfo){ | |
if ($this->db->insert($this->table_name, $data)) { | |
$oid = $this->db->insert_id(); | |
$total = count($datainfo[opentime]); | |
for($i=0;$i<$total;$i++) | |
{ | |
if(isset($datainfo[address][$i]) && !empty($datainfo[address][$i])){ | |
$CourseInfo = array( | |
'cid' => $oid, | |
'opentime' => $datainfo[opentime][$i], | |
'address' => $datainfo[address][$i], | |
); | |
if($this->db->insert($this->table_info, $CourseInfo)) { | |
$id = $this->db->insert_id(); | |
header("Location: /manage/history/list"); | |
} else { | |
echo '时间地点数据写入失败';//temp | |
} | |
}else{ | |
die("地址没有填写"); | |
} | |
} | |
} else { | |
echo 'error';//temp | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment