本文整理汇总了PHP中gen_db_date函数的典型用法代码示例。如果您正苦于以下问题:PHP gen_db_date函数的具体用法?PHP gen_db_date怎么用?PHP gen_db_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gen_db_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
示例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':
示例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;
}
示例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');
示例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']);
示例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));
示例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++;
}
示例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();
示例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])) {
示例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');
示例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;
}
示例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 *******************");
}
示例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:
示例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);
}
示例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