function page_execute() { // send customers usage alerts print "Checking customer usage alerts...\n"; $return = service_usage_alerts_generate(NULL); if ($return == -1) { print "No alerts sent - EMAIL_ENABLE is disabled.\n"; } print "Alerting complete.\n"; }
$id_service_customer = @security_script_input('/^[0-9]*$/', $_GET["id_service_customer"]); // make sure the customer actually exists $sql_obj = new sql_query(); $sql_obj->string = "SELECT id FROM `customers` WHERE id='{$id}' LIMIT 1"; $sql_obj->execute(); if (!$sql_obj->num_rows()) { $_SESSION["error"]["message"][] = "The customer you have attempted to view - {$id} - does not exist in this system."; } //// ERROR CHECKING /////////////////////// /// if there was an error, go back to the entry page if ($_SESSION["error"]["message"]) { header("Location: ../index.php?page=customers/service-history.php&id_customer={$id}&id_service_customer={$id_service_customer}"); exit(0); } else { // execute functions // // note: this will actually check all services for the customer, not just the selected one, but this // is not a bad thing and there is no reason not to, unless performance becomes an issue. // service_usage_alerts_generate($id); // display updated details header("Location: ../index.php?page=customers/service-history.php&id_customer={$id}&id_service_customer={$id_service_customer}"); exit(0); } ///////////////////////// } else { // user does not have perms to view this page/isn't logged on error_render_noperms(); header("Location: ../index.php?page=message.php"); exit(0); }