本文整理汇总了PHP中error_check函数的典型用法代码示例。如果您正苦于以下问题:PHP error_check函数的具体用法?PHP error_check怎么用?PHP error_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了error_check函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
function execute()
{
/*
Define form structure
*/
$this->obj_form = new form_input();
$this->obj_form->formname = "translation_form";
$this->obj_form->language = $_SESSION["user"]["lang"];
$this->obj_form->action = "popup/translation_form-process.php";
$this->obj_form->method = "post";
$this->num_trans = 5;
for ($i = 1; $i <= $this->num_trans; $i++) {
$structure = NULL;
$structure["fieldname"] = "untranslated_" . $i;
$structure["type"] = "input";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "translated_" . $i;
$structure["type"] = "input";
$this->obj_form->add_input($structure);
}
$structure = NULL;
$structure["fieldname"] = "submit";
$structure["type"] = "submit";
$structure["defaultvalue"] = "Save Translations";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "num_trans";
$structure["type"] = "hidden";
$structure["defaultvalue"] = $this->num_trans;
$this->obj_form->add_input($structure);
if (error_check()) {
$this->obj_form->load_data_error();
}
}
示例2: execute
function execute()
{
/*
Define form structure
*/
$this->obj_form = new form_input();
$this->obj_form->formname = "name_server_edit";
$this->obj_form->language = $_SESSION["user"]["lang"];
$this->obj_form->action = "servers/group-edit-process.php";
$this->obj_form->method = "post";
// general
$structure = NULL;
$structure["fieldname"] = "group_name";
$structure["type"] = "input";
$structure["options"]["req"] = "yes";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "group_description";
$structure["type"] = "textarea";
$this->obj_form->add_input($structure);
// submit section
$structure = NULL;
$structure["fieldname"] = "submit";
$structure["type"] = "submit";
$structure["defaultvalue"] = "Save Changes";
$this->obj_form->add_input($structure);
// subforms
$this->obj_form->subforms["group_details"] = array("group_name", "group_description");
$this->obj_form->subforms["submit"] = array("submit");
// load data
if (error_check()) {
$this->obj_form->load_data_error();
}
}
示例3: execute
function execute()
{
/*
Define form structure
*/
$this->obj_form = new form_input();
$this->obj_form->formname = "name_server_delete";
$this->obj_form->language = $_SESSION["user"]["lang"];
$this->obj_form->action = "servers/delete-process.php";
$this->obj_form->method = "post";
// general
$structure = NULL;
$structure["fieldname"] = "server_name";
$structure["type"] = "text";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "server_description";
$structure["type"] = "text";
$this->obj_form->add_input($structure);
// hidden section
$structure = NULL;
$structure["fieldname"] = "id_name_server";
$structure["type"] = "hidden";
$structure["defaultvalue"] = $this->obj_name_server->id;
$this->obj_form->add_input($structure);
// confirm delete
$structure = NULL;
$structure["fieldname"] = "delete_confirm";
$structure["type"] = "checkbox";
$structure["options"]["label"] = "Yes, I wish to delete this server and realise that once deleted the data can not be recovered.";
$this->obj_form->add_input($structure);
// submit
$structure = NULL;
$structure["fieldname"] = "submit";
$structure["type"] = "submit";
$structure["defaultvalue"] = "delete";
$this->obj_form->add_input($structure);
// define subforms
$this->obj_form->subforms["server_delete"] = array("server_name", "server_description");
$this->obj_form->subforms["hidden"] = array("id_name_server");
$this->obj_form->subforms["submit"] = array("delete_confirm", "submit");
// import data
if (error_check()) {
$this->obj_form->load_data_error();
} else {
if ($this->obj_name_server->load_data()) {
$this->obj_form->structure["server_name"]["defaultvalue"] = $this->obj_name_server->data["server_name"];
$this->obj_form->structure["server_description"]["defaultvalue"] = $this->obj_name_server->data["server_description"];
}
}
}
示例4: safe_query
function safe_query($query)
{
set_error_handler("exception_error_handler");
try {
$result = pg_query($query);
} catch (Exception $e) {
echo "<pre>Problem with query: " . $query . "\n";
echo "<pre>Error Message:" . $e->getMessage() . "</pre>\n";
// This needs to be updated to redirect to a well-formatted error screen
}
//This checks for non-fatal errors that return nothing to $result
error_check($result, $query);
return $result;
}
示例5: execute
function execute()
{
/*
Define form structure
*/
$this->obj_form = new form_input();
$this->obj_form->formname = "config_integration";
$this->obj_form->language = $_SESSION["user"]["lang"];
$this->obj_form->action = "admin/config_integration-process.php";
$this->obj_form->method = "post";
// customer portal stuff
$structure = NULL;
$structure["fieldname"] = "MODULE_CUSTOMER_PORTAL";
$structure["type"] = "checkbox";
$structure["options"]["no_translate_fieldname"] = "yes";
$structure["options"]["label"] = "Enable/disable the customer portal integration.";
$this->obj_form->add_input($structure);
// submit section
$structure = NULL;
$structure["fieldname"] = "submit";
$structure["type"] = "submit";
$structure["defaultvalue"] = "Save Changes";
$this->obj_form->add_input($structure);
// define subforms
$this->obj_form->subforms["config_integration"] = array("MODULE_CUSTOMER_PORTAL");
$this->obj_form->subforms["submit"] = array("submit");
if (error_check()) {
// load error datas
$this->obj_form->load_data_error();
} else {
// fetch all the values from the database
$sql_config_obj = new sql_query();
$sql_config_obj->string = "SELECT name, value FROM config ORDER BY name";
$sql_config_obj->execute();
$sql_config_obj->fetch_array();
foreach ($sql_config_obj->data as $data_config) {
$this->obj_form->structure[$data_config["name"]]["defaultvalue"] = $data_config["value"];
}
unset($sql_config_obj);
}
}
示例6: execute
function execute()
{
// load data
$this->obj_customer->load_data();
// define basic form details
$this->obj_form = new form_input();
$this->obj_form->formname = "cdr_override_edit";
$this->obj_form->language = $_SESSION["user"]["lang"];
$this->obj_form->action = "customers/service-cdr-override-edit-process.php";
$this->obj_form->method = "post";
// service details
$structure = NULL;
$structure["fieldname"] = "name_customer";
$structure["type"] = "text";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "service_name";
$structure["type"] = "text";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "service_description";
$structure["type"] = "text";
$this->obj_form->add_input($structure);
// rate table details
$structure = NULL;
$structure["fieldname"] = "rate_table_name";
$structure["type"] = "text";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "rate_table_description";
$structure["type"] = "text";
$this->obj_form->add_input($structure);
// item options
$structure = NULL;
$structure["fieldname"] = "rate_prefix";
$structure["type"] = "input";
$structure["options"]["req"] = "yes";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "rate_description";
$structure["type"] = "input";
$structure["options"]["req"] = "yes";
$this->obj_form->add_input($structure);
$structure = form_helper_prepare_dropdownfromdb("rate_billgroup", "SELECT id, billgroup_name as label FROM cdr_rate_billgroups");
$structure["options"]["req"] = "yes";
$structure["options"]["width"] = "100";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "rate_price_sale";
$structure["type"] = "money";
$structure["options"]["req"] = "yes";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "rate_price_cost";
$structure["type"] = "money";
$this->obj_form->add_input($structure);
// hidden
$structure = NULL;
$structure["fieldname"] = "id_customer";
$structure["type"] = "hidden";
$structure["defaultvalue"] = $this->obj_customer->id;
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "id_service_customer";
$structure["type"] = "hidden";
$structure["defaultvalue"] = $this->obj_customer->id_service_customer;
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "id_rate_override";
$structure["type"] = "hidden";
$structure["defaultvalue"] = $this->obj_cdr_rate_table->id_rate_override;
$this->obj_form->add_input($structure);
// submit button
$structure = NULL;
$structure["fieldname"] = "submit";
$structure["type"] = "submit";
$structure["defaultvalue"] = "submit";
$this->obj_form->add_input($structure);
// define subforms
$this->obj_form->subforms["service_details"] = array("name_customer", "service_name", "service_description");
$this->obj_form->subforms["rate_table_details"] = array("rate_table_name", "rate_table_description");
$this->obj_form->subforms["rate_table_items"] = array("rate_prefix", "rate_description", "rate_billgroup", "rate_price_sale", "rate_price_cost");
$this->obj_form->subforms["hidden"] = array("id_customer", "id_service_customer", "id_rate_override");
$this->obj_form->subforms["submit"] = array("submit");
// load any data returned due to errors
if (error_check()) {
$this->obj_form->load_data_error();
} else {
$this->obj_cdr_rate_table->load_data();
// load rate values from standard item
if ($this->obj_cdr_rate_table->id_rate) {
$this->obj_cdr_rate_table->load_data_rate();
}
// load override values
if ($this->obj_cdr_rate_table->id_rate_override) {
$this->obj_cdr_rate_table->load_data_rate_override();
}
$this->obj_form->structure["name_customer"]["defaultvalue"] = $this->obj_customer->data["name_customer"];
$this->obj_form->structure["service_name"]["defaultvalue"] = $this->obj_customer->obj_service->data["name_service"];
$this->obj_form->structure["service_description"]["defaultvalue"] = $this->obj_customer->obj_service->data["description"];
//.........这里部分代码省略.........
示例7: user_add_user
// so no need to translate this. This is just in case. :-)
$error = 'Invalid characters in login.';
} else {
if (empty($user)) {
// Username cannot be blank. This is currently the only place
// that calls addUser that is located in $user_inc.
$error = $blankUserStr;
} else {
user_add_user($user, $upassword1, $ufirstname, $ulastname, $uemail, $uis_admin, $u_enabled);
activity_log(0, $login, $user, LOG_USER_ADD, "{$ufirstname} {$ulastname}" . (empty($uemail) ? '' : " <{$uemail}>"));
}
}
}
} else {
if (!empty($add) && !access_can_access_function(ACCESS_USER_MANAGEMENT)) {
$error = print_not_auth(15);
} else {
// Don't allow a user to change themself to an admin by setting
// uis_admin in the URL by hand. They must be admin beforehand.
if (!$is_admin) {
$uis_admin = 'N';
}
user_update_user($user, $ufirstname, $ulastname, $uemail, $uis_admin, $uenabled);
activity_log(0, $login, $user, LOG_USER_UPDATE, "{$ufirstname} {$ulastname}" . (empty($uemail) ? '' : " <{$uemail}>"));
}
}
}
}
}
echo error_check('users.php', false);
示例8: autopay
function autopay()
{
log_write("debug", "invoice_autopay", "Executing autopay()");
// check capabilities
if (!$this->capable) {
if (!$this->check_autopay_capable()) {
return 0;
}
}
/*
Start SQL Transaction
*/
$sql_obj = new sql_query();
$sql_obj->trans_begin();
/*
Load Invoice Data
*/
$this->obj_invoice = new invoice();
$this->obj_invoice->id = $this->id_invoice;
$this->obj_invoice->type = $this->type_invoice;
if (!$this->obj_invoice->load_data()) {
log_write("error", "invoice_autopay", "Unable to load invoice data for checking for autopayments");
return -1;
}
/*
Make AutoPayments
*/
// handle credit payments
$this->autopay_credit();
// future: credit card, direct debit?
/*
Commit
*/
if (error_check()) {
$sql_obj->trans_rollback();
log_write("error", "invoice_autopay", "An error occured whilst making an invoice autopayment");
return 0;
} else {
$sql_obj->trans_commit();
return 1;
}
}
示例9: mysql_query
});
});
});
</script>
<!---Sends the form results to page "Results1.php" --->
<form action="Results1.php" method="post" id = "movie" class="pick">
<h4>I want to watch a... <h4>
<!---results stored in variable called genre --->
<select name ="genre" form="movie" class="genre">
<option value = ""> Select your genre </option>
<?php
// queries the genres from the database
$query = "SELECT name FROM tagtest WHERE type = 'genre'";
$result = mysql_query($query);
error_check($result);
runQueryForm($result);
?>
</select>
<br/><br/>
<!--The following is the subgenre question-->
<h4>With a some bit of... <h4>
<!---results stored in variable called subgenre --->
<select name="subgenre" form="movie" class="subgenre">
<option selected=""> Select your subgenre </option>
</select>
<br/>
<br/>
<input type="submit"/>
<!---submits form --->
</form>
示例10: service_invoices_generate
//.........这里部分代码省略.........
// nothing todo for these service types
log_write("debug", "service_invoicegen", "Not processing usage, this is a non-usage service type");
break;
default:
// we should always match all service types, even if we don't need to do anything
// in particular for that type.
die("Unable to process unknown service type: " . $obj_service->data["typeid_string"] . "");
break;
}
// end of processing usage
} else {
log_write("debug", "service_invoicegen", "Not billing for current usage, as this appears to be the first plan period so no usage can exist yet");
}
/*
Set invoice ID for period - this prevents the period from being added to
any other invoices and allows users to see which invoice it was billed under
*/
// set for plan period
$sql_obj = new sql_query();
$sql_obj->string = "UPDATE services_customers_periods SET invoiceid='{$invoiceid}', rebill='0' WHERE id='" . $period_data["id"] . "' LIMIT 1";
$sql_obj->execute();
// set for usage period
if (!empty($period_usage_data["active"])) {
$sql_obj = new sql_query();
$sql_obj->string = "UPDATE services_customers_periods SET invoiceid_usage='{$invoiceid}' WHERE id='" . $period_usage_data["id"] . "' LIMIT 1";
$sql_obj->execute();
}
}
// end of processing periods
/*
Only process orders and invoice
summary details if we had no errors above.
*/
if (!error_check()) {
/*
Process any customer orders
*/
if ($GLOBALS["config"]["ORDERS_BILL_ONSERVICE"]) {
log_write("debug", "inc_service_invoicegen", "Checking for customer orders to add to service invoice");
$obj_customer_orders = new customer_orders();
$obj_customer_orders->id = $customer_data["id"];
if ($obj_customer_orders->check_orders_num()) {
log_write("debug", "inc_service_invoicegen", "Order items exist, adding them to service invoice");
$obj_customer_orders->invoice_generate($invoiceid);
}
} else {
log_write("debug", "inc_service_invoicegen", "Not checking for customer orders, ORDERS_BILL_ONSERVICE is disabled currently");
}
/*
Update the invoice details + Ledger
Processes:
- taxes
- ledger
- invoice summary
We use the invoice_items class to perform these tasks, but we don't need
to define an item ID for the functions being used to work.
*/
$invoice = new invoice_items();
$invoice->id_invoice = $invoiceid;
$invoice->type_invoice = "ar";
$invoice->action_update_tax();
$invoice->action_update_ledger();
$invoice->action_update_total();
unset($invoice);
示例11: execute
function execute()
{
/*
Define form structure
*/
$this->obj_form = new form_input();
$this->obj_form->formname = "name_server_group_edit";
$this->obj_form->language = $_SESSION["user"]["lang"];
$this->obj_form->action = "servers/group-edit-process.php";
$this->obj_form->method = "post";
// general
$structure = NULL;
$structure["fieldname"] = "group_name";
$structure["type"] = "input";
$structure["options"]["req"] = "yes";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "group_description";
$structure["type"] = "textarea";
$this->obj_form->add_input($structure);
// group members
$member_servers = "";
$obj_sql = new sql_query();
$obj_sql->string = "SELECT id, server_name FROM name_servers WHERE id_group='" . $this->obj_name_server_group->id . "' ORDER BY server_name";
$obj_sql->execute();
if ($obj_sql->num_rows()) {
$obj_sql->fetch_array();
$count = 0;
foreach ($obj_sql->data as $data) {
$count++;
$member_servers .= "<a href=\"index.php?page=servers/view.php&id=" . $data["id"] . "\">" . $data["server_name"] . "</a>";
if ($count != $obj_sql->data_num_rows) {
$member_servers .= "<br> ";
}
}
}
$structure = NULL;
$structure["fieldname"] = "group_member_servers";
$structure["type"] = "text";
$structure["options"]["nohidden"] = 1;
$structure["defaultvalue"] = $member_servers;
$this->obj_form->add_input($structure);
$member_domains = "";
$obj_sql = new sql_query();
$obj_sql->string = "SELECT id, domain_name FROM dns_domains WHERE id IN (SELECT id_domain FROM dns_domains_groups WHERE id_group='" . $this->obj_name_server_group->id . "') ORDER BY domain_name";
$obj_sql->execute();
if ($obj_sql->num_rows()) {
$obj_sql->fetch_array();
$count = 0;
foreach ($obj_sql->data as $data) {
$count++;
$member_domains .= "<a href=\"index.php?page=domains/view.php&id=" . $data["id"] . "\">" . $data["domain_name"] . "</a>";
if ($count != $obj_sql->data_num_rows) {
$member_domains .= "<br> ";
}
}
}
$structure = NULL;
$structure["fieldname"] = "group_member_domains";
$structure["type"] = "text";
$structure["options"]["nohidden"] = 1;
$structure["defaultvalue"] = $member_domains;
$this->obj_form->add_input($structure);
// hidden section
$structure = NULL;
$structure["fieldname"] = "id_name_server_group";
$structure["type"] = "hidden";
$structure["defaultvalue"] = $this->obj_name_server_group->id;
$this->obj_form->add_input($structure);
// submit section
$structure = NULL;
$structure["fieldname"] = "submit";
$structure["type"] = "submit";
$structure["defaultvalue"] = "Save Changes";
$this->obj_form->add_input($structure);
// define subforms
$this->obj_form->subforms["group_details"] = array("group_name", "group_description");
$this->obj_form->subforms["group_members"] = array("group_member_servers", "group_member_domains");
$this->obj_form->subforms["hidden"] = array("id_name_server_group");
$this->obj_form->subforms["submit"] = array("submit");
// import data
if (error_check()) {
$this->obj_form->load_data_error();
} else {
if ($this->obj_name_server_group->load_data()) {
$this->obj_form->structure["group_name"]["defaultvalue"] = $this->obj_name_server_group->data["group_name"];
$this->obj_form->structure["group_description"]["defaultvalue"] = $this->obj_name_server_group->data["group_description"];
}
}
}
示例12: validate
function validate($data)
{
//print_r($data);
/* check for Null all values are required */
foreach ($data as $key => $val) {
if ($val == "") {
error_check("Missing field {$key}.<br>");
}
}
}
示例13: action_delete
function action_delete()
{
log_debug("journal_process", "Executing action_delete()");
/*
Start Transaction
*/
$sql_obj = new sql_query();
$sql_obj->trans_begin();
/*
Delete files (if applicable)
*/
if ($this->structure["type"] == "file") {
$file_obj = new file_storage();
$file_obj->data["type"] = "journal";
$file_obj->data["customid"] = $this->structure["id"];
$file_obj->load_data_bytype();
$file_obj->action_delete();
}
/*
Delete journal record
*/
$sql_obj->string = "DELETE FROM `journal` WHERE id='" . $this->structure["id"] . "' LIMIT 1";
$sql_obj->execute();
/*
Commit
*/
if (error_check()) {
log_write("error", "journal_process", "An error occured preventing the journal record from being deleted");
$sql_obj->trans_rollback();
return 0;
} else {
log_write("notification", "journal_process", "Journal record cleanly removed.");
$sql_obj->trans_commit();
return 1;
}
return 0;
}
示例14: bundle_service_delete
function bundle_service_delete($id_service)
{
log_write("debug", "inc_services", "Executing bundle_service_delete({$id_service}))");
/*
Begin Transaction
*/
$sql_obj = new sql_query();
$sql_obj->trans_begin();
/*
Apply Changes
*/
$sql_obj->string = "SELECT id FROM `services_bundles` WHERE id_bundle='" . $this->id . "' AND id_service='{$id_service}' LIMIT 1";
$sql_obj->execute();
$sql_obj->fetch_array();
$option_id = $sql_obj->data[0]["id"];
$sql_obj->string = "DELETE FROM `services_bundles` WHERE id='{$option_id}' LIMIT 1";
$sql_obj->execute();
$sql_obj->string = "DELETE FROM `services_options` WHERE option_type='bundle' AND option_type_id='{$option_id}'";
$sql_obj->execute();
/*
Update the Journal
*/
journal_quickadd_event("services", $this->id, "Service component removed from bundle.");
/*
Commit
*/
if (error_check()) {
$sql_obj->trans_rollback();
log_write("error", "process", "An error occured whilst attempting to remove a service from the bundle. No changes have been made.");
} else {
$sql_obj->trans_commit();
log_write("notification", "process", "Service successfully removed from bundle.");
}
return 0;
}
示例15: graph_cumulative_bydate
function graph_cumulative_bydate($p_metrics, $p_graph_width = 300, $p_graph_height = 380)
{
$t_graph_font = graph_get_font();
error_check(is_array($p_metrics) ? count($p_metrics) : 0, lang_get('cumulative') . ' ' . lang_get('by_date'));
foreach ($p_metrics as $i => $vals) {
if ($i > 0) {
$plot_date[] = $i;
$reported_plot[] = $p_metrics[$i][0];
$resolved_plot[] = $p_metrics[$i][1];
$still_open_plot[] = $p_metrics[$i][2];
}
}
$graph = new Graph($p_graph_width, $p_graph_height);
$graph->img->SetMargin(40, 40, 40, 170);
$graph->img->SetAntiAliasing();
$graph->SetScale('linlin');
$graph->SetMarginColor('white');
$graph->SetFrame(false);
$graph->title->Set(lang_get('cumulative') . ' ' . lang_get('by_date'));
$graph->title->SetFont($t_graph_font, FS_BOLD);
$graph->legend->Pos(0.05, 0.9, 'right', 'bottom');
$graph->legend->SetShadow(false);
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetFont($t_graph_font);
$graph->yaxis->scale->ticks->SetDirection(-1);
$graph->yaxis->SetFont($t_graph_font);
if (FF_FONT2 <= $t_graph_font) {
$graph->xaxis->SetLabelAngle(60);
} else {
$graph->xaxis->SetLabelAngle(90);
# can't rotate non truetype fonts
}
$graph->xaxis->SetLabelFormatCallback('graph_date_format');
$graph->xaxis->SetFont($t_graph_font);
$p1 = new LinePlot($reported_plot, $plot_date);
$p1->SetColor('blue');
$p1->SetCenter();
$p1->SetLegend(lang_get('legend_reported'));
$graph->Add($p1);
$p3 = new LinePlot($still_open_plot, $plot_date);
$p3->SetColor('red');
$p3->SetCenter();
$p3->SetLegend(lang_get('legend_still_open'));
$graph->Add($p3);
$p2 = new LinePlot($resolved_plot, $plot_date);
$p2->SetColor('black');
$p2->SetCenter();
$p2->SetLegend(lang_get('legend_resolved'));
$graph->Add($p2);
if (ON == config_get('show_queries_count')) {
$graph->subtitle->Set(db_count_queries() . ' queries (' . db_count_unique_queries() . ' unique) (' . db_time_queries() . 'sec)');
$graph->subtitle->SetFont($t_graph_font, FS_NORMAL, 8);
}
$graph->Stroke();
}