📄 timeedit.php
字号:
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' /> Edit 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='Edit 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['tmp_var'])) {// begin post validation //if ($_POST['tmp_var'] != '1') {echo "Something is fishy here.\n"; exit;}$tmp2_calc = intval($calc);$tmp2_timestamp = intval($timestamp);if ((strlen($tmp2_calc) != "10") || (!is_integer($tmp2_calc))) {echo "Something is fishy here.\n"; exit;}if ((strlen($tmp2_timestamp) != "10") || (!is_integer($tmp2_timestamp))) {echo "Something is fishy here.\n"; exit;}if (!is_numeric($final_num_rows)) {exit;}// end post validation //for ($x=0;$x<$final_num_rows;$x++) {$final_username[$x] = stripslashes($final_username[$x]);$tmp_username = stripslashes($tmp_username);if ($final_username[$x] != $tmp_username) {echo "Something is fishy heree.\n"; exit;}$final_mysql_timestamp[$x] = intval($final_mysql_timestamp[$x]);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]."')";$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;}if (!empty($edit_time_textbox[$x])) {// configure timestamp to insert/update //if ($calendar_style == "euro") {// $post_date = "$day/$month/$year"; $post_date = "$month/$day/$year";}elseif ($calendar_style == "amer") { $post_date = "$month/$day/$year";}$tmp_timestamp = strtotime($post_date) - @$tzo;$tmp_calc = $timestamp + 86400 - @$tzo;if (($tmp_timestamp != $timestamp) || ($tmp_calc != $calc)) {echo "Something is fishy here.\n"; exit;}// end post validation //if ($timefmt_24hr == '0') {if ((!eregi ("^([0-9]?[0-9])+:+([0-9]+[0-9])+([a|p]+m)$", $edit_time_textbox[$x], $time_regs)) && (!eregi ("^([0-9]?[0-9])+:+([0-9]+[0-9])+( [a|p]+m)$", $edit_time_textbox[$x], $time_regs))) {$evil_time = '1';} else {if (isset($time_regs)) {$h = $time_regs[1]; $m = $time_regs[2];}$h = $time_regs[1]; $m = $time_regs[2];if (($h > 12) || ($m > 59)) {$evil_time = '1';}}}elseif ($timefmt_24hr == '1') {if (!eregi ("^([0-9]?[0-9])+:+([0-9]+[0-9])$", $edit_time_textbox[$x], $time_regs)) {$evil_time = '1';} else {if (isset($time_regs)) {$h = $time_regs[1]; $m = $time_regs[2];}$h = $time_regs[1]; $m = $time_regs[2];if (($h > 24) || ($m > 59)) {$evil_time = '1';}}}}}for ($x=0;$x<$final_num_rows;$x++) {if (empty($edit_time_textbox[$x])) {$cnt++;}}if ($cnt == $final_num_rows) {$evil_time = '1';}if (isset($evil_time)) {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 Time is required.</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";// configure date to display correctly //if ($calendar_style == "euro") { $post_date = "$day/$month/$year";}echo " <th class=rightside_heading nowrap halign=left colspan=4><img src='../images/icons/clock_edit.png' /> Edit Time for $post_username on $post_date</th></tr>\n";echo " <tr><td height=15></td></tr>\n";echo " <tr><td nowrap width=1% class=column_headings style='padding-right:5px;padding-left:10px;'><b>New Time<b></td>\n";echo " <td nowrap width=7% align=left style='padding-left:15px;' class=column_headings>In/Out</td>\n";echo " <td nowrap style='padding-left:20px;' width=4% align=left class=column_headings>Current Time</td>\n";echo " <td style='padding-left:25px;' class=column_headings><u>Notes</u></td></tr>\n";for ($x=0;$x<$final_num_rows;$x++) {$row_color = ($row_count % 2) ? $color1 : $color2;$final_username[$x] = stripslashes($final_username[$x]);echo " <tr class=display_row>\n";echo " <td nowrap width=1% style='padding-right:5px;padding-left:10px;' class=table_rows><input type='text' size='7' maxlength='$timefmt_size' name='edit_time_textbox[$x]' value=\"$edit_time_textbox[$x]\"></td>\n";echo " <td nowrap align=left style='width:7%;padding-left:15px;background-color:$row_color;color:".$row["color"]."'>$final_inout[$x]</td>\n";echo " <td nowrap align=left 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";echo " <input type='hidden' name='final_username[$x]' value=\"$final_username[$x]\">\n";echo " <input type='hidden' name='final_inout[$x]' value=\"$final_inout[$x]\">\n";echo " <input type='hidden' name='final_notes[$x]' value=\"$final_notes[$x]\">\n";echo " <input type='hidden' name='final_time[$x]' value=\"$final_time[$x]\">\n";echo " <input type='hidden' name='final_mysql_timestamp[$x]' value=\"$final_mysql_timestamp[$x]\">\n";$row_count++;}echo " <tr><td height=15></td></tr>\n";$tmp_var = '1';echo " <input type='hidden' name='calc' value=\"$calc\">\n";echo " <input type='hidden' name='timestamp' value=\"$timestamp\">\n";echo " <input type='hidden' name='tmp_var' value=\"$tmp_var\">\n";echo " <input type='hidden' name='post_username' value=\"$post_username\">\n";echo " <input type='hidden' name='post_displayname' value=\"$post_displayname\">\n";echo " <input type='hidden' name='post_date' value=\"$post_date\">\n";echo " <input type='hidden' name='get_user' value=\"$get_user\">\n";echo " <input type='hidden' name='final_num_rows' value=\"$final_num_rows\">\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='Edit 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;} elseif (!isset($evil_time)) {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 edited 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";// configure date to display correctly //if ($calendar_style == "euro") { $post_date = "$day/$month/$year";}echo " <th class=rightside_heading nowrap halign=left colspan=5><img src='../images/icons/clock_edit.png' /> Edited Time for $post_username on $post_date</th></tr>\n";echo " <tr><td height=15></td></tr>\n";echo " <tr><td width=1% class=table_rows style='padding-left:5px;padding-right:5px;'></td><td nowrap width=1% class=column_headings style='padding-right:5px;'><b>New Time<b></td>\n";echo " <td nowrap width=7% align=left style='padding-left:15px;' class=column_headings>In/Out</td>\n";echo " <td nowrap style='padding-left:20px;' width=4% align=left class=column_headings>Old Time</td>\n";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -