$sql = "INSERT INTO `picture`( `PICTURE_OWNER_ID`, `PICTURE_NAME`, `PICTURE_FROM_DATE`) VALUES ('{$id}','" . basename($_FILES["picture"]["name"]) . "','{$time}')"; mysql_query($sql); } else { $sql = "UPDATE `picture` SET `PICTURE_THRU_DATE`='{$time}' WHERE `PICTURE_OWNER_ID`='{$id}' AND `PICTURE_THRU_DATE`=''"; mysql_query($sql); $sql = "INSERT INTO `picture`( `PICTURE_OWNER_ID`, `PICTURE_NAME`, `PICTURE_FROM_DATE`) VALUES ('{$id}','" . basename($_FILES["picture"]["name"]) . "','{$time}')"; mysql_query($sql); } set_updatetime($id); echo "The file " . basename($_FILES["picture"]["name"]) . " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } $follower = $_POST["follower"]; if (empty($_POST['runnum'])) { $runnum = create_run_number(); } else { $runnum = $_POST['runnum']; } $reg_year = $_POST['reg_year']; register($id, $runnum, $follower, $reg_year); if (isset($_POST['status'])) { edit_status($id, $_POST['status']); } if (isset($_POST['REMARK'])) { edit_remark($id, $_POST['REMARK']); } echo "<script type='text/javascript'>"; echo "window.close();"; echo "</script>";
<?php error_reporting(E_ERROR | E_PARSE); include '../../helper/db_connect.php'; connect_database(); $data_id = $_GET['id']; if (isset($_POST['REMARK'])) { edit_remark($data_id, $_POST['REMARK']); } echo "<script type='text/javascript'>"; echo "window.close();"; echo "</script>";
$result_name = mysql_fetch_assoc($res); if (!$result_name) { $sql = "INSERT INTO `picture`( `PICTURE_OWNER_ID`, `PICTURE_NAME`, `PICTURE_FROM_DATE`) VALUES ('{$id}','" . basename($_FILES["picture"]["name"]) . "','{$time}')"; mysql_query($sql); } else { $sql = "UPDATE `picture` SET `PICTURE_THRU_DATE`='{$time}' WHERE `PICTURE_OWNER_ID`='{$id}' AND `PICTURE_THRU_DATE`=''"; mysql_query($sql); $sql = "INSERT INTO `picture`( `PICTURE_OWNER_ID`, `PICTURE_NAME`, `PICTURE_FROM_DATE`) VALUES ('{$id}','" . basename($_FILES["picture"]["name"]) . "','{$time}')"; mysql_query($sql); } set_updatetime($id); // echo "The file " . basename($_FILES["picture"]["name"]) . " has been uploaded."; } else { // echo "Sorry, there was an error uploading your file."; } } $remark = $_POST["remark_id"]; edit_remark($data_id, $remark); // set_remark($data_id,$remark); $follower = $_POST["follower"]; if (empty($_POST['runnum'])) { $runnum = create_run_number(); } else { $runnum = $_POST['runnum']; } $reg_year = $_POST['reg_year']; register($data_id, $runnum, $follower, $reg_year); } echo "<script type='text/javascript'>"; echo "window.close();"; echo "</script>";