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