本文整理汇总了PHP中IsEmailAddress函数的典型用法代码示例。如果您正苦于以下问题:PHP IsEmailAddress函数的具体用法?PHP IsEmailAddress怎么用?PHP IsEmailAddress使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsEmailAddress函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ProcessRequestPassword
function ProcessRequestPassword()
{
global $tpl, $user, $error_list, $mail, $success;
$success = $_REQUEST['success'];
$email = $_REQUEST['email'];
$process = $_REQUEST['process'];
$check_email = $user->CheckEmailExist($email);
$i = 0;
if ($process == '1') {
if ($email == '') {
$error_list[$i] = _("Please enter your email address.");
$i++;
} elseif (!IsEmailAddress($email)) {
$error_list[$i] = _("Email is not valid.");
$i++;
} elseif (!$check_email) {
$error_list[$i] = _("Email doesnt exist.");
$i++;
} else {
$username = $check_email['username'];
$password = $user->RandomPassword($check_email['user_id']);
$firstname = $check_email['firstname'];
$lastname = $check_email['lastname'];
$from_email = CFG_NOTIFY_EMAIL;
$from_name = CFG_NOTIFY_FROM;
$mail->RequestPasswordEmail(CFG_SITE_NAME, $username, $password, $firstname, $from_email, $from_name, $email);
header("Location: request_password.php?pf=success");
}
}
}
示例2: GetInvoiceConfiguration
function GetInvoiceConfiguration()
{
global $inv_class, $error_list, $company, $contact, $address, $phone, $email, $success;
$invoice_config_data = $inv_class->GetInvoiceConfiguration();
$process = $_REQUEST['process'];
$i = 0;
if ($process == "edit") {
$company = stripslashes($_REQUEST['company']);
$contact = stripslashes($_REQUEST['contact']);
$address = stripslashes($_REQUEST['address']);
$phone = $_REQUEST['phone'];
$email = $_REQUEST['email'];
if ($company == "" || $contact == "" || $address == "" || $phone == "" || $email == "") {
if ($company == "") {
$error_list[$i] = "Company is requered";
$i++;
}
if ($contact == "") {
$error_list[$i] = "Contact is requered";
$i++;
}
if ($address == "") {
$error_list[$i] = "Address is requered";
$i++;
}
if ($phone == "") {
$error_list[$i] = "Phone is requered";
$i++;
}
if ($email == "") {
$error_list[$i] = "Email is requered";
$i++;
}
} elseif (!IsEmailAddress($email)) {
$error_list[$i] = "Invalid email format";
$i++;
}
if (!is_array($error_list)) {
$inv_class->Update($company, $address, $contact, $phone, $email);
$success = true;
}
} else {
$company = $invoice_config_data['company'];
$contact = $invoice_config_data['contact'];
$address = $invoice_config_data['address'];
$phone = $invoice_config_data['phone'];
$email = $invoice_config_data['email'];
}
}
示例3: prnMsg
if (isset($_POST['submit'])) {
//initialise no input errors assumed initially before we test
$InputError = 0;
/* actions to take once the user has clicked the submit button
ie the page has called itself with some user input */
//first off validate inputs sensible
if (isset($_POST['Con_ID']) and !is_long((int) $_POST['Con_ID'])) {
$InputError = 1;
prnMsg(_('The Contact ID must be an integer.'), 'error');
} elseif (mb_strlen($_POST['ContactName']) > 40) {
$InputError = 1;
prnMsg(_('The contact name must be forty characters or less long'), 'error');
} elseif (trim($_POST['ContactName']) == '') {
$InputError = 1;
prnMsg(_('The contact name may not be empty'), 'error');
} elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail']) > 0) {
$InputError = 1;
prnMsg(_('The contact email address is not a valid email address'), 'error');
}
if (isset($Id) and ($Id and $InputError != 1)) {
$sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "',\n\t\t\t\t\t\t\t\t\t\trole='" . $_POST['ContactRole'] . "',\n\t\t\t\t\t\t\t\t\t\tphoneno='" . $_POST['ContactPhone'] . "',\n\t\t\t\t\t\t\t\t\t\tnotes='" . $_POST['ContactNotes'] . "',\n\t\t\t\t\t\t\t\t\t\temail='" . $_POST['ContactEmail'] . "'\n\t\t\t\t\tWHERE debtorno ='" . $DebtorNo . "'\n\t\t\t\t\tAND contid='" . $Id . "'";
$msg = _('Customer Contacts') . ' ' . $DebtorNo . ' ' . _('has been updated');
} elseif ($InputError != 1) {
$sql = "INSERT INTO custcontacts (debtorno,\n\t\t\t\t\t\t\t\t\t\tcontactname,\n\t\t\t\t\t\t\t\t\t\trole,\n\t\t\t\t\t\t\t\t\t\tphoneno,\n\t\t\t\t\t\t\t\t\t\tnotes,\n\t\t\t\t\t\t\t\t\t\temail)\n\t\t\t\tVALUES ('" . $DebtorNo . "',\n\t\t\t\t\t\t'" . $_POST['ContactName'] . "',\n\t\t\t\t\t\t'" . $_POST['ContactRole'] . "',\n\t\t\t\t\t\t'" . $_POST['ContactPhone'] . "',\n\t\t\t\t\t\t'" . $_POST['ContactNotes'] . "',\n\t\t\t\t\t\t'" . $_POST['ContactEmail'] . "')";
$msg = _('The contact record has been added');
}
if ($InputError != 1) {
$result = DB_query($sql, $db);
//echo '<br />'.$sql;
echo '<br />';
prnMsg($msg, 'success');
示例4: ADDDATE
<?php
/* $Id: MaintenaceReminders.php 4551 2011-04-16 06:20:56Z daintree $*/
//this script can be set to run from cron
$AllowAnyone = true;
include 'includes/session.inc';
include 'includes/htmlMimeMail.php';
$sql = "SELECT \tdescription,\n\t\t\t\ttaskdescription,\n\t\t\t\tADDDATE(lastcompleted,frequencydays) AS duedate,\n\t\t\t\tuserresponsible,\n\t\t\t\temail\n\t\tFROM fixedassettasks\n\t\tINNER JOIN fixedassets\n\t\tON fixedassettasks.assetid=fixedassets.assetid\n\t\tINNER JOIN www_users\n\t\tON fixedassettasks.userresponsible=www_users.userid\n\t\tWHERE ADDDATE(lastcompleted,frequencydays-10)> CURDATE()\n\t\tORDER BY userresponsible";
$result = DB_query($sql, $db);
$LastUserResponsible = '';
while ($myrow = DB_fetch_array($result)) {
if (!isset(${'Mail' . $myrow['userresponsible']}) and IsEmailAddress($myrow['email'])) {
if ($LastUserResponsible != '') {
${'Mail' . $myrow['userresponsible']}->setText($MailText);
$SendResult = ${'Mail' . $myrow['userresponsible']}->send(array($LastUserEmail));
$MailText = _('You have the following maintenance task(s) falling due or over-due:') . "\n";
}
$LastUserResponsible = $myrow['userresponsible'];
$LastUserEmail = $myrow['email'];
${'Mail' . $myrow['userresponsible']} = new htmlMimeMail();
${'Mail' . $myrow['userresponsible']}->setSubject('Maintenance Tasks Reminder');
${'Mail' . $myrow['userresponsible']}->setFrom('Do_not_reply <>');
}
$MailText .= "Asset: " . $myrow['description'] . "\nTask: " . $myrow['taskdescription'] . "\nDue: " . ConvertSQLDate($myrow['duedate']);
if (Date1GreaterThanDate2(ConvertSQLDate($myrow['duedate']), Date($_SESSION['DefaultDateFormat']))) {
$MailText .= _('NB: THIS JOB IS OVERDUE');
}
$MailText . "\n\n";
}
if (DB_num_rows($result) > 0) {
${'Mail' . $LastUserResponsible}->setText($MailText);
示例5: trim
$OnlyDemo = 0;
$DualCompany = 0;
$NewCompany = 0;
if (!empty($_POST['Demo']) and $_POST['Demo'] == 'on') {
if (strtolower($DatabaseName) === 'weberpdemo') {
//user select to install the weberpdemo
$OnlyDemo = 1;
} else {
$DualCompany = 1;
//user choose to install the demo company and production environment
}
} else {
//user only choose to install the new weberp company
$NewCompany = 1;
}
if (!empty($_POST['Email']) and IsEmailAddress($_POST['Email'])) {
$Email = trim($_POST['Email']);
} else {
$InputError = 1;
prnMsg(_('You must enter a valid email address for the Administrator.'), 'error');
}
if (!empty($_POST['webERPPassword']) and !empty($_POST['PasswordConfirm']) and $_POST['webERPPassword'] == $_POST['PasswordConfirm']) {
$AdminPassword = $_POST['webERPPassword'];
} else {
$InputError = 1;
prnMsg(_('Please correct the password. The password is either blank, or the password check does not match.'), 'error');
}
if (!empty($_POST['HostName'])) {
// As HTTP_HOST is user input, ensure it only contains characters allowed
// in hostnames. See RFC 952 (and RFC 2181).
// $_SERVER['HTTP_HOST'] is lowercased here per specifications.
示例6: AddUser
function AddUser()
{
global $tpl, $user, $error_list;
$username = stripslashes($_REQUEST['username']);
$firstname = stripslashes($_REQUEST['firstname']);
$lastname = stripslashes($_REQUEST['lastname']);
$email = stripslashes($_REQUEST['email']);
$address1 = stripslashes($_REQUEST['address1']);
$address2 = stripslashes($_REQUEST['address2']);
$city = stripslashes($_REQUEST['city']);
$state = stripslashes($_REQUEST['state']);
$zip = stripslashes($_REQUEST['zip']);
$phone = stripslashes($_REQUEST['phone']);
$i = 0;
if ($username == "") {
$error_list[$i] = "Username is required";
$i++;
}
if ($firstname == "") {
$error_list[$i] = "Firstname is required";
$i++;
}
if ($lastname == "") {
$error_list[$i] = "Lastname is required";
$i++;
}
if ($email == "") {
$error_list[$i] = "Email is required";
$i++;
}
if ($address1 == "") {
$error_list[$i] = _("Address is required");
$i++;
}
if ($city == "") {
$error_list[$i] = _("City is required");
$i++;
}
if ($state == "") {
$error_list[$i] = _("State is required");
$i++;
}
if ($zip == "") {
$error_list[$i] = _("Zip is required");
$i++;
}
if ($user->CheckUser($username, $email)) {
$error_list[$i] = "Username or email is already exist";
$i++;
} elseif ($repassword != $password) {
$error_list[$i] = "Password does not match";
$i++;
} elseif (!IsEmailAddress($email)) {
$error_list[$i] = "Invalid format email";
$i++;
}
if (!is_array($error_list)) {
$_REQUEST['user_id'] = $user->Add($username, '', $firstname, $lastname, $email, $address1, $address2, $city, $state, $zip, $phone);
$_REQUEST['pf'] = 'detail';
$GLOBALS['user_data'] = $GLOBALS['user']->GetUser($_REQUEST['user_id']);
ShowFormDetailUser();
} else {
ShowFormAddUser();
}
}
示例7: ShowDetailUser
function ShowDetailUser()
{
$curr_user = $GLOBALS['user']->CheckUserActive($_SESSION['SESSION_USERNAME']);
$process = $_REQUEST['process'];
$GLOBALS['user_data'] = $GLOBALS['user']->GetUser($curr_user['user_id']);
if ($process == 'edit') {
$username = stripslashes($_REQUEST['username']);
$password = stripslashes($_REQUEST['password']);
$repassword = stripslashes($_REQUEST['repassword']);
$firstname = stripslashes($_REQUEST['firstname']);
$lastname = stripslashes($_REQUEST['lastname']);
$email = stripslashes($_REQUEST['email']);
$address1 = stripslashes($_REQUEST['address1']);
$address2 = stripslashes($_REQUEST['address2']);
$city = stripslashes($_REQUEST['city']);
$state = stripslashes($_REQUEST['state']);
$zip = stripslashes($_REQUEST['zip']);
$phone = stripslashes($_REQUEST['phone']);
if ($username == "") {
$GLOBALS['error_list'][] = _("Username is required");
} elseif ($GLOBALS['user_data']['username'] != $username) {
if ($GLOBALS['user']->CheckUserLogin($username)) {
$GLOBALS['error_list'][] = _("Username already exist");
}
}
if ($firstname == "") {
$GLOBALS['error_list'][] = _("Firstname is required");
}
if ($lastname == "") {
$GLOBALS['error_list'][] = _("Lastname is required");
}
if ($address1 == "") {
$GLOBALS['error_list'][] = _("Address is required");
}
if ($city == "") {
$GLOBALS['error_list'][] = _("City is required");
}
if ($state == "") {
$GLOBALS['error_list'][] = _("State is required");
}
if ($zip == "") {
$GLOBALS['error_list'][] = _("Zip is required");
}
if ($email == "") {
$GLOBALS['error_list'][] = _("Email is required");
} elseif ($GLOBALS['user_data']['email'] != $email) {
if ($GLOBALS['user']->CheckEmailExist($email)) {
$GLOBALS['error_list'][] = _("Email already exist");
}
} elseif (!IsEmailAddress($email)) {
$GLOBALS['error_list'][] = _("email is not valid");
} elseif ($repassword != $password) {
$GLOBALS['error_list'][] = _("password doesnt match");
}
if (!is_array($GLOBALS['error_list'])) {
$GLOBALS['user']->Update($curr_user['user_id'], $username, $password, $firstname, $lastname, $email, $address1, $address2, $city, $state, $zip, $phone);
$GLOBALS['success'] = true;
//refresh from DB
$GLOBALS['user_data'] = $GLOBALS['user']->GetUser($curr_user['user_id']);
} else {
$GLOBALS['user_data']['firstname'] = $firstname;
$GLOBALS['user_data']['lastname'] = $lastname;
$GLOBALS['user_data']['email'] = $email;
$GLOBALS['user_data']['address1'] = $address1;
$GLOBALS['user_data']['address2'] = $address2;
$GLOBALS['user_data']['city'] = $city;
$GLOBALS['user_data']['state'] = $state;
$GLOBALS['user_data']['zip'] = $zip;
$GLOBALS['user_data']['phone'] = $phone;
}
}
}
示例8: prnMsg
if ($_SESSION['PO' . $identifier]->DelAdd1 == '' or mb_strlen($_SESSION['PO' . $identifier]->DelAdd1) < 3) {
prnMsg(_('The purchase order cannot be committed to the database because there is no delivery street address specified'), 'error');
$InputError = 1;
} elseif ($_SESSION['PO' . $identifier]->Location == '' or !isset($_SESSION['PO' . $identifier]->Location)) {
prnMsg(_('The purchase order can not be committed to the database because there is no location specified to book any stock items into'), 'error');
$InputError = 1;
} elseif ($_SESSION['PO' . $identifier]->LinesOnOrder <= 0) {
prnMsg(_('The purchase order can not be committed to the database because there are no lines entered on this order'), 'error');
$InputError = 1;
}
/*If all clear then proceed to update the database
*/
if ($InputError != 1) {
$result = DB_Txn_Begin($db);
/*figure out what status to set the order to */
if (IsEmailAddress($_SESSION['UserEmail'])) {
$UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName'] . '</a>';
} else {
$UserDetails = ' ' . $_SESSION['UsersRealName'] . ' ';
}
if ($_SESSION['AutoAuthorisePO'] == 1) {
//if the user has authority to authorise the PO then it will automatically be authorised
$AuthSQL = "SELECT authlevel\n\t\t\t\t\t\tFROM purchorderauth\n\t\t\t\t\t\tWHERE userid='" . $_SESSION['UserID'] . "'\n\t\t\t\t\t\tAND currabrev='" . $_SESSION['PO' . $identifier]->CurrCode . "'";
$AuthResult = DB_query($AuthSQL, $db);
$AuthRow = DB_fetch_array($AuthResult);
if (DB_num_rows($AuthResult) > 0 and $AuthRow['authlevel'] > $_SESSION['PO' . $identifier]->Order_Value()) {
//user has authority to authrorise as well as create the order
$StatusComment = date($_SESSION['DefaultDateFormat']) . ' - ' . _('Order Created and Authorised by') . $UserDetails . '<br />' . $_SESSION['PO' . $identifier]->StatusComments . '<br />';
$_SESSION['PO' . $identifier]->AllowPrintPO = 1;
$_SESSION['PO' . $identifier]->Status = 'Authorised';
} else {
示例9: _
<br />
<br />';
include 'includes/footer.inc';
exit;
echo '<div class="centre"><br /><br /><br />' . _('This page must be called with a purchase order number to print');
echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a></div>';
exit;
}
if (isset($_GET['OrderNo'])) {
$OrderNo = $_GET['OrderNo'];
} elseif (isset($_POST['OrderNo'])) {
$OrderNo = $_POST['OrderNo'];
}
$title = _('Print Purchase Order Number') . ' ' . $OrderNo;
if (isset($_POST['PrintOrEmail']) and isset($_POST['EmailTo'])) {
if ($_POST['PrintOrEmail'] == 'Email' and !IsEmailAddress($_POST['EmailTo'])) {
include 'includes/header.inc';
prnMsg(_('The email address entered does not appear to be valid. No emails have been sent.'), 'warn');
include 'includes/footer.inc';
exit;
}
}
$ViewingOnly = 0;
if (isset($_GET['ViewingOnly']) and $_GET['ViewingOnly'] != '') {
$ViewingOnly = $_GET['ViewingOnly'];
} elseif (isset($_POST['ViewingOnly']) and $_POST['ViewingOnly'] != '') {
$ViewingOnly = $_POST['ViewingOnly'];
}
/* If we are previewing the order then we dont want to email it */
if ($OrderNo == 'Preview') {
//OrderNo is set to 'Preview' when just looking at the format of the printed order
示例10: Replace_Dodgy_Characters
} else {
$_POST['company_name'] = Replace_Dodgy_Characters($_POST['company_name']);
}
if (!isset($_POST['timezone']) || $_POST['timezone'] == '') {
set_error('Please enter timezone');
}
// Use KwaMoja logo if none supplied.
// Check if the user has entered a correct path
if (!file_exists($path_to_root . '/sql/mysql/kwamoja-demo.sql')) {
set_error('It appears the Absolute path that you entered is incorrect');
}
// Get admin email and validate it
if (!isset($_POST['admin_email']) || $_POST['admin_email'] == '') {
set_error('Please enter an email for the Administrator account');
} else {
if (IsEmailAddress($_POST['admin_email']) == false) {
set_error('Please enter a valid email address for the Administrator account');
}
}
// Get the two admin passwords entered, and check that they match
if (!isset($_POST['admin_password']) || $_POST['admin_password'] == '') {
set_error('Please enter a password for the Administrator account');
}
if (!isset($_POST['admin_repassword']) || $_POST['admin_repassword'] == '') {
set_error('Please make sure you re-enter the password for the Administrator account');
}
if ($_POST['admin_password'] != $_POST['admin_repassword']) {
// Zero BOTH passwords before returning form to user.
$_POST['admin_password'] = '';
$_POST['admin_repassword'] = '';
set_error('The two Administrator account passwords you entered do not match');
示例11: ShowConfig
function ShowConfig()
{
global $tpl, $pf, $error_list, $site_name, $site_url, $site_mail, $protect_path, $protect_url, $notify_email, $notify_from, $notify_expire, $success;
$pf = $_REQUEST['pf'];
$process = $_REQUEST['process'];
if ($process == 'edit') {
$site_name = stripslashes($_REQUEST['site_name']);
$site_mail = stripslashes($_REQUEST['site_mail']);
$protect_path = stripslashes($_REQUEST['protect_path']);
$protect_url = stripslashes($_REQUEST['protect_url']);
$notify_email = stripslashes($_REQUEST['notify_email']);
$notify_from = stripslashes($_REQUEST['notify_from']);
$notify_expire = stripslashes($_REQUEST['notify_expire']);
$i = 0;
if ($site_name == "" || $site_mail == "" || $protect_path == "" || $protect_url == "" || $notify_email == "" || $notify_from == "") {
if ($site_name == "") {
$error_list[$i] = "Site name is required";
$i++;
}
if ($site_mail == "") {
$error_list[$i] = "Site email is required";
$i++;
}
if ($protect_path == "") {
$error_list[$i] = "Protected path is required";
$i++;
}
if ($protect_url == "") {
$error_list[$i] = "Protected url is required";
$i++;
}
if ($notify_from == "") {
$error_list[$i] = "Notify from is required";
$i++;
}
if ($notify_email == "") {
$error_list[$i] = "Notify email is required";
$i++;
}
} elseif (!IsDigit($notify_expire)) {
$error_list[$i] = "Notify expire must be digit";
$i++;
} elseif (!IsEmailAddress($site_mail)) {
$error_list[$i] = "Site email is not valid format";
$i++;
} elseif (!IsEmailAddress($notify_email)) {
$error_list[$i] = "Notify email is not valid format";
$i++;
}
if (!is_array($error_list)) {
UpdateConfig($site_name, "site_name");
UpdateConfig($site_mail, "site_mail");
UpdateConfig($protect_path, "protect_path");
UpdateConfig($protect_url, "protect_url");
UpdateConfig($notify_email, "notify_email");
UpdateConfig($notify_from, "notify_from");
UpdateConfig($notify_expire, "notify_expire");
$success = true;
}
} else {
$site_name = CFG_SITE_NAME;
$site_mail = CFG_SITE_MAIL;
$protect_path = CFG_PROTECT_PATH;
$protect_url = CFG_PROTECT_URL;
$notify_email = CFG_NOTIFY_EMAIL;
$notify_from = CFG_NOTIFY_FROM;
$notify_expire = CFG_NOTIFY_EXPIRE;
}
}
示例12: elseif
} elseif (strlen($_POST['Phone']) > 25) {
$InputError = 1;
prnMsg(_('The telephone number must be 25 characters or less long'), 'error');
$Errors[$i] = 'Telephone';
$i++;
} elseif (strlen($_POST['Fax']) > 25) {
$InputError = 1;
prnMsg(_('The fax number must be 25 characters or less long'), 'error');
$Errors[$i] = 'Fax';
$i++;
} elseif (strlen($_POST['Email']) > 55) {
$InputError = 1;
prnMsg(_('The email address must be 55 characters or less long'), 'error');
$Errors[$i] = 'Email';
$i++;
} elseif (strlen($_POST['Email']) > 0 and !IsEmailAddress($_POST['Email'])) {
$InputError = 1;
prnMsg(_('The email address is not correctly formed'), 'error');
$Errors[$i] = 'Email';
$i++;
}
if ($InputError != 1) {
$sql = "SELECT typeabbrev FROM salestypes";
$result = DB_query($sql, $db);
$myrow = DB_fetch_array($result);
$SalesType = $myrow['typeabbrev'];
$InsuranceTypeID = $_POST['InsuranceType'];
if (!isset($_POST['New'])) {
$sql = "SELECT count(id)\n\t\t\t\t\t FROM debtortrans\n\t\t\t\t\twhere debtorno = '" . $_POST['DebtorNo'] . "'";
$result = DB_query($sql, $db);
$myrow = DB_fetch_array($result);
示例13: _
<?php
/* $Revision: 1.8 $ */
/* $Id$*/
include 'includes/session.inc';
include 'includes/SQL_CommonFunctions.inc';
if ($_GET['InvOrCredit'] == 'Invoice') {
$TransactionType = _('Invoice');
$TypeCode = 10;
} else {
$TransactionType = _('Credit Note');
$TypeCode = 11;
}
$title = _('Email') . ' ' . $TransactionType . ' ' . _('Number') . ' ' . $_GET['FromTransNo'];
if (isset($_POST['DoIt']) and IsEmailAddress($_POST['EmailAddr'])) {
if ($_SESSION['InvoicePortraitFormat'] == 0) {
echo '<meta http-equiv="Refresh" content=\'0; url=' . $rootpath . '/PrintCustTrans.php?FromTransNo=' . $_POST['TransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] . '&Email=' . $_POST['EmailAddr'] . "'>";
prnMsg(_('The transaction should have been emailed off') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ')' . '<a href="' . $rootpath . '/PrintCustTrans.php?FromTransNo=' . $_POST['FromTransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] . '&Email=' . $_POST['EmailAddr'] . '">' . _('click here') . '</a> ' . _('to email the customer transaction'), 'success');
} else {
echo '<meta http-equiv="Refresh" content=\'0; url=' . $rootpath . '/PrintCustTransPortrait.php?FromTransNo=' . $_POST['TransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] . '&Email=' . $_POST['EmailAddr'] . '">';
prnMsg(_('The transaction should have been emailed off. If this does not happen (perhaps the browser does not support META Refresh)') . '<a href="' . $rootpath . '/PrintCustTransPortrait.php?FromTransNo=' . $_POST['FromTransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] . '&Email=' . $_POST['EmailAddr'] . '">' . _('click here') . '</a> ' . _('to email the customer transaction'), 'success');
}
exit;
} elseif (isset($_POST['DoIt'])) {
$_GET['InvOrCredit'] = $_POST['InvOrCredit'];
$_GET['FromTransNo'] = $_POST['FromTransNo'];
prnMsg(_('The email address does not appear to be a valid email address. The transaction was not emailed'), 'warn');
}
include 'includes/header.inc';
echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/email.gif" title="' . _('Contract') . '" alt="" /> ' . $title . '</p>';
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
示例14: elseif
} elseif (strlen($_POST['X_PageLength']) > 3 || !is_numeric($_POST['X_PageLength']) || $_POST['X_PageLength'] < 1) {
$InputError = 1;
prnMsg(_('Lines per page must be greater than 1'), 'error');
} elseif (strlen($_POST['X_MonthsAuditTrail']) > 2 || !is_numeric($_POST['X_MonthsAuditTrail']) || $_POST['X_MonthsAuditTrail'] < 0) {
$InputError = 1;
prnMsg(_('The number of months of audit trail to keep must be zero or a positive number less than 100 months'), 'error');
} elseif (strlen($_POST['X_DefaultTaxCategory']) > 1 || !is_numeric($_POST['X_DefaultTaxCategory']) || $_POST['X_DefaultTaxCategory'] < 1) {
$InputError = 1;
prnMsg(_('DefaultTaxCategory must be between 1 and 9'), 'error');
} elseif (strlen($_POST['X_DefaultDisplayRecordsMax']) > 3 || !is_numeric($_POST['X_DefaultDisplayRecordsMax']) || $_POST['X_DefaultDisplayRecordsMax'] < 1) {
$InputError = 1;
prnMsg(_('Default maximum number of records to display must be between 1 and 500'), 'error');
} elseif (strlen($_POST['X_MaxImageSize']) > 3 || !is_numeric($_POST['X_MaxImageSize']) || $_POST['X_MaxImageSize'] < 1) {
$InputError = 1;
prnMsg(_('The maximum size of item image files must be between 50 and 500 (NB this figure refers to KB)'), 'error');
} elseif (!IsEmailAddress($_POST['X_FactoryManagerEmail'])) {
$InputError = 1;
prnMsg(_('The Factory Manager Email address does not appear to be valid'), 'error');
} elseif (strlen($_POST['X_FrequentlyOrderedItems']) > 2 || !is_numeric($_POST['X_FrequentlyOrderedItems'])) {
$InputError = 1;
prnMsg(_('The number of frequently ordered items to display must be numeric'), 'error');
}
if ($InputError != 1) {
$sql = array();
if ($_SESSION['DefaultDateFormat'] != $_POST['X_DefaultDateFormat']) {
$sql[] = "UPDATE config SET confvalue = '" . $_POST['X_DefaultDateFormat'] . "' WHERE confname = 'DefaultDateFormat'";
}
if ($_SESSION['DefaultTheme'] != $_POST['X_DefaultTheme']) {
$sql[] = "UPDATE config SET confvalue = '" . $_POST['X_DefaultTheme'] . "' WHERE confname = 'DefaultTheme'";
}
if ($_SESSION['PastDueDays1'] != $_POST['X_PastDueDays1']) {
示例15: elseif
} elseif (mb_strlen($_POST['X_DefaultTaxCategory']) > 1 or !is_numeric($_POST['X_DefaultTaxCategory']) or $_POST['X_DefaultTaxCategory'] < 1) {
$InputError = 1;
prnMsg(_('DefaultTaxCategory must be between 1 and 9'), 'error');
} elseif (mb_strlen($_POST['X_DefaultDisplayRecordsMax']) > 3 or !is_numeric($_POST['X_DefaultDisplayRecordsMax']) or $_POST['X_DefaultDisplayRecordsMax'] < 1) {
$InputError = 1;
prnMsg(_('Default maximum number of records to display must be between 1 and 500'), 'error');
} elseif (mb_strlen($_POST['X_MaxImageSize']) > 3 or !is_numeric($_POST['X_MaxImageSize']) or $_POST['X_MaxImageSize'] < 1) {
$InputError = 1;
prnMsg(_('The maximum size of item image files must be between 50 and 500 (NB this figure refers to KB)'), 'error');
} elseif (!IsEmailAddress($_POST['X_FactoryManagerEmail'])) {
$InputError = 1;
prnMsg(_('The Factory Manager Email address does not appear to be valid'), 'error');
} elseif (!IsEmailAddress($_POST['X_PurchasingManagerEmail'])) {
$InputError = 1;
prnMsg(_('The Purchasing Manager Email address does not appear to be valid'), 'error');
} elseif (!IsEmailAddress($_POST['X_InventoryManagerEmail']) and $_POST['X_InventoryManagerEmail'] != '') {
$InputError = 1;
prnMsg(_('The Inventory Manager Email address does not appear to be valid'), 'error');
} elseif (mb_strlen($_POST['X_FrequentlyOrderedItems']) > 2 or !is_numeric($_POST['X_FrequentlyOrderedItems'])) {
$InputError = 1;
prnMsg(_('The number of frequently ordered items to display must be numeric'), 'error');
} elseif (strlen($_POST['X_SmtpSetting']) != 1 or !is_numeric($_POST['X_SmtpSetting'])) {
$InputError = 1;
prnMsg(_('The SMTP setting should be selected as Yes or No'), 'error');
} elseif (strlen($_POST['X_QualityLogSamples']) != 1 or !is_numeric($_POST['X_QualityLogSamples'])) {
$InputError = 1;
prnMsg(_('The Quality Log Samples setting should be selected as Yes or No'), 'error');
} elseif (mb_strstr($_POST['X_QualityProdSpecText'], "'") or mb_strlen($_POST['X_QualityProdSpecText']) > 5000) {
$InputError = 1;
prnMsg(_('The Quality ProdSpec Text may not contain single quotes and may not be longer than 5000 chars'), 'error');
} elseif (mb_strstr($_POST['X_QualityCOAText'], "'") or mb_strlen($_POST['X_QualityCOAText']) > 5000) {