$Telephone = @$_SESSION['SESS_Telephone'];
 $Distance = @$_SESSION['SESS_Distance'];
 if (isset($_POST['submit'])) {
     $service = intval(getVal(@$_POST['service']));
     $distance = intval(getVal(@$_POST['distance']));
     $remoteCurrent = intval(getVal(@$_POST['remoteCurrent']));
     $remote = intval(getVal(@$_POST['remote']));
     $y2013 = intval(getVal(@$_POST['y2013']));
     $y2012 = intval(getVal(@$_POST['y2012']));
     $y2011 = intval(getVal(@$_POST['y2012']));
     $y2010 = intval(getVal(@$_POST['y2010']));
     $y2009 = intval(getVal(@$_POST['y2009']));
     $schservice = intval(getVal(@$_POST['schservice']));
     $marks31 = service(@$service);
     $marks32 = distance(@$distance);
     $marks33 = remote($remoteCurrent, $remote);
     $marks34 = leave($y2013, $y2012, $y2011, $y2010, $y2009);
     $marks35 = same_School_service($schservice);
     $markst = $marks31 + $marks32 + $marks33 + $marks34 + $marks35;
     if ($_POST['submit'] == "Submit") {
         $sql = "INSERT INTO educationwork_child_marks " . "(Application_ID, Category_ID, Service, Distance, RemotePresent, RemoteService, LeaveY1,LeaveY2,LeaveY3,LeaveY4,LeaveY5, ServiceSameSchool,Marks_Service, Marks_Distance, Marks_Remote, Marks_Leave, Marks_SameSchool, Marks_Total)" . "VALUES ('{$app}', '{$cat}', '{$service}', '{$distance}', '{$remoteCurrent}', '{$remote}', '{$y2013}', '{$y2012}', '{$y2011}', '{$y2010}', '{$y2009}','{$schservice}', '{$marks31}', '{$marks32}', '{$marks33}', '{$marks34}', '{$marks35}', '{$markst}') " . "ON DUPLICATE KEY UPDATE Service = VALUES (Service),Distance = VALUES (Distance),RemotePresent = VALUES (RemotePresent),RemoteService = VALUES (RemoteService),LeaveY1 = VALUES (LeaveY1),LeaveY2 = VALUES (LeaveY2),LeaveY3 = VALUES (LeaveY3),LeaveY4 = VALUES (LeaveY4),LeaveY5 = VALUES (LeaveY5),ServiceSameSchool = VALUES (ServiceSameSchool)," . "Marks_Service = VALUES (Marks_Service),Marks_Distance = VALUES (Marks_Distance),Marks_Remote = VALUES (Marks_Remote),Marks_Leave = VALUES (Marks_Leave),Marks_SameSchool = VALUES (Marks_SameSchool),Marks_Total = VALUES (Marks_Total);";
         $retval = mysql_query($sql);
         if (!$retval) {
             die('Could not enter data: ' . mysql_error());
         } else {
             $sql2 = "UPDATE application SET Marks = {$markst} WHERE Application_ID ={$app};";
             $set = mysql_query($sql2);
             if (!$set) {
                 die('Could not enter data: ' . mysql_error());
             }
             header("location: UnsetSession_SelectionPanel.php");
Example #2
0
 if ($bianjiqifieldsarr && is_array($bianjiqifieldsarr)) {
     foreach ($bianjiqifieldsarr as $key => $val) {
         $field = $val['field'];
         $dataother[$field] = $_POST[$field];
     }
 }
 //查询此模型编辑器的字段 end
 if ($_POST['self'] && is_array($_POST['self'])) {
     foreach ($_POST['self'] as $field => $val) {
         ${$field} = save($val);
         $dataother[$field] = ${$field};
     }
 }
 //zhaoyanmin 其他表 end
 $remote && remote($body);
 !$remote && $autopic && remote($body, true);
 empty($customlink) && ($customlink = GetPinyin($title));
 if (empty($aid)) {
     $userid = $admin->uid;
     $hits = $digg = $comments = 0;
     $filename = "";
     //$DreamCMS->db->get_var("SELECT `id` FROM `#DC@__article` where `customlink` ='$customlink'") && alert('该自定链接已经存在!请另选一个');
     //$DreamCMS->db->get_var("SELECT `id` FROM `#DC@__article` where `title` = '$title'") && alert('该标题的文章已经存在!请检查是否重复');
     $DreamCMS->db->insert('article', compact('cid', 'title', 'customlink', 'url', 'filename', 'source', 'author', 'userid', 'postype', 'keywords', 'tags', 'description', 'pic', 'pubdate', 'hits', 'digg', 'comments', 'type', 'visible'));
     $aid = $DreamCMS->db->insert_id;
     //zhaoyanmin start
     //添加其他表 start
     if ($model['table']) {
         $dataother['aid'] = $aid;
         $DreamCMS->db->insert($model['table'], $dataother);
     }