本文整理汇总了PHP中set_focus函数的典型用法代码示例。如果您正苦于以下问题:PHP set_focus函数的具体用法?PHP set_focus怎么用?PHP set_focus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_focus函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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;
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:29,代码来源:change_current_user_password.php
示例2: on_submit
function on_submit($selected_parent, $selected_component = -1)
{
if (!check_num('quantity', 0)) {
display_error(_("The quantity entered must be numeric and greater than zero."));
set_focus('quantity');
return;
}
if ($selected_component != -1) {
update_bom($selected_parent, $selected_component, $_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."));
}
}
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:bom_edit.php
示例3: handle_submit
function handle_submit()
{
global $selected_id, $Mode;
$ok = true;
if ($selected_id != -1) {
// make from_date start of month and to_date a year minus one day later
$_POST['from_date'] = start_month($_POST['from_date']);
$_POST['to_date'] = end_month(add_months($_POST['from_date'], 11));
if ($_POST['closed'] == 1) {
if (check_years_before($_POST['from_date'], false)) {
display_error(_("Cannot CLOSE this year because there are open fiscal years before"));
set_focus('closed');
return false;
}
$ok = close_year($selected_id);
} else {
open_year($selected_id);
}
if ($ok) {
update_fiscalyear($selected_id, $_POST['from_date'], $_POST['to_date'], $_POST['closed']);
display_notification(_('Selected fiscal year has been updated'));
}
} else {
if (!check_data()) {
return false;
}
add_fiscalyear($_POST['from_date'], $_POST['to_date'], $_POST['closed']);
display_notification(_('New fiscal year has been added'));
}
$Mode = 'RESET';
}
开发者ID:PaulShipley,项目名称:FrontAccounting,代码行数:31,代码来源:fiscalyears.php
示例4: 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;
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:29,代码来源:customers.php
示例5: can_process
function can_process()
{
if (!is_date($_POST['CreditDate'])) {
display_error(tr("The entered date is invalid."));
set_focus('CreditDate');
return false;
} elseif (!is_date_in_fiscalyear($_POST['CreditDate'])) {
display_error(tr("The entered date is not in fiscal year."));
set_focus('CreditDate');
return false;
}
if ($_SESSION['Items']->trans_no == 0) {
if (!references::is_valid($_POST['ref'])) {
display_error(tr("You must enter a reference."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], 11)) {
display_error(tr("The entered reference is already in use."));
set_focus('ref');
return false;
}
}
if (!check_num('ChargeFreightCost', 0)) {
display_error(tr("The entered shipping cost is invalid or less than zero."));
set_focus('ChargeFreightCost');
return false;
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:30,代码来源:customer_credit_invoice.php
示例6: can_process
function can_process()
{
if (strlen($_POST['fname']) == 0) {
display_error(_("First name cannot be empty."));
set_focus('code');
return false;
}
if (strlen($_POST['lname']) == 0) {
display_error(_("Last name cannot be empty."));
set_focus('code');
return false;
}
if (strlen($_POST['address']) == 0) {
display_error(_("Address cannot be empty."));
set_focus('code');
return false;
}
if (strlen($_POST['contact_number']) == 0) {
display_error(_("Contact number cannot be empty."));
set_focus('code');
return false;
}
if (strlen($_POST['email_address']) == 0) {
display_error(_("Email address cannot be empty."));
set_focus('code');
return false;
}
return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:29,代码来源:author.php
示例7: 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;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:30,代码来源:customer_allocate.php
示例8: check_data
function check_data()
{
global $Refs;
if (!is_date($_POST['date'])) {
display_error(_("The entered date is invalid."));
set_focus('date');
return false;
}
if (!is_date_in_fiscalyear($_POST['date'])) {
display_error(_("The entered date is not in fiscal year."));
set_focus('date');
return false;
}
if (!$Refs->is_valid($_POST['ref'])) {
display_error(_("You must enter a reference."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], ST_JOURNAL)) {
display_error(_("The entered reference is already in use."));
set_focus('ref');
return false;
}
return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:25,代码来源:revaluate_currencies.php
示例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;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:30,代码来源:gl_setup.php
示例10: 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;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:31,代码来源:supplier_invoice_grns.php
示例11: on_submit
function on_submit($selected_parent, $selected_component = null)
{
if (!check_num('quantity', 0)) {
display_error(tr("The quantity entered must be numeric and greater than zero."));
set_focus('quantity');
return;
}
if (isset($selected_parent) && isset($selected_component)) {
$sql = "UPDATE bom SET workcentre_added='" . $_POST['workcentre_added'] . "',\n\t\t\tloc_code='" . $_POST['loc_code'] . "',\n\t\t\tquantity= " . input_num('quantity') . "\n\t\t\tWHERE parent='" . $selected_parent . "'\n\t\t\tAND id='" . $selected_component . "'";
check_db_error("Could not update this bom component", $sql);
db_query($sql, "could not update bom");
} elseif (!isset($selected_component) && isset($selected_parent)) {
/*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 */
$sql = "SELECT component FROM bom\n\t\t\t\tWHERE parent='{$selected_parent}'\n\t\t\t\tAND component='" . $_POST['component'] . "'\n\t\t\t\tAND workcentre_added='" . $_POST['workcentre_added'] . "'\n\t\t\t\tAND loc_code='" . $_POST['loc_code'] . "'";
$result = db_query($sql, "check failed");
if (db_num_rows($result) == 0) {
$sql = "INSERT INTO bom (parent, component, workcentre_added, loc_code, quantity)\n\t\t\t\t\tVALUES ('{$selected_parent}', '" . $_POST['component'] . "', '" . $_POST['workcentre_added'] . "', '" . $_POST['loc_code'] . "', " . input_num('quantity') . ")";
db_query($sql, "check failed");
//$msg = tr("A new component part has been added to the bill of material for this item.");
} else {
/*The component must already be on the bom */
display_error(tr("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(tr("The selected component is a parent of the current item. Recursive BOMs are not allowed."));
}
}
}
开发者ID:ravenii,项目名称:guardocs,代码行数:33,代码来源:bom_edit.php
示例12: can_process
function can_process($selected_id)
{
if (strlen(trim($_POST['id'])) == 0) {
display_error(_("The account group id cannot be empty."));
set_focus('id');
return false;
}
if (strlen(trim($_POST['name'])) == 0) {
display_error(_("The account group name cannot be empty."));
set_focus('name');
return false;
}
$type = get_account_type(trim($_POST['id']));
if ($type && $type['id'] != $selected_id) {
display_error(_("This account group id is already in use."));
set_focus('id');
return false;
}
//if (strcmp($_POST['id'], $_POST['parent']) == 0)
if ($_POST['id'] === $_POST['parent']) {
display_error(_("You cannot set an account group to be a subgroup of itself."));
return false;
}
return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:25,代码来源:gl_account_types.php
示例13: update_component
function update_component($kit_code, $selected_item)
{
global $Mode, $Ajax, $selected_kit;
if (!check_num('quantity', 0)) {
display_error(_("The quantity entered must be numeric and greater than zero."));
set_focus('quantity');
return;
} elseif ($_POST['description'] == '') {
display_error(_("Item code description cannot be empty."));
set_focus('description');
return;
} elseif ($selected_item == -1) {
if (get_post('item_code') == '') {
// New kit/alias definition
$kit = get_item_kit($_POST['kit_code']);
if (db_num_rows($kit)) {
$input_error = 1;
display_error(_("This item code is already assigned to stock item or sale kit."));
set_focus('kit_code');
return;
}
if (get_post('kit_code') == '') {
display_error(_("Kit/alias code cannot be empty."));
set_focus('kit_code');
return;
}
}
}
if (check_item_in_kit($selected_item, $kit_code, $_POST['component'], true)) {
display_error(_("The selected component contains directly or on any lower level the kit under edition. Recursive kits are not allowed."));
set_focus('component');
return;
}
/*Now check to see that the component is not already in the kit */
if (check_item_in_kit($selected_item, $kit_code, $_POST['component'])) {
display_error(_("The selected component is already in this kit. You can modify it's quantity but it cannot appear more than once in the same kit."));
set_focus('component');
return;
}
if ($selected_item == -1) {
// new item alias/kit
if ($_POST['item_code'] == '') {
$kit_code = $_POST['kit_code'];
$selected_kit = $_POST['item_code'] = $kit_code;
$msg = _("New alias code has been created.");
} else {
$msg = _("New component has been added to selected kit.");
}
add_item_code($kit_code, get_post('component'), get_post('description'), get_post('category'), input_num('quantity'), 0);
display_notification($msg);
} else {
$props = get_kit_props($_POST['item_code']);
update_item_code($selected_item, $kit_code, get_post('component'), $props['description'], $props['category_id'], input_num('quantity'), 0);
display_notification(_("Component of selected kit has been updated."));
}
$Mode = 'RESET';
$Ajax->activate('_page_body');
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:58,代码来源:sales_kits.php
示例14: can_process
function can_process()
{
if (strlen($_POST['name']) == 0) {
display_error(tr("The account class name cannot be empty."));
set_focus('name');
return false;
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:9,代码来源:gl_account_classes.php
示例15: can_process
function can_process()
{
if (strlen($_POST['royalty_percentage']) == 0) {
display_error(_("Percentage cannot be empty."));
set_focus('royalty_percentage');
return false;
}
return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:9,代码来源:royalty_author.php
示例16: check_date
function check_date()
{
if (!is_date(get_post('reconcile_date'))) {
display_error(_("Invalid reconcile date format"));
set_focus('reconcile_date');
return false;
}
return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:9,代码来源:bank_account_reconcile.php
示例17: can_process
function can_process()
{
if ($_POST['typeId'] == '') {
display_error(_("Please select a category"));
set_focus('typeId');
return false;
}
return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:9,代码来源:subsidiary_ledger_2.php
示例18: can_process
function can_process()
{
if (strlen($_POST['name']) == 0) {
display_error(tr("The tax type name cannot be empty."));
set_focus('name');
return false;
} elseif (!check_num('rate', 0)) {
display_error(tr("The default tax rate must be numeric and not less than zero."));
set_focus('rate');
return false;
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:13,代码来源:tax_types.php
示例19: check_data
function check_data()
{
if (!check_num('This_QuantityCredited', 0)) {
display_error(tr("The quantity to credit must be numeric and greater than zero."));
set_focus('This_QuantityCredited');
return false;
}
if (!check_num('ChgPrice', 0)) {
display_error(tr("The price is either not numeric or negative."));
set_focus('ChgPrice');
return false;
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:14,代码来源:supplier_credit_grns.php
示例20: can_process
function can_process()
{
if (strlen($_POST['sales_type']) == 0) {
display_error(_("The sales type description cannot be empty."));
set_focus('sales_type');
return false;
}
if (!check_num('factor', 0)) {
display_error(_("Calculation factor must be valid positive number."));
set_focus('factor');
return false;
}
return true;
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:14,代码来源:sales_types.php
注:本文中的set_focus函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论