本文整理汇总了PHP中security_form_input_predefined函数的典型用法代码示例。如果您正苦于以下问题:PHP security_form_input_predefined函数的具体用法?PHP security_form_input_predefined怎么用?PHP security_form_input_predefined使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了security_form_input_predefined函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate_custom_records
function validate_custom_records($data_orig = array())
{
log_debug("domain", "Executing validate_custom_records(array_data)");
if (!isset($this->data)) {
// we need the domain details if we don't already have them
$this->load_data();
}
$data = array();
$data_tmp = array();
if (!empty($data_orig)) {
/*
Supplied Array Data - this data has some amount of pre-processing
done, having already run through the javascript validation.
*/
log_debug("domain", "Using supplied array data in \$data_orig");
/*
Fetch Data
*/
$data["custom"]["num_records"] = count(array_keys($data_orig));
for ($i = 0; $i < $data["custom"]["num_records"]; $i++) {
$data_tmp[$i]["id"] = @security_script_input_predefined("int", $data_orig[$i]["id"], 1);
$data_tmp[$i]["type"] = @security_script_input_predefined("any", $data_orig[$i]["type"], 1);
$data_tmp[$i]["ttl"] = @security_script_input_predefined("int", $data_orig[$i]["ttl"], 1);
$data_tmp[$i]["name"] = @security_script_input_predefined("any", $data_orig[$i]["name"], 1);
$data_tmp[$i]["prio"] = @security_script_input_predefined("int", $data_orig[$i]["prio"], 0);
$data_tmp[$i]["content"] = @security_script_input_predefined("any", $data_orig[$i]["content"], 1);
$data_tmp[$i]["reverse_ptr"] = @security_script_input_predefined("checkbox", $data_orig[$i]["reverse_ptr"], 1);
$data_tmp[$i]["reverse_ptr_orig"] = @security_script_input_predefined("checkbox", $data_orig[$i]["reverse_ptr_orig"], 1);
$data_tmp[$i]["delete_undo"] = @security_script_input_predefined("any", $data_orig[$i]["delete_undo"], 1);
if (empty($data_tmp[$i]["mode"]) || $data_tmp[$i]["mode"] != "delete" && $data_tmp[$i]["mode"] != "update") {
// mode undetermined, run check
if ($data_tmp[$i]["id"] && $data_tmp[$i]["delete_undo"] == "true") {
$data_tmp[$i]["mode"] = "delete";
} else {
if (!empty($data_tmp[$i]["content"]) && $data_tmp[$i]["delete_undo"] == "false") {
$data_tmp[$i]["mode"] = "update";
}
}
}
}
} elseif (isset($_POST['record_custom_page'])) {
/*
Fetch data from POST - easiest way, since we can take advantage of smart
error handling functions built in.
*/
// fetch number of records
$data["custom"]["num_records"] = @security_form_input_predefined("int", "num_records_custom", 0, "");
for ($i = 0; $i < $data["custom"]["num_records"]; $i++) {
/*
Fetch Data
*/
$data_tmp[$i]["id"] = @security_form_input_predefined("int", "record_custom_" . $i . "_id", 0, "");
$data_tmp[$i]["type"] = @security_form_input_predefined("any", "record_custom_" . $i . "_type", 0, "");
$data_tmp[$i]["ttl"] = @security_form_input_predefined("int", "record_custom_" . $i . "_ttl", 0, "");
$data_tmp[$i]["name"] = @security_form_input_predefined("any", "record_custom_" . $i . "_name", 0, "");
$data_tmp[$i]["content"] = @security_form_input_predefined("any", "record_custom_" . $i . "_content", 0, "");
$data_tmp[$i]["reverse_ptr"] = @security_form_input_predefined("checkbox", "record_custom_" . $i . "_reverse_ptr", 0, "");
$data_tmp[$i]["reverse_ptr_orig"] = @security_form_input_predefined("checkbox", "record_custom_" . $i . "_reverse_ptr_orig", 0, "");
$data_tmp[$i]["delete_undo"] = @security_form_input_predefined("any", "record_custom_" . $i . "_delete_undo", 0, "");
/*
Process Raw Data
*/
if ($data_tmp[$i]["id"] && $data_tmp[$i]["delete_undo"] == "true") {
$data_tmp[$i]["mode"] = "delete";
} else {
if (!empty($data_tmp[$i]["content"]) && $data_tmp[$i]["delete_undo"] == "false") {
$data_tmp[$i]["mode"] = "update";
}
}
}
}
/*
Process Validated Inputs
*/
if (!empty($data_tmp)) {
log_write("debug", "domains", "Record values obtained, running detailed check");
for ($i = 0; $i < $data["custom"]["num_records"]; $i++) {
/*
Error Handling
*/
// verify name syntax
if ($data_tmp[$i]["name"] == "*" || preg_match("/^\\*\\.[A-Za-z0-9\\p{L}:._-]+\$/", $data_tmp[$i]["name"])) {
// wildcard records are annoying - wildcards must be standalone, and can't be part of a sring
// OK -> *
// OK -> *.example.com
// BAD -> abc*.example.com
// BAD -> std*abc.example.com
// nothing todo
} elseif ($data_tmp[$i]["name"] != "@" && !preg_match("/^[A-Za-z0-9\\p{L}:._-]*\$/", $data_tmp[$i]["name"])) {
// all other record types
log_write("error", "process", "Sorry, the value you have entered for record " . $data_tmp[$i]["name"] . " contains invalid charactors");
error_flag_field("record_custom_" . $i . "");
}
// validate content and name formatting per domain type
if ($data_tmp[$i]["name"] != "") {
switch ($data_tmp[$i]["type"]) {
case "A":
// validate IPv4
if (!preg_match("/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}\$/", $data_tmp[$i]["content"])) {
// invalid IP address
//.........这里部分代码省略.........
示例2: foreach
foreach ((array) $input_structure_items as $input_structure_item) {
$i = $input_structure_item['field_src'];
$new_input_structure[$i]['field_src'] = $input_structure_item['field_src'];
$new_input_structure[$i]['field_dest'] = $input_structure_item["field_dest"];
$new_input_structure[$i]['data_format'] = $input_structure_item["data_format"];
}
unset($i);
}
$num_cols = @security_form_input_predefined("int", "num_cols", 1, "");
$structure_id = @security_form_input_predefined("int", "structure_id", 0, "");
if ($structure_id == $selected_structure || $selected_structure == 0) {
$structure_name = @security_form_input_predefined("any", "name", 0, "");
$structure_description = @security_form_input_predefined("any", "description", 0, "");
for ($i = 1; $i <= $num_cols; $i++) {
$data["column{$i}"] = @security_form_input_predefined("any", "column{$i}", 0, "");
$data["format{$i}"] = @security_form_input_predefined("any", "format{$i}", 0, "");
}
/*
Error Handling
*/
// verify that there is no duplicate configuration in the columns
for ($i = 1; $i <= $num_cols; $i++) {
$col = "column" . $i;
for ($j = $i + 1; $j <= $num_cols; $j++) {
$col2 = "column" . $j;
if (!empty($data[$col2])) {
if ($data[$col] == $data[$col2]) {
error_flag_field($col);
error_flag_field($col2);
log_write("error", "page_output", "Each column must be assigned a unique role.");
}
示例3: header
// account options
$data["option_lang"] = @security_form_input_predefined("any", "option_lang", 1, "");
$data["option_dateformat"] = @security_form_input_predefined("any", "option_dateformat", 1, "");
$data["option_timezone"] = @security_form_input_predefined("any", "option_timezone", 1, "");
$data["option_shrink_tableoptions"] = @security_form_input_predefined("any", "option_shrink_tableoptions", 0, "");
$data["option_table_limit"] = @security_form_input_predefined("any", "option_table_limit", 0, "");
$data["option_default_employeeid"] = @security_form_input_predefined("any", "option_default_employeeid", 0, "");
$data["option_theme"] = @security_form_input_predefined("any", "option_theme", 0, "");
$data["option_debug"] = @security_form_input_predefined("any", "option_debug", 0, "");
$data["option_concurrent_logins"] = @security_form_input_predefined("any", "option_concurrent_logins", 0, "");
$data["option_translation"] = @security_form_input_predefined("any", "option_translation", 0, "");
///// ERROR CHECKING ///////////////////////
// check password (if the user has requested to change it)
if ($_POST["password"] || $_POST["password_confirm"]) {
$data["password"] = @security_form_input_predefined("any", "password", 4, "");
$data["password_confirm"] = @security_form_input_predefined("any", "password_confirm", 4, "");
if ($data["password"] != $data["password_confirm"]) {
$_SESSION["error"]["message"][] = "Your passwords do not match!";
$_SESSION["error"]["password-error"] = 1;
$_SESSION["error"]["password_confirm-error"] = 1;
}
}
//// PROCESS DATA ////////////////////////////
if ($_SESSION["error"]["message"]) {
$_SESSION["error"]["form"]["user_options"] = "failed";
header("Location: ../index.php?page=user/options.php&id={$id}");
exit(0);
} else {
$_SESSION["error"] = array();
// start SQL transaction
$sql_obj = new sql_query();
示例4: array
$_SESSION["error"] = array();
$_SESSION["user"] = array();
if (user_online()) {
// user is already logged in!
$_SESSION["error"]["message"][] = "You are already logged in!";
$_SESSION["error"]["username_amberdms_bs"] = "error";
$_SESSION["error"]["password_amberdms_bs"] = "error";
} else {
// check & convert input
if ($GLOBALS["config"]["instance"] == "hosted") {
$instance = security_form_input("/^[0-9a-z]*\$/", "instance_amberdms_bs", 1, "Please provide a valid customer instance ID.");
} else {
$instance = NULL;
}
$username = @security_form_input_predefined("any", "username_amberdms_bs", 1, "Please enter a username.");
$password = @security_form_input_predefined("any", "password_amberdms_bs", 4, "Please enter a password.");
if ($_SESSION["error"]["message"]) {
// errors occured
header("Location: ../index.php?page=user/login.php");
exit(0);
}
// call the user functions to authenticate the user and handle blacklisting
$result = user_login($instance, $username, $password);
if ($result == 1) {
// login succeded
// if user has been redirected to login from a previous page, lets take them to that page.
if ($_SESSION["login"]["previouspage"]) {
header("Location: ../index.php?" . $_SESSION["login"]["previouspage"] . "");
$_SESSION["login"] = array();
exit(0);
} else {
示例5: service_form_delete_process
function service_form_delete_process()
{
log_debug("inc_services_process", "Executing service_form_delete_process()");
/*
Fetch all form data
*/
// get form data
$id = @security_form_input_predefined("int", "id_service", 1, "");
$data["delete_confirm"] = @security_form_input_predefined("any", "delete_confirm", 1, "You must confirm the deletion");
//// ERROR CHECKING ///////////////////////
// make sure the service actually exists
$sql_obj = new sql_query();
$sql_obj->string = "SELECT id FROM services WHERE id='{$id}' LIMIT 1";
$sql_obj->execute();
if (!$sql_obj->num_rows()) {
log_write("error", "process", "The service you have attempted to edit - {$id} - does not exist in this system.");
}
// make sure the service is not active for any customers
$sql_obj = new sql_query();
$sql_obj->string = "SELECT id FROM services_customers WHERE serviceid='{$id}' LIMIT 1";
$sql_obj->execute();
if ($sql_obj->num_rows()) {
log_write("error", "process", "Service is active for customers and can therefore not be deleted.");
}
/// if there was an error, go back to the entry page
if ($_SESSION["error"]["message"]) {
$_SESSION["error"]["form"]["service_delete"] = "failed";
header("Location: ../index.php?page=services/delete.php&id={$id}");
exit(0);
} else {
/*
Begin Transaction
*/
$sql_obj = new sql_query();
$sql_obj->trans_begin();
/*
Delete the service data
*/
$sql_obj->string = "DELETE FROM services WHERE id='{$id}' LIMIT 1";
$sql_obj->execute();
/*
Delete the service taxes
*/
$sql_obj->string = "DELETE FROM services_taxes WHERE serviceid='{$id}'";
$sql_obj->execute();
/*
Delete the service bundle components (if any)
*/
$sql_bundle_obj = new sql_query();
$sql_bundle_obj->string = "SELECT id FROM services_bundles WHERE id_service='{$id}'";
$sql_bundle_obj->execute();
if ($sql_bundle_obj->num_rows()) {
$sql_bundle_obj->fetch_array();
foreach ($sql_bundle_obj->data as $data_bundle) {
// delete any options for each bundle item
$sql_obj->string = "DELETE FROM services_options WHERE option_type='service' AND option_type_id='" . $data_bundle["id"] . "'";
$sql_obj->execute();
}
}
$sql_obj->string = "DELETE FROM services_bundles WHERE id_service='{$id}'";
$sql_obj->execute();
/*
Delete the service cdr rate overrides (if any)
*/
$sql_obj->string = "DELETE FROM cdr_rate_tables_overrides WHERE option_type='service' AND option_type_id='{$id}'";
$sql_obj->execute();
/*
Delete service journal data
*/
journal_delete_entire("services", $id);
/*
Commit
*/
if (error_check()) {
$sql_obj->trans_rollback();
log_write("error", "process", "An error occured whilst attempting to delete the transaction. No changes have been made.");
header("Location: ../index.php?page=services/view.php&id={$id}");
exit(0);
} else {
$sql_obj->trans_commit();
log_write("notification", "process", "Service successfully deleted");
header("Location: ../index.php?page=services/services.php");
exit(0);
}
}
// end if passed tests
}
示例6: array
*/
// includes
include_once "../include/config.php";
include_once "../include/amberphplib/main.php";
if (user_permissions_get('admin')) {
////// INPUT PROCESSING ////////////////////////
$id = @security_form_input_predefined("int", "id_user", 1, "");
$staffid = @security_form_input_predefined("int", "id_staff", 1, "");
// convert all the permissions input
$permissions = array();
$sql_perms_obj = new sql_query();
$sql_perms_obj->string = "SELECT * FROM `permissions_staff` ORDER BY value";
$sql_perms_obj->execute();
$sql_perms_obj->fetch_array();
foreach ($sql_perms_obj->data as $data_perms) {
$permissions[$data_perms["value"]] = @security_form_input_predefined("any", $data_perms["value"], 0, "Form provided invalid input!");
}
///// ERROR CHECKING ///////////////////////
// make sure the user actually exists
$sql_obj = new sql_query();
$sql_obj->string = "SELECT id FROM `users` WHERE id='{$id}' LIMIT 1";
$sql_obj->execute();
if (!$sql_obj->num_rows()) {
log_write("error", "process", "The user you have attempted to edit - {$id} - does not exist in this system.");
}
// make sure the staff member exists
$sql_obj = new sql_query();
$sql_obj->string = "SELECT id FROM `staff` WHERE id='{$staffid}' LIMIT 1";
$sql_obj->execute();
if (!$sql_obj->num_rows()) {
log_write("error", "process", "The staff member you have attempted to set permission for - {$id} - does not exist in this system.");
示例7:
if ($data["phone_trunk_quantity"] < $data["phone_trunk_included_units"]) {
$data["phone_trunk_quantity"] = $data["phone_trunk_included_units"];
}
break;
}
} else {
// standard fields
$data["serviceid"] = @security_form_input_predefined("any", "serviceid", 1, "");
$data["date_period_first"] = @security_form_input_predefined("date", "date_period_first", 1, "");
$data["date_period_next"] = $data["date_period_first"];
$data["description"] = @security_form_input_predefined("any", "description", 0, "");
// special migration stuff
if (sql_get_singlevalue("SELECT value FROM config WHERE name='SERVICE_MIGRATION_MODE'") == 1) {
$data["migration_date_period_usage_override"] = @security_form_input_predefined("any", "migration_date_period_usage_override", 1, "");
if ($data["migration_date_period_usage_override"] == "migration_use_usage_date") {
$data["migration_date_period_usage_first"] = @security_form_input_predefined("date", "migration_date_period_usage_first", 1, "");
}
}
}
/*
Verify Data
*/
// check that the specified customer actually exists
if (!$obj_customer->verify_id()) {
log_write("error", "process", "The customer you have attempted to edit - " . $obj_customer->id . " - does not exist in this system.");
} else {
if ($obj_customer->id_service_customer) {
// are we editing an existing service? make sure it exists and belongs to this customer
if (!$obj_customer->verify_id_service_customer()) {
log_write("error", "process", "The service you have attempted to edit - " . $obj_customer->id_service_customer . " - does not exist in this system.");
} else {
示例8: product
// includes
require "../include/config.php";
require "../include/amberphplib/main.php";
// custom includes
require "../include/products/inc_products.php";
if (user_permissions_get('products_write')) {
$obj_product = new product();
/*
Import POST Data
*/
$obj_product->id = @security_form_input_predefined("int", "id_product", 0, "");
// these exist to make error handling work right
$obj_product->data["code_product"] = @security_form_input_predefined("any", "code_product", 0, "");
$obj_product->data["name_product"] = @security_form_input_predefined("any", "name_product", 0, "");
// confirm deletion
$obj_product->data["delete_confirm"] = @security_form_input_predefined("any", "delete_confirm", 1, "You must confirm the deletion");
/*
Error Handling
*/
// check that the product exists
if (!$obj_product->verify_id()) {
log_write("error", "process", "The product you have attempted to edit - " . $obj_product->id . " - does not exist in this system.");
}
// check that the product is safe to delete
if ($obj_product->check_delete_lock()) {
log_write("error", "process", "This product is locked and can not be deleted.");
}
// if there was an error, go back to the entry page
if ($_SESSION["error"]["message"]) {
$_SESSION["error"]["form"]["product_delete"] = "failed";
header("Location: ../index.php?page=products/delete.php&id=" . $obj_product->id);
示例9: header
$obj_rate_table->id = @security_form_input_predefined("int", "id_rate_table", 1, "");
$data["nad_country_prefix"] = @security_form_input_predefined("int", "nad_country_prefix", 0, "");
$data["nad_default_destination"] = @security_form_input_predefined("any", "nad_default_destination", 0, "");
$data["cdr_rate_import_mode"] = @security_form_input_predefined("any", "cdr_rate_import_mode", 1, "");
$data["nad_price_cost_national"] = @security_form_input_predefined("float", "nad_price_cost_national", 0, "");
$data["nad_price_sale_national"] = @security_form_input_predefined("float", "nad_price_sale_national", 0, "");
$data["nad_price_cost_mobile"] = @security_form_input_predefined("float", "nad_price_cost_mobile", 0, "");
$data["nad_price_sale_mobile"] = @security_form_input_predefined("float", "nad_price_sale_mobile", 0, "");
$data["nad_price_cost_directory_national"] = @security_form_input_predefined("float", "nad_price_cost_directory_national", 0, "");
$data["nad_price_sale_directory_national"] = @security_form_input_predefined("float", "nad_price_sale_directory_national", 0, "");
$data["nad_price_cost_directory_international"] = @security_form_input_predefined("float", "nad_price_cost_directory_international", 0, "");
$data["nad_price_sale_directory_international"] = @security_form_input_predefined("float", "nad_price_sale_directory_international", 0, "");
$data["nad_price_cost_tollfree"] = @security_form_input_predefined("float", "nad_price_cost_tollfree", 0, "");
$data["nad_price_sale_tollfree"] = @security_form_input_predefined("float", "nad_price_sale_tollfree", 0, "");
$data["nad_price_cost_special"] = @security_form_input_predefined("float", "nad_price_cost_special", 0, "");
$data["nad_price_sale_special"] = @security_form_input_predefined("float", "nad_price_sale_special", 0, "");
/*
Error Handling
*/
// verify valid rate table
if (!$obj_rate_table->verify_id()) {
log_write("error", "process", "The CDR rate table you have attempted to edit - " . $obj_rate_table->id . " - does not exist in this system.");
}
// TODO: some sort of NAD validation logic here?
/*
Process Data
*/
if (error_check()) {
$_SESSION["error"]["form"]["cdr_import_rate_table_nad"] = "failed";
header("Location: ../index.php?page=services/cdr-rates-import-nad.php&id=" . $obj_rate_table->id);
exit(0);
示例10: cdr_rate_table
require "../include/services/inc_services.php";
require "../include/services/inc_services_cdr.php";
if (user_permissions_get("services_write")) {
/*
Fetch Form/Session Data
*/
$obj_rate_table = new cdr_rate_table();
$obj_rate_table->id = @security_form_input_predefined("int", "id_rate_table", 1, "");
$data["cdr_rate_import_mode"] = @security_form_input_predefined("any", "cdr_rate_import_mode", 1, "");
$data["rate_billgroup"] = @security_form_input_predefined("int", "rate_billgroup", 1, "");
$data["cdr_rate_import_cost_price"] = @security_form_input_predefined("any", "cdr_rate_import_cost_price", 1, "");
$data["cdr_rate_import_sale_price"] = @security_form_input_predefined("any", "cdr_rate_import_sale_price", 1, "");
$data["cdr_rate_import_sale_price_margin"] = @security_form_input_predefined("float", "cdr_rate_import_sale_price_margin", 0, "");
$num_cols = @security_form_input_predefined("int", "num_cols", 1, "");
for ($i = 1; $i <= $num_cols; $i++) {
$data["column{$i}"] = @security_form_input_predefined("any", "column{$i}", 0, "");
}
/*
Error Handling
*/
// verify valid rate table
if (!$obj_rate_table->verify_id()) {
log_write("error", "process", "The CDR rate table you have attempted to edit - " . $obj_rate_table->id . " - does not exist in this system.");
}
// verify that there is no duplicate configuration in the columns
for ($i = 1; $i <= $num_cols; $i++) {
$col = "column" . $i;
for ($j = $i + 1; $j <= $num_cols; $j++) {
$col2 = "column" . $j;
if (!empty($data[$col2])) {
if ($data[$col] == $data[$col2]) {
示例11: header
/*
admin/blacklist-enable-process.php
access: admins only
Allows the admin to enable/disable blacklisting.
*/
// includes
include_once "../include/config.php";
include_once "../include/amberphplib/main.php";
if (user_permissions_get('admin')) {
/////////////////////////
// convert the data given
$data["blacklist_enable"] = @security_form_input_predefined("any", "blacklist_enable", 0, "");
$data["blacklist_limit"] = @security_form_input_predefined("int", "blacklist_limit", 1, "");
//// ERROR CHECKING ///////////////////////
if ($data["blacklist_enable"] == "on") {
$data["blacklist_enable"] = "enabled";
} else {
$data["blacklist_enable"] = "disabled";
}
// if there was an error, go back to the previous page
if ($_SESSION["error"]["message"]) {
$_SESSION["error"]["form"]["blacklist_control"] = "failed";
header("Location: ../index.php?page=admin/blacklist.php");
exit(0);
} else {
// enable/disable blacklisting
$sql_obj = new sql_query();
$sql_obj->string = "UPDATE config SET value='" . $data["blacklist_enable"] . "' WHERE name='BLACKLIST_ENABLE' LIMIT 1";
示例12:
$obj_tax->id = @security_form_input_predefined("int", "id_tax", 0, "");
$obj_tax->data["name_tax"] = @security_form_input_predefined("any", "name_tax", 1, "");
$obj_tax->data["taxrate"] = @security_form_input_predefined("any", "taxrate", 1, "");
$obj_tax->data["chartid"] = @security_form_input_predefined("int", "chartid", 1, "");
$obj_tax->data["taxnumber"] = @security_form_input_predefined("any", "taxnumber", 1, "");
$obj_tax->data["description"] = @security_form_input_predefined("any", "description", 1, "");
//default settings
$obj_tax->data["default_customers"] = @security_form_input_predefined("checkbox", "default_customers", 0, "");
$obj_tax->data["default_vendors"] = @security_form_input_predefined("checkbox", "default_vendors", 0, "");
$obj_tax->data["default_services"] = @security_form_input_predefined("checkbox", "default_services", 0, "");
$obj_tax->data["default_products"] = @security_form_input_predefined("checkbox", "default_products", 0, "");
// only used when adding new taxes
$obj_tax->data["autoenable_tax_customers"] = @security_form_input_predefined("checkbox", "autoenable_tax_customers", 0, "");
$obj_tax->data["autoenable_tax_vendors"] = @security_form_input_predefined("checkbox", "autoenable_tax_vendors", 0, "");
$obj_tax->data["autoenable_tax_services"] = @security_form_input_predefined("checkbox", "autoenable_tax_services", 0, "");
$obj_tax->data["autoenable_tax_products"] = @security_form_input_predefined("checkbox", "autoenable_tax_products", 0, "");
/*
Error Handling
*/
if ($obj_tax->id) {
// make sure the tax actually exists
if (!$obj_tax->verify_id()) {
log_write("error", "process", "The tax you have attempted to edit - " . $obj_tax->id . " - does not exist in this system.");
}
}
// make sure we don't choose a tax name that is already in use
if (!$obj_tax->verify_name_tax()) {
log_write("error", "process", "Another tax already exists with the same name - please choose a unique name.");
$_SESSION["error"]["name_tax-error"] = 1;
}
// make sure the selected chart exists
示例13: SUM
} else {
$obj_refund->load_data();
}
}
}
/*
Fetch Standard Data
*/
$obj_refund->data["date_trans"] = @security_form_input_predefined("date", "date_trans", 1, "");
$obj_refund->data["description"] = @security_form_input_predefined("any", "description", 0, "");
$obj_refund->data["amount_total"] = @security_form_input_predefined("money", "amount", 1, "");
$obj_refund->data["account_dest"] = @security_form_input_predefined("int", "account_dest", 1, "");
$obj_refund->data["account_asset"] = @security_form_input_predefined("int", "account_asset", 1, "");
$obj_refund->data["id_employee"] = @security_form_input_predefined("int", "id_employee", 1, "");
$obj_refund->data["id_customer"] = $obj_customer->id;
@security_form_input_predefined("any", "type", 0, "");
// ignored, for error handling only
// make sure the refund amount isn't more than the available credit
$credit_balance = sql_get_singlevalue("SELECT SUM(amount_total) as value FROM customers_credits WHERE id_customer='" . $obj_customer->id . "' AND id!='" . $obj_refund->id . "'");
if ($obj_refund->data["amount_total"] > $credit_balance) {
log_write("error", "process", "Refund amount can not be more than the credit balance of " . format_money($credit_balance) . "");
}
/*
Check for any errors
*/
if (error_check()) {
$_SESSION["error"]["form"]["credit-refund_view"] = "failed";
header("Location: ../index.php?page=customers/credit-refund.php&id_customer=" . $obj_customer->id . "&id_order=" . $obj_customer->id_order);
exit(0);
} else {
/*
示例14:
Load Data
*/
$obj_customer->id = @security_form_input_predefined("int", "id_customer", 1, "");
$obj_customer->id_service_customer = @security_form_input_predefined("int", "id_service_customer", 0, "");
$obj_ddi->id = @security_form_input_predefined("int", "id_ddi", 0, "");
$obj_ddi->id_customer = $obj_customer->id;
$obj_ddi->id_service_customer = $obj_customer->id_service_customer;
$obj_ddi->data["ddi_start"] = @security_form_input_predefined("int", "ddi_start", 1, "");
$obj_ddi->data["ddi_finish"] = @security_form_input_predefined("int", "ddi_finish", 1, "");
$obj_ddi->data["description"] = @security_form_input_predefined("any", "description", 0, "");
if ($GLOBALS["config"]["SERVICE_CDR_LOCAL"] == "prefix") {
// prefix integer based
$obj_ddi->data["local_prefix"] = @security_form_input_predefined("any", "phone_local_prefix", 1, "");
} else {
// string/region/destination based
$obj_ddi->data["local_prefix"] = @security_form_input_predefined("any", "phone_local_prefix", 1, "");
}
/*
Verify Data
*/
// check that the specified customer actually exists
if (!$obj_customer->verify_id()) {
log_write("error", "process", "The customer you have attempted to edit - " . $obj_customer->id . " - does not exist in this system.");
} else {
// make sure the service exists and is assigned to the customer
if (!$obj_customer->verify_id_service_customer()) {
log_write("error", "process", "The service you have attempted to edit - " . $obj_customer->id_service_customer . " - does not exist in this system.");
} else {
$obj_customer->load_data();
$obj_customer->load_data_service();
}
示例15: sql_query
}
}
//taxes
$obj_customer->data["tax_number"] = @security_form_input_predefined("any", "tax_number", 0, "");
$obj_customer->data["discount"] = @security_form_input_predefined("float", "discount", 0, "");
// get tax selection options
$sql_taxes_obj = new sql_query();
$sql_taxes_obj->string = "SELECT id FROM account_taxes";
$sql_taxes_obj->execute();
if ($sql_taxes_obj->num_rows()) {
// only get the default tax if taxes exist
$obj_customer->data["tax_default"] = @security_form_input_predefined("int", "tax_default", 0, "");
// fetch all the taxes and see which ones are enabled for the customer
$sql_taxes_obj->fetch_array();
foreach ($sql_taxes_obj->data as $data_tax) {
$obj_customer->data["tax_" . $data_tax["id"]] = @security_form_input_predefined("any", "tax_" . $data_tax["id"], 0, "");
}
}
/*
Error Handling
*/
// verify valid ID (if performing update)
if ($obj_customer->id) {
if (!$obj_customer->verify_id()) {
log_write("error", "process", "The customer you have attempted to edit - " . $obj_customer->id . " - does not exist in this system.");
}
}
// make sure we don't choose a customer name that has already been taken
if (!$obj_customer->verify_name_customer()) {
log_write("error", "process", "This customer name is already used for another customer - please choose a unique name.");
$_SESSION["error"]["name_customer-error"] = 1;