📄 timedelete.php
字号:
<a class=admin_headings href='statuscreate.php'>Create Status</a></td></tr>\n";echo " <tr><td class=left_rows height=33></td></tr>\n";echo " <tr><td class=left_rows_headings height=18 valign=middle colspan=2>Miscellaneous</td></tr>\n";echo " <tr><td class=left_rows height=18 align=left valign=middle><img src='../images/icons/clock.png' alt='Add/Edit/Delete Time' /> <a class=admin_headings href='timeadmin.php'>Add/Edit/Delete Time</a></td></tr>\n";echo " <tr><td class=left_rows_indent height=18 align=left valign=middle><img src='../images/icons/arrow_right.png' alt='Add Time' /> <a class=admin_headings href=\"timeadd.php?username=$get_user\">Add Time</a></td></tr>\n";echo " <tr><td class=left_rows_indent height=18 align=left valign=middle><img src='../images/icons/arrow_right.png' alt='Edit Time' /> <a class=admin_headings href=\"timeedit.php?username=$get_user\">Edit Time</a></td></tr>\n";echo " <tr><td class=current_left_rows_indent height=18 align=left valign=middle><img src='../images/icons/arrow_right.png' alt='Delete Time' /> <a class=admin_headings href=\"timedelete.php?username=$get_user\">Delete Time</a></td></tr>\n";echo " <tr><td class=left_rows_border_top height=18 align=left valign=middle><img src='../images/icons/application_edit.png' alt='Edit System Settings' /> <a class=admin_headings href='sysedit.php'>Edit System Settings</a></td></tr>\n";echo " <tr><td class=left_rows height=18 align=left valign=middle><img src='../images/icons/database_go.png' alt='Upgrade Database' /> <a class=admin_headings href='dbupgrade.php'>Upgrade Database</a></td></tr>\n";echo " </table></td>\n";echo " <td align=left class=right_main scope=col>\n";echo " <table width=100% height=100% border=0 cellpadding=10 cellspacing=1>\n";echo " <tr class=right_main_text>\n";echo " <td valign=top>\n";echo " <br />\n";// begin post validation //if (empty($post_date)) {$evil_post = '1';echo " <table align=center class=table_border width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr>\n";echo " <td class=table_rows width=20 align=center><img src='../images/icons/cancel.png' /></td><td class=table_rows_red> A valid Date is required.</td></tr>\n";echo " </table>\n";}elseif (eregi ("^([0-9]{1,2})[-,/,.]([0-9]{1,2})[-,/,.](([0-9]{2})|([0-9]{4}))$", $post_date, $date_regs)) {if ($calendar_style == "amer") {if (isset($date_regs)) {$month = $date_regs[1]; $day = $date_regs[2]; $year = $date_regs[3];}if ($month > 12 || $day > 31) {$evil_post = '1';if (!isset($evil_post)) {echo " <table align=center class=table_border width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr>\n";echo " <td class=table_rows width=20 align=center><img src='../images/icons/cancel.png' /></td><td class=table_rows_red> A valid Date is required.</td></tr>\n";echo " </table>\n";}}}elseif ($calendar_style == "euro") {if (isset($date_regs)) {$month = $date_regs[2]; $day = $date_regs[1]; $year = $date_regs[3];}if ($month > 12 || $day > 31) {$evil_post = '1';if (!isset($evil_post)) {echo " <table align=center class=table_border width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr>\n";echo " <td class=table_rows width=20 align=center><img src='../images/icons/cancel.png' /></td><td class=table_rows_red> A valid Date is required.</td></tr>\n";echo " </table>\n";}}}}if (isset($evil_post)) {echo " <br />\n";echo " <form name='form' action='$self' method='post' onsubmit=\"return isDate()\">\n";echo " <table align=center class=table_border width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr>\n";echo " <th class=rightside_heading nowrap halign=left colspan=3><img src='../images/icons/clock_add.png' /> Add Time </th></tr>\n";echo " <tr><td height=15></td></tr>\n";echo " <input type='hidden' name='date_format' value='$js_datefmt'>\n";echo " <tr><td class=table_rows height=25 style='padding-left:32px;' width=20% nowrap>Username:</td><td align=left class=table_rows colspan=2 width=80% style='padding-left:20px;'> <input type='hidden' name='post_username' value=\"$post_username\">$post_username</td></tr>\n";echo " <tr><td class=table_rows height=25 style='padding-left:32px;' width=20% nowrap>Display Name:</td><td align=left class=table_rows colspan=2 width=80% style='padding-left:20px;'> <input type='hidden' name='post_displayname' value=\"$post_displayname\">$post_displayname</td></tr>\n";echo " <tr><td class=table_rows height=25 style='padding-left:32px;' width=20% nowrap>Date: ($tmp_datefmt)</td><td colspan=2 width=80% style='color:red;font-family:Tahoma;font-size:10px;padding-left:20px;'><input type='text' size='10' maxlength='10' name='post_date' value='$post_date'> * <a href=\"#\" onclick=\"cal.select(document.forms['form'].post_date,'post_date_anchor','$js_datefmt'); return false;\" name=\"post_date_anchor\" id=\"post_date_anchor\" style='font-size:11px;color:#27408b;'>Pick Date</a></td><tr>\n";echo " <input type='hidden' name='get_user' value=\"$get_user\">\n";echo " <tr><td class=table_rows align=right colspan=3 style='color:red;font-family:Tahoma;font-size:10px;'>* required </td></tr>\n";echo " </table>\n";echo " <div style=\"position:absolute;visibility:hidden;background-color:#ffffff;layer-background-color:#ffffff;\" id=\"mydiv\" height=200> </div>\n";echo " <table align=center width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr><td height=40> </td></tr>\n";echo " <tr><td width=30><input type='image' name='submit' value='Delete Time' align='middle' src='../images/buttons/next_button.png'></td><td><a href='timeadmin.php'><img src='../images/buttons/cancel_button.png' border='0'></td></tr></table></form></td></tr>\n";include '../footer.php';exit;// end post validation //} else {if (isset($_POST['delete_time_checkbox'])) {echo " <table align=center class=table_border width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr>\n";echo " <td class=table_rows width=20 align=center><img src='../images/icons/accept.png' /></td><td class=table_rows_green> Time deleted successfully.</td></tr>\n";echo " </table>\n";echo " <br />\n";echo " <form name='form' action='$self' method='post'>\n";echo " <table align=center class=table_border width=60% border=0 cellpadding=3 cellspacing=0>\n";echo " <tr>\n";echo " <th class=rightside_heading nowrap halign=left colspan=4><img src='../images/icons/clock_delete.png' /> Deleted Time for $post_username on $post_date </th></tr>\n";echo " <tr><td height=15></td></tr>\n";echo " <tr><td nowrap width=1% style='padding-right:5px;padding-left:5px;' class=column_headings>Deleted</td>\n";echo " <td nowrap width=7% align=left class=column_headings>In/Out</td>\n";echo " <td nowrap style='padding-left:20px;' width=4% align=right class=column_headings>Time</td>\n";echo " <td style='padding-left:25px;' class=column_headings><u>Notes</u></td></tr>\n";// begin post validation //if (!is_numeric($final_num_rows)) {exit;} // end post validation //$tmp_tmp_username = array();// determine who the authenticated user is for audit logif (isset($_SESSION['valid_user'])) {$user = $_SESSION['valid_user'];}elseif (isset($_SESSION['time_admin_valid_user'])) {$user = $_SESSION['time_admin_valid_user'];}else {$user = "";}// configure current time to insert for audit log$time_hour = gmdate('H');$time_min = gmdate('i');$time_sec = gmdate('s');$time_month = gmdate('m');$time_day = gmdate('d');$time_year = gmdate('Y');$time_tz_stamp = mktime ($time_hour, $time_min, $time_sec, $time_month, $time_day, $time_year);// this needs to be changed later$post_why = "";for ($x=0;$x<$final_num_rows;$x++) {// begin post validation //$final_username[$x] = stripslashes($final_username[$x]);$tmp_username = stripslashes($tmp_username);$final_username[$x] = stripslashes($final_username[$x]);if ($final_username[$x] != $tmp_username) {echo "Something is fishy here.\n"; exit;}//if ((strlen($final_mysql_timestamp[$x]) != "10") || (!is_integer($final_mysql_timestamp[$x]))) {echo "Something is fishy here.\n"; exit;}$query_sel = "select * from ".$db_prefix."punchlist where punchitems = '".$final_inout[$x]."'";$result_sel = mysql_query($query_sel);while ($row=mysql_fetch_array($result_sel)) { $punchitems = "".$row['punchitems']."";}mysql_free_result($result_sel);if (!isset($punchitems)) {echo "Something is fishy here.\n"; exit;}$final_notes[$x] = ereg_replace("[^[:alnum:] \,\.\?-]","",$final_notes[$x]);$final_username[$x] = addslashes($final_username[$x]);$query5 = "select * from ".$db_prefix."info where (fullname = '".$final_username[$x]."') and (timestamp = '".$final_mysql_timestamp[$x]."') and (`inout` = '".$final_inout[$x]."') and (notes = '".$final_notes[$x]."')";$result5 = mysql_query($query5);@$tmp_num_rows = mysql_num_rows($result5);if ((isset($tmp_num_rows)) && (@$tmp_num_rows != '1')) {echo "Something is fishy here.\n"; exit;}// end post validation //$row_color = ($row_count % 2) ? $color1 : $color2;if (@$delete_time_checkbox[$x] == '1') {// begin post validation //$tmp_time[$x] = date("$timefmt", $final_mysql_timestamp[$x] + $tzo);if ($tmp_time[$x] != $final_time[$x]) {echo "Something is fishy here.\n"; exit;}// end post validation ////if (!get_magic_quotes_gpc()) {$final_username[$x] = addslashes($final_username[$x]);}$query = "select * from ".$db_prefix."employees where empfullname = '".$final_username[$x]."'";$result = mysql_query($query);while ($row=mysql_fetch_array($result)) {$tmp_empfullname_1 = stripslashes("".$row['empfullname']."");$tmp_tstamp_1 = "".$row['tstamp']."";}$tmp_tmp_username[$x] = stripslashes($final_username[$x]);if (($tmp_empfullname_1 == $tmp_tmp_username[$x]) && ($tmp_tstamp_1 == $final_mysql_timestamp[$x])) {$query2 = "select * from ".$db_prefix."info where fullname = '".$final_username[$x]."' order by timestamp desc limit 1,1";$result2 = mysql_query($query2);while ($row2=mysql_fetch_array($result2)) {$tmp_empfullname_2 = stripslashes("".$row2['fullname']."");$tmp_empfullname_2 = addslashes($tmp_empfullname_2);$tmp_tstamp_2 = "".$row2['timestamp']."";}$query3 = "update ".$db_prefix."employees set empfullname = '".$tmp_empfullname_2."', tstamp = '".$tmp_tstamp_2."' where empfullname = '".$tmp_empfullname_2."'";$result3 = mysql_query($query3);}// delete the time from the info table for $post_username$query4 = "delete from ".$db_prefix."info where fullname = '".$final_username[$x]."' and timestamp = '".$final_mysql_timestamp[$x]."'";$result4 = mysql_query($query4);// add the results to the audit tableif (strtolower($ip_logging) == "yes") {$query6 = "insert into ".$db_prefix."audit (modified_by_ip, modified_by_user, modified_when, modified_from, modified_to, modified_why, user_modified) values ('".$connecting_ip."', '".$user."', '".$time_tz_stamp."', '".$final_mysql_timestamp[$x]."', '0', '".$post_why."', '".$final_username[$x]."')";$result6 = mysql_query($query6);} else {$query6 = "insert into ".$db_prefix."audit (modified_by_user, modified_when, modified_from, modified_to, modified_why, user_modified) values ('".$user."', '".$time_tz_stamp."', '".$final_mysql_timestamp[$x]."', '0', '".$post_why."', '".$final_username[$x]."')";$result6 = mysql_query($query6);}echo " <tr class=display_row height=20>\n";echo " <td nowrap bgcolor='$row_color' width=5% align=center><img src='../images/icons/accept.png' /></td>\n";echo " <td nowrap bgcolor='$row_color' align=left width=7% style='padding-left:5px;'>$final_inout[$x]</td>\n";echo " <td nowrap align=right style='padding-left:20px;' width=4% bgcolor='$row_color'>$final_time[$x]</td>\n";echo " <td style='padding-left:25px;' bgcolor='$row_color'>$final_notes[$x]</td>\n";echo " </tr>\n";$row_count++;}}echo " <tr><td height=15></td></tr>\n";echo " </table>\n";echo " <table align=center width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr><td height=20 align=left> </td></tr>\n";echo " <tr><td><a href='timeadmin.php'><img src='../images/buttons/done_button.png' border='0'></td></tr></table></td></tr>\n";include '../footer.php';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -