• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP key_in_foreign_table函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中key_in_foreign_table函数的典型用法代码示例。如果您正苦于以下问题:PHP key_in_foreign_table函数的具体用法?PHP key_in_foreign_table怎么用?PHP key_in_foreign_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了key_in_foreign_table函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: 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;
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:25,代码来源:currencies.php


示例2: can_delete

function can_delete($selected_id)
{
    if (key_in_foreign_table($selected_id, 'tax_group_items', 'tax_type_id')) {
        display_error(_("Cannot delete this tax type because tax groups been created referring to it."));
        return false;
    }
    return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:8,代码来源:tax_types.php


示例3: check_delete

function check_delete($name)
{
    // check if selected profile is used by any user
    if ($name == '') {
        return 0;
    }
    // cannot delete system default profile
    return key_in_foreign_table($name, 'users', 'print_profile');
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:9,代码来源:print_profiles.php


示例4: can_delete

function can_delete($selected_id)
{
    if ($selected_id == "") {
        return false;
    }
    if (key_in_foreign_table($selected_id, 'chart_types', 'class_id')) {
        display_error(_("Cannot delete this account class because GL account types have been created referring to it."));
        return false;
    }
    return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:11,代码来源:gl_account_classes.php


示例5: can_delete

function can_delete($selected_id)
{
    if (key_in_foreign_table($selected_id, 'stock_master', 'tax_type_id')) {
        display_error(_("Cannot delete this item tax type because items have been created referring to it."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'stock_category', 'dflt_tax_type')) {
        display_error(_("Cannot delete this item tax type because item categories have been created referring to it."));
        return false;
    }
    return true;
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:12,代码来源:item_tax_types.php


示例6: can_delete

function can_delete($selected_id)
{
    if ($selected_id == -1) {
        return false;
    }
    if (key_in_foreign_table($selected_id, 'cust_branch', 'tax_group_id')) {
        display_error(_("Cannot delete this tax group because customer branches been created referring to it."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'suppliers', 'tax_group_id')) {
        display_error(_("Cannot delete this tax group because suppliers been created referring to it."));
        return false;
    }
    return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:15,代码来源:tax_groups.php


示例7: can_delete

function can_delete($type)
{
    if ($type == "") {
        return false;
    }
    if (key_in_foreign_table($type, 'chart_master', 'account_type')) {
        display_error(_("Cannot delete this account group because GL accounts have been created referring to it."));
        return false;
    }
    if (key_in_foreign_table($type, 'chart_types', 'parent')) {
        display_error(_("Cannot delete this account group because GL account groups have been created referring to it."));
        return false;
    }
    return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:15,代码来源:gl_account_types.php


示例8: can_delete

function can_delete($selected_account)
{
    if ($selected_account == "") {
        return false;
    }
    if (key_in_foreign_table($selected_account, 'gl_trans', 'account')) {
        display_error(_("Cannot delete this account because transactions have been created using this account."));
        return false;
    }
    if (gl_account_in_company_defaults($selected_account)) {
        display_error(_("Cannot delete this account because it is used as one of the company default GL accounts."));
        return false;
    }
    if (key_in_foreign_table($selected_account, 'bank_accounts', 'account_code')) {
        display_error(_("Cannot delete this account because it is used by a bank account."));
        return false;
    }
    if (gl_account_in_stock_category($selected_account)) {
        display_error(_("Cannot delete this account because it is used by one or more Item Categories."));
        return false;
    }
    if (gl_account_in_stock_master($selected_account)) {
        display_error(_("Cannot delete this account because it is used by one or more Items."));
        return false;
    }
    if (gl_account_in_tax_types($selected_account)) {
        display_error(_("Cannot delete this account because it is used by one or more Taxes."));
        return false;
    }
    if (gl_account_in_cust_branch($selected_account)) {
        display_error(_("Cannot delete this account because it is used by one or more Customer Branches."));
        return false;
    }
    if (gl_account_in_suppliers($selected_account)) {
        display_error(_("Cannot delete this account because it is used by one or more suppliers."));
        return false;
    }
    if (gl_account_in_quick_entry_lines($selected_account)) {
        display_error(_("Cannot delete this account because it is used by one or more Quick Entry Lines."));
        return false;
    }
    return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:43,代码来源:gl_accounts.php


示例9: can_delete

function can_delete($selected_id)
{
    if (key_in_foreign_table($selected_id, 'stock_moves', 'loc_code')) {
        display_error(_("Cannot delete this location because item movements have been created using this location."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'workorders', 'loc_code')) {
        display_error(_("Cannot delete this location because it is used by some work orders records."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'cust_branch', 'default_location')) {
        display_error(_("Cannot delete this location because it is used by some branch records as the default location to deliver from."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'bom', 'loc_code')) {
        display_error(_("Cannot delete this location because it is used by some related records in other tables."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'grn_batch', 'loc_code')) {
        display_error(_("Cannot delete this location because it is used by some related records in other tables."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'purch_orders', 'into_stock_location')) {
        display_error(_("Cannot delete this location because it is used by some related records in other tables."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'sales_orders', 'from_stk_loc')) {
        display_error(_("Cannot delete this location because it is used by some related records in other tables."));
        return false;
    }
    if (key_in_foreign_table($selected_id, 'sales_pos', 'pos_location')) {
        display_error(_("Cannot delete this location because it is used by some related records in other tables."));
        return false;
    }
    return true;
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:36,代码来源:locations.php


示例10: update_crm_category

    }
    if ($input_error != 1) {
        if ($selected_id != -1) {
            update_crm_category($selected_id, get_post('type'), get_post('subtype'), get_post('name'), get_post('description'));
            $note = _('Selected contact category has been updated');
        } else {
            add_crm_category(get_post('type'), get_post('subtype'), get_post('name'), get_post('description'));
            $note = _('New contact category has been added');
        }
        display_notification($note);
        $Mode = 'RESET';
    }
}
if ($Mode == 'Delete') {
    $cancel_delete = 0;
    if (key_in_foreign_table($selected_id, 'crm_relations', 'category_id')) {
        $cancel_delete = 1;
        display_error(_("Cannot delete this category because there are contacts related to it."));
    }
    if ($cancel_delete == 0) {
        delete_crm_category($selected_id);
        display_notification(_('Category has been deleted'));
    }
    $Mode = 'RESET';
}
if ($Mode == 'RESET') {
    $selected_id = -1;
    $sav = get_post('show_inactive');
    unset($_POST);
    $_POST['show_inactive'] = $sav;
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:crm_categories.php


示例11: update_shipper

}
//----------------------------------------------------------------------------------------------
if ($Mode == 'UPDATE_ITEM' && can_process()) {
    update_shipper($selected_id, $_POST['shipper_name'], $_POST['contact'], $_POST['phone'], $_POST['phone2'], $_POST['address']);
    display_notification(_('Selected shipping company has been updated'));
    $Mode = 'RESET';
}
//----------------------------------------------------------------------------------------------
if ($Mode == 'Delete') {
    // PREVENT DELETES IF DEPENDENT RECORDS IN 'sales_orders'
    if (key_in_foreign_table($selected_id, 'sales_orders', 'ship_via')) {
        $cancel_delete = 1;
        display_error(_("Cannot delete this shipping company because sales orders have been created using this shipper."));
    } else {
        // PREVENT DELETES IF DEPENDENT RECORDS IN 'debtor_trans'
        if (key_in_foreign_table($selected_id, 'debtor_trans', 'ship_via')) {
            $cancel_delete = 1;
            display_error(_("Cannot delete this shipping company because invoices have been created using this shipping company."));
        } else {
            delete_shipper($selected_id);
            display_notification(_('Selected shipping company has been deleted'));
        }
    }
    $Mode = 'RESET';
}
if ($Mode == 'RESET') {
    $selected_id = -1;
    $sav = get_post('show_inactive');
    unset($_POST);
    $_POST['show_inactive'] = $sav;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:shipping_companies.php


示例12: display_notification_centered

            display_notification_centered(_("The selected user has been updated."));
        } else {
            add_user($_POST['user_id'], $_POST['real_name'], md5($_POST['password']), $_POST['phone'], $_POST['email'], $_POST['role_id'], $_POST['language'], $_POST['print_profile'], check_value('rep_popup'), $_POST['pos']);
            $id = db_insert_id();
            // use current user display preferences as start point for new user
            $prefs = $_SESSION['wa_current_user']->prefs->get_all();
            update_user_prefs($id, array_merge($prefs, get_post(array('print_profile', 'rep_popup' => 0, 'language'))));
            display_notification_centered(_("A new user has been added."));
        }
        $Mode = 'RESET';
    }
}
//-------------------------------------------------------------------------------------------------
if ($Mode == 'Delete' && check_csrf_token()) {
    $cancel_delete = 0;
    if (key_in_foreign_table($selected_id, 'audit_trail', 'user')) {
        $cancel_delete = 1;
        display_error(_("Cannot delete this user because entries are associated with this user."));
    }
    if ($cancel_delete == 0) {
        delete_user($selected_id);
        display_notification_centered(_("User has been deleted."));
    }
    //end if Delete group
    $Mode = 'RESET';
}
//-------------------------------------------------------------------------------------------------
if ($Mode == 'RESET') {
    $selected_id = -1;
    $sav = get_post('show_inactive', null);
    unset($_POST);
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:users.php


示例13: add_salesman

        } else {
            /*Selected group is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new Sales-person form */
            add_salesman($_POST['salesman_name'], $_POST['salesman_phone'], $_POST['salesman_fax'], $_POST['salesman_email'], input_num('provision'), input_num('break_pt'), input_num('provision2'));
        }
        if ($selected_id != -1) {
            display_notification(_('Selected sales person data have been updated'));
        } else {
            display_notification(_('New sales person data have been added'));
        }
        $Mode = 'RESET';
    }
}
if ($Mode == 'Delete') {
    //the link to delete a selected record was clicked instead of the submit button
    // PREVENT DELETES IF DEPENDENT RECORDS IN 'debtors_master'
    if (key_in_foreign_table($selected_id, 'cust_branch', 'salesman')) {
        display_error(_("Cannot delete this sales-person because branches are set up referring to this sales-person - first alter the branches concerned."));
    } else {
        delete_salesman($selected_id);
        display_notification(_('Selected sales person data have been deleted'));
    }
    $Mode = 'RESET';
}
if ($Mode == 'RESET') {
    $selected_id = -1;
    $sav = get_post('show_inactive');
    unset($_POST);
    $_POST['show_inactive'] = $sav;
}
//------------------------------------------------------------------------------------------------
$result = get_salesmen(check_value('show_inactive'));
开发者ID:M-Shahbaz,项目名称:FA,代码行数:31,代码来源:sales_people.php


示例14: _

            $note = _('Selected payment terms have been updated');
        } else {
            add_payment_terms($from_now, $_POST['terms'], $days);
            $note = _('New payment terms have been added');
        }
        //run the sql from either of the above possibilites
        display_notification($note);
        $Mode = 'RESET';
    }
}
if ($Mode == 'Delete') {
    // PREVENT DELETES IF DEPENDENT RECORDS IN debtors_master
    if (key_in_foreign_table($selected_id, 'debtors_master', 'payment_terms')) {
        display_error(_("Cannot delete this payment term, because customer accounts have been created referring to this term."));
    } else {
        if (key_in_foreign_table($selected_id, 'suppliers', 'payment_terms')) {
            display_error(_("Cannot delete this payment term, because supplier accounts have been created referring to this term"));
        } else {
            //only delete if used in neither customer or supplier accounts
            delete_payment_terms($selected_id);
            display_notification(_('Selected payment terms have been deleted'));
        }
    }
    //end if payment terms used in customer or supplier accounts
    $Mode = 'RESET';
}
if ($Mode == 'RESET') {
    $selected_id = -1;
    $sav = get_post('show_inactive');
    unset($_POST);
    $_POST['show_inactive'] = $sav;
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:payment_terms.php


示例15: supplier_settings

function supplier_settings(&$supplier_id)
{
    start_outer_table(TABLESTYLE2);
    table_section(1);
    if ($supplier_id) {
        //SupplierID exists - either passed when calling the form or from the form itself
        $myrow = get_supplier($_POST['supplier_id']);
        $_POST['supp_name'] = $myrow["supp_name"];
        $_POST['supp_ref'] = $myrow["supp_ref"];
        $_POST['address'] = $myrow["address"];
        $_POST['supp_address'] = $myrow["supp_address"];
        $_POST['gst_no'] = $myrow["gst_no"];
        $_POST['website'] = $myrow["website"];
        $_POST['supp_account_no'] = $myrow["supp_account_no"];
        $_POST['bank_account'] = $myrow["bank_account"];
        $_POST['dimension_id'] = $myrow["dimension_id"];
        $_POST['dimension2_id'] = $myrow["dimension2_id"];
        $_POST['curr_code'] = $myrow["curr_code"];
        $_POST['payment_terms'] = $myrow["payment_terms"];
        $_POST['credit_limit'] = price_format($myrow["credit_limit"]);
        $_POST['tax_group_id'] = $myrow["tax_group_id"];
        $_POST['tax_included'] = $myrow["tax_included"];
        $_POST['payable_account'] = $myrow["payable_account"];
        $_POST['purchase_account'] = $myrow["purchase_account"];
        $_POST['payment_discount_account'] = $myrow["payment_discount_account"];
        $_POST['notes'] = $myrow["notes"];
        $_POST['inactive'] = $myrow["inactive"];
    } else {
        $_POST['supp_name'] = $_POST['supp_ref'] = $_POST['address'] = $_POST['supp_address'] = $_POST['tax_group_id'] = $_POST['website'] = $_POST['supp_account_no'] = $_POST['notes'] = '';
        $_POST['dimension_id'] = 0;
        $_POST['dimension2_id'] = 0;
        $_POST['tax_included'] = 0;
        $_POST['sales_type'] = -1;
        $_POST['gst_no'] = $_POST['bank_account'] = '';
        $_POST['payment_terms'] = '';
        $_POST['credit_limit'] = price_format(0);
        $company_record = get_company_prefs();
        $_POST['curr_code'] = $company_record["curr_default"];
        $_POST['payable_account'] = $company_record["creditors_act"];
        $_POST['purchase_account'] = '';
        // default/item's cogs account
        $_POST['payment_discount_account'] = $company_record['pyt_discount_act'];
    }
    table_section_title(_("Basic Data"));
    text_row(_("Supplier Name:"), 'supp_name', null, 42, 40);
    text_row(_("Supplier Short Name:"), 'supp_ref', null, 30, 30);
    text_row(_("GSTNo:"), 'gst_no', null, 42, 40);
    link_row(_("Website:"), 'website', null, 35, 55);
    if ($supplier_id && !is_new_supplier($supplier_id) && (key_in_foreign_table($_POST['supplier_id'], 'supp_trans', 'supplier_id') || key_in_foreign_table($_POST['supplier_id'], 'purch_orders', 'supplier_id'))) {
        label_row(_("Supplier's Currency:"), $_POST['curr_code']);
        hidden('curr_code', $_POST['curr_code']);
    } else {
        currencies_list_row(_("Supplier's Currency:"), 'curr_code', null);
    }
    tax_groups_list_row(_("Tax Group:"), 'tax_group_id', null);
    text_row(_("Our Customer No:"), 'supp_account_no', null, 42, 40);
    table_section_title(_("Purchasing"));
    text_row(_("Bank Name/Account:"), 'bank_account', null, 42, 40);
    amount_row(_("Credit Limit:"), 'credit_limit', null);
    payment_terms_list_row(_("Payment Terms:"), 'payment_terms', null);
    //
    // tax_included option from supplier record is used directly in update_average_cost() function,
    // therefore we can't edit the option after any transaction waas done for the supplier.
    //
    if (is_new_supplier($supplier_id)) {
        check_row(_("Prices contain tax included:"), 'tax_included');
    } else {
        hidden('tax_included');
        label_row(_("Prices contain tax included:"), $_POST['tax_included'] ? _('Yes') : _('No'));
    }
    table_section_title(_("Accounts"));
    gl_all_accounts_list_row(_("Accounts Payable Account:"), 'payable_account', $_POST['payable_account']);
    gl_all_accounts_list_row(_("Purchase Account:"), 'purchase_account', $_POST['purchase_account'], false, false, _("Use Item Inventory/COGS Account"));
    gl_all_accounts_list_row(_("Purchase Discount Account:"), 'payment_discount_account', $_POST['payment_discount_account']);
    if (!$supplier_id) {
        table_section_title(_("Contact Data"));
        text_row(_("Phone Number:"), 'phone', null, 32, 30);
        text_row(_("Secondary Phone Number:"), 'phone2', null, 32, 30);
    }
    table_section(2);
    $dim = get_company_pref('use_dimension');
    if ($dim >= 1) {
        table_section_title(_("Dimension"));
        dimensions_list_row(_("Dimension") . " 1:", 'dimension_id', null, true, " ", false, 1);
        if ($dim > 1) {
            dimensions_list_row(_("Dimension") . " 2:", 'dimension2_id', null, true, " ", false, 2);
        }
    }
    if ($dim < 1) {
        hidden('dimension_id', 0);
    }
    if ($dim < 2) {
        hidden('dimension2_id', 0);
    }
    table_section_title(_("Addresses"));
    textarea_row(_("Mailing Address:"), 'address', null, 35, 5);
    textarea_row(_("Physical Address:"), 'supp_address', null, 35, 5);
    table_section_title(_("General"));
    textarea_row(_("General Notes:"), 'notes', null, 35, 5);
    if ($supplier_id) {
//.........这里部分代码省略.........
开发者ID:M-Shahbaz,项目名称:FA,代码行数:101,代码来源:suppliers.php


示例16: update_sales_area

    if ($input_error != 1) {
        if ($selected_id != -1) {
            update_sales_area($selected_id, $_POST['description']);
            $note = _('Selected sales area has been updated');
        } else {
            add_sales_area($_POST['description']);
            $note = _('New sales area has been added');
        }
        display_notification($note);
        $Mode = 'RESET';
    }
}
if ($Mode == 'Delete') {
    $cancel_delete = 0;
    // PREVENT DELETES IF DEPENDENT RECORDS IN 'debtors_master'
    if (key_in_foreign_table($selected_id, 'cust_branch', 'area')) {
        $cancel_delete = 1;
        display_error(_("Cannot delete this area because customer branches have been created using this area."));
    }
    if ($cancel_delete == 0) {
        delete_sales_area($selected_id);
        display_notification(_('Selected sales area has been deleted'));
    }
    //end if Delete area
    $Mode = 'RESET';
}
if ($Mode == 'RESET') {
    $selected_id = -1;
    $sav = get_post('show_inactive');
    unset($_POST);
    $_POST['show_inactive'] = $sav;
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:sales_areas.php


示例17: add_crm_person

            add_crm_person($_POST['supp_ref'], $_POST['contact'], '', $_POST['address'], $_POST['phone'], $_POST['phone2'], $_POST['fax'], $_POST['email'], $_POST['rep_lang'], '');
            add_crm_contact('supplier', 'general', $supplier_id, db_insert_id());
            display_notification(_("A new supplier has been added."));
            $Ajax->activate('_page_body');
        }
        commit_transaction();
    }
} elseif (isset($_POST['delete']) && $_POST['delete'] != "") {
    //the link to delete a selected record was clicked instead of the submit button
    $cancel_delete = 0;
    // PREVENT DELETES IF DEPENDENT RECORDS IN 'supp_trans' , purch_orders
    if (key_in_foreign_table($_POST['supplier_id'], 'supp_trans', 'supplier_id')) {
        $cancel_delete = 1;
        display_error(_("Cannot delete this supplier because there are transactions that refer to this supplier."));
    } else {
        if (key_in_foreign_table($_POST['supplier_id'], 'purch_orders', 'supplier_id')) {
            $cancel_delete = 1;
            display_error(_("Cannot delete the supplier record because purchase orders have been created against this supplier."));
        }
    }
    if ($cancel_delete == 0) {
        delete_supplier($_POST['supplier_id']);
        unset($_SESSION['supplier_id']);
        $supplier_id = '';
        $Ajax->activate('_page_body');
    }
    //end if Delete supplier
}
start_form();
if (db_has_suppliers()) {
    start_table(false, "", 3);
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:suppliers.php


示例18: display_notification

    display_notification(_('New sales type has been added'));
    $Mode = 'RESET';
}
//----------------------------------------------------------------------------------------------------
if ($Mode == 'UPDATE_ITEM' && can_process()) {
    update_sales_type($selected_id, $_POST['sales_type'], isset($_POST['tax_included']) ? 1 : 0, input_num('factor'));
    display_notification(_('Selected sales type has been updated'));
    $Mode = 'RESET';
}
//----------------------------------------------------------------------------------------------------
if ($Mode == 'Delete') {
    // PREVENT DELETES IF DEPENDENT RECORDS IN 'debtor_trans'
    if (key_in_foreign_table($selected_id, 'debtor_trans', 'tpe')) {
        display_error(_("Cannot delete this sale type because customer transactions have been created using this sales type."));
    } else {
        if (key_in_foreign_table($selected_id, 'debtors_master', 'sales_type')) {
            display_error(_("Cannot delete this sale type because customers are currently set up to use this sales type."));
        } else {
            delete_sales_type($selected_id);
            display_notification(_('Selected sales type has been deleted'));
        }
    }
    //end if sales type used in debtor transactions or in customers set up
    $Mode = 'RESET';
}
if ($Mode == 'RESET') {
    $selected_id = -1;
    $sav = get_post('show_inactive');
    unset($_POST);
    $_POST['show_inactive'] = $sav;
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:31,代码来源:sales_types.php


示例19: update_item_category

    }
    if ($input_error != 1) {
        if ($selected_id != -1) {
            update_item_category($selected_id, $_POST['description'], $_POST['tax_type_id'], $_POST['sales_account'], $_POST['cogs_account'], $_POST['inventory_account'], $_POST['adjustment_account'], $_POST['assembly_account'], $_POST['units'], $_POST['mb_flag'], $_POST['dim1'], $_POST['dim2'], check_value('no_sale'));
            display_notification(_('Selected item category has been updated'));
        } else {
            add_item_category($_POST['description'], $_POST['tax_type_id'], $_POST['sales_account'], $_POST['cogs_account'], $_POST['inventory_account'], $_POST['adjustment_account'], $_POST['assembly_account'], $_POST['units'], $_POST['mb_flag'], $_POST['dim1'], $_POST['dim2'], check_value('no_sale'));
            display_notification(_('New item category has been added'));
        }
        $Mode = 'RESET';
    }
}
//----------------------------------------------------------------------------------
if ($Mode == 'Delete') {
    // PREVENT DELETES IF DEPENDENT RECORDS IN 'stock_master'
    if (key_in_foreign_table($selected_id, 'stock_master', 'category_id')) {
        display_error(_("Cannot delete this item category because items have been created using this item category."));
    } else {
        delete_item_category($selected_id);
        display_notification(_('Selected item category has been deleted'));
    }
    $Mode = 'RESET';
}
if ($Mode == 'RESET') {
    $selected_id = -1;
    $sav = get_post('show_inactive');
    unset($_POST);
    $_POST['show_inactive'] = $sav;
}
if (list_updated('mb_flag')) {
    $Ajax->activate('details');
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:item_categories.php


示例20: handle_submit

if (isset($_POST['submit'])) {
    handle_submit($selected_id);
}
//--------------------------------------------------------------------------------------------
if (isset($_POST['delete'])) {
    $cancel_delete = 0;
    // PREVENT DELETES IF DEPENDENT RECORDS IN 'debtor_trans'
    if (key_in_foreign_table($selected_id, 'debtor_trans', 'debtor_no')) {
        $cancel_delete = 1;
        display_error(_("This customer cannot be deleted because there are transactions that refer to it."));
    } else {
        if (key_in_foreign_table($selected_id, 'sales_orders', 'debtor_no')) {
            $cancel_delete = 1;
            display_error(_("Cannot delete the customer record because orders have been created against it."));
        } else {
            if (key_in_foreign_table($selected_id, 'cust_branch', 'debtor_no')) {
                $cancel_delete = 1;
                display_error(_("Cannot delete this customer because there are branch records set up against it."));
                //echo "<br> There are " . $myrow[0] . " branch records relating to this customer";
            }
        }
    }
    if ($cancel_delete == 0) {
        //ie not cancelled the delete as a result of above tests
        delete_customer($selected_id);
        display_notification(_("Selected customer has been deleted."));
        unset($_POST['customer_id']);
        $selected_id = '';
        $Ajax->activate('_page_body');
    }
    //end if Delete Customer
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:customers.php



注:本文中的key_in_foreign_table函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP key_value函数代码示例发布时间:2022-05-15
下一篇:
PHP key_get函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap