Beispiel #1
0
{
    $item = "\"" . str_replace("\"", "\"\"", $item) . "\"";
}
if ($fp_in = fopen($INPUT_CSV_FILE, "rb")) {
    $upload_dir = $_SERVER["DOCUMENT_ROOT"] . "/" . COption::GetOptionString("main", "upload_dir", "/upload/") . "/statistic";
    if (substr($OUTPUT_CSV_FILE, 0, strlen($upload_dir)) == $upload_dir && ($fp_out = fopen($OUTPUT_CSV_FILE, "wb"))) {
        $i = 0;
        // counter of the read valuable lines
        $j = 0;
        // counter of the written to the resulting  file lines
        $lang_date_format = FORMAT_DATETIME;
        // date format for the current language
        $event1 = "shareit";
        $event2 = "buy";
        $EVENT_ID = CStatEventType::ConditionSet($event1, $event2, $arEventType) . " (" . $event1 . " / " . $event2 . ")";
        $SITE_ID = GetEventSiteID();
        // short site identifier (ID)
        while (!feof($fp_in)) {
            $arrCSV = fgetcsv($fp_in, 4096, $SEPARATOR);
            if (is_array($arrCSV) && count($arrCSV) > 1) {
                array_walk($arrCSV, "CleanUpCsv");
                reset($arrCSV);
                $i++;
                // if it is the first line then
                if ($arrCSV[0] == "PADATE") {
                    // get an array with the field numbers
                    $arrS = array_flip($arrCSV);
                } elseif ($arrCSV[0] != "PADATE" && is_array($arrS) && count($arrS) > 0) {
                    $arrRes = array();
                    // ID of an event type;
                    $arrRes[] = $EVENT_ID;
Beispiel #2
0
		<td colspan="2">
		<table border="0" cellspacing="0" cellpadding="0" class="internal" id="table1">
		<tr class="heading">
			<td>#</td>
			<td><input type="checkbox" name="selectall" value="Y" onclick="OnSelectAll(this.checked)" checked></td>
			<td><?php 
    echo GetMessage("STAT_EVENT_TYPE");
    ?>
<span class="required">*</span></td>
			<td>event3</td>
			<td><?php 
    echo GetMessage("STAT_DATE") . " (" . FORMAT_DATE . ")";
    ?>
</td>
			<td><?php 
    $site_id = GetEventSiteID();
    echo str_replace("#GROUP_SITE_ID#", $site_id, GetMessage("STAT_PARAM"));
    ?>
</td>
			<td><?php 
    echo GetMessage("STAT_MONEY");
    ?>
</td>
			<?php 
    if ($currency_module == "Y") {
        ?>
			<td><?php 
        echo GetMessage("STAT_CURRENCY");
        ?>
</td>
			<?php