本文整理汇总了PHP中display_error函数的典型用法代码示例。如果您正苦于以下问题:PHP display_error函数的具体用法?PHP display_error怎么用?PHP display_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assign_jobs
function assign_jobs()
{
global $smarty;
global $db;
$db->run('get_jobs_customer(' . $_SESSION['customer_id'] . ')');
if ($db->error_result) {
display_error(1);
return true;
}
$jobs = $db->get_result_array();
if (empty($jobs)) {
$smarty->assign('job_message', 'Im Moment sind keine Aufträge vorhanden.');
return true;
}
$db->run('get_job_status_customer(' . $_SESSION['customer_id'] . ')');
if ($db->error_result) {
display_errors(1);
return true;
}
$job_status = $db->get_result_array();
foreach ($jobs as $j_key => $job) {
foreach ($job_status as $js_key => $status) {
if ($job['job_id'] == $status['job_id']) {
$jobs[$j_key]['status'][] = $status;
}
}
}
$smarty->assign('jobs', $jobs);
return true;
}
示例2: insert
public function insert($values)
{
$keys = array();
$vals = array();
foreach ($values as $key => $value) {
if (in_array($key, $this->columns_name)) {
$keys[] = $key;
$key_type = $this->columns[$key];
switch ($key_type) {
case 'text':
$value = str_replace('\\r\\n', '<br>', $value);
$vals[] = mysql_real_escape_string(htmlentities($value), $this->database->getConnection());
break;
case 'int':
$vals[] = is_numeric($value) ? $value : 0;
break;
default:
// Check for varchar_64
$varchar_split = explode('_', $key_type);
if ($varchar_split[0] == 'varchar') {
$vals[] = substr($value, 0, $varchar_split[1]);
break;
}
display_error("The key type '{$key_type}' is not defined in the loop");
break;
}
} else {
display_error("The key '{$key}' does not exist in table '{$this->name}'");
return false;
}
}
$sql = 'INSERT INTO ' . $this->name . ' (`' . implode('`, `', $keys) . '`) VALUES("' . implode('", "', $vals) . '");';
return $this->database->query($sql);
}
示例3: check_data
function check_data()
{
global $check_price_charged_vs_order_price, $check_qty_charged_vs_del_qty;
if (!check_num('this_quantity_inv', 0) || input_num('this_quantity_inv') == 0) {
display_error(tr("The quantity to invoice must be numeric and greater than zero."));
set_focus('this_quantity_inv');
return false;
}
if (!check_num('ChgPrice')) {
display_error(tr("The price is not numeric."));
set_focus('ChgPrice');
return false;
}
if ($check_price_charged_vs_order_price == True) {
if ($_POST['order_price'] != input_num('ChgPrice')) {
if ($_POST['order_price'] == 0 || input_num('ChgPrice') / $_POST['order_price'] > 1 + sys_prefs::over_charge_allowance() / 100) {
display_error(tr("The price being invoiced is more than the purchase order price by more than the allowed over-charge percentage. The system is set up to prohibit this. See the system administrator to modify the set up parameters if necessary.") . tr("The over-charge percentage allowance is :") . sys_prefs::over_charge_allowance() . "%");
set_focus('ChgPrice');
return false;
}
}
}
if ($check_qty_charged_vs_del_qty == True) {
if (input_num('this_quantity_inv') / ($_POST['qty_recd'] - $_POST['prev_quantity_inv']) > 1 + sys_prefs::over_charge_allowance() / 100) {
display_error(tr("The quantity being invoiced is more than the outstanding quantity by more than the allowed over-charge percentage. The system is set up to prohibit this. See the system administrator to modify the set up parameters if necessary.") . tr("The over-charge percentage allowance is :") . sys_prefs::over_charge_allowance() . "%");
set_focus('this_quantity_inv');
return false;
}
}
return true;
}
示例4: can_delete
function can_delete($selected_id)
{
$sql = "SELECT COUNT(*) FROM stock_moves WHERE loc_code='{$selected_id}'";
$result = db_query($sql, "could not query stock moves");
$myrow = db_fetch_row($result);
if ($myrow[0] > 0) {
display_error(tr("Cannot delete this location because item movements have been created using this location."));
return false;
}
$sql = "SELECT COUNT(*) FROM workorders WHERE loc_code='{$selected_id}'";
$result = db_query($sql, "could not query work orders");
$myrow = db_fetch_row($result);
if ($myrow[0] > 0) {
display_error(tr("Cannot delete this location because it is used by some work orders records."));
return false;
}
$sql = "SELECT COUNT(*) FROM cust_branch WHERE default_location='{$selected_id}'";
$result = db_query($sql, "could not query customer branches");
$myrow = db_fetch_row($result);
if ($myrow[0] > 0) {
display_error(tr("Cannot delete this location because it is used by some branch records as the default location to deliver from."));
return false;
}
return true;
}
示例5: sendmail
public function sendmail($to_name, $to_email, $from_name = '', $from_email = '', $subject, $body, $altbody = '')
{
if ($from_name == '') {
$from_name = APPLICATION_NAME;
}
if ($from_email == '') {
$from_email = APPLICATION_EMAIL;
}
if (!$subject) {
display_system("The subject has not been set");
} else {
if (!$body) {
display_system("The body has not been set");
} else {
$this->mailer->From = $from_email;
$this->mailer->FromName = $from_name;
$this->mailer->AddAddress($to_email, $to_name);
$this->mailer->AddBCC($from_email, $from_name);
$this->mailer->IsHTML(true);
if ($body == '') {
$this->mailer->IsHTML(false);
}
$this->mailer->Subject = $subject;
$this->mailer->Body = $body;
$this->mailer->AltBody = $altbody;
if (!$this->mailer->Send()) {
display_error("The email from " . $from_name . " (" . $from_email . ") to " . $to_name . " (" . $to_email . ") could not be sent. The mailer replied with the following error :: " . $this->mailer->ErrorInfo . ".<br />The contents of the email were as follows :<br /><b>" . $subject . "</b><br />" . $body . "");
return false;
}
// Need to do this, otherwise recipients will keep adding up
$this->mailer->ClearAllRecipients();
return true;
}
}
}
示例6: can_process
function can_process()
{
global $selected_id;
if ($selected_id == -1) {
if (!references::is_valid($_POST['ref'])) {
display_error(tr("The dimension reference must be entered."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], systypes::dimension())) {
display_error(tr("The entered reference is already in use."));
set_focus('ref');
return false;
}
}
if (strlen($_POST['name']) == 0) {
display_error(tr("The dimension name must be entered."));
set_focus('name');
return false;
}
if (!is_date($_POST['date_'])) {
display_error(tr("The date entered is in an invalid format."));
set_focus('date_');
return false;
}
if (!is_date($_POST['due_date'])) {
display_error(tr("The required by date entered is in an invalid format."));
set_focus('due_date');
return false;
}
return true;
}
示例7: try_add_user
function try_add_user($login, $pass, $pass2, $realname, $session, $is_admin, $antispam)
{
$return_val = false;
// Help prevent robot registrations
if (!check_antispam($antispam)) {
display_error("Invalid security code");
} else {
if ($session != md5(session_id() . $_SERVER['REMOTE_ADDR'])) {
display_error("Invalid session.");
} else {
if ($pass != $pass2) {
display_warning("Password mismatch");
} else {
if ($realname == '' || $pass == '' || $pass2 == '' || $login == '') {
display_warning("Please fill out all fields");
} else {
if (get_user_id($login) > 0) {
display_error("The user <strong>{$login}</strong> already exists.");
} else {
add_user($login, $realname, $pass, $is_admin);
$return_val = display_success("<strong>{$login}</strong> has been successfully created");
}
}
}
}
}
return $return_val;
}
示例8: check_data
function check_data()
{
$total_allocated = 0;
for ($counter = 0; $counter < $_POST["TotalNumberOfAllocs"]; $counter++) {
if (!check_num('amount' . $counter)) {
display_error(tr("The entry for one or more amounts is invalid."));
set_focus('amount' . $counter);
return false;
}
if (!check_num('amount' . $counter, 0)) {
display_error(tr("The entry for an amount to allocate was negative. A positive allocation amount is expected."));
set_focus('amount' . $counter);
return false;
}
/*Now check to see that the AllocAmt is no greater than the
amount left to be allocated against the transaction under review */
if (input_num('amount' . $counter) > $_POST['un_allocated' . $counter]) {
//$_POST['amount' . $counter] = $_POST['un_allocated' . $counter];
}
$_SESSION['alloc']->allocs[$counter]->current_allocated = input_num('amount' . $counter);
$total_allocated += input_num('amount' . $counter);
}
if ($total_allocated - $_SESSION['alloc']->amount > sys_prefs::allocation_settled_allowance()) {
display_error(tr("These allocations cannot be processed because the amount allocated is more than the total amount left to allocate."));
//echo tr("Total allocated:") . " " . $total_allocated ;
//echo " " . tr("Total amount that can be allocated:") . " " . -$_SESSION['alloc']->TransAmt . "<BR>";
return false;
}
return true;
}
示例9: can_process
function can_process()
{
if (!check_num('po_over_receive', 0, 100)) {
display_error(_("The delivery over-receive allowance must be between 0 and 100."));
set_focus('po_over_receive');
return false;
}
if (!check_num('po_over_charge', 0, 100)) {
display_error(_("The invoice over-charge allowance must be between 0 and 100."));
set_focus('po_over_charge');
return false;
}
if (!check_num('past_due_days', 0, 100)) {
display_error(_("The past due days interval allowance must be between 0 and 100."));
set_focus('past_due_days');
return false;
}
$grn_act = get_company_pref('grn_clearing_act');
if (get_post('grn_clearing_act') != $grn_act && db_num_rows(get_grn_items(0, '', true))) {
display_error(_("Before GRN Clearing Account can be changed all GRNs have to be invoiced"));
$_POST['grn_clearing_act'] = $grn_act;
set_focus('grn_clearing_account');
return false;
}
if (!is_account_balancesheet(get_post('retained_earnings_act')) || is_account_balancesheet(get_post('profit_loss_year_act'))) {
display_error(_("The Retained Earnings Account should be a Balance Account or the Profit and Loss Year Account should be an Expense Account (preferred the last one in the Expense Class)"));
return false;
}
return true;
}
示例10: check_can_delete
function check_can_delete($curr)
{
if ($curr == "") {
return false;
}
// PREVENT DELETES IF DEPENDENT RECORDS IN debtors_master
if (key_in_foreign_table($curr, 'debtors_master', 'curr_code')) {
display_error(_("Cannot delete this currency, because customer accounts have been created referring to this currency."));
return false;
}
if (key_in_foreign_table($curr, 'suppliers', 'curr_code')) {
display_error(_("Cannot delete this currency, because supplier accounts have been created referring to this currency."));
return false;
}
if ($curr == get_company_pref('curr_default')) {
display_error(_("Cannot delete this currency, because the company preferences uses this currency."));
return false;
}
// see if there are any bank accounts that use this currency
if (key_in_foreign_table($curr, 'bank_accounts', 'bank_curr_code')) {
display_error(_("Cannot delete this currency, because thre are bank accounts that use this currency."));
return false;
}
return true;
}
示例11: on_submit
function on_submit($selected_parent, $selected_id = -1)
{
if (!check_num('quantity', 0)) {
display_error(_("The quantity entered must be numeric and greater than zero."));
set_focus('quantity');
return;
}
if ($selected_id != -1) {
update_bom($selected_parent, $selected_id, $_POST['workcentre_added'], $_POST['loc_code'], input_num('quantity'));
display_notification(_('Selected component has been updated'));
$Mode = 'RESET';
} else {
/*Selected component is null cos no item selected on first time round
so must be adding a record must be Submitting new entries in the new
component form */
//need to check not recursive bom component of itself!
if (!check_for_recursive_bom($selected_parent, $_POST['component'])) {
/*Now check to see that the component is not already on the bom */
if (!is_component_already_on_bom($_POST['component'], $_POST['workcentre_added'], $_POST['loc_code'], $selected_parent)) {
add_bom($selected_parent, $_POST['component'], $_POST['workcentre_added'], $_POST['loc_code'], input_num('quantity'));
display_notification(_("A new component part has been added to the bill of material for this item."));
$Mode = 'RESET';
} else {
/*The component must already be on the bom */
display_error(_("The selected component is already on this bom. You can modify it's quantity but it cannot appear more than once on the same bom."));
}
} else {
display_error(_("The selected component is a parent of the current item. Recursive BOMs are not allowed."));
}
}
}
示例12: debit
public function debit()
{
$this->fondos_model->extract(CFG_COSTO_CUENTAPLUS);
$user_id = $this->session->userdata('user_id');
$date_end = add_date(date('d-m-Y'), 0, 0, CFG_TIME_CUENTAPLUS);
$query = $this->db->get_where(TBL_CUENTAPLUS, array('user_id' => $user_id));
if ($query->num_rows == 0) {
$sql = "INSERT INTO " . TBL_CUENTAPLUS . "(user_id, date_start, date_end) VALUES(";
$sql .= $user_id . ",";
$sql .= "now(),";
$sql .= "'" . $date_end . "'";
$sql .= ")";
if (!$this->db->query($sql)) {
display_error(__FILE__, "debit", ERR_DB_INSERT, array(TBL_CUENTAPLUS));
}
} else {
$sql = "UPDATE " . TBL_CUENTAPLUS . " SET ";
$sql .= "date_start = now(),";
$sql .= "date_end = '" . $date_end . "' ";
$sql .= "WHERE user_id=" . $user_id;
if (!$this->db->query($sql)) {
display_error(__FILE__, "debit", ERR_DB_UPDATE, array(TBL_CUENTAPLUS));
}
}
return true;
}
示例13: can_process
function can_process()
{
$Auth_Result = hook_authenticate($_SESSION["wa_current_user"]->username, $_POST['cur_password']);
if (!isset($Auth_Result)) {
// if not used external login: standard method
$Auth_Result = get_user_auth($_SESSION["wa_current_user"]->username, md5($_POST['cur_password']));
}
if (!$Auth_Result) {
display_error(_("Invalid password entered."));
set_focus('cur_password');
return false;
}
if (strlen($_POST['password']) < 4) {
display_error(_("The password entered must be at least 4 characters long."));
set_focus('password');
return false;
}
if (strstr($_POST['password'], $_SESSION["wa_current_user"]->username) != false) {
display_error(_("The password cannot contain the user login."));
set_focus('password');
return false;
}
if ($_POST['password'] != $_POST['passwordConfirm']) {
display_error(_("The passwords entered are not the same."));
set_focus('password');
return false;
}
return true;
}
示例14: can_process
function can_process()
{
if (strlen($_POST['CustName']) == 0) {
display_error(_("The customer name cannot be empty."));
set_focus('CustName');
return false;
}
if (strlen($_POST['cust_ref']) == 0) {
display_error(_("The customer short name cannot be empty."));
set_focus('cust_ref');
return false;
}
if (!check_num('credit_limit', 0)) {
display_error(_("The credit limit must be numeric and not less than zero."));
set_focus('credit_limit');
return false;
}
if (!check_num('pymt_discount', 0, 100)) {
display_error(_("The payment discount must be numeric and is expected to be less than 100% and greater than or equal to 0."));
set_focus('pymt_discount');
return false;
}
if (!check_num('discount', 0, 100)) {
display_error(_("The discount percentage must be numeric and is expected to be less than 100% and greater than or equal to 0."));
set_focus('discount');
return false;
}
return true;
}
示例15: sign_in
public function sign_in()
{
// retrieve local parameters
$user_name = mysql_escape_string($this->_parameters['user_name']);
$password = mysql_escape_string($this->_parameters['password']);
if (empty($user_name)) {
display_error(100);
} else {
if (empty($password)) {
display_error(102);
}
}
// check credentials
$signIn = mysql_query("SELECT user_id FROM users WHERE user_name='" . $user_name . "' AND password='" . sha1($password) . "' AND status='Approved' LIMIT 1");
$checkIfPending = mysql_query("SELECT user_id FROM users WHERE user_name='" . $user_name . "' AND password='" . sha1($password) . "' AND status='Pending' LIMIT 1");
if (mysql_num_rows($checkIfPending) > 0) {
display_error(107);
} else {
if (mysql_num_rows($signIn) == 0) {
display_error(106);
} else {
$userInfo = mysql_fetch_array($signIn);
$data = array("user_id" => $userInfo['user_id']);
display_success($data);
}
}
}