本文整理汇总了PHP中force_page函数的典型用法代码示例。如果您正苦于以下问题:PHP force_page函数的具体用法?PHP force_page怎么用?PHP force_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了force_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_acl
function check_acl($db, $module, $page)
{
$uid = $_SESSION['login_id'];
/* get group id */
$q = 'SELECT ' . PRFX . 'CONFIG_EMPLOYEE_TYPE.TYPE_NAME
FROM ' . PRFX . 'TABLE_EMPLOYEE,' . PRFX . 'CONFIG_EMPLOYEE_TYPE
WHERE ' . PRFX . 'TABLE_EMPLOYEE.EMPLOYEE_TYPE = ' . PRFX . 'CONFIG_EMPLOYEE_TYPE.TYPE_ID AND EMPLOYEE_ID=' . $db->qstr($uid);
if (!($rs = $db->execute($q))) {
force_page('core', 'error&error_msg=Could not get Group ID for user');
exit;
} else {
$gid = $rs->fields['TYPE_NAME'];
}
/* check page to see if we have access */
if (!isset($module)) {
$page = "core:main";
} else {
$page = $module . ":" . $page;
}
$q = 'SELECT ' . $gid . ' as ACL FROM ' . PRFX . 'ACL WHERE page=' . $db->qstr($page);
if (!($rs = $db->execute($q))) {
force_page('core', 'error&error_msg=Could not get Page ACL');
exit;
} else {
$acl = $rs->fields['ACL'];
if ($acl != 1) {
return false;
} else {
return true;
}
}
}
示例2: display_workorder_status2
function display_workorder_status2($db, $wo_id)
{
$sql = "SELECT " . PRFX . "TABLE_WORK_ORDER_STATUS.*, " . PRFX . "TABLE_EMPLOYEE.EMPLOYEE_DISPLAY_NAME \n\t\t\t\tFROM " . PRFX . "TABLE_WORK_ORDER_STATUS, " . PRFX . "TABLE_EMPLOYEE \n\t\t\t\tWHERE " . PRFX . "TABLE_WORK_ORDER_STATUS.WORK_ORDER_ID=" . $db->qstr($wo_id) . " \n\t\t\t\tAND " . PRFX . "TABLE_EMPLOYEE.EMPLOYEE_ID = " . PRFX . "TABLE_WORK_ORDER_STATUS.WORK_ORDER_STATUS_ENTER_BY ORDER BY " . PRFX . "TABLE_WORK_ORDER_STATUS.WORK_ORDER_STATUS_ID";
if (!($result = $db->Execute($sql))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
}
$work_order_status2 = $result->GetArray();
return $work_order_status2;
}
示例3: date_format_call
function date_format_call($db)
{
$q = 'SELECT * FROM ' . PRFX . 'TABLE_COMPANY';
if (!($rs = $db->execute($q))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
} else {
$date_format = $rs->fields['COMPANY_DATE_FORMAT'];
return $date_format;
}
}
示例4: display_closed
function display_closed($db, $page_no, $smarty)
{
global $smarty;
// Define the number of results per page
$max_results = 25;
// Figure out the limit for the Execute based
// on the current page number.
$from = $page_no * $max_results - $max_results;
$sql = "SELECT \n\t\t\t" . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_ID, \n\t\t\t" . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_OPEN_DATE,\n\t\t\t" . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_ASSIGN_TO,\n\t\t\t" . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_SCOPE, \n\t\t\t" . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_CLOSE_DATE,\n\t\t\t" . PRFX . "TABLE_CUSTOMER.*, \n\t\t\t" . PRFX . "TABLE_EMPLOYEE.EMPLOYEE_ID, \n\t\t\t" . PRFX . "TABLE_EMPLOYEE.EMPLOYEE_DISPLAY_NAME, \n\t\t\t" . PRFX . "TABLE_EMPLOYEE.EMPLOYEE_WORK_PHONE, \n\t\t\t" . PRFX . "TABLE_EMPLOYEE.EMPLOYEE_HOME_PHONE, \n\t\t\t" . PRFX . "TABLE_EMPLOYEE.EMPLOYEE_MOBILE_PHONE, \n\t\t\t" . PRFX . "CONFIG_WORK_ORDER_STATUS.CONFIG_WORK_ORDER_STATUS\n\t\t\tFROM " . PRFX . "TABLE_WORK_ORDER\n\t\t\tLEFT JOIN " . PRFX . "TABLE_CUSTOMER ON " . PRFX . "TABLE_WORK_ORDER.CUSTOMER_ID = " . PRFX . "TABLE_CUSTOMER.CUSTOMER_ID\n\t\t\tLEFT JOIN " . PRFX . "TABLE_EMPLOYEE ON " . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_ASSIGN_TO = " . PRFX . "TABLE_EMPLOYEE.EMPLOYEE_ID\n\t\t\tLEFT JOIN " . PRFX . "CONFIG_WORK_ORDER_STATUS ON " . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_CURRENT_STATUS = " . PRFX . "CONFIG_WORK_ORDER_STATUS.CONFIG_WORK_ORDER_STATUS_ID\n\t\t\tWHERE WORK_ORDER_STATUS=" . $db->qstr(6) . " GROUP BY " . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_ID ORDER BY " . PRFX . "TABLE_WORK_ORDER.WORK_ORDER_ID DESC LIMIT {$from}, {$max_results}";
if (!($rs = $db->Execute($sql))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
} else {
$work_order = $rs->GetArray();
}
// Figure out the total number of results in DB:
$q = "SELECT COUNT(*) as Num FROM " . PRFX . "TABLE_WORK_ORDER WHERE WORK_ORDER_STATUS=" . $db->qstr(6);
if (!($results = $db->Execute($q))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
}
if (!($total_results = $results->FetchRow())) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
} else {
$smarty->assign('total_results', $total_results['Num']);
}
// Figure out the total number of pages. Always round up using ceil()
$total_pages = ceil($total_results["Num"] / $max_results);
$smarty->assign('total_pages', $total_pages);
// Assign the first page
if ($page_no > 1) {
$prev = $page_no - 1;
}
// Build Next Link
if ($page_no < $total_pages) {
$next = $page_no + 1;
}
$smarty->assign('name', $name);
$smarty->assign('page_no', $page_no);
$smarty->assign("previous", $prev);
$smarty->assign("next", $next);
return $work_order;
}
示例5: gateway_xml2php
<?php
// Load the Expense Functions
require_once 'include.php';
// Load the Translations for this Module
if (!xml2php('expense')) {
$smarty->assign('error_msg', "Error in language file");
}
$expenseID = $VAR['expenseID'];
// Load PHP Language Translations
$langvals = gateway_xml2php('expense');
// Make sure we got an Expense ID number
if (!isset($expenseID) || $expenseID == "") {
$smarty->assign('results', 'Please go back and select an expense record');
die;
}
// Delete the expense function call
if (!delete_expense($db, $expenseID)) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
} else {
force_page('expense', 'search&page_title=' . $langvals['expense_search_title']);
exit;
}
示例6: gateway_xml2php
<?php
// Load the Expense Functions
require_once 'include.php';
// Load the Translations for this Module
if (!xml2php('expense')) {
$smarty->assign('error_msg', "Error in language file");
}
// Load PHP Language Translations
$langvals = gateway_xml2php('expense');
// Load expense details
$expense_details = display_expense_info($db, $VAR['expenseID']);
// If details submitted run update values, if not set load edit.tpl and populate values
if (isset($VAR['submit'])) {
if (!update_expense($db, $VAR)) {
force_page('expense', 'edit&error_msg=Falied to Update Expense Information&expenseID=' . $VAR['expenseID']);
exit;
} else {
force_page('expense', 'expense_details&expenseID=' . $VAR['expenseID'] . '&page_title=' . $langvals['expense_details_title']);
exit;
}
} else {
$smarty->assign('expense_details', $expense_details);
$smarty->display('expense' . SEP . 'edit.tpl');
}
示例7: gateway_xml2php
require_once 'include.php';
// Load the Translation for this Module
if (!xml2php('refund')) {
$smarty->assign('error_msg', "Error in language file");
}
// Load PHP Language Translations
$langvals = gateway_xml2php('refund');
$last_record_id = last_record_id_lookup($db);
$new_record_id = $last_record_id + 1;
// If details submitted insert record, if non submitted load new.tpl and populate values
if (isset($VAR['submit']) || isset($VAR['submitandnew'])) {
if ($run != insert_new_refund($db, $VAR)) {
$smarty->assign('error_msg', 'Falied to insert Refund');
$smarty->display('core' . SEP . 'error.tpl');
echo "refund insert error";
} else {
if (isset($VAR['submitandnew'])) {
// Submit New Refund and reload page
force_page('refund', 'new&page_title=');
exit;
} else {
// Submit and load Refund View Details
force_page('refund', 'refund_details&refundID=' . $new_record_id . '&page_title=' . $langvals['refund_details_title']);
exit;
}
}
} else {
$smarty->assign('new_record_id', $new_record_id);
$smarty->assign('tax_rate', $tax_rate);
$smarty->display('refund' . SEP . 'new.tpl');
}
示例8: employee_type
function employee_type($db)
{
$q = "SELECT * FROM " . PRFX . "CONFIG_EMPLOYEE_TYPE";
if (!($rs = $db->Execute($q))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
} else {
$arr = $rs->GetArray();
return $arr;
}
}
示例9: force_page
<?php
require_once "include.php";
if (!xml2php("customer")) {
$smarty->assign('error_msg', "Error in language file");
}
if (isset($VAR['submit'])) {
if (!($customer_id = insert_new_customer($db, $VAR))) {
$smarty->assign('error_msg', 'Falied to insert customer');
$smarty->display('core' . SEP . 'error.tpl');
} else {
force_page('customer', 'customer_details&customer_id=' . $customer_id . '&msg=Added New Customer ' . $VAR["displayName"] . ' &page_title=' . $VAR["displayName"]);
exit;
}
} else {
$smarty->display('customer' . SEP . 'new.tpl');
}
示例10: force_page
<?php
require_once "include.php";
if (empty($VAR['wo_id'])) {
force_page('core', 'error&error_msg=No Work Order ID');
exit;
}
if (isset($VAR['submit'])) {
if (!update_status($db, $VAR)) {
force_page('core', 'error&error_msg=Falied to update work order status');
exit;
} else {
force_page('workorder', 'view&wo_id=' . $VAR['wo_id'] . '&page_title=Work%20Order%20ID%20' . $VAR['wo_id']);
exit;
}
} else {
$smarty->assign('wo_id', $VAR['wo_id']);
$smarty->display('workorder' . SEP . 'new_status.tpl');
}
示例11: force_page
$q = "INSERT INTO " . PRFX . "TABLE_WORK_ORDER_STATUS SET\n\t\t\t\tWORK_ORDER_ID\t\t\t\t\t= " . $db->qstr($wo_id) . ",\n\t\t\t\tWORK_ORDER_STATUS_DATE \t\t= " . $db->qstr(time()) . ",\n\t\t\t\tWORK_ORDER_STATUS_NOTES \t\t= " . $db->qstr($memo) . ",\n\t\t\t\tWORK_ORDER_STATUS_ENTER_BY\t= " . $db->qstr($_SESSION['login_id']);
if (!($rs = $db->execute($q))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1');
exit;
}
/* check status */
$q = "SELECT WORK_ORDER_STATUS FROM " . PRFX . "TABLE_WORK_ORDER WHERE WORK_ORDER_ID=" . $db->qstr($wo_id);
if (!($rs = $db->execute($q))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
}
if ($rs->fields['WORK_ORDER_STATUS'] != '6') {
/* check if we have a schedule */
$q = "SELECT count(*) as count FROM " . PRFX . "TABLE_SCHEDULE WHERE WORK_ORDER_ID=" . $db->qstr($wo_id);
if (!($rs = $db->execute($q))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
}
if ($rs->fields['count'] == 1) {
$status = '2';
} else {
$status = '1';
}
$q = "UPDATE " . PRFX . "TABLE_WORK_ORDER SET WORK_ORDER_CURRENT_STATUS =" . $db->qstr($status) . ", LAST_ACTIVE=" . $db->qstr(time()) . " WHERE WORK_ORDER_ID = " . $db->qstr($wo_id);
if (!($rs = $db->execute($q))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
}
}
force_page('workorder', 'view&wo_id=' . $wo_id . '&page_title=Work%20Order%20ID%20' . $wo_id);
示例12: force_page
$partsID = $VAR['partsID'];
// Labour Delete Record
if (isset($VAR['deleteType']) && $VAR['deleteType'] == "labourRecord") {
// Delete the labour record Function call
if (!delete_labour_record($db, $labourID)) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
} else {
force_page('invoice', 'new&invoice_id=' . $invoice_id . '&wo_id=' . $wo_id . '&page_title=' . $langvals['invoice_invoice'] . '&customer_id=' . $customer_id);
exit;
}
}
// Parts Delete Record
if (isset($VAR['deleteType']) && $VAR['deleteType'] == "partsRecord") {
// Delete the labour record Function call
if (!delete_parts_record($db, $partsID)) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
} else {
force_page('invoice', 'new&invoice_id=' . $invoice_id . '&wo_id=' . $wo_id . '&page_title=' . $langvals['invoice_invoice'] . '&customer_id=' . $customer_id);
exit;
}
}
// Delete Invoice
if (!delete_invoice($db, $invoice_id, $customer_id, $login)) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
} else {
force_page('invoice', 'view_paid&page_title=Paid%20Invoices');
exit;
}
示例13: display_memo
function display_memo($db, $customer_id)
{
$q = "SELECT * FROM " . PRFX . "CUSTOMER_NOTES WHERE CUSTOMER_ID=" . $db->qstr($customer_id);
if (!($rs = $db->execute($q))) {
force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
exit;
}
$arr = $rs->GetArray();
return $arr;
}
示例14: force_page
$smarty->assign('DD_BSB', $DD_BSB);
$smarty->assign('DD_ACC', $DD_ACC);
$smarty->assign('DD_INS', $DD_INS);
$smarty->assign('DD_BANK', $DD_BANK);
$smarty->assign('CHECK_PAYABLE', $CHECK_PAYABLE);
$smarty->assign('PAYMATE_LOGIN', $PAYMATE_LOGIN);
$smarty->assign('company', $company);
$smarty->assign('company2', $company2);
//$smarty->assign('CURRENCY_CODE',$CURRENCY_CODE);
//$smarty->assign('currency_sym',$currency_sym);
$smarty->assign('country', $country);
$smarty->assign('pamount', $pamount);
$smarty->assign('paymate_amt', $paymate_amt);
$smarty->assign('PAYMATE_FEES', $PAYMATE_FEES);
$smarty->assign('parts_sub_total_sum', $parts_sub_total_sum);
$smarty->assign('labour_sub_total_sum', $labour_sub_total_sum);
$smarty->assign('wo_description', $wo_description);
$smarty->assign('wo_resolution', $wo_resolution);
$smarty->display('invoice' . SEP . 'print_html.tpl');
} else {
// EOF HTML Printing Section
// BOF PDF Printing Section
if ($print_type == 'pdf') {
require_once FILE_ROOT . 'templates/invoice/print_pdf_tpl.php';
//This loads the PDF template file
} else {
force_page('core', "error&menu=1&error_msg=No Printing Options set. Please set up printing options in the Control Center.&type=error");
exit;
}
}
// EOF PDF Printing Section
示例15: list
if (!insert_new_schedule($db, $VAR)) {
/* If db insert fails send em the error */
$day = $VAR['start']['schedule_date'];
$start_time = $VAR['start']['Time_Hour'] . ":" . $VAR['start']['Time_Minute'] . " " . $VAR['start']['Time_Meridian'];
$notes = $VAR['schedule_notes'];
$end_time = $VAR['end']['Time_Hour'] . ":" . $VAR['end']['Time_Minute'] . " " . $VAR['end']['Time_Meridian'];
$smarty->assign('end_time', $end_time);
$smarty->assign('start_day', $day);
$smarty->assign('start_time', $start_time);
$smarty->assign('schedule_notes', $notes);
$smarty->assign('tech', $VAR['tech']);
$smarty->assign('wo_id', $VAR['wo_id']);
$smarty->display("schedule/new.tpl");
//force_page('schedule','main&y='.$s_year.'&d='.$s_month.'&m='.$s_day.'&wo_id='.$VAR['wo_id'].'&page_title=schedule&tech='.$VAR['tech']);
} else {
//list($s_day, $s_month, $s_year) = split('[/.-]', $VAR['start']['SCHEDULE_date']);
list($s_month, $s_day, $s_year) = split('[/.-]', $VAR['start']['SCHEDULE_date']);
force_page('schedule', 'main&y=' . $s_year . '&d=' . $s_month . '&m=' . $s_day . '&wo_id=' . $VAR['wo_id'] . '&page_title=schedule&tech=' . $VAR['tech']);
}
} else {
// Load html form to smarty
$start_time = $VAR['starttime'];
$day = $VAR['day'];
$wo_id = $VAR['wo_id'];
$tech = $VAR['tech'];
$smarty->assign('tech', $tech);
$smarty->assign('wo_id', $wo_id);
$smarty->assign('start_day', $day);
$smarty->assign('start_time', $start_time);
$smarty->display('schedule' . SEP . 'new.tpl');
}