当前位置: 首页>>代码示例>>PHP>>正文


PHP xml::xml_to_array方法代码示例

本文整理汇总了PHP中xml::xml_to_array方法的典型用法代码示例。如果您正苦于以下问题:PHP xml::xml_to_array方法的具体用法?PHP xml::xml_to_array怎么用?PHP xml::xml_to_array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xml的用法示例。


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

示例1: xml

 * style_str - style string
 * styletype - stype of style change
 */
ini_set("display_errors", "1");
ini_set("display_startup_errors", "1");
include "include/dbcommon.php";
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
include "include/reportfunctions.php";
// #9875 It's expected that webreport_style table belongs to the webreport db connection
$_connection = $cman->getForWebReports();
$xml = new xml();
if (!postvalue('str_xml')) {
    echo "Error: No se han obtenido resultados. Inténtelo de nuevo.";
    exit(0);
}
$arr = $xml->xml_to_array(postvalue('str_xml'));
$repname = postvalue('repname');
if ($_POST['str_xml'] == "del_all") {
    $strSQL = "DELETE FROM " . $_connection->addTableWrappers("webreport_style") . " WHERE " . $_connection->addFieldWrappers("repname") . "=" . $_connection->prepareString($repname);
    $_connection->exec($strSQL);
    die;
}
$arrayer = array();
foreach ($arr as $key => $style_record) {
    if ($style_record['type'] == "table") {
        $strSQL = "DELETE FROM " . $_connection->addTableWrappers("webreport_style") . " WHERE (" . $_connection->addFieldWrappers("repname") . "=" . $_connection->prepareString($repname) . " AND " . $_connection->addFieldWrappers("styletype") . "='" . $style_record['params']['styleType'] . "')";
        $_connection->exec($strSQL);
    }
    if ($style_record['type'] == "group") {
        if ($style_record['params']['groupName'] != 0) {
            $strSQL = "DELETE FROM " . $_connection->addTableWrappers("webreport_style") . " WHERE (" . $_connection->addFieldWrappers("group") . " = " . (0 + $style_record["params"]["groupName"]) . " AND " . $_connection->addFieldWrappers("repname") . "=" . $_connection->prepareString($repname) . " AND " . $_connection->addFieldWrappers("styletype") . "='" . $style_record["params"]["styleType"] . "' AND (" . $_connection->addFieldWrappers("type") . "='cell' OR " . $_connection->addFieldWrappers("type") . "='group'))";
开发者ID:kcallow,项目名称:MatchMe,代码行数:31,代码来源:save-style.php

示例2: getabspath

require_once "include/dbcommon.php";
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
require_once "classes/charts.php";
require_once getabspath("include/xml.php");
require_once getabspath("classes/searchclause.php");
if (!isLogged()) {
    Security::saveRedirectURL();
    HeaderRedirect("login", "", "message=expired");
    return;
}
$xml = new xml();
$chrt_strXML = "";
if (checkTableName(postvalue("chartname"), titCHART)) {
    include_once "include/" . postvalue("chartname") . "_variables.php";
    $chrt_strXML = GetChartXML(postvalue("chartname"));
    $chrt_array = $xml->xml_to_array($chrt_strXML);
    $_SESSION["webobject"]["table_type"] = "project";
    $_SESSION["object_sql"] = "";
}
$webchart = false;
if (!$chrt_strXML) {
    $sessPrefix = "webchart" . postvalue('cname');
    $chrt_strXML = LoadSelectedChart(postvalue('cname'));
    $webchart = true;
    $chrt_array = $xml->xml_to_array($chrt_strXML);
    if (is_wr_project()) {
        include_once "include/" . $chrt_array['settings']['short_table_name'] . "_variables.php";
    }
}
$param = array();
$param["webchart"] = $webchart;
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:31,代码来源:dchartdata.php

示例3: xml_to_array

 /**
  * 将XMLL               字符串或文件转为数组
  * @param string $xml   XML字符串或XML文件
  * @return array        解析后的数组
  */
 public function xml_to_array($xml)
 {
     return xml::xml_to_array($xml);
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:9,代码来源:Control.class.php

示例4: GetReportsList

function GetReportsList()
{
    $connection = getWebreportConnection();
    // #9875
    $xml = new xml();
    $arr = array();
    $arrUserGroup = GetUserGroup();
    $strSQL = "SELECT " . $connection->addFieldWrappers("rpt_name") . ", " . $connection->addFieldWrappers("rpt_title") . ", " . $connection->addFieldWrappers("rpt_owner") . ", " . $connection->addFieldWrappers("rpt_status") . ", " . $connection->addFieldWrappers("rpt_content") . " FROM " . $connection->addTableWrappers("webreports") . " WHERE " . $connection->addFieldWrappers("rpt_type") . " = 'report' order by " . $connection->addFieldWrappers("rpt_title");
    $qResult = $connection->query($strSQL);
    while ($row = $qResult->fetchNumeric()) {
        $report_arr = $xml->xml_to_array(escapeEntities($row[4]));
        $view = 0;
        $edit = 0;
        if (isset($report_arr['permissions'])) {
            foreach ($report_arr['permissions'] as $arr_prm) {
                if (in_array($arr_prm['id'], $arrUserGroup)) {
                    $view = $arr_prm['view'] == "true" ? 1 : 0;
                    $edit = $arr_prm['edit'] == "true" ? 1 : 0;
                }
            }
        } else {
            $view = 1;
        }
        if (!$report_arr["tmp_active"]) {
            $arr[] = array("name" => $row[0], "title" => $row[1], "owner" => $row[2], "status" => $row[3], "view" => $view, "edit" => $edit);
        }
    }
    return $arr;
}
开发者ID:kcallow,项目名称:MatchMe,代码行数:29,代码来源:reportfunctions.php

示例5: GetReportsList

function GetReportsList() {
	global $conn;

	$xml = new xml();
	$arr=array();
	$strSQL = "SELECT ".AddFieldWrappers("rpt_name").", ".AddFieldWrappers("rpt_title").", ".AddFieldWrappers("rpt_owner").", ".AddFieldWrappers("rpt_status").", ".AddFieldWrappers("rpt_content");
	$strSQL .= " FROM ".AddTableWrappers("webreports")." WHERE ".AddFieldWrappers("rpt_type")." = 'report' order by ".AddFieldWrappers("rpt_title");
	$rsReport = db_query($strSQL,$conn);
	
	$arrUserGroup = GetUserGroup();
	while( $row = db_fetch_numarray( $rsReport ) ) {
		$report_arr = $xml->xml_to_array( escapeEntities($row[4]) );
        $view = 0;
		$edit = 0;

		if ( isset($report_arr['permissions']) ) {
			foreach ( $report_arr['permissions'] as $arr_prm ) {
				if (in_array($arr_prm['id'], $arrUserGroup)) {
					$view = ( $arr_prm['view'] == "true" ) ? 1 : 0;
					$edit = ( $arr_prm['edit'] == "true" ) ? 1 : 0;
				}
			}
		}
		else
		{
			$view=1;
		}

		if(!$report_arr["tmp_active"])
		{
		$arr[] = array(
			"name"		=> $row[0],
			"title"		=> $row[1],
			"owner"		=> $row[2],
			"status"	=> $row[3],
			"view"		=> $view,
			"edit"		=> $edit
		);
	}
	}
	
	return $arr;
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:43,代码来源:reportfunctions.php


注:本文中的xml::xml_to_array方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。