function doSection ($attrstr) {
	$attrstr = html_entity_decode($attrstr);
	$attr = new Attributes($attrstr);
	$preface = $attr->getAttrib('preface');
	if ($preface !== false) {
/*		flush_section(0);
		if ($preface == 'start')
			$ret = "<abstract>";
		elseif ($preface == 'end')
			$ret = "</abstract>"; */
	}
	else {
		global $current_section;
		$level = $attr->getAttrib('level');
		$ret = flush_section($level) . "<section";
		$current_section = $level;
		$label = trim($attr->getAttrib('label'));
		if ($label != '') {
			$ret .= ' id="'.substitute_umlauts($label).'"';
			$ret .= ' wikipage="'.substitute_umlauts($label).'"';
		}
		$title = $attr->getAttrib('title');
		$ret.= "><title>".xmlencode($attr->getAttrib('title'))."</title>";
	}
	return $ret;
}
Пример #2
0
function arrToXmlLabel($arr, $xmlStr)
{
    foreach ($arr as $key => $val) {
        if (is_array($val)) {
            $xmlStr .= "\n<" . $key . ">" . arrToXmlLabel($val) . "</" . $key . ">";
        } else {
            $xmlStr .= "\n<" . $key . ">" . xmlencode($val) . "</" . $key . ">";
        }
    }
    return $xmlStr;
}
Пример #3
0
function showrss($rssarr)
{
    global $sql;
    header("Content-type: application/xml");
    echo "<?xml version=\"1.0\" encoding=\"" . $rssarr['charset'] . "\"?>\n<rss version=\"2.0\">\n\t<channel>\n\t\t<title>" . xmlencode($rssarr['title']) . "</title>\n\t\t<link>" . xmlencode($rssarr['link']) . "</link>\n\t\t<description>" . xmlencode($rssarr['description']) . "</description>\n\t\t<copyright>" . xmlencode($rssarr['copyright']) . "</copyright>\n\t\t<generator>" . xmlencode($rssarr['generator']) . "</generator>\n\t\t<sql>" . $sql . "</sql>\n\t\t<lastBuildDate>" . $rssarr['lastBuildDate'] . "</lastBuildDate>\r\n";
    if (!empty($rssarr['items'])) {
        foreach ($rssarr['items'] as $key => $value) {
            echo "\t\t<item>\n\t\t\t<title>" . xmlencode($value['title']) . "</title>\n\t\t\t<link>" . xmlencode($value['link']) . "</link>\n\t\t\t<description><![CDATA[" . $value['description'] . "]]>\n\t\t\t</description>\n\t\t\t<category>" . xmlencode($value['category']) . "</category>\n\t\t\t<author>" . xmlencode($value['author']) . "</author>\n\t\t\t<pubDate>" . xmlencode($value['pubDate']) . "</pubDate>\n\t\t</item>\r\n";
        }
    }
    echo "\t</channel>\r\n</rss>";
}
		<attr value="label">' . xmlencode(GetFieldLabel("Non_Selling_Products_with_Stock_Current_Year", "SUM_Fact_DiscountValue_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataNon_Selling_Products_with_Stock_Current_Year[".chartXml"] .= '<attr value="10">
		<attr value="name">SUM(Fact_GrossProfit)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Non_Selling_Products_with_Stock_Current_Year", "SUM_Fact_GrossProfit_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataNon_Selling_Products_with_Stock_Current_Year[".chartXml"] .= '<attr value="11">
		<attr value="name">SUM(Fact_GP)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Non_Selling_Products_with_Stock_Current_Year", "SUM_Fact_GP_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataNon_Selling_Products_with_Stock_Current_Year[".chartXml"] .= '<attr value="12">
		<attr value="name">AVG(QOH)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Non_Selling_Products_with_Stock_Current_Year", "AVG_QOH_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataNon_Selling_Products_with_Stock_Current_Year[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Non Selling Products with Stock Current Year</attr>
<attr value="short_table_name">Non_Selling_Products_with_Stock_Current_Year</attr>
</attr>

</chart>';
$tables_data["Non Selling Products with Stock Current Year"] =& $tdataNon_Selling_Products_with_Stock_Current_Year;
$field_labels["Non_Selling_Products_with_Stock_Current_Year"] =& $fieldLabelsNon_Selling_Products_with_Stock_Current_Year;
$fieldToolTips["Non Selling Products with Stock Current Year"] =& $fieldToolTipsNon_Selling_Products_with_Stock_Current_Year;
$page_titles["Non_Selling_Products_with_Stock_Current_Year"] =& $pageTitlesNon_Selling_Products_with_Stock_Current_Year;
		<attr value="label">' . xmlencode(GetFieldLabel("Current_Year_Sales", "AVG_Fact_GP_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent_Year_Sales[".chartXml"] .= '<attr value="4">
		<attr value="name">m</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current_Year_Sales", "m")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent_Year_Sales[".chartXml"] .= '<attr value="5">
		<attr value="name">y</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current_Year_Sales", "y")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent_Year_Sales[".chartXml"] .= '<attr value="6">
		<attr value="name">monthName</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current_Year_Sales", "monthName")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent_Year_Sales[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Current Year Sales</attr>
<attr value="short_table_name">Current_Year_Sales</attr>
</attr>

</chart>';
$tables_data["Current Year Sales"] =& $tdataCurrent_Year_Sales;
$field_labels["Current_Year_Sales"] =& $fieldLabelsCurrent_Year_Sales;
$fieldToolTips["Current Year Sales"] =& $fieldToolTipsCurrent_Year_Sales;
$page_titles["Current_Year_Sales"] =& $pageTitlesCurrent_Year_Sales;
Пример #6
0
 /**
  * Get axes displyed values
  * @param Number index
  * @param String value
  * @return String
  */
 protected function getAxisDisplayValue($index, $value)
 {
     global $locale_info;
     if ($value == "" || is_null($value)) {
         return "";
     }
     $groupFieldsData = $this->xml_array["group_fields"];
     $field = $groupFieldsData[$index]["name"];
     $int_type = $groupFieldsData[$index]["int_type"];
     if ($this->fromWizard) {
         $control = $this->viewControls->getControl($field);
     }
     if ($int_type == 0) {
         // The 'Normal' interval is set
         if ($this->fromWizard) {
             $data = array($field => $value);
             return $control->showDBValue($data, "");
         }
         if ($this->table_type != "db") {
             $fieldIdentifier = $this->xml_array["tables"][0] . "_" . $field;
         } else {
             $fieldIdentifier = $this->CrossGoodFieldName($field);
         }
         if ($this->xml_array['totals'][$fieldIdentifier]['curr'] == true) {
             return str_format_currency($value);
         }
         return xmlencode($value);
     }
     $ftype = $this->getFieldType($field);
     if (IsNumberType($ftype)) {
         $start = $value - $value % $int_type;
         $end = $start + $int_type;
         if ($this->fromWizard) {
             $dataStart = array($field => $start);
             $dataEnd = array($field => $end);
             return $control->showDBValue($dataStart, "") . " - " . $control->showDBValue($dataEnd, "");
         }
         if ($this->table_type != "db") {
             $fieldIdentifier = $this->xml_array["tables"][0] . "_" . $field;
         } else {
             $fieldIdentifier = $this->CrossGoodFieldName($field);
         }
         if ($this->xml_array['totals'][$fieldIdentifier]['curr'] == true) {
             return str_format_currency($start) . " - " . str_format_currency($end);
         }
         return $start . " - " . $end;
     }
     if (IsCharType($ftype)) {
         return xmlencode(substr($value, 0, $int_type));
     }
     if (IsDateFieldType($ftype)) {
         $dvalue = substr($value, 0, 4) . '-' . substr($value, 4, 2) . '-' . substr($value, 6, 2);
         if (strlen($value) == 10) {
             $dvalue .= " " . substr($value, 8, 2) . "00:00";
         } elseif (strlen($value) == 12) {
             $dvalue .= " " . substr($value, 8, 2) . ":" . substr($value, 10, 2) . ":00";
         }
         $tm = db2time($dvalue);
         if (!count($tm)) {
             return "";
         }
         switch ($int_type) {
             case 1:
                 // DATE_INTERVAL_YEAR
                 return $tm[0];
             case 2:
                 // DATE_INTERVAL_QUARTER
                 return $tm[0] . "/Q" . $tm[1];
             case 3:
                 // DATE_INTERVAL_MONTH
                 return @$locale_info["LOCALE_SABBREVMONTHNAME" . $tm[1]] . " " . $tm[0];
             case 4:
                 // DATE_INTERVAL_WEEK
                 $dates = $this->getDatesByWeek($tm[1] + 1, $tm[0]);
                 return format_shortdate(db2time($dates[0])) . ' - ' . format_shortdate(db2time($dates[1]));
             case 5:
                 // DATE_INTERVAL_DAY
                 return format_shortdate($tm);
             case 6:
                 // DATE_INTERVAL_HOUR
                 $tm[4] = 0;
                 $tm[5] = 0;
                 return str_format_datetime($tm);
             case 7:
                 // DATE_INTERVAL_MINUTE
                 $tm[5] = 0;
                 return str_format_datetime($tm);
             default:
                 return str_format_datetime($tm);
         }
     }
     return "";
 }
Пример #7
0
function buildXmlTree($var, &$xml)
{
    if (is_array($var)) {
        foreach ($var as $key => $value) {
            $xml .= "<{$key}>" . buildXmlTree($value, $xml) . "</{$key}>\n";
        }
    } else {
        return xmlencode($var);
    }
}
Пример #8
0
$play_cycle = intval($_G['cache']['plugin']['wirror_slider']['play_cycle']);
$pic_width = ($player_width ? $player_width : 960) - 40;
$pic_height = ($player_height ? $player_height : 300) - 100;
$auto_play = $play_cycle ? $play_cycle : 10;
$effects = array('<Transition Pieces="9" Time="1.2" Transition="easeInOutBack" Delay="0.1" DepthOffset="300" CubeDistance="30"></Transition>', '<Transition Pieces="15" Time="3" Transition="easeInOutElastic" Delay="0.03" DepthOffset="200" CubeDistance="10"></Transition>', '<Transition Pieces="5" Time="1.3" Transition="easeInOutCubic" Delay="0.1" DepthOffset="500" CubeDistance="50"></Transition>', '<Transition Pieces="9" Time="1.25" Transition="easeInOutBack" Delay="0.1" DepthOffset="900" CubeDistance="5"></Transition>');
$xml = '';
$xml .= '<?xml version="1.0" encoding="utf-8"?>' . "\n";
$xml .= '<Piecemaker>' . "\n";
$xml .= '<Contents>' . "\n";
$pics = C::t('#wirror_slider#wirror_slider_pics')->fetch_all_data(true);
foreach ($pics as $pic) {
    $pic['title'] = iconv(CHARSET, 'UTF-8', $pic['title']);
    $pic['description'] = iconv(CHARSET, 'UTF-8', $pic['description']);
    $xml .= '<Image Source="' . xmlencode($pic['pic']) . '" Title="' . xmlencode($pic['title']) . '">' . "\n";
    $xml .= "<Text>&lt;h1&gt;{$pic['title']}&lt;/h1&gt;&lt;p&gt;{$pic['description']}&lt;/p&gt;</Text>" . "\n";
    $xml .= '<Hyperlink URL="' . xmlencode($pic['link']) . '" Target="_blank" />' . "\n";
    $xml .= '</Image>' . "\n";
}
$xml .= '</Contents>' . "\n";
$xml .= '<Settings ImageWidth="' . $pic_width . '" ImageHeight="' . $pic_height . '" LoaderColor="0x333333" InnerSideColor="0x222222" SideShadowAlpha="0.8" DropShadowAlpha="0.7" DropShadowDistance="25" DropShadowScale="0.95" DropShadowBlurX="40" DropShadowBlurY="4" MenuDistanceX="20" MenuDistanceY="50" MenuColor1="0x999999" MenuColor2="0x333333" MenuColor3="0xFFFFFF" ControlSize="100" ControlDistance="20" ControlColor1="0x222222" ControlColor2="0xFFFFFF" ControlAlpha="0.8" ControlAlphaOver="0.95" ControlsX="' . $pic_width / 2 . '" ControlsY="' . ($pic_height - 50) . '&#xD;&#xA;" ControlsAlign="center" TooltipHeight="30" TooltipColor="0x222222" TooltipTextY="5" TooltipTextStyle="P-Italic" TooltipTextColor="0xFFFFFF" TooltipMarginLeft="5" TooltipMarginRight="7" TooltipTextSharpness="50" TooltipTextThickness="-100" InfoWidth="400" InfoBackground="0xFFFFFF" InfoBackgroundAlpha="0.95" InfoMargin="15" InfoSharpness="0" InfoThickness="0" Autoplay="' . $auto_play . '" FieldOfView="45"></Settings>' . "\n";
$xml .= '<Transitions>' . "\n";
foreach ($pics as $idx => $pic) {
    if (isset($effects[$idx])) {
        $xml .= $effects[$idx] . "\n";
    } else {
        $xml .= $effects[0] . "\n";
    }
}
$xml .= '</Transitions>' . "\n";
$xml .= '</Piecemaker>' . "\n";
header('Content-Type:text/xml;charset=utf-8;');
Пример #9
0
function buildXmlTree($var, &$xml)
{
    if (is_array($var)) {
        foreach ($var as $key => $value) {
            if (is_numeric($key)) {
                $key = "id_" . $key;
            }
            $xml .= "<{$key}>";
            $inner = buildXmlTree($value, $xml);
            $xml .= $inner . "</{$key}>\n";
        }
    } else {
        return xmlencode($var);
    }
}
Пример #10
0
        $lastupdated = date("r");
        if (isset($_GET['type'])) {
            $xmlpage = "<" . "?" . "xml version=\"1.0\" encoding=\"{$charset}\" ?" . ">\n                <rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n                <channel>\n                <atom:link href=\"{$encoded_url}\" rel=\"self\" type=\"application/rss+xml\" />\n                <title>" . xmlencode($site_name) . " - " . _("Latest Releases") . "</title>\n                <link>" . xmlencode($code_url) . "</link>\n                <description>" . xmlencode(sprintf(_("The latest releases posted to Project Gutenberg from %1\$s."), $site_name)) . "</description>\n                <webMaster>" . xmlencode($site_manager_email_addr) . " (" . xmlencode(_("Site Manager")) . ")</webMaster>\n                <pubDate>" . xmlencode($lastupdated) . "</pubDate>\n                <lastBuildDate>" . xmlencode($lastupdated) . "</lastBuildDate>\n                {$data}\n                </channel>\n                </rss>";
        } else {
            $xmlpage = "<" . "?" . "xml version=\"1.0\" encoding=\"{$charset}\" ?" . ">\n                <!-- Last Updated: {$lastupdated} -->\n                <projects xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"projects.xsd\">\n                {$data}\n                </projects>";
        }
    }
    if ($content == "news") {
        $data = '';
        $result = mysql_query("SELECT * FROM news_items ORDER BY date_posted DESC LIMIT 10");
        while ($news_item = mysql_fetch_array($result)) {
            $posteddate = date("l, F jS, Y", $news_item['date_posted']);
            $data .= "<item>\n                <title>" . xmlencode(sprintf(_("News Update for %1\$s."), $posteddate)) . "</title>\n                <link>" . xmlencode("{$code_url}/pastnews.php?#" . $news_item['id']) . "</link>\n                <guid>" . xmlencode("{$code_url}/pastnews.php?#" . $news_item['id']) . "</guid>\n                <description>" . xmlencode(strip_tags($news_item['content'])) . "</description>\n                </item>\n                ";
        }
        $lastupdated = date("r");
        $xmlpage = "<" . "?" . "xml version=\"1.0\" encoding=\"{$charset}\" ?" . ">\n                <rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n                <channel>\n                <atom:link href=\"{$encoded_url}\" rel=\"self\" type=\"application/rss+xml\" />\n                <title>" . xmlencode($site_name) . " - " . _("Latest News") . "</title>\n                <link>" . xmlencode($code_url) . "</link>\n                <description>" . xmlencode(sprintf(_("The latest news related to %1\$s."), $site_name)) . "</description>\n                <webMaster>" . xmlencode($site_manager_email_addr) . " (" . xmlencode(_("Site Manager")) . ")</webMaster>\n                <pubDate>" . xmlencode($lastupdated) . "</pubDate>\n                <lastBuildDate>" . xmlencode($lastupdated) . "</lastBuildDate>\n                {$data}\n                </channel>\n                </rss>";
    }
    $file = fopen($xmlfile, "w");
    fwrite($file, $xmlpage);
    $file = fclose($file);
}
// If we're here, the file exists and is fresh, output it
$fileModifiedTime = filemtime($xmlfile);
$secondsOfFreshnessRemaining = $fileModifiedTime + $refreshDelay - time();
// Let the browser cache it until the local cache becomes stale
header("Content-Type: text/xml");
header("Expires: " . gmdate("D, d M Y H:i:s", $fileModifiedTime + $refreshDelay) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $fileModifiedTime) . " GMT");
header("Cache-Control: max-age={$secondsOfFreshnessRemaining}, public, must-revalidate");
readfile($xmlfile);
// vim: sw=4 ts=4 expandtab
<attr value="linestyle">0</attr>
<attr value="autoupdate">0</attr>
<attr value="autoupmin">60</attr>
<attr value="cscroll">true</attr>
<attr value="maxbarscroll">10</attr>';
$tdataSales_By_SalesPerson_Chart[".chartXml"] .= '</attr>

<attr value="fields">';
$tdataSales_By_SalesPerson_Chart[".chartXml"] .= '<attr value="0">
		<attr value="name">SalesPerson</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Sales_By_SalesPerson_Chart", "SalesPerson")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataSales_By_SalesPerson_Chart[".chartXml"] .= '<attr value="1">
		<attr value="name">MTD Sales</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Sales_By_SalesPerson_Chart", "MTD_Sales")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataSales_By_SalesPerson_Chart[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Sales By SalesPerson Chart</attr>
<attr value="short_table_name">Sales_By_SalesPerson_Chart</attr>
</attr>

</chart>';
$tables_data["Sales By SalesPerson Chart"] =& $tdataSales_By_SalesPerson_Chart;
$field_labels["Sales_By_SalesPerson_Chart"] =& $fieldLabelsSales_By_SalesPerson_Chart;
$fieldToolTips["Sales By SalesPerson Chart"] =& $fieldToolTipsSales_By_SalesPerson_Chart;
$page_titles["Sales_By_SalesPerson_Chart"] =& $pageTitlesSales_By_SalesPerson_Chart;
		<attr value="label">' . xmlencode(GetFieldLabel("Top_Selling_Products_Current_Year", "SUM_Fact_DiscountValue_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_Selling_Products_Current_Year[".chartXml"] .= '<attr value="10">
		<attr value="name">SUM(Fact_GrossProfit)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Top_Selling_Products_Current_Year", "SUM_Fact_GrossProfit_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_Selling_Products_Current_Year[".chartXml"] .= '<attr value="11">
		<attr value="name">SUM(Fact_GP)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Top_Selling_Products_Current_Year", "SUM_Fact_GP_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_Selling_Products_Current_Year[".chartXml"] .= '<attr value="12">
		<attr value="name">AVG(QOH)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Top_Selling_Products_Current_Year", "AVG_QOH_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_Selling_Products_Current_Year[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Top Selling Products Current Year</attr>
<attr value="short_table_name">Top_Selling_Products_Current_Year</attr>
</attr>

</chart>';
$tables_data["Top Selling Products Current Year"] =& $tdataTop_Selling_Products_Current_Year;
$field_labels["Top_Selling_Products_Current_Year"] =& $fieldLabelsTop_Selling_Products_Current_Year;
$fieldToolTips["Top Selling Products Current Year"] =& $fieldToolTipsTop_Selling_Products_Current_Year;
$page_titles["Top_Selling_Products_Current_Year"] =& $pageTitlesTop_Selling_Products_Current_Year;
Пример #13
0
echo "<?xml version=\"1.0\" encoding=\"{$charset}\" ?>\n";
echo "<memberstats xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"memberstats.xsd\">\n";
$now = time();
$daysInExistence = floor(($now - $user->date_created) / 86400);
//User info
if ($user->u_privacy == PRIVACY_PUBLIC) {
    echo "\n        <userinfo id='{$user->u_id}'>\n            <username>" . xmlencode($user->username) . "</username>\n            <datejoined>" . date("m/d/Y", $user->date_created) . "</datejoined>\n            <lastlogin>" . date("m/d/Y", $user->last_login) . "</lastlogin>\n            <location>" . xmlencode($forum_profile['from']) . "</location>\n            <occupation>" . xmlencode($forum_profile['occ']) . "</occupation>\n            <interests>" . xmlencode($forum_profile['interests']) . "</interests>\n            <website>" . xmlencode($forum_profile['website']) . "</website>";
    foreach ($page_tally_names as $tally_name => $tally_title) {
        $tallyboard = new TallyBoard($tally_name, 'U');
        $current_page_tally = $tallyboard->get_current_tally($user->u_id);
        $currentRank = $tallyboard->get_rank($user->u_id);
        list($bestDayCount, $bestDayTimestamp) = $tallyboard->get_info_re_largest_delta($user->u_id);
        $bestDayTime = date("M. jS, Y", $bestDayTimestamp - 1);
        if ($daysInExistence > 0) {
            $daily_Average = $current_page_tally / $daysInExistence;
        } else {
            $daily_Average = 0;
        }
        echo "\n            <roundinfo id='{$tally_name}'>\n                <pagescompleted>{$current_page_tally}</pagescompleted>\n                <overallrank>{$currentRank}</overallrank>\n                <bestdayever>\n                    <pages>{$bestDayCount}</pages>\n                    <date>{$bestDayTime}</date>\n                </bestdayever>\n                <dailyaverage>" . number_format($daily_Average) . "</dailyaverage>\n            </roundinfo>";
    }
    echo "\n        </userinfo>";
    //Team info
    $result = select_from_teams("id IN ({$user->team_1}, {$user->team_2}, {$user->team_3})");
    echo "\n        <teaminfo>";
    while ($row = mysql_fetch_assoc($result)) {
        echo "\n            <team>\n            <name>" . xmlencode($row['teamname']) . "</name>\n            <activemembers>" . $row['active_members'] . "</activemembers>\n            </team>";
    }
    echo "\n        </teaminfo>";
}
echo "\n</memberstats>";
// vim: sw=4 ts=4 expandtab
		<attr value="label">' . xmlencode(GetFieldLabel("Current___Last_Year_Sales_Comparison", "FiscalMonth")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent___Last_Year_Sales_Comparison[".chartXml"] .= '<attr value="1">
		<attr value="name">monthName</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current___Last_Year_Sales_Comparison", "monthName")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent___Last_Year_Sales_Comparison[".chartXml"] .= '<attr value="2">
		<attr value="name">CurrSales</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current___Last_Year_Sales_Comparison", "CurrSales")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent___Last_Year_Sales_Comparison[".chartXml"] .= '<attr value="3">
		<attr value="name">PrevSales</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current___Last_Year_Sales_Comparison", "PrevSales")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent___Last_Year_Sales_Comparison[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Current - Last Year Sales Comparison</attr>
<attr value="short_table_name">Current___Last_Year_Sales_Comparison</attr>
</attr>

</chart>';
$tables_data["Current - Last Year Sales Comparison"] =& $tdataCurrent___Last_Year_Sales_Comparison;
$field_labels["Current___Last_Year_Sales_Comparison"] =& $fieldLabelsCurrent___Last_Year_Sales_Comparison;
$fieldToolTips["Current - Last Year Sales Comparison"] =& $fieldToolTipsCurrent___Last_Year_Sales_Comparison;
$page_titles["Current___Last_Year_Sales_Comparison"] =& $pageTitlesCurrent___Last_Year_Sales_Comparison;
		<attr value="label">' . xmlencode(GetFieldLabel("YTD_Sales_By_SalesPerson", "SourceID")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataYTD_Sales_By_SalesPerson[".chartXml"] .= '<attr value="1">
		<attr value="name">SalesPerson</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("YTD_Sales_By_SalesPerson", "SalesPerson")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataYTD_Sales_By_SalesPerson[".chartXml"] .= '<attr value="2">
		<attr value="name">TRANO</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("YTD_Sales_By_SalesPerson", "TRANO")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataYTD_Sales_By_SalesPerson[".chartXml"] .= '<attr value="3">
		<attr value="name">Fact_SalesValue</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("YTD_Sales_By_SalesPerson", "Fact_SalesValue")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataYTD_Sales_By_SalesPerson[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">YTD Sales By SalesPerson</attr>
<attr value="short_table_name">YTD_Sales_By_SalesPerson</attr>
</attr>

</chart>';
$tables_data["YTD Sales By SalesPerson"] =& $tdataYTD_Sales_By_SalesPerson;
$field_labels["YTD_Sales_By_SalesPerson"] =& $fieldLabelsYTD_Sales_By_SalesPerson;
$fieldToolTips["YTD Sales By SalesPerson"] =& $fieldToolTipsYTD_Sales_By_SalesPerson;
$page_titles["YTD_Sales_By_SalesPerson"] =& $pageTitlesYTD_Sales_By_SalesPerson;
<attr value="linestyle">0</attr>
<attr value="autoupdate">0</attr>
<attr value="autoupmin">60</attr>
<attr value="cscroll">true</attr>
<attr value="maxbarscroll">10</attr>';
$tdataSales_By_Department[".chartXml"] .= '</attr>

<attr value="fields">';
$tdataSales_By_Department[".chartXml"] .= '<attr value="0">
		<attr value="name">DepartmentDesc</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Sales_By_Department", "DepartmentDesc")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataSales_By_Department[".chartXml"] .= '<attr value="1">
		<attr value="name">MTD Sales</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Sales_By_Department", "MTD_Sales")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataSales_By_Department[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Sales By Department</attr>
<attr value="short_table_name">Sales_By_Department</attr>
</attr>

</chart>';
$tables_data["Sales By Department"] =& $tdataSales_By_Department;
$field_labels["Sales_By_Department"] =& $fieldLabelsSales_By_Department;
$fieldToolTips["Sales By Department"] =& $fieldToolTipsSales_By_Department;
$page_titles["Sales_By_Department"] =& $pageTitlesSales_By_Department;
		<attr value="label">' . xmlencode(GetFieldLabel("Current___Last_Year_GP_Comparison", "FiscalMonth")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent___Last_Year_GP_Comparison[".chartXml"] .= '<attr value="1">
		<attr value="name">monthName</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current___Last_Year_GP_Comparison", "monthName")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent___Last_Year_GP_Comparison[".chartXml"] .= '<attr value="2">
		<attr value="name">CurrGrossProfit</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current___Last_Year_GP_Comparison", "CurrGrossProfit")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent___Last_Year_GP_Comparison[".chartXml"] .= '<attr value="3">
		<attr value="name">PrevGrossProfit</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Current___Last_Year_GP_Comparison", "PrevGrossProfit")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataCurrent___Last_Year_GP_Comparison[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Current - Last Year GP Comparison</attr>
<attr value="short_table_name">Current___Last_Year_GP_Comparison</attr>
</attr>

</chart>';
$tables_data["Current - Last Year GP Comparison"] =& $tdataCurrent___Last_Year_GP_Comparison;
$field_labels["Current___Last_Year_GP_Comparison"] =& $fieldLabelsCurrent___Last_Year_GP_Comparison;
$fieldToolTips["Current - Last Year GP Comparison"] =& $fieldToolTipsCurrent___Last_Year_GP_Comparison;
$page_titles["Current___Last_Year_GP_Comparison"] =& $pageTitlesCurrent___Last_Year_GP_Comparison;
		<attr value="label">' . xmlencode(GetFieldLabel("Top_Grossing_Products_YTD", "SUM_Fact_DiscountValue_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_Grossing_Products_YTD[".chartXml"] .= '<attr value="10">
		<attr value="name">SUM(Fact_GrossProfit)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Top_Grossing_Products_YTD", "SUM_Fact_GrossProfit_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_Grossing_Products_YTD[".chartXml"] .= '<attr value="11">
		<attr value="name">SUM(Fact_GP)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Top_Grossing_Products_YTD", "SUM_Fact_GP_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_Grossing_Products_YTD[".chartXml"] .= '<attr value="12">
		<attr value="name">AVG(QOH)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Top_Grossing_Products_YTD", "AVG_QOH_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_Grossing_Products_YTD[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Top Grossing Products YTD</attr>
<attr value="short_table_name">Top_Grossing_Products_YTD</attr>
</attr>

</chart>';
$tables_data["Top Grossing Products YTD"] =& $tdataTop_Grossing_Products_YTD;
$field_labels["Top_Grossing_Products_YTD"] =& $fieldLabelsTop_Grossing_Products_YTD;
$fieldToolTips["Top Grossing Products YTD"] =& $fieldToolTipsTop_Grossing_Products_YTD;
$page_titles["Top_Grossing_Products_YTD"] =& $pageTitlesTop_Grossing_Products_YTD;
<attr value="linestyle">0</attr>
<attr value="autoupdate">0</attr>
<attr value="autoupmin">60</attr>
<attr value="cscroll">true</attr>
<attr value="maxbarscroll">10</attr>';
$tdataStock_on_Hand_by_Dept[".chartXml"] .= '</attr>

<attr value="fields">';
$tdataStock_on_Hand_by_Dept[".chartXml"] .= '<attr value="0">
		<attr value="name">DepartmentDesc</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Stock_on_Hand_by_Dept", "DepartmentDesc")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataStock_on_Hand_by_Dept[".chartXml"] .= '<attr value="1">
		<attr value="name">SUM(SMAST.QOH)</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Stock_on_Hand_by_Dept", "SUM_SMAST_QOH_")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataStock_on_Hand_by_Dept[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Stock on Hand by Dept</attr>
<attr value="short_table_name">Stock_on_Hand_by_Dept</attr>
</attr>

</chart>';
$tables_data["Stock on Hand by Dept"] =& $tdataStock_on_Hand_by_Dept;
$field_labels["Stock_on_Hand_by_Dept"] =& $fieldLabelsStock_on_Hand_by_Dept;
$fieldToolTips["Stock on Hand by Dept"] =& $fieldToolTipsStock_on_Hand_by_Dept;
$page_titles["Stock_on_Hand_by_Dept"] =& $pageTitlesStock_on_Hand_by_Dept;
Пример #20
0
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$result = select_from_teams("id = {$req_team_id}");
$curTeam = mysql_fetch_assoc($result);
$team_id = $curTeam['id'];
//Team info portion of $data
$result = mysql_query("SELECT COUNT(id) AS totalTeams FROM user_teams");
$totalTeams = mysql_result($result, 0, "totalTeams");
$data = "<teaminfo id='{$team_id}'>\n        <teamname>" . xmlencode($curTeam['teamname']) . "</teamname>\n        <datecreated>" . date("m/d/Y", $curTeam['created']) . "</datecreated>\n        <createdby>" . xmlencode($curTeam['createdby']) . "</createdby>\n        <leader>" . xmlencode(get_username_for_uid($curTeam['owner'])) . "</leader>\n        <description>" . xmlencode($curTeam['team_info']) . "</description>\n        <website>" . xmlencode($curTeam['webpage']) . "</website>\n        <forums>" . xmlencode(get_url_to_view_topic($curTeam['topic_id'])) . "</forums>\n        <totalmembers>" . $curTeam['member_count'] . "</totalmembers>\n        <currentmembers>" . $curTeam['active_members'] . "</currentmembers>\n        <retiredmembers>" . ($curTeam['member_count'] - $curTeam['active_members']) . "</retiredmembers>";
foreach ($page_tally_names as $tally_name => $tally_title) {
    $teams_tallyboard = new TallyBoard($tally_name, 'T');
    $pageCount = $teams_tallyboard->get_current_tally($team_id);
    $pageCountRank = $teams_tallyboard->get_rank($team_id);
    $avg_pages_per_day = get_daily_average($curTeam['created'], $pageCount);
    list($bestDayCount, $bestDayTimestamp) = $teams_tallyboard->get_info_re_largest_delta($team_id);
    $bestDayTime = date("M. jS, Y", $bestDayTimestamp - 1);
    $data .= "\n        <roundinfo id='{$tally_name}'>\n            <totalpages>{$pageCount}</totalpages>\n            <rank>" . $pageCountRank . "/" . $totalTeams . "</rank>\n            <avgpagesday>" . number_format($avg_pages_per_day, 1) . "</avgpagesday>\n            <mostpagesday>" . $bestDayCount . " (" . $bestDayTime . ")</mostpagesday>\n        </roundinfo>";
}
$data .= "\n    </teaminfo>\n";
//Team members portion of $data
$data .= "<teammembers>";
$mbrQuery = mysql_query("\n    SELECT username, date_created, u_id, u_privacy\n    FROM users\n    WHERE {$team_id} IN (team_1, team_2, team_3)\n    ORDER BY username ASC\n");
while ($curMbr = mysql_fetch_assoc($mbrQuery)) {
    if ($curMbr['u_privacy'] == PRIVACY_PUBLIC) {
        $data .= "<member id=\"" . $curMbr['u_id'] . "\">\n            <username>" . xmlencode($curMbr['username']) . "</username>\n            <datejoined>" . date("m/d/Y", $curMbr['date_created']) . "</datejoined>\n        </member>\n        ";
    }
}
$data .= "</teammembers>";
$xmlpage = "<" . "?" . "xml version=\"1.0\" encoding=\"{$charset}\" ?" . ">\n<teamstats xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"teamstats.xsd\">\n{$data}\n</teamstats>";
echo $xmlpage;
// vim: sw=4 ts=4 expandtab
		<attr value="label">' . xmlencode(GetFieldLabel("Fact_SalesTransaction_Chart", "CurrSales")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataFact_SalesTransaction_Chart[".chartXml"] .= '<attr value="8">
		<attr value="name">CurrCost</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Fact_SalesTransaction_Chart", "CurrCost")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataFact_SalesTransaction_Chart[".chartXml"] .= '<attr value="9">
		<attr value="name">CurrGrossProfit</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Fact_SalesTransaction_Chart", "CurrGrossProfit")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataFact_SalesTransaction_Chart[".chartXml"] .= '<attr value="10">
		<attr value="name">CurrGP</attr>
		<attr value="label">' . xmlencode(GetFieldLabel("Fact_SalesTransaction_Chart", "CurrGP")) . '</attr>
		<attr value="search"></attr>
	</attr>';
$tdataFact_SalesTransaction_Chart[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Fact_SalesTransaction Chart</attr>
<attr value="short_table_name">Fact_SalesTransaction_Chart</attr>
</attr>

</chart>';
$tables_data["Fact_SalesTransaction Chart"] =& $tdataFact_SalesTransaction_Chart;
$field_labels["Fact_SalesTransaction_Chart"] =& $fieldLabelsFact_SalesTransaction_Chart;
$fieldToolTips["Fact_SalesTransaction Chart"] =& $fieldToolTipsFact_SalesTransaction_Chart;
$page_titles["Fact_SalesTransaction_Chart"] =& $pageTitlesFact_SalesTransaction_Chart;