Esempio n. 1
0
function PrepareQuotes(&$item)
{
    $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;
Esempio n. 2
0
 public static function SetEventType($event1, $event2, &$arEventType)
 {
     return CStatEventType::ConditionSet($event1, $event2, $arEventType);
 }