} header("Location: menu.php?inc=sms_board&op=sms_board_list&err=" . urlencode($error_string)); break; case "sms_board_add": if ($err) { $content = "<p><font color=red>{$err}</font><p>"; } $content .= "\n\t\t <h2>Add SMS board</h2>\n\t\t <p>\n\t\t <form action=menu.php?inc=sms_board&op=sms_board_add_yes method=post>\n\t\t <p>SMS board code: <input type=text size=30 maxlength=30 name=add_board_code value=\"{$add_board_code}\">\n\t\t <p><b>Leave them empty if you dont know what to fill in these boxes below</b>\n\t\t <p>Forward to email: <input type=text size=30 name=add_email value=\"{$add_email}\">\n\t\t <p>Template:\n\t\t <br><textarea name=add_template rows=5 cols=60>{$add_template}</textarea>\n\t\t <p><input type=submit class=button value=Add>\n\t\t </form>\n\t\t"; echo $content; break; case "sms_board_add_yes": $add_board_code = strtoupper($_POST[add_board_code]); $add_email = $_POST[add_email]; $add_template = $_POST[add_template]; if ($add_board_code) { if (checkavailablecode($add_board_code)) { if (!$add_template) { $add_template = "<font color=black size=-1><b>##SENDER##</b></font><br>"; $add_template .= "<font color=black size=-2><i>##DATETIME##</i></font><br>"; $add_template .= "<font color=black size=-1>##MESSAGE##</font>"; } $db_query = "\n\t\t\t\t\t INSERT INTO playsms_featBoard (uid,board_code,board_forward_email,board_pref_template)\n\t\t\t\t\t VALUES ('{$uid}','{$add_board_code}','{$add_email}','{$add_template}')\n\t\t\t\t\t"; if ($new_uid = @dba_insert_id($db_query)) { $error_string = "SMS board `{$add_board_code}` has been added"; } else { $error_string = "Fail to add SMS board `{$add_board_code}`"; } } else { $error_string = "SMS code `{$add_board_code}` already exists, reserved or use by other feature!"; } } else {
break; case "sms_command_add": if ($err) { $content = "<p><font color=red>{$err}</font><p>"; } $content .= "\n\t\t <h2>Add SMS command</h2>\n\t\t <p>\n\t\t <form action=menu_admin.php?inc=sms_command&op=sms_command_add_yes method=post>\n\t\t <p>SMS command code: <input type=text size=10 maxlength=10 name=add_command_code value=\"{$add_command_code}\">\n\t\t <p>Pass these parameter to command exec field:\n\t\t <p>##SMSDATETIME## replaced by SMS incoming date/time\n\t\t <p>##SMSSENDER## replaced by sender number\n\t\t <p>##COMMANDCODE## replaced by command code \n\t\t <p>##COMMANDPARAM## replaced by command parameter passed to server from SMS\n\t\t <p>SMS command binary path : <b>" . $feat_command_path['bin'] . "</b>\n\t\t <p>SMS command exec: <input type=text size=60 maxlength=200 name=add_command_exec value=\"{$add_command_exec}\">\n\t\t <p><input type=submit class=button value=Add>\n\t\t </form>\n\t\t"; echo $content; break; case "sms_command_add_yes": $add_command_code = strtoupper($_POST[add_command_code]); $add_command_exec = $_POST[add_command_exec]; if ($add_command_code && $add_command_exec) { $add_command_exec = $feat_command_path['bin'] . "/" . $add_command_exec; $add_command_exec = str_replace("//", "/", $add_command_exec); $add_command_exec = str_replace("..", ".", $add_command_exec); if (checkavailablecode($add_command_code)) { $db_query = "INSERT INTO playsms_featCommand (uid,command_code,command_exec) VALUES ('{$uid}','{$add_command_code}','{$add_command_exec}')"; if ($new_uid = @dba_insert_id($db_query)) { $error_string = "SMS command code `{$add_command_code}` has been added"; } else { $error_string = "Fail to add SMS command code `{$add_command_code}`"; } } else { $error_string = "SMS code `{$add_command_code}` already exists, reserved or use by other feature!"; } } else { $error_string = "You must fill all fields!"; } header("Location: menu_admin.php?inc=sms_command&op=sms_command_add&err=" . urlencode($error_string)); break; }
} } header("Location: menu.php?inc=sms_custom&op=sms_custom_list&err=" . urlencode($error_string)); break; case "sms_custom_add": if ($err) { $content = "<p><font color=red>{$err}</font><p>"; } $content .= "\n\t\t <h2>Add SMS custom</h2>\n\t\t <p>\n\t\t <form action=menu.php?inc=sms_custom&op=sms_custom_add_yes method=post>\n\t\t <p>SMS custom code: <input type=text size=10 maxlength=10 name=add_custom_code value=\"{$add_custom_code}\">\n\t\t <p>Pass these parameter to custom URL field:\n\t\t <p>##SMSDATETIME## replaced by SMS incoming date/time\n\t\t <p>##SMSSENDER## replaced by sender number\n\t\t <p>##CUSTOMCODE## replaced by custom code \n\t\t <p>##CUSTOMPARAM## replaced by custom parameter passed to server from SMS\n\t\t <p>SMS custom URL: <input type=text size=60 maxlength=200 name=add_custom_url value=\"{$add_custom_url}\">\n\t\t <p><input type=submit class=button value=Add>\n\t\t </form>\n\t\t"; echo $content; break; case "sms_custom_add_yes": $add_custom_code = strtoupper($_POST[add_custom_code]); $add_custom_url = $_POST[add_custom_url]; if ($add_custom_code && $add_custom_url) { if (checkavailablecode($add_custom_code)) { $db_query = "INSERT INTO playsms_featCustom (uid,custom_code,custom_url) VALUES ('{$uid}','{$add_custom_code}','{$add_custom_url}')"; if ($new_uid = @dba_insert_id($db_query)) { $error_string = "SMS custom code `{$add_custom_code}` has been added"; } else { $error_string = "Fail to add SMS custom code `{$add_custom_code}`"; } } else { $error_string = "SMS code `{$add_custom_code}` already exists, reserved or use by other feature!"; } } else { $error_string = "You must fill all fields!"; } header("Location: menu.php?inc=sms_custom&op=sms_custom_add&err=" . urlencode($error_string)); break; }
dba_query($db_query); $error_string = "SMS poll choice with code `{$choice_code}` and all its voters has been deleted!"; } } header("Location: menu.php?inc=sms_poll&op=sms_poll_edit&poll_id={$poll_id}&err=" . urlencode($error_string)); break; case "sms_poll_add": if ($err) { $content = "<p><font color=red>{$err}</font><p>"; } $content .= "\n\t\t <h2>Add SMS poll</h2>\n\t\t <p>\n\t\t <form action=menu.php?inc=sms_poll&op=sms_poll_add_yes method=post>\n\t\t <p>SMS poll code: <input type=text size=3 maxlength=10 name=add_poll_code value=\"{$add_poll_code}\">\n\t\t <p>SMS poll title: <input type=text size=60 maxlength=200 name=add_poll_title value=\"{$add_poll_title}\">\n\t\t <p><input type=submit class=button value=Add>\n\t\t </form>\n\t\t"; echo $content; break; case "sms_poll_add_yes": $add_poll_code = strtoupper($_POST[add_poll_code]); $add_poll_title = $_POST[add_poll_title]; if ($add_poll_title && $add_poll_code) { if (checkavailablecode($add_poll_code)) { $db_query = "\n\t\t\t\t\t INSERT INTO playsms_featPoll (uid,poll_code,poll_title)\n\t\t\t\t\t VALUES ('{$uid}','{$add_poll_code}','{$add_poll_title}')\n\t\t\t\t\t"; if ($new_uid = @dba_insert_id($db_query)) { $error_string = "SMS poll with code `{$add_poll_code}` has been added"; } } else { $error_string = "SMS code `{$add_poll_code}` already exists, reserved or use by other feature!"; } } else { $error_string = "You must fill all fields!"; } header("Location: menu.php?inc=sms_poll&op=sms_poll_add&err=" . urlencode($error_string)); break; }