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

PHP gen_db_date函数代码示例

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

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



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

示例1: define

define('JOURNAL_ID', (int) $_GET['jID']);
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/popup_delivery/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'save':
        $i = 1;
        while (true) {
            if (!isset($_POST['eta_date_' . $i])) {
                break;
            }
            if ($_POST['eta_date_' . $i] != '') {
                $new_date = gen_db_date($_POST['eta_date_' . $i]);
                $rID = $_POST['id_' . $i];
                $db->Execute("update " . TABLE_JOURNAL_ITEM . " set date_1 = '" . $new_date . "' where id = " . $rID);
            }
            $i++;
        }
        gen_add_audit_log(ORD_DELIVERY_DATES . TEXT_EDIT, $result->fields['purchase_invoice_id']);
        break;
    default:
}
/*****************   prepare to display templates  *************************/
$gl_type = JOURNAL_ID == 4 || JOURNAL_ID == 6 ? 'poo' : 'soo';
$sql = " select m.purchase_invoice_id, i.id, i.sku, i.qty, i.description, i.date_1 \n\tfrom " . TABLE_JOURNAL_MAIN . " m inner join " . TABLE_JOURNAL_ITEM . " i on m.id = i.ref_id \n\twhere i.ref_id = " . $oID . " and i.gl_type = '" . $gl_type . "'";
$ordr_items = $db->Execute($sql);
$num_items = $ordr_items->RecordCount();
$include_header = false;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例2: validate_user

// +-----------------------------------------------------------------+
//  Path: /modules/zencart/pages/main/pre_process.php
//
$security_level = validate_user(SECURITY_ID_ZENCART_INTERFACE);
/**************  include page specific files    *********************/
gen_pull_language('shipping');
gen_pull_language('inventory');
require_once DIR_FS_MODULES . 'inventory/defaults.php';
require_once DIR_FS_MODULES . 'shipping/defaults.php';
require_once DIR_FS_WORKING . 'functions/zencart.php';
require_once DIR_FS_MODULES . 'inventory/functions/inventory.php';
require_once DIR_FS_WORKING . 'classes/zencart.php';
require_once DIR_FS_WORKING . 'classes/bulk_upload.php';
/**************   page specific initialization  *************************/
$error = false;
$ship_date = $_POST['ship_date'] ? gen_db_date($_POST['ship_date']) : date('Y-m-d');
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_MODULES . 'custom/zencart/pages/main/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'upload':
        $upXML = new zencart();
        $id = db_prepare_input($_POST['rowSeq']);
        if ($upXML->submitXML($id, 'product_ul')) {
            gen_add_audit_log(ZENCART_UPLOAD_PRODUCT, $upXML->sku);
        }
        break;
    case 'bulkupload':
开发者ID:TrinityComputers,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例3: processCSV

 function processCSV($upload_name = '')
 {
     global $coa, $db, $currencies, $messageStack;
     if (!$this->cyberParse($upload_name)) {
         return false;
     }
     // parse the submitted string, check for csv errors
     //echo 'parsed string = '; print_r($this->records); echo '<br />';
     $row_id = 0;
     while ($row_id < count($this->records)) {
         $current_order = $this->records[$row_id];
         // pre-process and check for errors
         if (!in_array($current_order['gl_acct'], $coa) || !in_array($current_order['inv_gl_acct'], $coa)) {
             $messageStack->add(GL_BEG_BAL_ERROR_1 . ($row_id + 1), 'error');
             return false;
         }
         if (!$current_order['order_id']) {
             switch (JOURNAL_ID) {
                 case 6:
                     $messageStack->add(sprintf(GL_BEG_BAL_ERROR_2, $row_id + 1), 'caution');
                     $this->records[$row_id]['waiting'] = 1;
                     break;
                 default:
                     $messageStack->add(GL_BEG_BAL_ERROR_3 . ($row_id + 1), 'error');
                     return false;
             }
         }
         $this->records[$row_id]['post_date'] = gen_db_date($current_order['post_date']);
         // from mm/dd/yyyy to YYYY-MM-DD
         if (!validate_db_date($this->records[$row_id]['post_date'])) {
             $messageStack->add(sprintf(GL_BEG_BAL_ERROR_4, $row_id + 1) . DATE_FORMAT, 'error');
             return false;
         }
         switch (JOURNAL_ID) {
             // total amount is calculated for PO/SOs
             case 6:
             case 12:
                 $this->records[$row_id]['total_amount'] = $currencies->clean_value($current_order['total_amount']);
                 if ($current_order['total_amount'] == 0) {
                     $messageStack->add(GL_BEG_BAL_ERROR_5 . ($row_id + 1), 'caution');
                     $this->records[$row_id]['skip_this_record'] = 1;
                 }
             default:
         }
         // TBD check for duplicate so/po/invoice numbers
         $row_id++;
     }
     if (is_array($this->records)) {
         // *************** START TRANSACTION *************************
         $db->transStart();
         if (!$this->submitJournalEntry()) {
             $db->transRollback();
             if (DEBUG) {
                 $messageStack->write_debug();
             }
             return false;
         }
         $db->transCommit();
         // post the chart of account values
         if (DEBUG) {
             $messageStack->write_debug();
         }
         // *************** END TRANSACTION *************************
     }
     return true;
 }
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:66,代码来源:beg_balances_imp.php


示例4: define

define('JOURNAL_ID', '19');
/**************  include page specific files    *********************/
require_once DIR_FS_MODULES . 'phreebooks/classes/gen_ledger.php';
if (file_exists(DIR_FS_MODULES . 'phreepos/custom/classes/journal/journal_' . JOURNAL_ID . '.php')) {
    require_once DIR_FS_MODULES . 'phreepos/custom/classes/journal/journal_' . JOURNAL_ID . '.php';
} else {
    require_once DIR_FS_MODULES . 'phreepos/classes/journal/journal_' . JOURNAL_ID . '.php';
    // is needed here for the defining of the class and retriving the security_token
}
$class = 'journal_' . JOURNAL_ID;
/**************   page specific initialization  *************************/
define('POPUP_FORM_TYPE', 'pos:rcpt');
$error = false;
history_filter('pos_mgr');
/***************   hook for custom actions  ***************************/
$date = gen_db_date($_REQUEST['search_date']);
$acct_period = $_REQUEST['search_period'];
$oid = isset($_GET['oID']) ? $_GET['oID'] : false;
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/pos_mgr/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'delete':
        $id = db_prepare_input($_POST['rowSeq']);
        if ($id) {
            $delOrd = new $class($id);
            if ($_SESSION['admin_prefs']['restrict_period'] && $delOrd->period != CURRENT_ACCOUNTING_PERIOD) {
                $error = $messageStack->add(ORD_ERROR_DEL_NOT_CUR_PERIOD, 'error');
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例5: validate_user

//
$security_level = validate_user(SECURITY_RMA_MGT);
/**************  include page specific files    *********************/
require_once DIR_FS_WORKING . 'defaults.php';
require_once DIR_FS_MODULES . 'inventory/defaults.php';
/**************   page specific initialization  *************************/
if (!isset($_REQUEST['list'])) {
    $_REQUEST['list'] = 1;
}
$error = false;
$processed = false;
$cInfo = new objectInfo(array());
$creation_date = isset($_POST['creation_date']) ? gen_db_date($_POST['creation_date']) : date('Y-m-d');
$receive_date = isset($_POST['receive_date']) ? gen_db_date($_POST['receive_date']) : '';
$closed_date = isset($_POST['closed_date']) ? gen_db_date($_POST['closed_date']) : '';
$invoice_date = isset($_POST['invoice_date']) ? gen_db_date($_POST['invoice_date']) : '';
history_filter();
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/main/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'save':
        if ($security_level < 2) {
            $messageStack->add_session(ERROR_NO_PERMISSION, 'error');
            gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL'));
            break;
        }
        $id = db_prepare_input($_POST['id']);
开发者ID:TrinityComputers,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例6: foreach

        foreach ($status_fields as $status_field) {
            if (db_prepare_input($_POST[$status_field]) != $status_values->fields[$status_field]) {
                $sequence_array[$status_field] = db_prepare_input($_POST[$status_field]);
                $status_values->fields[$status_field] = $sequence_array[$status_field];
            }
        }
        // post them to the current_status table
        if (sizeof($sequence_array) > 0) {
            $result = db_perform(TABLE_CURRENT_STATUS, $sequence_array, 'update', 'id > 0');
            $messageStack->add(GEN_ADM_TOOLS_POST_SEQ_SUCCESS, 'success');
            gen_add_audit_log(GEN_ADM_TOOLS_AUDIT_LOG_SEQ);
        }
        $default_tab_id = 'tools';
        break;
    case 'clean_security':
        $clean_date = gen_db_date($_POST['clean_date']);
        if (!$clean_date) {
            break;
        }
        $result = $db->Execute("delete from " . TABLE_DATA_SECURITY . " where exp_date < '" . $clean_date . "'");
        $messageStack->add(sprintf(TEXT_CLEAN_SECURITY_SUCCESS, $result->AffectedRows()), 'success');
        break;
    default:
}
/*****************   prepare to display templates  *************************/
// build some general pull down arrays
$sel_yes_no = array(array('id' => '0', 'text' => TEXT_NO), array('id' => '1', 'text' => TEXT_YES));
$sel_transport = array(array('id' => 'PHP', 'text' => 'PHP'), array('id' => 'sendmail', 'text' => 'sendmail'), array('id' => 'sendmail-f', 'text' => 'sendmail-f'), array('id' => 'smtp', 'text' => 'smtp'), array('id' => 'smtpauth', 'text' => 'smtpauth'), array('id' => 'Qmail', 'text' => 'Qmail'));
$sel_linefeed = array(array('id' => 'LF', 'text' => 'LF'), array('id' => 'CRLF', 'text' => 'CRLF'));
$sel_format = array(array('id' => 'TEXT', 'text' => 'TEXT'), array('id' => 'HTML', 'text' => 'HTML'));
$sel_order_lines = array(array('id' => '0', 'text' => TEXT_DOUBLE_MODE), array('id' => '1', 'text' => TEXT_SINGLE_MODE));
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例7: switch

$period = CURRENT_ACCOUNTING_PERIOD;
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/admin_tools/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'update':
        validate_security($security_level, 3);
        // propagate into remaining fiscal years if the last date was changed.
        $fy_array = array();
        $x = 0;
        while (isset($_POST['start_' . $x])) {
            $update_period = db_prepare_input($_POST['per_' . $x]);
            $fy_array = array('start_date' => gen_db_date(db_prepare_input($_POST['start_' . $x])), 'end_date' => gen_db_date(db_prepare_input($_POST['end_' . $x])));
            db_perform(TABLE_ACCOUNTING_PERIODS, $fy_array, 'update', 'period = ' . (int) $update_period);
            $x++;
        }
        // see if there is a disconnect between fiscal years
        $next_period = $update_period + 1;
        $next_start_date = date('Y-m-d', strtotime($fy_array['end_date']) + 60 * 60 * 24);
        $result = $db->Execute("select start_date from " . TABLE_ACCOUNTING_PERIODS . " where period = " . $next_period);
        if ($result->RecordCount() > 0) {
            // next FY exists, check it
            if ($next_start_date != $result->fields['start_date']) {
                $fy_array = array('start_date' => $next_start_date);
                db_perform(TABLE_ACCOUNTING_PERIODS, $fy_array, 'update', 'period = ' . (int) $next_period);
                $messageStack->add(GL_ERROR_FISCAL_YEAR_SEQ, 'caution');
                $fy++;
            }
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例8: gen_db_date

$creation_date = $_POST['creation_date'] ? gen_db_date($_POST['creation_date']) : date('Y-m-d');
history_filter();
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/main/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'save':
        validate_security($security_level, 2);
        $id = db_prepare_input($_POST['rowSeq']);
        // check for errors, process
        // write the data
        if (!$error) {
            $sql_data_array = array('capa_type' => db_prepare_input($_POST['capa_type']), 'requested_by' => db_prepare_input($_POST['requested_by']), 'capa_status' => db_prepare_input($_POST['capa_status']), 'entered_by' => db_prepare_input($_POST['entered_by']), 'creation_date' => $creation_date, 'analyze_due' => $_POST['analyze_due'] ? gen_db_date($_POST['analyze_due']) : '', 'analyze_date' => $_POST['analyze_date'] ? gen_db_date($_POST['analyze_date']) : '', 'repair_due' => $_POST['repair_due'] ? gen_db_date($_POST['repair_due']) : '', 'repair_date' => $_POST['repair_date'] ? gen_db_date($_POST['repair_date']) : '', 'audit_due' => $_POST['audit_due'] ? gen_db_date($_POST['audit_due']) : '', 'audit_date' => $_POST['audit_date'] ? gen_db_date($_POST['audit_date']) : '', 'closed_due' => $_POST['closed_due'] ? gen_db_date($_POST['closed_due']) : '', 'closed_date' => $_POST['closed_date'] ? gen_db_date($_POST['closed_date']) : '', 'action_date' => $_POST['action_date'] ? gen_db_date($_POST['action_date']) : '', 'notes_issue' => db_prepare_input($_POST['notes_issue']), 'customer_name' => db_prepare_input($_POST['customer_name']), 'customer_id' => db_prepare_input($_POST['customer_id']), 'customer_telephone' => db_prepare_input($_POST['customer_telephone']), 'customer_invoice' => db_prepare_input($_POST['customer_invoice']), 'customer_email' => db_prepare_input($_POST['customer_email']), 'notes_customer' => db_prepare_input($_POST['notes_customer']), 'analyze_due_id' => db_prepare_input($_POST['analyze_due_id']), 'analyze_close_id' => db_prepare_input($_POST['analyze_close_id']), 'repair_due_id' => db_prepare_input($_POST['repair_due_id']), 'repair_close_id' => db_prepare_input($_POST['repair_close_id']), 'audit_due_id' => db_prepare_input($_POST['audit_due_id']), 'audit_close_id' => db_prepare_input($_POST['audit_close_id']), 'closed_due_id' => db_prepare_input($_POST['closed_due_id']), 'closed_close_id' => db_prepare_input($_POST['closed_close_id']), 'notes_investigation' => db_prepare_input($_POST['notes_investigation']), 'agreed_by' => db_prepare_input($_POST['agreed_by']), 'notes_action' => db_prepare_input($_POST['notes_action']), 'capa_closed' => db_prepare_input($_POST['capa_closed']), 'next_capa_num' => db_prepare_input($_POST['next_capa_num']), 'notes_audit' => db_prepare_input($_POST['notes_audit']));
            if ($id) {
                if ($success = db_perform(TABLE_CAPA, $sql_data_array, 'update', 'id = ' . $id)) {
                    gen_add_audit_log(CAPA_LOG_USER_UPDATE . $_POST['capa_num']);
                    $capa_num = $_POST['capa_num'];
                } else {
                    $error = true;
                }
            } else {
                // fetch the CAPA number
                $result = $db->Execute("select next_capa_num from " . TABLE_CURRENT_STATUS);
                $capa_num = $result->fields['next_capa_num'];
                $sql_data_array['capa_num'] = $capa_num;
                $success = db_perform(TABLE_CAPA, $sql_data_array, 'insert');
                if ($success) {
                    $id = db_insert_id();
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例9: db_prepare_input

 // customer PO/Ref number
 $order->store_id = db_prepare_input($_POST['store_id']);
 if ($order->store_id == '') {
     $order->store_id = 0;
 }
 $order->description = sprintf(TEXT_JID_ENTRY, constant('ORD_TEXT_' . JOURNAL_ID . '_WINDOW_TITLE'));
 $order->recur_id = db_prepare_input($_POST['recur_id']);
 $order->recur_frequency = db_prepare_input($_POST['recur_frequency']);
 //	$order->sales_tax_auths     = db_prepare_input($_POST['sales_tax_auths']);
 $order->admin_id = $_SESSION['admin_id'];
 $order->rep_id = db_prepare_input($_POST['rep_id']);
 $order->gl_acct_id = db_prepare_input($_POST['gl_acct_id']);
 $order->terms = db_prepare_input($_POST['terms']);
 $order->waiting = JOURNAL_ID == 6 || JOURNAL_ID == 7 ? isset($_POST['waiting']) ? 1 : 0 : ($_POST['waiting'] ? 1 : 0);
 $order->closed = $_POST['closed'] == '1' ? 1 : 0;
 $order->terminal_date = gen_db_date($_POST['terminal_date']);
 $order->item_count = db_prepare_input($_POST['item_count']);
 $order->weight = db_prepare_input($_POST['weight']);
 $order->printed = db_prepare_input($_POST['printed']);
 $order->subtotal = $currencies->clean_value(db_prepare_input($_POST['subtotal']), $order->currencies_code) / $order->currencies_value;
 // don't need unless for verification
 $order->disc_gl_acct_id = db_prepare_input($_POST['disc_gl_acct_id']);
 $order->discount = $currencies->clean_value(db_prepare_input($_POST['discount']), $order->currencies_code) / $order->currencies_value;
 $order->disc_percent = $order->subtotal ? 1 - ($order->subtotal - $order->discount) / $order->subtotal : 0;
 $order->ship_gl_acct_id = db_prepare_input($_POST['ship_gl_acct_id']);
 $order->rm_attach = isset($_POST['rm_attach']) ? true : false;
 $order->sales_tax = $currencies->clean_value(db_prepare_input($_POST['sales_tax']), $order->currencies_code) / $order->currencies_value;
 $order->total_amount = $currencies->clean_value(db_prepare_input($_POST['total']), $order->currencies_code) / $order->currencies_value;
 // load item row data
 $x = 1;
 while (isset($_POST['qty_' . $x])) {
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例10: validate_user

// | The license that is bundled with this package is located in the |
// | file: /doc/manual/ch01-Introduction/license.html.               |
// | If not, see http://www.gnu.org/licenses/                        |
// +-----------------------------------------------------------------+
//  Path: /modules/audit/pages/main/pre_process.php
//
/**************   Check user security   *****************************/
$security_level = validate_user(SECURITY_ID_AUDIT);
/**************  include page specific files    *********************/
//gen_pull_language($module);
require_once DIR_FS_WORKING . 'functions/audit.php';
/**************   page specific initialization  *************************/
$error = false;
$date_from = gen_db_date($_REQUEST['date_from']);
//         ? db_prepare_input($_POST['date_from'])       : $_GET['date_from'];
$date_to = gen_db_date($_REQUEST['date_to']);
//           ? db_prepare_input($_POST['date_to'])         : $_GET['date_to'];
$select = $_REQUEST['select'];
//           ? db_prepare_input($_POST['date_to'])         : $_GET['date_to'];
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_MODULES . 'audit/custom/pages/main/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'export_audit':
        //search for contacts, gl_accounts and journals
        $output = build_audit_xml($date_from, $date_to, $select);
        if ($output == false) {
            $messageStack->add(GL_ERROR_BALANCE, 'error');
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例11: calculate_terms_due_dates

function calculate_terms_due_dates($post_date, $terms_encoded, $type = 'AR')
{
    $terms = explode(':', $terms_encoded);
    $date_details = gen_get_dates($post_date);
    $result = array();
    switch ($terms[0]) {
        default:
        case '0':
            // Default terms
            $result['discount'] = constant($type . '_PREPAYMENT_DISCOUNT_PERCENT') / 100;
            $result['net_date'] = gen_specific_date($post_date, constant($type . '_NUM_DAYS_DUE'));
            if ($result['discount'] != 0) {
                $result['early_date'] = gen_specific_date($post_date, constant($type . '_PREPAYMENT_DISCOUNT_DAYS'));
            } else {
                $result['early_date'] = $post_date;
                // move way out
            }
            break;
        case '1':
            // Cash on Delivery (COD)
        // Cash on Delivery (COD)
        case '2':
            // Prepaid
            $result['discount'] = 0;
            $result['early_date'] = $post_date;
            $result['net_date'] = $post_date;
            break;
        case '3':
            // Special terms
            $result['discount'] = $terms[1] / 100;
            $result['early_date'] = gen_specific_date($post_date, $terms[2]);
            $result['net_date'] = gen_specific_date($post_date, $terms[3]);
            break;
        case '4':
            // Due on day of next month
            $result['discount'] = $terms[1] / 100;
            $result['early_date'] = gen_specific_date($post_date, $terms[2]);
            $result['net_date'] = gen_db_date($terms[3]);
            break;
        case '5':
            // Due at end of month
            $result['discount'] = $terms[1] / 100;
            $result['early_date'] = gen_specific_date($post_date, $terms[2]);
            $result['net_date'] = date('Y-m-d', mktime(0, 0, 0, $date_details['ThisMonth'], $date_details['TotalDays'], $date_details['ThisYear']));
            break;
    }
    return $result;
}
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:48,代码来源:phreebooks.php


示例12: start_import

 public function start_import($ouwer_bank_account_number, $post_date, $other_bank_account_number, $credit_amount, $debit_amount, $description, $bank_gl_acct, $other_bank_account_iban)
 {
     global $db, $messageStack, $currencies;
     if ($post_date == '') {
         $messageStack->add(" date is required", 'error');
         return false;
         exit;
     }
     $this->reset();
     $messageStack->debug("\n\n*************** Start Processing Import Payment *******************");
     if ($ouwer_bank_account_number != '') {
         $ouwer_bank = ltrim($ouwer_bank_account_number, 0);
         if ($ouwer_bank == '') {
             $messageStack->add(TEXT_BIMP_ERMSG1, 'error');
             return false;
             exit;
         }
         $sql = "select id, description from " . TABLE_CHART_OF_ACCOUNTS . " where description like '%{$ouwer_bank}%'";
         $result = $db->Execute($sql);
         if ($result->RecordCount() == 0) {
             $messageStack->add(TEXT_BIMP_ERMSG5 . ' ' . $ouwer_bank, 'error');
             return false;
             exit;
         }
         if (!$result->RecordCount() > 1) {
             $messageStack->add(TEXT_BIMP_ERMSG2 . ' ' . $ouwer_bank, 'error');
             return false;
             exit;
         }
         $this->gl_acct_id = $result->fields['id'];
     } else {
         if ($bank_gl_acct == '') {
             $messageStack->add(TEXT_BIMP_ERMSG1, 'error');
             return false;
             exit;
         }
         $this->gl_acct_id = $bank_gl_acct;
     }
     $this->_description = $description;
     $this->_creditamount = $currencies->clean_value($credit_amount);
     $this->_debitamount = $currencies->clean_value($debit_amount);
     $this->total_amount = $this->_debitamount + $this->_creditamount;
     $this->post_date = gen_db_date($post_date);
     $this->period = gen_calculate_period($this->post_date, true);
     $this->admin_id = $_SESSION['admin_id'];
     if ($this->find_contact($other_bank_account_number, $other_bank_account_iban)) {
         $this->find_right_invoice();
     } else {
         if ($this->proces_know_mutation($other_bank_account_number, $other_bank_account_iban) == false) {
             $this->proces_mutation();
         }
     }
     $messageStack->debug("\n\n*************** End Processing Import Payment *******************");
 }
开发者ID:Nimblemouse,项目名称:PhreeBooksERP,代码行数:54,代码来源:import_banking.php


示例13: gen_add_audit_log

             if (DEBUG) {
                 $messageStack->write_debug();
             }
             gen_add_audit_log(GL_LOG_ADD_JOURNAL . TEXT_DELETE, $delGL->purchase_invoice_id);
             gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL'));
         }
         // *************** END TRANSACTION *************************
     }
     $db->transRollback();
     $messageStack->add(GL_ERROR_NO_DELETE, 'error');
     if (DEBUG) {
         $messageStack->write_debug();
     }
     $cInfo = new objectInfo($_POST);
     // if we are here, there was an error, reload page
     $cInfo->post_date = gen_db_date($_POST['post_date']);
     break;
 case 'edit':
     $oID = (int) $_GET['oID'];
     validate_security($security_level, 2);
     $cInfo = new objectInfo(array());
     break;
 case 'dn_attach':
     $oID = db_prepare_input($_POST['id']);
     if (file_exists(PHREEBOOKS_DIR_MY_ORDERS . 'order_' . $oID . '.zip')) {
         require_once DIR_FS_MODULES . 'phreedom/classes/backup.php';
         $backup = new backup();
         $backup->download(PHREEBOOKS_DIR_MY_ORDERS, 'order_' . $oID . '.zip', true);
     }
     die;
 default:
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例14: array

require_once DIR_FS_MODULES . 'phreebooks/classes/gen_ledger.php';
require_once DIR_FS_MODULES . 'phreebooks/classes/banking.php';
/**************   page specific initialization  *************************/
$error = false;
$till_known = false;
$cleared_items = array();
$current_cleard_items = unserialize($_POST['current_cleard_items']);
$all_items = array();
$gl_types = array('pmt', 'ttl', 'tpm');
$post_date = $_POST['post_date'] ? gen_db_date($_POST['post_date']) : '';
$payment_modules = load_all_methods('payment');
$tills = new tills();
$glEntry = new journal();
if (isset($_GET['till_id'])) {
    $tills->get_till_info(db_prepare_input($_GET['till_id']));
    $post_date = gen_db_date(gen_locale_date(date('Y-m-d')));
} else {
    if (isset($_POST['till_id'])) {
        $tills->get_till_info(db_prepare_input($_POST['till_id']));
    } else {
        if ($tills->showDropDown() == false) {
            $tills->get_default_till_info();
        } else {
            $post_date = '';
            $_REQUEST['action'] = '';
        }
    }
}
if ($post_date) {
    $period = gen_calculate_period($post_date);
}
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例15: validate_user

// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   |
// | GNU General Public License for more details.                    |
// +-----------------------------------------------------------------+
//  Path: /modules/inventory/pages/adjustments/pre_process.php
//
$security_level = validate_user(SECURITY_ID_ADJUST_INVENTORY);
/**************  include page specific files    *********************/
gen_pull_language('phreebooks');
require_once DIR_FS_WORKING . 'defaults.php';
require_once DIR_FS_MODULES . 'phreebooks/functions/phreebooks.php';
require_once DIR_FS_MODULES . 'phreebooks/classes/gen_ledger.php';
/**************   page specific initialization  *************************/
define('JOURNAL_ID', 16);
// Adjustment Journal
define('GL_TYPE', '');
$post_date = isset($_POST['post_date']) ? gen_db_date($_POST['post_date']) : date('Y-m-d');
$error = false;
$glEntry = new journal();
$glEntry->id = isset($_POST['id']) ? $_POST['id'] : '';
$glEntry->journal_id = JOURNAL_ID;
$glEntry->store_id = isset($_POST['store_id']) ? $_POST['store_id'] : 0;
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/adjustments/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'save':
        validate_security($security_level, 2);
        // retrieve and clean input values
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例16: what_to_save

 public function what_to_save()
 {
     global $db, $currencies;
     $sql_data_array = array();
     $xtra_db_fields = $db->Execute("select field_name, entry_type, params \n          from " . TABLE_EXTRA_FIELDS . " where module_id='{$this->module}'");
     while (!$xtra_db_fields->EOF) {
         if ($xtra_db_fields->fields['field_name'] == 'id') {
             $xtra_db_fields->MoveNext();
         }
         $field_name = $xtra_db_fields->fields['field_name'];
         if ($xtra_db_fields->fields['entry_type'] == 'multi_check_box') {
             $temp = '';
             $params = unserialize($xtra_db_fields->fields['params']);
             $choices = explode(',', $params['default']);
             while ($choice = array_shift($choices)) {
                 $values = explode(':', $choice);
                 if (isset($_POST[$field_name . $values[0]])) {
                     $temp .= $_POST[$field_name . $values[0]] . ',';
                 }
             }
             $sql_data_array[$field_name] = $temp;
         } elseif (!isset($_POST[$field_name]) && $xtra_db_fields->fields['entry_type'] == 'check_box') {
             $sql_data_array[$field_name] = '0';
             // special case for unchecked check boxes
         } elseif (isset($_POST[$field_name]) && $field_name != 'id') {
             $sql_data_array[$field_name] = db_prepare_input($_POST[$field_name]);
         }
         if ($xtra_db_fields->fields['entry_type'] == 'date_time') {
             $sql_data_array[$field_name] = $sql_data_array[$field_name] ? gen_db_date($sql_data_array[$field_name]) : '';
         }
         if ($xtra_db_fields->fields['entry_type'] == 'decimal') {
             $sql_data_array[$field_name] = $sql_data_array[$field_name] ? $currencies->clean_value($sql_data_array[$field_name]) : '';
         }
         $xtra_db_fields->MoveNext();
     }
     return $sql_data_array;
 }
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:37,代码来源:fields.php


示例17: isset

$type = isset($_GET['type']) ? $_GET['type'] : 'c';
history_filter('inv_prices');
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_MODULES . 'inventory/pages/price_sheets/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'save':
    case 'update':
        validate_security($security_level, 2);
        $id = db_prepare_input($_POST['id']);
        $sheet_name = db_prepare_input($_POST['sheet_name']);
        $revision = db_prepare_input($_POST['revision']);
        $effective_date = gen_db_date($_POST['effective_date']);
        $default_sheet = isset($_POST['default_sheet']) ? '1' : '0';
        $inactive = isset($_POST['inactive']) ? '1' : '0';
        $encoded_prices = array();
        for ($i = 0, $j = 1; $i < MAX_NUM_PRICE_LEVELS; $i++, $j++) {
            $price = $currencies->clean_value(db_prepare_input($_POST['price_' . $j]));
            $adj = db_prepare_input($_POST['adj_' . $j]);
            $adj_val = $currencies->clean_value(db_prepare_input($_POST['adj_val_' . $j]));
            $rnd = db_prepare_input($_POST['rnd_' . $j]);
            $rnd_val = $currencies->clean_value(db_prepare_input($_POST['rnd_val_' . $j]));
            $level_data = $_POST['price_' . $j] ? $price : '0';
            $level_data .= ':' . db_prepare_input($_POST['qty_' . $j]);
            $level_data .= ':' . db_prepare_input($_POST['src_' . $j]);
            $level_data .= ':' . ($_POST['adj_' . $j] ? $adj : '0');
            $level_data .= ':' . ($_POST['adj_val_' . $j] ? $adj_val : '0');
            $level_data .= ':' . ($_POST['rnd_' . $j] ? $rnd : '0');
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例18: gen_add_audit_log

                     break;
                     // file does not exist, exit loop
                 }
             }
             $cnt++;
         }
         $shipments->MoveNext();
     }
     // delete log since deleting label from FedEx is just a courtesy
     $db->Execute("delete from " . TABLE_SHIPPING_LOG . " where shipment_id = " . $shipment_id);
     gen_add_audit_log(SHIPPING_LABEL_DELETED, $shipment_id);
     break;
 case 'close':
     $date = $_GET['date'] ? $_GET['date'] : date('Y-m-d');
     $shipment = new $shipping_module();
     $shipment->close_date = $_POST['search_date'] ? gen_db_date($_POST['search_date']) : date('Y-m-d');
     $shipment->closeFedEx($date);
     gen_add_audit_log(sprintf(SHIPPING_END_OF_DAY, $shipping_module), $tracking_id);
     break;
 case 'report':
     $date = $_GET['date'] ? $_GET['date'] : date('Y-m-d');
     break;
 default:
     $oID = db_prepare_input($_GET['oID']);
     $sql = "select shipper_code, ship_primary_name, ship_contact, ship_address1, ship_address2, \n\t\tship_city_town, ship_state_province, ship_postal_code, ship_country_code, ship_telephone1, \n\t\tship_email, purchase_invoice_id, purch_order_id, total_amount  \n\t\tfrom " . TABLE_JOURNAL_MAIN . " where id = " . (int) $oID;
     $result = $db->Execute($sql);
     if (is_array($result->fields)) {
         while (list($key, $value) = each($result->fields)) {
             $sInfo->{$key} = $value;
         }
         $temp = explode(':', $result->fields['shipper_code']);
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


示例19: gen_build_sql_date

function gen_build_sql_date($date_prefs, $df)
{
    global $db;
    $dates = gen_get_dates();
    $DateArray = explode(':', $date_prefs);
    $t = time();
    $ds = '0000-00-00';
    $de = '2199-00-00';
    switch ($DateArray[0]) {
        default:
        case "a":
            // All, skip the date addition to the where statement, all dates in db
            $d = '';
            $fildesc = '';
            break;
        case "b":
            // Date Range
            $d = '';
            $fildesc = RW_RPT_DATERANGE;
            if ($DateArray[1] != '') {
                $ds = gen_db_date($DateArray[1]);
                $d .= $df . " >= '" . $ds . "'";
                $fildesc .= ' ' . TEXT_FROM . ' ' . $DateArray[1];
            }
            if ($DateArray[2] != '') {
                // a value entered, check
                if (strlen($d) > 0) {
                    $d .= ' and ';
                }
                $de = gen_specific_date(gen_db_date($DateArray[2]), 1);
                $d .= $df . " < '" . $de . "'";
                $fildesc .= ' ' . TEXT_TO . ' ' . $DateArray[2];
            }
            $fildesc .= '; ';
            break;
        case "c":
            // Today (specify range for datetime type fields to match for time parts)
            $ds = $dates['Today'];
            $de = gen_specific_date($dates['Today'], 1);
            $d = $df . " >= '" . $ds . "' and " . $df . " < '" . $de . "'";
            $fildesc = RW_RPT_DATERANGE . ' = ' . gen_locale_date($dates['Today']) . '; ';
            break;
        case "d":
            // This Week
            $ds = date('Y-m-d', mktime(0, 0, 0, $dates['ThisMonth'], date('j', $t) - date('w', $t), $dates['ThisYear']));
            $de = gen_specific_date(date('Y-m-d', mktime(0, 0, 0, $dates['ThisMonth'], date('j', $t) - date('w', $t) + 6, $dates['ThisYear'])), 1);
            $d = $df . " >= '" . $ds . "' and " . $df . " < '" . $de . "'";
            $fildesc = RW_RPT_DATERANGE . ' ' . TEXT_FROM . ' ' . gen_locale_date($ds) . ' ' . TEXT_TO . ' ' . gen_locale_date(gen_specific_date($de, -1)) . '; ';
            break;
        case "e":
            // This Week to Date
            $ds = date('Y-m-d', mktime(0, 0, 0, $dates['ThisMonth'], date('j', $t) - date('w', $t), $dates['ThisYear']));
            $de = gen_specific_date($dates['Today'], 1);
            $d = $df . " >= '" . $ds . "' and " . $df . " < '" . $de . "'";
            $fildesc = RW_RPT_DATERANGE . ' ' . TEXT_FROM . ' ' . gen_locale_date($ds) . ' ' . TEXT_TO . ' ' . gen_locale_date($dates['Today']) . '; ';
            break;
        case "f":
            // This Month
            $ds = date('Y-m-d', mktime(0, 0, 0, $dates['ThisMonth'], 1, $dates['ThisYear']));
            $de = gen_specific_date(date('Y-m-d', mktime(0, 0, 0, $dates['ThisMonth'], $dates['TotalDays'], $dates['ThisYear'])), 1);
            $d = $df . " >= '" . $ds . "' and " . $df . " < '" . $de . "'";
            $fildesc = RW_RPT_DATERANGE . ' ' . TEXT_FROM . ' ' . gen_locale_date($ds) . ' ' . TEXT_TO . ' ' . gen_locale_date(gen_specific_date($de, -1)) . '; ';
            break;
        case "g":
            // This Month to Date
            $ds = date('Y-m-d', mktime(0, 0, 0, $dates['ThisMonth'], 1, $dates['ThisYear']));
            $de = gen_specific_date($dates['Today'], 1);
            $d = $df . " >= '" . $ds . "' and " . $df . " < '" . $de . "'";
            $fildesc = RW_RPT_DATERANGE . ' ' . TEXT_FROM . ' ' . gen_locale_date($ds) . ' ' . TEXT_TO . ' ' . gen_locale_date($dates['Today']) . '; ';
            break;
        case "h":
            // This Quarter
            $QtrStrt = CURRENT_ACCOUNTING_PERIOD - (CURRENT_ACCOUNTING_PERIOD - 1) % 3;
            $temp = gen_calculate_fiscal_dates($QtrStrt);
            $ds = $temp['start_date'];
            $temp = gen_calculate_fiscal_dates($QtrStrt + 2);
            $de = gen_specific_date($temp[' 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP gen_executor函数代码示例发布时间:2022-05-15
下一篇:
PHP gen_code函数代码示例发布时间: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