本文整理汇总了PHP中xmlEntry函数的典型用法代码示例。如果您正苦于以下问题:PHP xmlEntry函数的具体用法?PHP xmlEntry怎么用?PHP xmlEntry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xmlEntry函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: responseXML
function responseXML($code, $text, $level, $extra_xml = false)
{
$strResponse = '';
$strResponse .= '<?xml version="1.0" encoding="UTF-8" ?>' . chr(10);
$strResponse .= '<Response>' . chr(10);
$strResponse .= xmlEntry('Version', '1.00');
$strResponse .= xmlEntry('Reference', $this->reference);
$strResponse .= xmlEntry('Code', $code);
switch ($level) {
case 'success':
$strResponse .= xmlEntry('Result', 'success');
$strResponse .= xmlEntry('Text', $text);
break;
case 'error':
$strResponse .= xmlEntry('Result', 'error');
$strResponse .= xmlEntry('Text', $text);
break;
default:
$strResponse .= xmlEntry('Result', 'error');
$strResponse .= xmlEntry('Text', SOAP_UNEXPECTED_ERROR);
}
if ($extra_xml) {
$strResponse .= $extra_xml;
}
$strResponse .= '</Response>';
echo $strResponse;
die;
}
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:28,代码来源:parser.php
示例2: processXML
function processXML($rawXML)
{
global $messageStack;
//echo '<pre>' . $rawXML . '</pre>';
$rawXML = utf8_decode($rawXML);
$rawXML = iconv("UTF-8", "UTF-8//IGNORE", $rawXML);
//echo '<pre>' . $rawXML . '</pre>';
if (!($objXML = xml_to_object($rawXML))) {
return false;
}
// parse the submitted string, check for errors
//echo 'parsed string = '; print_r($objXML); echo '<br />';
if (DEBUG) {
$messageStack->debug("\n\nobjXML array = " . serialize($objXML));
}
$this->username = $objXML->Request->UserID;
$this->password = $objXML->Request->Password;
$this->version = $objXML->Request->Version;
$this->function = $objXML->Request->Function;
$this->action = $objXML->Request->Action;
$this->validateUser($this->username, $this->password);
$this->processOrder($objXML);
$extra_response = NULL;
if (sizeof($this->successful) > 0) {
$result_code = '0';
$result_flag = 'success';
$extra_response .= xmlEntry('SuccessfulOrders', implode(', ', $this->successful));
}
if (sizeof($this->failed) > 0) {
$result_code = '90';
$result_flag = 'error';
$extra_response .= xmlEntry('FailedOrders', implode(', ', $this->failed));
}
$this->responseXML($result_code, implode("<br />", $this->response), $result_flag, $extra_response);
}
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:35,代码来源:orders.php
示例3: build_dir_path
/************** page specific initialization *************************/
if (!isset($_REQUEST['list'])) {
$_REQUEST['list'] = 1;
}
$fieldset_content = 'NULL';
$id = (int) $_GET['id'];
if (!isset($_GET['id'])) {
die;
}
$doc_details = $db->Execute("select * from " . TABLE_PHREEFORM . " where id = '" . $id . "'");
if ($id == 0 || $doc_details->fields['doc_type'] == '0') {
// folder
$dir_path = TEXT_PATH . ': /' . build_dir_path($id);
$result = html_heading_bar(array(), array(' ', $dir_path, TEXT_ACTION));
$list_header = $result['html_code'];
$field_list = array('id', 'doc_type', 'doc_title', 'security');
$query_raw = "select SQL_CALC_FOUND_ROWS " . implode(', ', $field_list) . " from " . TABLE_PHREEFORM . " where parent_id = '" . $id . "'";
$query_result = $db->Execute($query_raw, MAX_DISPLAY_SEARCH_RESULTS * ($_REQUEST['list'] - 1) . ", " . MAX_DISPLAY_SEARCH_RESULTS);
// the splitPageResults should be run directly after the query that contains SQL_CALC_FOUND_ROWS
$query_split = new splitPageResults($_REQUEST['list'], '');
include DIR_FS_MODULES . 'phreeform/pages/main/tab_folder.php';
} else {
// load document details
include DIR_FS_MODULES . 'phreeform/pages/main/tab_report.php';
}
$html = "<div>";
$html .= $fieldset_content;
$html .= "</div>";
$xml .= "\t" . xmlEntry("htmlContents", $html);
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:load_doc_details.php
示例4: validate_ajax_user
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/work_orders/ajax/load_wo_detail.php
//
/************** Check user security *****************************/
$xml = NULL;
$security_level = validate_ajax_user();
/************** page specific initialization *************************/
$id = $_GET['id'];
if (!$id) {
echo createXmlHeader() . xmlEntry('error', 'Error - Bad ID passed.') . createXmlFooter();
die;
}
$result = $db->Execute("select display_name, admin_email from " . TABLE_USERS . " where admin_id = " . $_SESSION['admin_id']);
$xml = xmlEntry("id", $id);
$xml .= xmlEntry("sEmail", $result->fields['admin_email']);
$xml .= xmlEntry("sName", $result->fields['display_name']);
$xml .= xmlEntry("rEmail", '');
$xml .= xmlEntry("rName", '');
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:load_wo_detail.php
示例5: validate_ajax_user
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/work_orders/ajax/load_bom_list.php
//
/************** Check user security *****************************/
$security_level = validate_ajax_user();
/************** include page specific files *********************/
/************** page specific initialization *************************/
$xml = NULL;
$sku_id = $_GET['skuID'];
$qty = $_GET['qty'];
if (!$sku_id || !$qty) {
die;
}
$result = $db->Execute("select sku, description, qty from " . TABLE_INVENTORY_ASSY_LIST . " where ref_id = '" . $sku_id . "'");
$short = array();
while (!$result->EOF) {
$stock = $db->Execute("select quantity_on_hand, quantity_on_sales_order, quantity_on_allocation \n from " . TABLE_INVENTORY . " where sku = '" . $result->fields['sku'] . "' limit 1");
$qty_available = $stock->fields['quantity_on_hand'] - $stock->fields['quantity_on_sales_order'] - $stock->fields['quantity_on_allocation'];
if ($qty_available < $qty * $result->fields['qty']) {
$short[] = sprintf(WO_TEXT_PARTS_SHORTAGE, $qty_available, $qty * $result->fields['qty'], $result->fields['sku'], $result->fields['description']);
}
$result->MoveNext();
}
$shortage = sizeof($short) == 0 ? 'none' : implode(chr(10), $short);
echo createXmlHeader() . xmlEntry("shortage", $shortage) . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:load_bom_list.php
示例6: while
while (!$bill_add->EOF) {
$xml .= "\t<billaddress>\n";
foreach ($bill_add->fields as $key => $value) {
$xml .= "\t\t" . xmlEntry($key, $value);
}
$xml .= "\t</billaddress>\n";
$bill_add->MoveNext();
}
}
if ($bill->fields) {
// there was an bill to open
$xml .= "\t<bill>\n";
foreach ($bill->fields as $key => $value) {
$xml .= "\t\t" . xmlEntry($key, $value);
}
$xml .= "\t</bill>\n";
}
foreach ($item_list as $item) {
// there should always be invoices to pull
$xml .= "\t<items>\n";
foreach ($item as $key => $value) {
$xml .= "\t\t" . xmlEntry($key, $value);
}
$xml .= "\t</items>\n";
}
//put it all together
$str = createXmlHeader($function_name);
$str .= $xml;
$str .= createXmlFooter();
echo $str;
die;
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:load_bill.php
示例7: while
while (!$ship_add->EOF) {
$xml .= "\t<Address>\n";
foreach ($ship_add->fields as $key => $value) {
$xml .= "\t\t" . xmlEntry($key, $value);
}
$xml .= "\t</Address>\n";
$ship_add->MoveNext();
}
}
$xml .= "</ShipContact>\n";
}
if (sizeof($order->fields) > 0) {
// there was an order to open
$xml .= "<OrderData>\n";
foreach ($order->fields as $key => $value) {
$xml .= "\t" . xmlEntry($key, strval($value));
}
foreach ($item_list as $item) {
$xml .= "\t<Item>\n";
foreach ($item as $key => $value) {
$xml .= "\t\t" . xmlEntry($key, strval($value));
}
$xml .= "\t</Item>\n";
}
$xml .= "</OrderData>\n";
}
if ($debug) {
$xml .= xmlEntry('debug', $debug);
}
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:load_order.php
示例8: xmlEntry
$xml .= "<bom>\n";
$xml .= "\t" . xmlEntry("qty", $value['qty']);
$xml .= "\t" . xmlEntry("sku", $value['sku']);
$xml .= "\t" . xmlEntry("description_short", $value['description_short']);
$xml .= "\t" . xmlEntry("item_cost", $value['item_cost']);
$xml .= "\t" . xmlEntry("quantity_on_hand", $value['quantity_on_hand']);
$xml .= "</bom>\n";
}
}
$xml .= xmlEntry("assy_cost", $assy_cost);
// build where used
foreach ($sku_usage as $value) {
$xml .= "<sku_usage>\n";
$xml .= "\t" . xmlEntry("text_line", $value);
$xml .= "</sku_usage>\n";
}
// build the sales price
$xml .= xmlEntry("sales_price", $sales_price);
// build the stock status
if (sizeof($stock_note) > 0) {
foreach ($stock_note as $value) {
$xml .= "<stock_note>\n";
$xml .= "\t" . xmlEntry("text_line", $value);
$xml .= "</stock_note>\n";
}
}
$str = createXmlHeader($fID);
$str .= $xml;
$str .= createXmlFooter();
echo $str;
die;
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:inv_details.php
示例9: max
case 'delete':
if ($rID) {
$my_class->btn_delete($rID);
}
break;
case 'update':
$my_class->btn_update($rID);
break;
case 'go_first':
$_REQUEST['list'] = 1;
break;
case 'go_previous':
$_REQUEST['list'] = max($_REQUEST['list'] - 1, 1);
break;
case 'go_next':
$_REQUEST['list']++;
break;
case 'go_last':
$_REQUEST['list'] = 99999;
break;
case 'go_page':
break;
}
// put the output together
$xml .= "\t" . xmlEntry("subject", $subject);
$xml .= "\t" . xmlEntry("htmlContents", "<div>" . $my_class->build_main_html() . "</div>");
if ($my_class->message) {
$xml .= "\t" . xmlEntry("message", $my_class->message);
}
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:tab_details.php
示例10: validate_ajax_user
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/phreedom/ajax/validate.php
//
/************** Check user security *****************************/
$security_level = validate_ajax_user();
/************** include page specific files *********************/
/************** page specific initialization *************************/
$xml = NULL;
$user = $_GET['u'];
$pass = $_GET['p'];
$level = $_GET['level'];
$result = $db->Execute("select inactive, admin_pass from " . TABLE_USERS . " where admin_name = '" . $user . "'");
if ($result->RecordCount() != 1 || $result->fields['inactive']) {
$xml = xmlEntry('result', 'failed');
} elseif (!pw_validate_password($pass, $result->fields['admin_pass'])) {
$xml = xmlEntry('result', 'failed');
} else {
$xml = xmlEntry('result', 'validated');
}
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:validate.php
示例11: Execute
function Execute($zf_sql, $zf_limit = false, $zf_cache = false, $zf_cachetime = 0)
{
global $zc_cache, $messageStack;
if ($zf_limit) {
$zf_sql = $zf_sql . ' LIMIT ' . $zf_limit;
}
if ($zf_cache and $zc_cache->sql_cache_exists($zf_sql) and !$zc_cache->sql_cache_is_expired($zf_sql, $zf_cachetime)) {
$obj = new queryFactoryResult();
$obj->cursor = 0;
$obj->is_cached = true;
$obj->sql_query = $zf_sql;
$zp_result_array = $zc_cache->sql_cache_read($zf_sql);
$obj->result = $zp_result_array;
if (sizeof($zp_result_array) > 0) {
$obj->EOF = false;
while (list($key, $value) = each($zp_result_array[0])) {
$obj->fields[$key] = $value;
}
return $obj;
} else {
$obj->EOF = true;
}
} elseif ($zf_cache) {
$zc_cache->sql_cache_expire_now($zf_sql);
$time_start = explode(' ', microtime());
$obj = new queryFactoryResult();
$obj->sql_query = $zf_sql;
if (!$this->db_connected) {
$this->set_error('0', DB_ERROR_NOT_CONNECTED);
}
$zp_db_resource = @mysql_query($zf_sql, $this->link);
if (!$zp_db_resource) {
$this->set_error(@mysql_errno(), @mysql_error());
}
$obj->resource = $zp_db_resource;
$obj->cursor = 0;
$obj->is_cached = true;
if ($obj->RecordCount() > 0) {
$obj->EOF = false;
$zp_ii = 0;
while (!$obj->EOF) {
$zp_result_array = @mysql_fetch_array($zp_db_resource);
if ($zp_result_array) {
while (list($key, $value) = each($zp_result_array)) {
if (!preg_match('/^[0-9]/', $key)) {
$obj->result[$zp_ii][$key] = $value;
}
}
} else {
$obj->Limit = $zp_ii;
$obj->EOF = true;
}
$zp_ii++;
}
while (list($key, $value) = each($obj->result[$obj->cursor])) {
if (!preg_match('/^[0-9]/', $key)) {
$obj->fields[$key] = $value;
}
}
$obj->EOF = false;
} else {
$obj->EOF = true;
}
$zc_cache->sql_cache_store($zf_sql, $obj->result);
$time_end = explode(' ', microtime());
$query_time = $time_end[1] + $time_end[0] - $time_start[1] - $time_start[0];
$this->total_query_time += $query_time;
$this->count_queries++;
return $obj;
} else {
$time_start = explode(' ', microtime());
$obj = new queryFactoryResult();
if (!$this->db_connected) {
$this->set_error('0', DB_ERROR_NOT_CONNECTED);
}
$zp_db_resource = @mysql_query($zf_sql, $this->link);
if (!$zp_db_resource) {
if ($_POST['page'] == 'ajax' || $_GET['page'] == 'ajax') {
$messageStack->debug("\n\nThe failing sql was: " . $zf_sql);
$messageStack->debug("\n\nmySQL returned: " . @mysql_errno($this->link) . ' ' . @mysql_error($this->link));
if (defined('FILENAME_DEFAULT')) {
$messageStack->write_debug();
}
echo createXmlHeader() . xmlEntry('error', 'There was a SQL Error: ' . @mysql_error($this->link)) . createXmlFooter();
die;
}
if (method_exists($messageStack, 'debug')) {
$messageStack->debug("\n\nThe failing sql was: " . $zf_sql);
$messageStack->debug("\n\nmySQL returned: " . @mysql_errno($this->link) . ' ' . @mysql_error($this->link));
if (defined('FILENAME_DEFAULT')) {
$messageStack->write_debug();
$messageStack->add('The last transaction had a SQL database error.', 'error');
gen_redirect(html_href_link(FILENAME_DEFAULT, 'cat=phreedom&page=main&action=crash', 'SSL'));
} else {
echo str_replace("\n", '<br />', $messageStack->debug_info);
die;
}
} else {
echo str_replace("\n", '<br />', $messageStack->debug_info);
die;
//.........这里部分代码省略.........
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:101,代码来源:query_factory.php
示例12: object_to_xml
function object_to_xml($params, $multiple = false, $multiple_key = '')
{
$output = NULL;
if (!is_array($params) && !is_object($params)) {
return;
}
foreach ($params as $key => $value) {
$xml_key = $multiple ? $multiple_key : $key;
if (is_array($value)) {
$output .= object_to_xml($value, true, $key);
} elseif (is_object($value)) {
$output .= "<" . $xml_key . ">\n" . object_to_xml($value) . "</" . $xml_key . ">\n";
} else {
if ($value != '') {
$output .= xmlEntry($xml_key, $value);
}
}
}
return $output;
}
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:20,代码来源:parser.php
示例13: PhreebooksExceptionHandler
function PhreebooksExceptionHandler($exception)
{
global $messageStack;
if ($_POST['page'] == 'ajax' || $_GET['page'] == 'ajax') {
echo createXmlHeader() . xmlEntry('error', "Exception: " . $exception->getMessage()) . createXmlFooter();
die;
}
$messageStack->add($exception->getMessage(), 'error');
$text = date('Y-m-d H:i:s') . " User: " . $_SESSION['admin_id'] . " Company: " . $_SESSION['company'];
$text .= " Exception: '" . $exception->getMessage() . "' line " . $exception->getLine() . " in file " . $exception->getFile();
if (DEBUG) {
error_log($text . PHP_EOL, 3, DIR_FS_MY_FILES . "/errors.log");
}
}
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:14,代码来源:common_functions.php
示例14: array
$field_list = array();
$query_raw = "select m.id, m.wo_title, m.description, i.image_with_path \n from " . TABLE_WO_MAIN . " m inner join " . TABLE_INVENTORY . " i on m.sku_id = i.id \n where m.inactive = '0' and i.id = '" . $iID . "'";
$result = $db->Execute($query_raw);
$id = $result->fields['id'];
$xml .= xmlEntry("WOid", $id);
$xml .= xmlEntry("WOTitle", $result->fields['wo_title']);
$xml .= xmlEntry("WODescription", $result->fields['description']);
if ($result->fields['image_with_path']) {
// show image if it is defined
$image = DIR_WS_MY_FILES . $_SESSION['company'] . '/inventory/images/' . $result->fields['image_with_path'];
} else {
$image = 0;
}
$xml .= xmlEntry("ImageURL", $image);
if ($id) {
$result = $db->Execute("select * from " . TABLE_WO_STEPS . " where ref_id = '" . $id . "' order by step");
while (!$result->EOF) {
$task = $db->Execute("select task_name, description from " . TABLE_WO_TASK . " where id = " . $result->fields['task_id'] . " limit 1");
$xml .= "<Task>\n";
$xml .= "\t" . xmlEntry("Step", $result->fields['step']);
$xml .= "\t" . xmlEntry("Task_id", $result->fields['task_id']);
$xml .= "\t" . xmlEntry("Task_name", $task->fields['task_name']);
$xml .= "\t" . xmlEntry("Description", $task->fields['description']);
$xml .= "</Task>\n";
$result->MoveNext();
}
} else {
$xml .= xmlEntry("Message", 'This SKU does not have a work order to build from!');
}
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:load_task_list.php
示例15: array
if ($result->RecordCount() > 0) {
$ajax_text = DOC_CTL_JS_DIR_DELETED_ERROR;
break;
}
// jstree initialization
$db_config = array("servername" => DB_SERVER_HOST, "username" => DB_SERVER_USERNAME, "password" => DB_SERVER_PASSWORD, "database" => DB_DATABASE);
if (extension_loaded("mysqli")) {
require_once DIR_FS_MODULES . "doc_ctl/includes/jstree/_lib/class._database_i.php";
} else {
require_once DIR_FS_MODULES . "doc_ctl/includes/jstree/_lib/class._database.php";
}
// Tree class
require_once DIR_FS_MODULES . "doc_ctl/includes/jstree/_lib/class.tree.php";
$jstree = new json_tree();
// deleted from database tree
$_POST['operation'] = $_REQUEST['operation'] = 'remove_node';
$_POST['id'] = $_REQUEST['id'] = $id;
$jstree->{'remove_node'}($_REQUEST);
$id = $doc_details->fields['parent_id'];
// set the id to the parent to display refreshed page
$ajax_text = '';
$xml .= "\t" . xmlEntry("action", 'reload_tree');
break;
default:
die;
}
// put the output together
$xml .= "\t" . xmlEntry("docID", $id);
$xml .= "\t" . xmlEntry("msg", $ajax_text);
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:doc_operation.php
示例16: db_prepare_input
$contact_id = db_prepare_input($_GET['contact_id']);
$xml = NULL;
$enc_data = new encryption();
$sql = "select id, hint, enc_value from " . TABLE_DATA_SECURITY . " \r\n\twhere module = 'contacts' and ref_1 = " . $contact_id;
$result = $db->Execute($sql);
while (!$result->EOF) {
$data = $enc_data->decrypt($_SESSION['admin_encrypt'], $result->fields['enc_value']);
$fields = explode(':', $data);
$xml .= "\t<payments>\n";
$xml .= "\t\t" . xmlEntry("id", $result->fields['id']);
$xml .= "\t\t" . xmlEntry("name", $fields[0]);
// will be the name field for credit cards
$xml .= "\t\t" . xmlEntry("hint", $result->fields['hint']);
for ($i = 0; $i < sizeof($fields); $i++) {
$xml .= "\t\t" . xmlEntry("field_" . $i, $fields[$i]);
}
$xml .= "\t</payments>\n";
$result->MoveNext();
}
// error check
if (!$_SESSION['admin_encrypt'] && $result->RecordCount() > 0) {
// no permission to enter page, return error
echo createXmlHeader($function_name) . xmlEntry('error', BNK_ERROR_NO_ENCRYPT_KEY) . createXmlFooter();
die;
}
//put it all together
$str = createXmlHeader($function_name);
$str .= $xml;
$str .= createXmlFooter();
echo $str;
die;
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:stored_payments.php
示例17: xmlEntry
if ($results = get_chart_data($fID, $data)) {
$xml .= xmlEntry('modID', $_GET['modID']);
$xml .= xmlEntry('type', $results['type']);
$xml .= xmlEntry('title', $results['title']);
$xml .= xmlEntry('width', $results['width']);
$xml .= xmlEntry('height', $results['height']);
$xml .= xmlEntry('rowCnt', sizeof($results['data']));
if (sizeof($results['data']) > 0) {
foreach ($results['data'] as $value) {
$xml .= '<chartData>';
$xml .= xmlEntry('string', $value['label']);
$xml .= xmlEntry('number', $value['value']);
$xml .= '</chartData>';
}
} else {
$xml .= xmlEntry('error', 'No data returned from function call!');
}
} else {
$xml .= xmlEntry('error', 'No data returned from function call!');
break;
}
} else {
$xml .= xmlEntry('error', 'Could not find module function file to process!');
break;
}
break;
default:
die;
}
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:phreedom.php
示例18: build_audit_xml
function build_audit_xml($date_from, $date_to, $select)
{
global $db, $messageStack, $coa_types_list, $currencies;
$tax_auths = gen_build_tax_auth_array();
$dates = gen_get_dates($date_from);
$output = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . chr(10);
$output .= '<auditfile>' . chr(10);
$output .= '<header>' . chr(10);
$output .= xmlEntry('auditfileVersion', 'CLAIR2.00.00', true);
$output .= xmlEntry('companyID', substr(htmlspecialchars(AUDIT_DEBIT_NUMBER), 0, 20), true);
$output .= xmlEntry('taxRegistrationNr', substr(htmlspecialchars(TAX_ID), 0, 15), true);
$output .= xmlEntry('companyName', substr(htmlspecialchars(COMPANY_NAME), 0, 50), true);
$output .= xmlEntry('companyAddress', substr(htmlspecialchars(COMPANY_ADDRESS1), 0, 50), true);
$output .= xmlEntry('companyCity', substr(htmlspecialchars(COMPANY_CITY_TOWN), 0, 50), true);
$output .= xmlEntry('companyPostalCode', substr(htmlspecialchars(COMPANY_POSTAL_CODE), 0, 10), true);
$output .= xmlEntry('fiscalYear', $dates['ThisYear'], true);
$output .= xmlEntry('startDate', $date_from, true);
$output .= xmlEntry('endDate', $date_to, true);
$output .= xmlEntry('currencyCode', DEFAULT_CURRENCY, true);
$output .= xmlEntry('dateCreated', date('Y-m-d'), true);
$output .= xmlEntry('productID', 'Phreebooks', true);
$output .= xmlEntry('productVersion', 'Phreebooks =' . MODULE_PHREEBOOKS_STATUS . ' audit=' . MODULE_AUDIT_STATUS, true);
//$output .= xmlEntry('',);
$output .= '</header>' . chr(10);
$output .= '<generalLedger>' . chr(10);
//all general ledger account
$income_types = array(30, 32, 34);
//$output .= xmlEntry('taxonomy','',true); //Zie toelichting *)
$result = $db->Execute("select * from " . TABLE_CHART_OF_ACCOUNTS . " where heading_only = '0'");
while (!$result->EOF) {
$temp = $coa_types_list[$result->fields['account_type']]['text'];
$output .= "\t" . '<ledgerAccount>' . chr(10);
$output .= "\t" . xmlEntry('accountID', $result->fields['id'], true);
//generalLedger id
$output .= "\t" . xmlEntry('accountDesc', substr(htmlspecialchars($result->fields['description']), 0, 50), true);
//generalLedger description
$output .= "\t" . xmlEntry('accountType', in_array($result->fields['account_type'], $income_types) ? TEXT_INCOME_STATEMENT : TEXT_BALANCE_SHEET, true);
//generalLedger Type balance or income
$output .= "\t" . xmlEntry('leadCode', $result->fields['account_type'], true);
//gl account type id *)
$output .= "\t" . xmlEntry('leadDescription', constant($coa_types_list[$result->fields['account_type']]['text']), true);
//GL account Type description *)
$output .= "\t" . '</ledgerAccount>' . chr(10);
$result->MoveNext();
}
$output .= '</generalLedger>' . chr(10);
$output .= '<customersSuppliers>' . chr(10);
// all contacts
$contacts = array();
$result = $db->Execute("select * from " . TABLE_CONTACTS . " where inactive = '0' and type in('v','c') ");
while (!$result->EOF) {
$contacts[$result->fields['id']] = $result->fields['short_name'];
$output .= "\t" . '<customerSupplier>' . chr(10);
$output .= "\t" . xmlEntry('custSupID', $result->fields['short_name'], true);
// vendor- of customer id
$output .= "\t" . xmlEntry('type', $result->fields['type'] == 'v' ? ACT_V_TYPE_NAME : ACT_C_TYPE_NAME, true);
// type Vendor or customer
$output .= "\t" . xmlEntry('taxRegistrationNr', htmlspecialchars($result->fields['gov_id_number']), true);
//tax id
$output .= "\t" . xmlEntry('taxVerificationDate', $result->fields['gov_id_number_date'], true);
//tax verification date (not present in phreedom) maybe in custom fields
$address = $db->Execute("select * from " . TABLE_ADDRESS_BOOK . " where ref_id = '" . $result->fields['id'] . "'");
while (!$address->EOF) {
if (substr($address->fields['type'], 1, 2) == 'm') {
$output .= "\t" . xmlEntry('companyName', htmlspecialchars($address->fields['primary_name']), true);
//company name
$output .= "\t" . xmlEntry('contact', htmlspecialchars($address->fields['contact']), true);
//contact person
$output .= "\t" . xmlEntry('telephone', htmlspecialchars($address->fields['telephone1']), true);
//company telephone
$output .= "\t" . xmlEntry('fax', htmlspecialchars($address->fields['telephone3']), true);
//company fax
$output .= "\t" . xmlEntry('email', htmlspecialchars($address->fields['email']), true);
//company email
$output .= "\t" . xmlEntry('website', htmlspecialchars($address->fields['website']), true);
//company URL website
//company billing address
$output .= "\t\t" . '<postalAddress>' . chr(10);
$output .= "\t\t" . xmlEntry('address', substr(htmlspecialchars($address->fields['address1'] . ' ' . $address->fields['address2']), 0, 50), true);
$output .= "\t\t" . xmlEntry('city', htmlspecialchars($address->fields['city_town']), true);
$output .= "\t\t" . xmlEntry('postalCode', htmlspecialchars($address->fields['postal_code']), true);
$output .= "\t\t" . xmlEntry('region', htmlspecialchars($address->fields['state_province']), true);
$output .= "\t\t" . xmlEntry('country', $address->fields['country_code'], true);
$output .= "\t\t" . '</postalAddress>' . chr(10);
} else {
if (substr($address->fields['type'], 1, 2) == 's') {
//company shipping address
$output .= "\t\t" . '<streetAddress>' . chr(10);
$output .= "\t\t" . xmlEntry('address', substr(htmlspecialchars($address->fields['address1'] . ' ' . $address->fields['address2']), 0, 50), true);
$output .= "\t\t" . xmlEntry('city', htmlspecialchars($address->fields['city_town']), true);
$output .= "\t\t" . xmlEntry('postalCode', htmlspecialchars($address->fields['postal_code']), true);
$output .= "\t\t" . xmlEntry('region', htmlspecialchars($address->fields['state_province']), true);
$output .= "\t\t" . xmlEntry('country', $address->fields['country_code'], true);
$output .= "\t\t" . '</streetAddress>' . chr(10);
}
}
$address->MoveNext();
}
$output .= "\t" . '</customerSupplier>' . chr(10);
$result->MoveNext();
//.........这里部分代码省略.........
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:101,代码来源:audit.php
示例19: switch
/************** include page specific files *********************/
/************** page specific initialization *************************/
$id = $_GET['id'];
$ajax_text = '';
if (!isset($_GET['id'])) {
die;
}
$dir_details = $db->Execute("select * from " . TABLE_PHREEFORM . " where id = '" . $id . "'");
switch ($_REQUEST['action']) {
case 'go_up':
$id = $dir_details->fields['parent_id'];
// set the id to the parent to display refreshed page
break;
case 'delete':
$result = $db->Execute("select id from " . TABLE_PHREEFORM . " where parent_id = '" . $id . "' limit 1");
if ($result->RecordCount() > 0) {
$ajax_text = DOC_CTL_DIR_NOT_EMPTY;
} else {
$db->Execute("delete from " . TABLE_PHREEFORM . " where id = '" . $id . "'");
$id = $dir_details->fields['parent_id'];
// set the id to the parent to display refreshed page
$ajax_text = DOC_CTL_DIR_DELETED;
}
break;
default:
die;
}
$xml .= "\t" . xmlEntry("docID", $id);
$xml .= "\t" . xmlEntry("message", $ajax_text);
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:dir_operation.php
示例20: validate_ajax_user
// +-----------------------------------------------------------------+
// Path: /modules/phreebooks/ajax/load_gl_data.php
//
/************** Check user security *****************************/
$xml = NULL;
$security_level = validate_ajax_user();
/************** include page specific files *********************/
/************** page specific initialization *********************/
$gl_acct = db_prepare_input($_GET['glAcct']);
$fy = db_prepare_input($_GET['fy']);
$error = false;
$result = $db->Execute("select period, start_date, end_date from " . TABLE_ACCOUNTING_PERIODS . " \n\twhere fiscal_year = '" . ($fy - 1) . "' order by period");
if ($result->RecordCount() == 0) {
// no earlier data found
echo createXmlHeader() . xmlEntry('error', ERROR_NO_GL_ACCT_INFO) . createXmlFooter();
die;
}
$periods = array();
while (!$result->EOF) {
$periods[] = $result->fields['period'];
$result->MoveNext();
}
$result = $db->Execute("select debit_amount - credit_amount as balance from " . TABLE_CHART_OF_ACCOUNTS_HISTORY . " \n\twhere account_id = '" . $gl_acct . "' and period in (" . implode(',', $periods) . ")");
while (!$result->EOF) {
$xml .= "\t<items>\n";
$xml .= "\t\t" . xmlEntry('balance', $currencies->format($result->fields['balance']));
$xml .= "\t</items>\n";
$result->MoveNext();
}
echo createXmlHeader() . $xml . createXmlFooter();
die;
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:load_gl_data.php
注:本文中的xmlEntry函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论