📄 statuscreate.php
字号:
// begin post validation //if (($create_status !== '0') && ($create_status !== '1')) {exit;}$post_statusname = stripslashes($post_statusname);$post_statusname = addslashes($post_statusname);$string = strstr($post_statusname, "\'");$string2 = strstr($post_statusname, "\"");if (empty($string)) {$query = "select punchitems from ".$db_prefix."punchlist where punchitems = '".$post_statusname."'";$result = mysql_query($query);while ($row=mysql_fetch_array($result)) {$dupe = '1';}}if ((empty($post_statusname)) || (empty($post_color)) || (!eregi ("^([[:alnum:]]| |-|_|\.)+$", $post_statusname)) || (isset($dupe)) || ((!eregi ("^(#[a-fA-F0-9]{6})+$", $post_color)) && (!eregi ("^([a-fA-F0-9]{6})+$", $post_color))) || (!empty($string)) || (!empty($string2))) {if (empty($post_statusname)) {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 Status Name is required.</td></tr>\n";echo " </table>\n";}elseif (empty($post_color)) {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 Color is required.</td></tr>\n";echo " </table>\n";}elseif (!empty($string)) {echo " <table align=center class=table_border width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr><td class=table_rows width=20 align=center><img src='../images/icons/cancel.png' /></td><td class=table_rows_red> Apostrophes are not allowed.</td></tr>\n";echo " </table>\n";}elseif (!empty($string2)) {echo " <table align=center class=table_border width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr><td class=table_rows width=20 align=center><img src='../images/icons/cancel.png' /></td><td class=table_rows_red> Double Quotes are not allowed.</td></tr>\n";echo " </table>\n";}elseif (!eregi ("^([[:alnum:]]| |-|_|\.)+$", $post_statusname)) {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> Alphanumeric characters, hyphens, underscores, spaces, and periods are allowed when editing a Status Name.</td></tr>\n";echo " </table>\n";}elseif ((!eregi ("^(#[a-fA-F0-9]{6})+$", $post_color)) && (!eregi ("^([a-fA-F0-9]{6})+$", $post_color))) {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> The '#' symbol followed by letters A-F, or numbers 0-9 are allowed when editing a Color.</td></tr>\n";echo " </table>\n";}elseif (isset($dupe)) {echo " <table align=center class=table_border width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr><td class=table_rows width=20 align=center><img src='../images/icons/cancel.png' /></td><td class=table_rows_red> Status already exists. Create another status.</td></tr>\n";echo " </table>\n";}if (!empty($string)) {$post_statusname = stripslashes($post_statusname);}if (!empty($string2)) {$post_statusname = stripslashes($post_statusname);}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><th class=rightside_heading nowrap halign=left colspan=3> <img src='../images/icons/application_add.png' /> Create Status</th></tr>\n";echo " <tr><td height=15></td></tr>\n";echo " <tr><td class=table_rows height=25 width=20% style='padding-left:32px;' nowrap>Status Name:</td><td colspan=2 width=80% style='color:red;font-family:Tahoma;font-size:10px;padding-left:20px;'><input type='text' size='20' maxlength='50' name='post_statusname' value=\"$post_statusname\"> *</td></tr>\n";echo " <tr><td class=table_rows height=25 width=20% style='padding-left:32px;' nowrap>Color:</td><td colspan=2 width=80% style='color:red;font-family:Tahoma;font-size:10px;padding-left:20px;'><input type='text' size='20' maxlength='7' name='post_color' value=\"$post_color\"> * <a href=\"#\" onclick=\"cp.select(document.forms['form'].post_color,'pick');return false;\" name=\"pick\" id=\"pick\" style='font-size:11px;color:#27408b;'>Pick Color</a></td></tr>\n";echo " <tr><td class=table_rows height=25 width=20% style='padding-left:32px;' nowrap>Is Status considered '<b>In</b>' or '<b>Out</b>'?</td>\n";if ($create_status == '1') {echo " <td class=table_rows align=left width=80% style='padding-left:20px;'><input checked type='radio' name='create_status' value='1'>In <input type='radio' name='create_status' value='0'>Out</td></tr>\n";} elseif ($create_status == '0') {echo " <td class=table_rows align=left width=80% style='padding-left:20px;'><input type='radio' name='create_status' value='1'>In <input checked type='radio' name='create_status' value='0'>Out</td></tr>\n";}if (!empty($string)) {$post_statusname = stripslashes($post_statusname);}if (!empty($string2)) {$post_statusname = stripslashes($post_statusname);}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 " <script language=\"javascript\">cp.writeDiv()</script>\n";echo " <table align=center width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr><td height=40></td></tr>\n";echo " </table>\n";echo " <table align=center width=60% border=0 cellpadding=0 cellspacing=3>\n";echo " <tr><td width=30><input type='image' name='submit' value='Create Status' src='../images/buttons/next_button.png'></td> <td><a href='statusadmin.php'><img src='../images/buttons/cancel_button.png' border='0'></td></tr></table></form></td></tr>\n";include '../footer.php';exit;} else {$query = "insert into ".$db_prefix."punchlist (punchitems, color, in_or_out) values ('".$post_statusname."', '".$post_color."', '".$create_status."')";$result = mysql_query($query);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> Status created successfully.</td></tr>\n";echo " </table>\n";echo " <br />\n";echo " <table align=center class=table_border width=60% border=0 cellpadding=3 cellspacing=0>\n";echo " <tr><th class=rightside_heading nowrap halign=left colspan=3> <img src='../images/icons/application_add.png' /> Create Status</th>\n";echo " </tr>\n";echo " <tr><td height=15></td></tr>\n";echo " <tr><td class=table_rows height=25 width=20% style='padding-left:32px;' nowrap>Status Name:</td><td align=left class=table_rows colspan=2 width=80% style='padding-left:20px;'>$post_statusname</td></tr>\n";echo " <tr><td class=table_rows height=25 width=20% style='padding-left:32px;' nowrap>Color:</td><td align=left class=table_rows colspan=2 width=80% style='padding-left:20px;'>$post_color</td></tr>\n";if ($create_status == '1') { $create_status_tmp = 'In'; } else { $create_status_tmp = 'Out';}echo " <tr><td class=table_rows height=25 width=20% style='padding-left:32px;' nowrap>Is Status considered '<b>In</b>' or '<b>Out</b>'?</td> <td align=left class=table_rows colspan=2 width=80% style='padding-left:20px;'>$create_status_tmp</td></tr>\n";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='statusadmin.php'><img src='../images/buttons/done_button.png' border='0'></a></td></tr></table>\n";}include '../footer.php'; exit;}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -