Exemple #1
0
function autoloadEvents($class)
{
    if (strToLower(right($class, 5)) !== 'event') {
        return;
    }
    require_once jailpath(DIAMONDMVC_ROOT . '/classes/events', strToLower(substr($class, 0, strlen($class) - 5)) . '.php');
}
Exemple #2
0
function mainAutoLoader($class)
{
    // Exceptions werden leicht besonders behandelt.
    if (right($class, 9) === 'Exception') {
        $file = DIAMONDMVC_ROOT . "/exceptions/{$class}.php";
    } else {
        $class = strToLower($class);
        if (left($class, 10) === 'controller' and $class !== 'controller') {
            $class = substr($class, 10);
            $file = DIAMONDMVC_ROOT . "/controllers/{$class}.php";
        } else {
            if (left($class, 5) === 'model' and $class !== 'model') {
                $class = substr($class, 5);
                $file = DIAMONDMVC_ROOT . "/models/{$class}.php";
            } else {
                if (left($class, 6) === 'module' and $class !== 'module') {
                    $class = substr($class, 6);
                    $file = DIAMONDMVC_ROOT . "/modules/{$class}/{$class}.php";
                } else {
                    $file = DIAMONDMVC_ROOT . "/lib/class_{$class}.php";
                }
            }
        }
    }
    if (file_exists($file)) {
        include_once $file;
    }
}
function extractColors($Hexa)
{
    if (strlen($Hexa) != 6) {
        return array(0, 0, 0);
    }
    $R = hexdec(left($Hexa, 2));
    $G = hexdec(mid($Hexa, 3, 2));
    $B = hexdec(right($Hexa, 2));
    return array($R, $G, $B);
}
 function __construct($mask, $ts = 0, $setby = "")
 {
     if ($ts == 0) {
         $ts = time();
     }
     $ex_pos = strpos($mask, '!');
     $at_pos = strpos($mask, '@');
     $ident = substr($mask, $ex_pos, $at_pos - $ex_pos);
     if (strlen($ident) > IDENT_LEN) {
         $mask = substr($mask, 0, $ex_pos) . '!*' . right($ident, IDENT_LEN) . '@' . substr($mask, $at_pos);
     }
     $this->mask = $mask;
     $this->setby = $setby;
     $this->ts = $ts;
 }
Exemple #5
0
function textFormat($arrayData, $maxchar)
{
    $maxchar = 40;
    $text = '';
    foreach ($arrayData as $key => $val) {
        $newval = number_format($val, 0, '', '.');
        $space = $maxchar - (strlen($key) + strlen($newval) + 2);
        $text .= left($key, strlen($key));
        $text .= str_repeat(" ", $space);
        $text .= right($newval, strlen($newval));
        $text .= ",-";
        $text .= "\r\n";
    }
    return $text;
}
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request, Absent $absentModel, Product $productModel)
 {
     if (!right('Alerts')) {
         abort(404);
     }
     if (isset($_POST['save'])) {
         //pr($_POST);
         $currentAbsents = $absentModel->getAbsentsList();
         foreach ($_POST['fields'] as $key => $element) {
             //если стоит галка Выполенно
             if (isset($element['done'])) {
                 //удаляем дату у товаров
                 $productModel->deleteAbsent($element['old_absent']);
                 //удаляем уведомление
                 $absentModel->deleteAbsent($element['old_absent']);
             } else {
                 //если меняем дату уведомления
                 if ($element['new_absent'] != $element['old_absent']) {
                     //меняем дату у товаров
                     $productModel->changeAbsent($element['old_absent'], $element['new_absent']);
                     //если уведомление с такой датой уже есть
                     if ($currentAbsents->search($element['new_absent']) !== false) {
                         if (!empty($element['note'])) {
                             //меняем комментарий
                             $absentModel->updateAbsent($element['new_absent'], array('note' => $element['note']));
                         }
                         //удаляем старое уведомление
                         $absentModel->deleteAbsent($element['old_absent']);
                     } else {
                         //просто меняем дату и коммент
                         $absentModel->updateAbsent($element['old_absent'], array('absent' => $element['new_absent'], 'note' => $element['note']));
                     }
                 } else {
                     //если написан комментарий
                     if (!empty($element['note'])) {
                         //меняем комментарий
                         $absentModel->updateAbsent($element['new_absent'], array('note' => $element['note']));
                     }
                 }
             }
         }
         $absents = $productModel->getAbsentsList();
         $absentModel->addAbsentsList($absents);
         Session::flash('message', GetMessages("SUCCESS_UPDATE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request, Note $noteModel, History $historyModel)
 {
     if (right('AddNewPublicNote')) {
         if (strlen($_POST['notification']) > 0) {
             $noteModel->addNote($_POST['notification']);
             $historyModel->saveHistory('create_note');
             Session::flash('message', GetMessages("ADD_NEW_NOTE_MESSAGE"));
             return redirect()->route('note.index');
         } else {
             Session::flash('message', GetMessages("EMPTY_NOTE_MESSAGE"));
             return redirect()->route('note.index');
         }
     } else {
         Session::flash('message', GetMessages("NO_RIGHTS"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
 }
function fixNickHostMask($mask)
{
    $ex_pos = strpos($mask, '!');
    $at_pos = strpos($mask, '@');
    if ($at_pos === false) {
        $mask = '*@' . $mask;
        $at_pos = 1;
    }
    if ($ex_pos === false) {
        $mask = '*!' . $mask;
        $ex_pos = 1;
        $at_pos = strpos($mask, '@');
    }
    $ident = substr($mask, $ex_pos + 1, $at_pos - $ex_pos - 1);
    if (strlen($ident) > IDENT_LEN) {
        $mask = substr($mask, 0, $ex_pos) . '!*' . right($ident, IDENT_LEN - 1) . substr($mask, $at_pos);
    }
    return $mask;
}
Exemple #9
0
function getHtmlValue($content, $sType)
{
    $i = '';
    $endStr = '';
    $s = '';
    $labelName = '';
    $startLabel = '';
    $endLabel = '';
    $LCaseEndStr = '';
    $paramName = '';
    $startLabel = '<';
    $endLabel = '>';
    for ($i = 1; $i <= len($content); $i++) {
        $s = mid($content, $i, 1);
        $endStr = mid($content, $i, -1);
        if ($s == '<') {
            if (inStr($endStr, '>') > 0) {
                $s = mid($endStr, 1, inStr($endStr, '>'));
                $i = $i + len($s) - 1;
                $s = mid($s, 2, len($s) - 2);
                $s = PHPTrim($s);
                if (right($s, 1) == '/') {
                    $s = PHPTrim(left($s, len($s) - 1));
                }
                $endStr = right($endStr, len($endStr) - len($s) - 2);
                //最后字符减去当前标签  -2是因为它有<>二个字符
                //注意之前放在labelName下面
                $labelName = mid($s, 1, inStr($s . ' ', ' ') - 1);
                $labelName = lCase($labelName);
                if ($labelName == 'title' && $sType == 'webtitle') {
                    $LCaseEndStr = lCase($endStr);
                    if (inStr($LCaseEndStr, '</title>') > 0) {
                        $s = mid($endStr, 1, inStr($LCaseEndStr, '</title>') - 1);
                    } else {
                        $s = '';
                    }
                    $getHtmlValue = $s;
                    return @$getHtmlValue;
                } else {
                    if ($labelName == 'meta' && ($sType == 'webkeywords' || $sType == 'webdescription')) {
                        $LCaseEndStr = lCase($endStr);
                        $paramName = PHPTrim(lCase(getParamValue($s, 'name')));
                        if ('web' . $paramName == $sType) {
                            $getHtmlValue = getParamValue($s, 'content');
                            return @$getHtmlValue;
                        }
                    }
                }
            }
        }
    }
    $getHtmlValue = '';
    return @$getHtmlValue;
}
Exemple #10
0
function handleDoubleQuotation($s)
{
    $NewS = '';
    $NewS = PHPTrim($s);
    if (left($NewS, 1) == '"' && right($NewS, 1) == '"') {
        $s = mid($NewS, 2, len($NewS) - 2);
    }
    $handleDoubleQuotation = $s;
    return @$handleDoubleQuotation;
}
Exemple #11
0
 public function fdecimal($conteudo = '', $qt = 2, $tp = 1)
 {
     if (!$conteudo) {
         $conteudo = 0;
     }
     if ($tp == 1) {
         $conteudo = number_format($conteudo, $qt, ',', '.');
     } elseif ($tp == 3) {
         $conteudo = number_format($conteudo, $qt, '.', '');
     } elseif ($tp == 4) {
         //retira pontos e virgulas, deixa somente números
         $conteudo = number_format($conteudo, $qt, '', '');
     } else {
         $conteudo = left($conteudo, strlen($conteudo) - $qt) . "," . right($conteudo, $qt);
     }
     return $conteudo;
 }
<?php

include "system.php";
$action = $_GET['action'];
if (!isset($action) || $action == 'create') {
    include "../simantz/class/pchart/pChart/pData.class";
    include "../simantz/class/pchart/pChart/pChart.class";
    //$oriyear= date("Y",time());
    //$orimonth=date("m",time());
    //$oriyear=2008;
    //$orimonth=8;
    $orimonth = right(left(getDateSession(), 7), 2);
    $oriyear = left(getDateSession(), 4);
    $p = array();
    $arrtotalamt = array();
    //$period1=$period->getPeriodID($year,$month);
    for ($i = 5; $i >= 0; $i--) {
        $year = $oriyear;
        $month = $orimonth - $i;
        if ($month <= 0) {
            $month = $month + 12;
            $year = $year - 1;
        }
        if (strlen($month) == 1) {
            $month = "0" . $month;
        }
        //$period1=$period->getPeriodID($year,$month);
        $curperiodname = $year . '-' . $month;
        array_push($p, $year . '-' . $month);
        $sql = "SELECT '{$curperiodname}',coalesce(sum(localamt),0) as totalamt\n                FROM sim_bpartner_quotation q\n                where q.iscomplete=1 and  left(CAST( q.document_date AS CHAR),7)='{$curperiodname}'\n                group by left(CAST( q.document_date AS CHAR),7)";
        $query = $xoopsDB->query($sql);
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Label $labelModel, Request $request, Purchase $purchaseModel, User $userModel, Product $productModel, History $historyModel)
 {
     if (isset($_POST['update_template'])) {
         //pr($_POST);
         if (isset($_POST['col']) and !empty($_POST['col'])) {
             $fields = serialize($_POST['col']);
         } else {
             $fields = null;
         }
         if (!empty($_POST['name_template'])) {
             $template_name = $_POST['name_template'];
         } elseif (isset($_POST['selected_name_template']) and !empty($_POST['selected_name_template'])) {
             $template_name = $_POST['selected_name_template'];
         } else {
             $template_name = 'По умолчанию';
         }
         $template_id = $userModel->checkTemplates($template_name, 'products');
         if ($template_id != null) {
             $res = array('fields' => $fields);
             $userModel->updateTemplate($res, $template_id, 'products');
         } else {
             //добавляем шаблон
             $res = array('type' => 'products', 'user_id' => Auth::User()->id, 'template' => $template_name, 'fields' => $fields);
             $userModel->addTemplates($res, 'products');
         }
         Session::flash('message', GetMessages("SUCCESS_SETTINGS_SAVE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
     if (isset($_POST['delete_template'])) {
         $userModel->deleteTemplate($_POST['selected_name_template'], 'products');
         Session::flash('message', GetMessages("SUCCESS_TEMPLATE_DELETE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
     if (isset($_POST['select_template'])) {
         $userModel->updateUser(Auth::User()->id, array('template_prod_id' => $_POST['selected_name_template']));
         Session::flash('message', GetMessages("SUCCESS_SETTINGS_SAVE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
     if (isset($_POST['search_button'])) {
         //pr($_POST);
         if (strlen($_POST['search_field']) > 0) {
             return redirect()->route('product.search.index', ['string' => $_POST['search_field']]);
         } else {
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['update_products'])) {
         if (!right('EditProduct')) {
             abort(404);
         }
         unset($_POST['update_products']);
         unset($_POST['_token']);
         $res = array();
         $reViewAbsents = false;
         //pr($_POST);
         foreach ($_POST as $element) {
             if (array_key_exists('check', $element)) {
                 unset($element['check']);
                 $childs = false;
                 if (isset($element['childs'])) {
                     $childs = unserialize($productModel->where('id', $element['id'])->pluck('childs'));
                 }
                 //status
                 !isset($element['status']['new']) ? $element['status']['new'] = 0 : ($element['status']['new'] = 1);
                 if ($element['status']['new'] != $element['status']['old']) {
                     $res[$element['id']]['products.status'] = $element['status']['new'];
                 }
                 //name
                 if ($element['name']['new'] != $element['name']['old']) {
                     $res[$element['id']]['products.name'] = trim($element['name']['new']);
                 }
                 //monitoring_name
                 if ($element['monitoring_name']['new'] != $element['monitoring_name']['old']) {
                     $res[$element['id']]['products.monitoring_name'] = trim($element['monitoring_name']['new']);
                 }
                 //absent
                 if ($element['absent']['new'] != $element['absent']['old']) {
                     if (empty($element['absent']['new'])) {
                         $res[$element['id']]['products.absent'] = null;
                     } else {
                         $res[$element['id']]['products.absent'] = trim($element['absent']['new']);
                     }
                     $reViewAbsents = true;
                 }
                 //article
                 if ($element['article']['new'] != $element['article']['old']) {
                     $res[$element['id']]['products.article'] = trim($element['article']['new']);
                 }
                 //in_stock
                 !isset($element['in_stock']['new']) ? $element['in_stock']['new'] = 0 : ($element['in_stock']['new'] = 1);
                 if ($element['in_stock']['new'] != $element['in_stock']['old']) {
                     $res[$element['id']]['products.in_stock'] = $element['in_stock']['new'];
                 }
                 //flag
                 !isset($element['flag']['new']) ? $element['flag']['new'] = 0 : ($element['flag']['new'] = 1);
                 if ($element['flag']['new'] != $element['flag']['old']) {
                     $res[$element['id']]['products.flag'] = $element['flag']['new'];
                 }
                 //sort
                 if ($element['sort']['new'] != $element['sort']['old']) {
                     $res[$element['id']]['products.sort'] = $element['sort']['new'];
                 }
                 //mrc
                 if ($element['mrc']['new'] != $element['mrc']['old']) {
                     $res[$element['id']]['products.mrc'] = toFloat($element['mrc']['new']);
                 }
                 //mrc_currency
                 if ($element['mrc_currency']['new'] != $element['mrc_currency']['old']) {
                     $res[$element['id']]['products.mrc_currency'] = $element['mrc_currency']['new'];
                 }
                 //mrc_relation
                 if ($element['mrc_relation']['new'] != $element['mrc_relation']['old']) {
                     $res[$element['id']]['products.mrc_relation'] = trim($element['mrc_relation']['new']);
                 }
                 //mrc_raise_relation
                 if ($element['mrc_raise_relation']['new'] != $element['mrc_raise_relation']['old']) {
                     $res[$element['id']]['products.mrc_raise_relation'] = trim($element['mrc_raise_relation']['new']);
                 }
                 //price
                 if ($element['price']['new'] != $element['price']['old']) {
                     $res[$element['id']]['products.price'] = toFloat($element['price']['new']);
                 }
                 //price_currency
                 if ($element['price_currency']['new'] != $element['price_currency']['old']) {
                     $res[$element['id']]['products.price_currency'] = $element['price_currency']['new'];
                 }
                 //price_relation
                 if ($element['price_relation']['new'] != $element['price_relation']['old']) {
                     $res[$element['id']]['products.price_relation'] = trim($element['price_relation']['new']);
                 }
                 //price_raise_relation
                 if ($element['price_raise_relation']['new'] != $element['price_raise_relation']['old']) {
                     $res[$element['id']]['products.price_raise_relation'] = trim($element['price_raise_relation']['new']);
                 }
                 //target_margin
                 isset($element['target_margin']['new']) ? $element['target_margin']['new'] = toFloat($element['target_margin']['new']) : ($element['target_margin']['new'] = 0);
                 if ($element['target_margin']['new'] != $element['target_margin']['old']) {
                     $res[$element['id']]['products.target_margin'] = $element['target_margin']['new'];
                 }
                 //common_price
                 isset($element['common_price']['new']) ? $element['common_price']['new'] = toFloat($element['common_price']['new']) : ($element['common_price']['new'] = 0);
                 if ($element['common_price']['new'] != $element['common_price']['old']) {
                     $res[$element['id']]['products.common_price'] = $element['common_price']['new'];
                 }
                 if (isset($element['GK_enabled']['old'])) {
                     //GK_enabled
                     !isset($element['GK_enabled']['new']) ? $element['GK_enabled']['new'] = 0 : ($element['GK_enabled']['new'] = 1);
                     if ($element['GK_enabled']['new'] != $element['GK_enabled']['old']) {
                         $res[$element['id']]['GK.enabled'] = $element['GK_enabled']['new'];
                     }
                     //GK_yandex_enabled
                     !isset($element['GK_yandex_enabled']['new']) ? $element['GK_yandex_enabled']['new'] = 0 : ($element['GK_yandex_enabled']['new'] = 1);
                     if ($element['GK_yandex_enabled']['new'] != $element['GK_yandex_enabled']['old']) {
                         $res[$element['id']]['GK.yandex_enabled'] = $element['GK_yandex_enabled']['new'];
                     }
                     //GK_price
                     if ($element['GK_price']['new'] != $element['GK_price']['old']) {
                         $res[$element['id']]['GK.price'] = toFloat($element['GK_price']['new']);
                         if ($childs) {
                             foreach ($childs as $child) {
                                 $res[$child['product_id']]['GK.price'] = $res[$element['id']]['GK.price'] * $child['multiplicator'];
                                 $res[$child['product_id']]['GK.to_export'] = 1;
                             }
                         }
                     }
                     //GK_price_currency
                     if ($element['GK_price_currency']['new'] != $element['GK_price_currency']['old']) {
                         $res[$element['id']]['GK.currency'] = $element['GK_price_currency']['new'];
                         if ($childs) {
                             foreach ($childs as $child) {
                                 $res[$child['product_id']]['GK.currency'] = $res[$element['id']]['GK.currency'];
                                 $res[$child['product_id']]['GK.to_export'] = 1;
                             }
                         }
                     }
                     //GK update
                     if (isset($res[$element['id']]['products.in_stock']) or isset($res[$element['id']]['GK.enabled']) or isset($res[$element['id']]['GK.yandex_enabled']) or isset($res[$element['id']]['GK.price']) or isset($res[$element['id']]['GK.currency'])) {
                         $res[$element['id']]['GK.to_export'] = 1;
                         $res[$element['id']]['GK.updated_at'] = date('Y-m-d H:i:s');
                         $res[$element['id']]['GK.user_id'] = Auth::User()->id;
                         $res[$element['id']]['products.updated_at'] = date('Y-m-d H:i:s');
                         $res[$element['id']]['products.user_id'] = Auth::User()->id;
                     }
                 }
                 if (isset($element['TV_enabled']['old'])) {
                     //TV_enabled
                     !isset($element['TV_enabled']['new']) ? $element['TV_enabled']['new'] = 0 : ($element['TV_enabled']['new'] = 1);
                     if ($element['TV_enabled']['new'] != $element['TV_enabled']['old']) {
                         $res[$element['id']]['TV.enabled'] = $element['TV_enabled']['new'];
                     }
                     //TV_yandex_enabled
                     !isset($element['TV_yandex_enabled']['new']) ? $element['TV_yandex_enabled']['new'] = 0 : ($element['TV_yandex_enabled']['new'] = 1);
                     if ($element['TV_yandex_enabled']['new'] != $element['TV_yandex_enabled']['old']) {
                         $res[$element['id']]['TV.yandex_enabled'] = $element['TV_yandex_enabled']['new'];
                     }
                     //TV_price
                     if ($element['TV_price']['new'] != $element['TV_price']['old']) {
                         $res[$element['id']]['TV.price'] = toFloat($element['TV_price']['new']);
                         if ($childs) {
                             foreach ($childs as $child) {
                                 $res[$child['product_id']]['TV.price'] = $res[$element['id']]['TV.price'] * $child['multiplicator'];
                                 $res[$child['product_id']]['TV.to_export'] = 1;
                             }
                         }
                     }
                     //TV_price_currency
                     if ($element['TV_price_currency']['new'] != $element['TV_price_currency']['old']) {
                         $res[$element['id']]['TV.currency'] = $element['TV_price_currency']['new'];
                         if ($childs) {
                             foreach ($childs as $child) {
                                 $res[$child['product_id']]['TV.currency'] = $res[$element['id']]['TV.currency'];
                                 $res[$child['product_id']]['TV.to_export'] = 1;
                             }
                         }
                     }
                     //TV update
                     if (isset($res[$element['id']]['products.in_stock']) or isset($res[$element['id']]['TV.enabled']) or isset($res[$element['id']]['TV.yandex_enabled']) or isset($res[$element['id']]['TV.price']) or isset($res[$element['id']]['TV.currency'])) {
                         $res[$element['id']]['TV.to_export'] = 1;
                         $res[$element['id']]['TV.updated_at'] = date('Y-m-d H:i:s');
                         $res[$element['id']]['TV.user_id'] = Auth::User()->id;
                         $res[$element['id']]['products.updated_at'] = date('Y-m-d H:i:s');
                         $res[$element['id']]['products.user_id'] = Auth::User()->id;
                     }
                 }
                 if (isset($element['MK_enabled']['old'])) {
                     //MK_enabled
                     !isset($element['MK_enabled']['new']) ? $element['MK_enabled']['new'] = 0 : ($element['MK_enabled']['new'] = 1);
                     if ($element['MK_enabled']['new'] != $element['MK_enabled']['old']) {
                         $res[$element['id']]['MK.enabled'] = $element['MK_enabled']['new'];
                     }
                     //MK_yandex_enabled
                     !isset($element['MK_yandex_enabled']['new']) ? $element['MK_yandex_enabled']['new'] = 0 : ($element['MK_yandex_enabled']['new'] = 1);
                     if ($element['MK_yandex_enabled']['new'] != $element['MK_yandex_enabled']['old']) {
                         $res[$element['id']]['MK.yandex_enabled'] = $element['MK_yandex_enabled']['new'];
                     }
                     //MK_price
                     if ($element['MK_price']['new'] != $element['MK_price']['old']) {
                         $res[$element['id']]['MK.price'] = toFloat($element['MK_price']['new']);
                         if ($childs) {
                             foreach ($childs as $child) {
                                 $res[$child['product_id']]['MK.price'] = $res[$element['id']]['MK.price'] * $child['multiplicator'];
                                 $res[$child['product_id']]['MK.to_export'] = 1;
                             }
                         }
                     }
                     //MK_price_currency
                     if ($element['MK_price_currency']['new'] != $element['MK_price_currency']['old']) {
                         $res[$element['id']]['MK.currency'] = $element['MK_price_currency']['new'];
                         if ($childs) {
                             foreach ($childs as $child) {
                                 $res[$child['product_id']]['MK.currency'] = $res[$element['id']]['MK.currency'];
                                 $res[$child['product_id']]['MK.to_export'] = 1;
                             }
                         }
                     }
                     //MK update
                     if (isset($res[$element['id']]['products.in_stock']) or isset($res[$element['id']]['MK.enabled']) or isset($res[$element['id']]['MK.yandex_enabled']) or isset($res[$element['id']]['MK.price']) or isset($res[$element['id']]['MK.currency'])) {
                         $res[$element['id']]['MK.to_export'] = 1;
                         $res[$element['id']]['MK.updated_at'] = date('Y-m-d H:i:s');
                         $res[$element['id']]['MK.user_id'] = Auth::User()->id;
                         $res[$element['id']]['products.updated_at'] = date('Y-m-d H:i:s');
                         $res[$element['id']]['products.user_id'] = Auth::User()->id;
                     }
                 }
                 //product update
                 if (isset($res[$element['id']]['products.status']) or isset($res[$element['id']]['products.name']) or isset($res[$element['id']]['products.article']) or isset($res[$element['id']]['products.in_stock']) or isset($res[$element['id']]['products.mrc']) or isset($res[$element['id']]['products.mrc_currency']) or isset($res[$element['id']]['products.mrc_relation']) or isset($res[$element['id']]['products.mrc_raise_relation']) or isset($res[$element['id']]['products.price']) or isset($res[$element['id']]['products.price_currency']) or isset($res[$element['id']]['products.price_relation']) or isset($res[$element['id']]['products.price_raise_relation']) or isset($res[$element['id']]['products.target_margin']) or isset($res[$element['id']]['products.common_price'])) {
                     $res[$element['id']]['products.updated_at'] = date('Y-m-d H:i:s');
                     $res[$element['id']]['products.user_id'] = Auth::User()->id;
                 }
             }
         }
         if (count($res) > 0) {
             $productModel->updatingListProducts($res);
             $historyModel->saveHistory('update_products', $res);
             if ($reViewAbsents) {
                 $absentModel = new Absent();
                 $absents = $productModel->getAbsentsList();
                 $absentModel->addAbsentsList($absents);
             }
             Session::flash('message', GetMessages("SUCCESS_DATA_PRODUCTS_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         } else {
             Session::flash('message', GetMessages("ERROR_NO_DATA_FOR_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['update_product'])) {
         if (!right('EditProduct')) {
             abort(404);
         }
         //pr($_POST);
         $res = array();
         //status
         !isset($_POST['status']['new']) ? $_POST['status']['new'] = 0 : ($_POST['status']['new'] = 1);
         if ($_POST['status']['new'] != $_POST['status']['old']) {
             $res[$_POST['id']]['products.status'] = $_POST['status']['new'];
         }
         //name
         if ($_POST['name']['new'] != $_POST['name']['old']) {
             $res[$_POST['id']]['products.name'] = trim($_POST['name']['new']);
         }
         //article
         if ($_POST['article']['new'] != $_POST['article']['old']) {
             $res[$_POST['id']]['products.article'] = trim($_POST['article']['new']);
         }
         //ean
         if ($_POST['ean']['new'] != $_POST['ean']['old']) {
             $res[$_POST['id']]['products.ean'] = trim($_POST['ean']['new']);
         }
         //in_stock
         !isset($_POST['in_stock']['new']) ? $_POST['in_stock']['new'] = 0 : ($_POST['in_stock']['new'] = 1);
         if ($_POST['in_stock']['new'] != $_POST['in_stock']['old']) {
             $res[$_POST['id']]['products.in_stock'] = $_POST['in_stock']['new'];
         }
         //mrc
         isset($_POST['mrc']['new']) ? $_POST['mrc']['new'] = toFloat($_POST['mrc']['new']) : ($_POST['mrc']['new'] = 0);
         if ($_POST['mrc']['new'] != $_POST['mrc']['old']) {
             $res[$_POST['id']]['products.mrc'] = toFloat($_POST['mrc']['new']);
         }
         //price
         isset($_POST['price']['new']) ? $_POST['price']['new'] = toFloat($_POST['price']['new']) : ($_POST['price']['new'] = 0);
         if ($_POST['price']['new'] != $_POST['price']['old']) {
             $res[$_POST['id']]['products.price'] = toFloat($_POST['price']['new']);
         }
         //target_margin
         if ($_POST['target_margin']['new'] != $_POST['target_margin']['old']) {
             $res[$_POST['id']]['products.target_margin'] = toFloat($_POST['target_margin']['new']);
         }
         //category_id
         if ($_POST['category_id']['new'] != $_POST['category_id']['old']) {
             $res[$_POST['id']]['products.category_id'] = intval($_POST['category_id']['new']);
         }
         //brand_id
         if ($_POST['brand_id']['new'] != $_POST['brand_id']['old']) {
             $res[$_POST['id']]['products.brand_id'] = intval($_POST['brand_id']['new']);
         }
         //childs
         if (isset($_POST['childs']) and !empty($_POST['childs'])) {
             foreach ($_POST['childs'] as $key => $child) {
                 if (empty($child['product_id']) or empty($child['multiplicator'])) {
                     unset($_POST['childs'][$key]);
                 }
             }
             if (!empty($_POST['childs'])) {
                 $res[$_POST['id']]['products.childs'] = serialize($_POST['childs']);
             } else {
                 $res[$_POST['id']]['products.childs'] = null;
             }
         }
         if (isset($_POST['GK_enabled']['old'])) {
             //GK_id
             isset($_POST['GK_id']['new']) ? $_POST['GK_id']['new'] = intval($_POST['GK_id']['new']) : ($_POST['GK_id']['new'] = 0);
             if ($_POST['GK_id']['new'] != $_POST['GK_id']['old']) {
                 if ($_POST['GK_id']['new'] !== 0 and $_POST['GK_id']['new'] !== 1) {
                     if (count($productModel->checkSiteId('GK', $_POST['GK_id']['new'])) > 0) {
                         Session::flash('message', GetMessages("ERROR_SITE_ID_EXISTS"));
                         return redirect($_SERVER['HTTP_REFERER']);
                     }
                 }
                 $res[$_POST['id']]['GK.site_id'] = $_POST['GK_id']['new'];
             }
             //GK_enabled
             !isset($_POST['GK_enabled']['new']) ? $_POST['GK_enabled']['new'] = 0 : ($_POST['GK_enabled']['new'] = 1);
             if ($_POST['GK_enabled']['new'] != $_POST['GK_enabled']['old']) {
                 $res[$_POST['id']]['GK.enabled'] = $_POST['GK_enabled']['new'];
             }
             //GK_yandex_enabled
             !isset($_POST['GK_yandex_enabled']['new']) ? $_POST['GK_yandex_enabled']['new'] = 0 : ($_POST['GK_yandex_enabled']['new'] = 1);
             if ($_POST['GK_yandex_enabled']['new'] != $_POST['GK_yandex_enabled']['old']) {
                 $res[$_POST['id']]['GK.yandex_enabled'] = $_POST['GK_yandex_enabled']['new'];
             }
             //GK_price
             isset($_POST['GK_price']['new']) ? $_POST['GK_price']['new'] = toFloat($_POST['GK_price']['new']) : ($_POST['GK_price']['new'] = 0);
             if ($_POST['GK_price']['new'] != $_POST['GK_price']['old']) {
                 $res[$_POST['id']]['GK.price'] = $_POST['GK_price']['new'];
             }
             //GK_price_currency
             if ($_POST['GK_price_currency']['new'] != $_POST['GK_price_currency']['old']) {
                 $res[$_POST['id']]['GK.currency'] = $_POST['GK_price_currency']['new'];
             }
             //GK update
             if (isset($res[$_POST['id']]['products.in_stock']) or isset($res[$_POST['id']]['GK.enabled']) or isset($res[$_POST['id']]['GK.yandex_enabled']) or isset($res[$_POST['id']]['GK.price']) or isset($res[$_POST['id']]['GK.currency'])) {
                 $res[$_POST['id']]['GK.to_export'] = 1;
                 $res[$_POST['id']]['GK.updated_at'] = date('Y-m-d H:i:s');
                 $res[$_POST['id']]['GK.user_id'] = Auth::User()->id;
             }
         }
         if (isset($_POST['TV_enabled']['old'])) {
             //TV_id
             isset($_POST['TV_id']['new']) ? $_POST['TV_id']['new'] = intval($_POST['TV_id']['new']) : ($_POST['TV_id']['new'] = 0);
             if ($_POST['TV_id']['new'] != $_POST['TV_id']['old']) {
                 if ($_POST['TV_id']['new'] !== 0 and $_POST['TV_id']['new'] !== 1) {
                     if (count($productModel->checkSiteId('TV', $_POST['TV_id']['new'])) > 0) {
                         Session::flash('message', GetMessages("ERROR_SITE_ID_EXISTS"));
                         return redirect($_SERVER['HTTP_REFERER']);
                     }
                 }
                 $res[$_POST['id']]['TV.site_id'] = $_POST['TV_id']['new'];
             }
             //TV_enabled
             !isset($_POST['TV_enabled']['new']) ? $_POST['TV_enabled']['new'] = 0 : ($_POST['TV_enabled']['new'] = 1);
             if ($_POST['TV_enabled']['new'] != $_POST['TV_enabled']['old']) {
                 $res[$_POST['id']]['TV.enabled'] = $_POST['TV_enabled']['new'];
             }
             //TV_yandex_enabled
             !isset($_POST['TV_yandex_enabled']['new']) ? $_POST['TV_yandex_enabled']['new'] = 0 : ($_POST['TV_yandex_enabled']['new'] = 1);
             if ($_POST['TV_yandex_enabled']['new'] != $_POST['TV_yandex_enabled']['old']) {
                 $res[$_POST['id']]['TV.yandex_enabled'] = $_POST['TV_yandex_enabled']['new'];
             }
             //TV_price
             isset($_POST['TV_price']['new']) ? $_POST['TV_price']['new'] = toFloat($_POST['TV_price']['new']) : ($_POST['TV_price']['new'] = 0);
             if ($_POST['TV_price']['new'] != $_POST['TV_price']['old']) {
                 $res[$_POST['id']]['TV.price'] = $_POST['TV_price']['new'];
             }
             //TV_price_currency
             if ($_POST['TV_price_currency']['new'] != $_POST['TV_price_currency']['old']) {
                 $res[$_POST['id']]['TV.currency'] = $_POST['TV_price_currency']['new'];
             }
             //TV update
             if (isset($res[$_POST['id']]['products.in_stock']) or isset($res[$_POST['id']]['TV.enabled']) or isset($res[$_POST['id']]['TV.yandex_enabled']) or isset($res[$_POST['id']]['TV.price']) or isset($res[$_POST['id']]['TV.currency'])) {
                 $res[$_POST['id']]['TV.to_export'] = 1;
                 $res[$_POST['id']]['TV.updated_at'] = date('Y-m-d H:i:s');
                 $res[$_POST['id']]['TV.user_id'] = Auth::User()->id;
             }
         }
         if (isset($_POST['MK_enabled']['old'])) {
             //MK_id
             isset($_POST['MK_id']['new']) ? $_POST['MK_id']['new'] = intval($_POST['MK_id']['new']) : ($_POST['MK_id']['new'] = 0);
             if ($_POST['MK_id']['new'] != $_POST['MK_id']['old']) {
                 if ($_POST['MK_id']['new'] !== 0 and $_POST['MK_id']['new'] !== 1) {
                     if (count($productModel->checkSiteId('MK', $_POST['MK_id']['new'])) > 0) {
                         Session::flash('message', GetMessages("ERROR_SITE_ID_EXISTS"));
                         return redirect($_SERVER['HTTP_REFERER']);
                     }
                 }
                 $res[$_POST['id']]['MK.site_id'] = $_POST['MK_id']['new'];
             }
             //MK_enabled
             !isset($_POST['MK_enabled']['new']) ? $_POST['MK_enabled']['new'] = 0 : ($_POST['MK_enabled']['new'] = 1);
             if ($_POST['MK_enabled']['new'] != $_POST['MK_enabled']['old']) {
                 $res[$_POST['id']]['MK.enabled'] = $_POST['MK_enabled']['new'];
             }
             //MK_yandex_enabled
             !isset($_POST['MK_yandex_enabled']['new']) ? $_POST['MK_yandex_enabled']['new'] = 0 : ($_POST['MK_yandex_enabled']['new'] = 1);
             if ($_POST['MK_yandex_enabled']['new'] != $_POST['MK_yandex_enabled']['old']) {
                 $res[$_POST['id']]['MK.yandex_enabled'] = $_POST['MK_yandex_enabled']['new'];
             }
             //MK_price
             isset($_POST['MK_price']['new']) ? $_POST['MK_price']['new'] = toFloat($_POST['MK_price']['new']) : ($_POST['MK_price']['new'] = 0);
             if ($_POST['MK_price']['new'] != $_POST['MK_price']['old']) {
                 $res[$_POST['id']]['MK.price'] = $_POST['MK_price']['new'];
             }
             //MK_price_currency
             if ($_POST['MK_price_currency']['new'] != $_POST['MK_price_currency']['old']) {
                 $res[$_POST['id']]['MK.currency'] = $_POST['MK_price_currency']['new'];
             }
             //MK update
             if (isset($res[$_POST['id']]['products.in_stock']) or isset($res[$_POST['id']]['MK.enabled']) or isset($res[$_POST['id']]['MK.yandex_enabled']) or isset($res[$_POST['id']]['MK.price']) or isset($res[$_POST['id']]['MK.currency'])) {
                 $res[$_POST['id']]['MK.to_export'] = 1;
                 $res[$_POST['id']]['MK.updated_at'] = date('Y-m-d H:i:s');
                 $res[$_POST['id']]['MK.user_id'] = Auth::User()->id;
             }
         }
         //product update
         if (isset($res[$_POST['id']]['products.status']) or isset($res[$_POST['id']]['products.name']) or isset($res[$_POST['id']]['products.article']) or isset($res[$_POST['id']]['products.ean']) or isset($res[$_POST['id']]['products.in_stock']) or isset($res[$_POST['id']]['products.mrc']) or isset($res[$_POST['id']]['products.price']) or isset($res[$_POST['id']]['products.target_margin']) or isset($res[$_POST['id']]['products.category_id']) or isset($res[$_POST['id']]['products.brand_id'])) {
             $res[$_POST['id']]['products.updated_at'] = date('Y-m-d H:i:s');
             $res[$_POST['id']]['products.user_id'] = Auth::User()->id;
         }
         if (count($res) > 0 or isset($arLabels)) {
             $productModel->updatingListProducts($res);
             $historyModel->saveHistory('update_products', $res);
             Session::flash('message', GetMessages("SUCCESS_DATA_PRODUCTS_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         } else {
             Session::flash('message', GetMessages("ERROR_NO_DATA_FOR_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['update_labels'])) {
         $label = trim($_POST['labels']['new']);
         if ($label != $_POST['labels']['old']) {
             $labelModel->joinLabels($_POST['product_id'], explode(',', $_POST['labels']['new']));
             Session::flash('message', GetMessages("SUCCESS_DATA_PRODUCTS_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         } else {
             Session::flash('message', GetMessages("ERROR_NO_DATA_FOR_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['add_to_site'])) {
         if (!right('EditProduct')) {
             abort(404);
         }
         //pr($_POST);
         if (isset($_POST['GK'])) {
             if (!isset($_POST['GK']['product_id']) or strlen($_POST['GK']['product_id']) < 1) {
                 Session::flash('message', GetMessages("ERROR"));
                 return redirect($_SERVER['HTTP_REFERER']);
             }
             if (!empty($_POST['GK']['site_id']) and count($productModel->checkSiteId('GK', $_POST['GK']['site_id'])) > 0) {
                 Session::flash('message', GetMessages("ERROR_SITE_ID_EXISTS"));
                 return redirect($_SERVER['HTTP_REFERER']);
             }
             $res = array();
             $res['product_id'] = $_POST['GK']['product_id'];
             !empty($_POST['GK']['site_id']) ? $res['site_id'] = intval($_POST['GK']['site_id']) : ($res['site_id'] = 1);
             isset($_POST['GK']['enabled']) ? $res['enabled'] = 1 : ($res['enabled'] = 0);
             isset($_POST['GK']['yandex_enabled']) ? $res['yandex_enabled'] = 1 : ($res['yandex_enabled'] = 0);
             !empty($_POST['GK']['currency']) ? $res['currency'] = $_POST['GK']['currency'] : ($res['currency'] = 'RUB');
             !empty($_POST['GK']['price']) ? $res['price'] = toFloat($_POST['GK']['price']) : ($res['price'] = 0);
             $res['created_at'] = date('Y-m-d H:i:s');
             $res['updated_at'] = date('Y-m-d H:i:s');
             $res['user_id'] = Auth::User()->id;
             $productModel->addToSite($res, 'GK');
             $historyModel->saveHistory('add_to_site', $res['product_id'], 'ГарантКомфорт');
             Session::flash('message', GetMessages("SUCCESS_PRODUCT_ADD_TO_SITE"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
         if (isset($_POST['TV'])) {
             if (!isset($_POST['TV']['product_id']) or strlen($_POST['TV']['product_id']) < 1) {
                 Session::flash('message', GetMessages("ERROR"));
                 return redirect($_SERVER['HTTP_REFERER']);
             }
             if (!empty($_POST['TV']['site_id']) and count($productModel->checkSiteId('TV', $_POST['TV']['site_id'])) > 0) {
                 Session::flash('message', GetMessages("ERROR_SITE_ID_EXISTS"));
                 return redirect($_SERVER['HTTP_REFERER']);
             }
             $res = array();
             $res['product_id'] = $_POST['TV']['product_id'];
             !empty($_POST['TV']['site_id']) ? $res['site_id'] = intval($_POST['TV']['site_id']) : ($res['site_id'] = 1);
             isset($_POST['TV']['enabled']) ? $res['enabled'] = 1 : ($res['enabled'] = 0);
             isset($_POST['TV']['yandex_enabled']) ? $res['yandex_enabled'] = 1 : ($res['yandex_enabled'] = 0);
             !empty($_POST['TV']['currency']) ? $res['currency'] = $_POST['TV']['currency'] : ($res['currency'] = 'RUB');
             !empty($_POST['TV']['price']) ? $res['price'] = toFloat($_POST['TV']['price']) : ($res['price'] = 0);
             $res['created_at'] = date('Y-m-d H:i:s');
             $res['updated_at'] = date('Y-m-d H:i:s');
             $res['user_id'] = Auth::User()->id;
             $productModel->addToSite($res, 'TV');
             $historyModel->saveHistory('add_to_site', $res['product_id'], 'Таваго');
             Session::flash('message', GetMessages("SUCCESS_PRODUCT_ADD_TO_SITE"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
         if (isset($_POST['MK'])) {
             if (!isset($_POST['MK']['product_id']) or strlen($_POST['MK']['product_id']) < 1) {
                 Session::flash('message', GetMessages("ERROR"));
                 return redirect($_SERVER['HTTP_REFERER']);
             }
             if (!empty($_POST['MK']['site_id']) and count($productModel->checkSiteId('MK', $_POST['MK']['site_id'])) > 0) {
                 Session::flash('message', GetMessages("ERROR_SITE_ID_EXISTS"));
                 return redirect($_SERVER['HTTP_REFERER']);
             }
             $res = array();
             $res['product_id'] = $_POST['MK']['product_id'];
             !empty($_POST['MK']['site_id']) ? $res['site_id'] = intval($_POST['MK']['site_id']) : ($res['site_id'] = 1);
             isset($_POST['MK']['enabled']) ? $res['enabled'] = 1 : ($res['enabled'] = 0);
             isset($_POST['MK']['yandex_enabled']) ? $res['yandex_enabled'] = 1 : ($res['yandex_enabled'] = 0);
             !empty($_POST['MK']['currency']) ? $res['currency'] = $_POST['MK']['currency'] : ($res['currency'] = 'RUB');
             !empty($_POST['MK']['price']) ? $res['price'] = toFloat($_POST['MK']['price']) : ($res['price'] = 0);
             $res['created_at'] = date('Y-m-d H:i:s');
             $res['updated_at'] = date('Y-m-d H:i:s');
             $res['user_id'] = Auth::User()->id;
             $productModel->addToSite($res, 'MK');
             $historyModel->saveHistory('add_to_site', $res['product_id'], 'МаксКлимат');
             Session::flash('message', GetMessages("SUCCESS_PRODUCT_ADD_TO_SITE"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['add_purchase'])) {
         if (!right('EditProduct')) {
             abort(404);
         }
         //pr($_POST);
         $res = array();
         $res['vendor_id'] = $_POST['provider'];
         $res['product_id'] = $_POST['product_id'];
         $res['currency'] = $_POST['currency'];
         !empty($_POST['base_price']) ? $res['base_price'] = toFloat($_POST['base_price']) : ($res['base_price'] = 0);
         !empty($_POST['discount_price']) ? $res['discount_price'] = toFloat($_POST['discount_price']) : ($res['discount_price'] = 0);
         !empty($_POST['raise']) ? $res['raise'] = toFloat($_POST['raise']) : ($res['raise'] = 0);
         !empty($_POST['discount_bulk']) ? $res['discount_bulk'] = toFloat($_POST['discount_bulk']) : ($res['discount_bulk'] = 0);
         $res['created_at'] = date('Y-m-d H:i:s');
         $res['updated_at'] = date('Y-m-d H:i:s');
         $res['user_id'] = Auth::User()->id;
         $purchaseModel->addPurchase($res);
         $historyModel->saveHistory('add_purchase', $res['product_id']);
         Session::flash('message', GetMessages("SUCCESS_ADD_PURCHASE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
     if (isset($_POST['update_purchase'])) {
         if (!right('EditProduct')) {
             abort(404);
         }
         unset($_POST['_token']);
         unset($_POST['update_purchase']);
         //pr($_POST);
         $res = array();
         foreach ($_POST as $element) {
             //base_price
             if (isset($element['base_price'])) {
                 if ($element['base_price']['new'] != $element['base_price']['old']) {
                     $res[$element['purchase_id']]['base_price'] = $element['base_price']['new'];
                 }
             } else {
                 $res[$element['purchase_id']]['base_price'] = 0;
             }
             //currency
             if (isset($element['currency'])) {
                 if ($element['currency']['new'] != $element['currency']['old']) {
                     $res[$element['purchase_id']]['currency'] = $element['currency']['new'];
                 }
             } else {
                 $res[$element['purchase_id']]['currency'] = 'RUB';
             }
             //raise
             if (isset($element['raise'])) {
                 if ($element['raise']['new'] != $element['raise']['old']) {
                     $res[$element['purchase_id']]['raise'] = $element['raise']['new'];
                 }
             } else {
                 $res[$element['purchase_id']]['raise'] = 1;
             }
             //discount_price
             if (isset($element['discount_price'])) {
                 if ($element['discount_price']['new'] != $element['discount_price']['old']) {
                     $res[$element['purchase_id']]['discount_price'] = $element['discount_price']['new'];
                 }
             } else {
                 $res[$element['purchase_id']]['discount_price'] = 0;
             }
             //discount_bulk
             if (isset($element['discount_bulk'])) {
                 if ($element['discount_bulk']['new'] != $element['discount_bulk']['old']) {
                     $res[$element['purchase_id']]['discount_bulk'] = $element['discount_bulk']['new'];
                 }
             } else {
                 $res[$element['purchase_id']]['discount_bulk'] = 0;
             }
             if (isset($res[$element['purchase_id']]['base_price']) or isset($res[$element['purchase_id']]['currency']) or isset($res[$element['purchase_id']]['raise']) or isset($res[$element['purchase_id']]['discount_price']) or isset($res[$element['purchase_id']]['discount_bulk'])) {
                 $res[$element['purchase_id']]['product_id'] = $element['product_id'];
                 $res[$element['purchase_id']]['purchase.updated_at'] = date('Y-m-d H:i:s');
                 $res[$element['purchase_id']]['purchase.user_id'] = Auth::User()->id;
             }
         }
         //pr($res);
         if (count($res) > 0) {
             $purchaseModel->updatePurchase($res);
             $historyModel->saveHistory('update_purchase', $res);
             Session::flash('message', GetMessages("SUCCESS_DATA_PRODUCTS_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         } else {
             Session::flash('message', GetMessages("ERROR_NO_DATA_FOR_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['create_product'])) {
         if (!right('EditProduct')) {
             abort(404);
         }
         unset($_POST['_token']);
         unset($_POST['create_product']);
         //pr($_POST);
         if (strlen($request->input('name')) > 0) {
             $res = array();
             $res['name'] = $request->input('name');
             $res['article'] = $request->input('article');
             $res['ean'] = $request->input('ean');
             $res['status'] = isset($_POST['status']) ? 1 : 0;
             $res['category_id'] = $request->input('category_id');
             $res['brand_id'] = $request->input('brand_id');
             $res['mrc'] = empty($_POST['mrc']) ? 0 : $_POST['mrc'];
             $res['mrc_currency'] = empty($_POST['mrc_currency']) ? 'RUB' : $_POST['mrc_currency'];
             $res['price'] = empty($_POST['price']) ? 0 : $_POST['price'];
             $res['price_currency'] = empty($_POST['price_currency']) ? 'RUB' : $_POST['price_currency'];
             $res['target_margin'] = $request->input('target_margin');
             $res['in_stock'] = isset($_POST['in_stock']) ? 1 : 0;
             $res['user_id'] = Auth::User()->id;
             $res['created_at'] = date('Y-m-d H:i:s');
             $res['updated_at'] = date('Y-m-d H:i:s');
             $id = $productModel->createProduct($res);
             $historyModel->saveHistory('create_product', $id);
             Session::flash('message', GetMessages("SUCCESS_CREATE_NEW_PRODUCT"));
             return redirect()->route('product.show', ['id' => $id]);
         } else {
             Session::flash('message', GetMessages("ERROR_EMPTY_NAME_PRODUCT"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['ajax'])) {
         if (!right('EditProduct')) {
             abort(404);
         }
         return $productModel->checkSiteId($_POST['site'], $_POST['id']);
     }
     if (isset($_POST['cp_page_sbmt'])) {
         $userModel->where('id', Auth::User()->id)->update(array('count_products' => $_POST['cp_page_val']));
         Session::flash('message', GetMessages("SUCCESS_UPDATE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
 }
Exemple #14
0
function getCaiSortCountPage($content)
{
    $i = '';
    $s = '';
    $getCaiSortCountPage = '';
    $content = delHtml($content);
    $content = handleNumber($content);
    for ($i = 1; $i <= 30; $i++) {
        $s = mid($content, 1, len($i));
        if ($s == cStr($i)) {
            $getCaiSortCountPage = $i;
            //Call Echo(i,s)
            $content = right($content, len($content) - len($i));
        }
    }
    return @$getCaiSortCountPage;
}
Exemple #15
0
function handleWithWebSiteList($httpurl, $urllist)
{
    $website = '';
    $splstr = '';
    $url = '';
    $c = '';
    $urlWebsite = '';
    $s = '';
    $website = lCase(getWebSite($httpurl));
    $splstr = aspSplit($urllist, vbCrlf());
    foreach ($splstr as $key => $url) {
        if ($url != '') {
            if (right($url, 1) != '/' && inStr($url, '?') == false) {
                $s = mid($url, inStrRev($url, '/'), -1);
                //call echo("s",s)
                if ((inStr($s, '.') == false || inStr($s, '.com') > 0 || inStr($s, '.cn') > 0 || inStr($s, '.net') > 0) && inStr($s, '@') == false) {
                    $url = $url . '/';
                }
                //call echo("url",url)
            }
            $urlWebsite = lCase(getWebSite($url));
            if ($website == $urlWebsite && inStr(vbCrlf() . $c . vbCrlf(), vbCrlf() . $url . vbCrlf()) == false) {
                if ($c != '') {
                    $c = $c . vbCrlf();
                }
                $c = $c . $url;
            }
        }
    }
    $handleWithWebSiteList = $c;
    return @$handleWithWebSiteList;
}
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.squid.inc');
	include_once('ressources/class.status.inc');
	include_once('ressources/class.artica.graphs.inc');
	
	$users=new usersMenus();
	if(!$users->AsWebStatisticsAdministrator){die();}	

	
	if(!isset($_GET["day"])){$_GET["day"]=date("Y-m-d");}
	if(!isset($_GET["type"])){$_GET["type"]="size";}
	if($_GET["type"]==null){$_GET["type"]="size";}
	if($_GET["day"]==null){$q=new mysql_squid_builder();$_GET["day"]=date("Y-m-d");}		
	
	if(isset($_GET["day-right-infos"])){right();die();}
	if(isset($_GET["days-left-menus"])){left();die();}
	if(isset($_GET["today-zoom"])){today_zoom_js();exit;}
	if(isset($_GET["today-zoom-popup"])){today_zoom_popup();exit;}
	if(isset($_GET["today-zoom-popup-list"])){today_zoom_popup_list();exit;}
	if(isset($_GET["statistics-days-left-status"])){left_status();exit;}
	if(isset($_GET["view-table"])){view_table();exit;}
	if(isset($_GET["Zoom-js"])){ZOOM_JS();exit;}
	if(isset($_GET["block-zoom-popup"])){ZOOM_POPUP();exit;}
	
page();

function ZOOM_JS(){
	$ID=$_GET["Zoom-js"];
	$q=new mysql_squid_builder();
	$key="ID";
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Purchase $purchaseModel, History $historyModel, Product $productModel, User $userModel, Request $request)
 {
     if (isset($_POST['update_template'])) {
         //pr($_POST);
         if (isset($_POST['col']) and !empty($_POST['col'])) {
             $fields = serialize($_POST['col']);
         } else {
             $fields = null;
         }
         if (!empty($_POST['name_template'])) {
             $template_name = $_POST['name_template'];
         } elseif (isset($_POST['selected_name_template']) and !empty($_POST['selected_name_template'])) {
             $template_name = $_POST['selected_name_template'];
         } else {
             $template_name = 'По умолчанию';
         }
         $template_id = $userModel->checkTemplates($template_name, 'purchases');
         if ($template_id != null) {
             $res = array('fields' => $fields);
             $userModel->updateTemplate($res, $template_id, 'purchases');
         } else {
             //добавляем шаблон
             $res = array('type' => 'purchases', 'user_id' => Auth::User()->id, 'template' => $template_name, 'fields' => $fields);
             $userModel->addTemplates($res, 'purchases');
         }
         Session::flash('message', GetMessages("SUCCESS_SETTINGS_SAVE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
     if (isset($_POST['delete_template'])) {
         $userModel->deleteTemplate($_POST['selected_name_template'], 'purchases');
         Session::flash('message', GetMessages("SUCCESS_TEMPLATE_DELETE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
     if (isset($_POST['select_template'])) {
         $userModel->updateUser(Auth::User()->id, array('template_prod_id' => $_POST['selected_name_template']));
         Session::flash('message', GetMessages("SUCCESS_SETTINGS_SAVE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
     if (isset($_POST['search_button'])) {
         //pr($_POST);
         if (strlen($_POST['search_field']) > 0) {
             return redirect()->route('purchase.search.index', ['string' => $_POST['search_field']]);
         } else {
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['update_purchase'])) {
         if (!right('EditProduct')) {
             abort(404);
         }
         unset($_POST['update_purchase']);
         unset($_POST['_token']);
         //pr($_POST);
         $res = array();
         foreach ($_POST as $element) {
             if (array_key_exists('check', $element)) {
                 unset($element['check']);
                 //sort
                 isset($element['sort']['new']) ? $element['sort']['new'] = intval($element['sort']['new']) : ($field['sort']['new'] = '');
                 if ($element['sort']['new'] != $element['sort']['old']) {
                     $res[$element['id']]['purchase.sort'] = $element['sort']['new'];
                 }
                 //flag
                 !isset($element['flag']['new']) ? $element['flag']['new'] = 0 : ($element['flag']['new'] = 1);
                 if ($element['flag']['new'] != $element['flag']['old']) {
                     $res[$element['id']]['products.flag'] = $element['flag']['new'];
                 }
                 //base_price
                 isset($element['base_price']['new']) ? $element['base_price']['new'] = toFloat($element['base_price']['new']) : ($field['base_price']['new'] = 0);
                 if ($element['base_price']['new'] != $element['base_price']['old']) {
                     $res[$element['id']]['base_price'] = $element['base_price']['new'];
                 }
                 //currency
                 if ($element['currency']['new'] != $element['currency']['old']) {
                     $res[$element['id']]['currency'] = $element['currency']['new'];
                 }
                 //raise
                 isset($element['raise']['new']) ? $element['raise']['new'] = toFloat($element['raise']['new']) : ($field['raise']['new'] = 0);
                 if ($element['raise']['new'] != $element['raise']['old']) {
                     $res[$element['id']]['raise'] = $element['raise']['new'];
                 }
                 //discount_price
                 isset($element['discount_price']['new']) ? $element['discount_price']['new'] = toFloat($element['discount_price']['new']) : ($field['discount_price']['new'] = 0);
                 if ($element['discount_price']['new'] != $element['discount_price']['old']) {
                     $res[$element['id']]['discount_price'] = $element['discount_price']['new'];
                 }
                 //discount_bulk
                 isset($element['discount_bulk']['new']) ? $element['discount_bulk']['new'] = toFloat($element['discount_bulk']['new']) : ($field['discount_bulk']['new'] = 0);
                 if ($element['discount_bulk']['new'] != $element['discount_bulk']['old']) {
                     $res[$element['id']]['discount_bulk'] = $element['discount_bulk']['new'];
                 }
                 //comment
                 if ($element['comment']['new'] != $element['comment']['old']) {
                     $res[$element['id']]['comment'] = trim($element['comment']['new']);
                 }
                 //purchase update
                 if (isset($res[$element['id']]['products.flag']) or isset($res[$element['id']]['purchase.sort']) or isset($res[$element['id']]['base_price']) or isset($res[$element['id']]['currency']) or isset($res[$element['id']]['raise']) or isset($res[$element['id']]['discount_price']) or isset($res[$element['id']]['discount_bulk']) or isset($res[$element['id']]['comment'])) {
                     $res[$element['id']]['product_id'] = $element['product_id'];
                     $res[$element['id']]['purchase.updated_at'] = date('Y-m-d H:i:s');
                     $res[$element['id']]['purchase.user_id'] = Auth::User()->id;
                 }
             }
         }
         if (count($res) > 0) {
             //pr($res);
             $purchaseModel->updatePurchase($res);
             $historyModel->saveHistory('update_purchase', $res);
             Session::flash('message', GetMessages("SUCCESS_DATA_PRODUCTS_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         } else {
             Session::flash('message', GetMessages("ERROR_NO_DATA_FOR_UPDATE"));
             return redirect($_SERVER['HTTP_REFERER']);
         }
     }
     if (isset($_POST['cp_page_sbmt'])) {
         $userModel->where('id', Auth::User()->id)->update(array('count_products' => $_POST['cp_page_val']));
         Session::flash('message', GetMessages("SUCCESS_UPDATE"));
         return redirect($_SERVER['HTTP_REFERER']);
     }
 }
Exemple #18
0
function readColumeSetTitle($action, $id, $ColumeTitle, $ColumeContent)
{
    $TitleWidth = '';
    //标题宽度
    $TitleHeight = '';
    //标题高度
    $ContentHeight = '';
    //内容高度
    $ContentWidth = '';
    //内容宽度
    $ContentCss = '';
    $TitleWidth = RParam($action, 'TitleWidth');
    //获得标题高度    待应用20150715
    $TitleHeight = RParam($action, 'TitleHeight');
    //获得标题宽度
    $ContentWidth = RParam($action, 'ContentWidth');
    //获得内容宽度
    $ContentHeight = RParam($action, 'ContentHeight');
    //获得内容高度
    //标题宽
    $TitleWidth = aspTrim($TitleWidth);
    //自动加px单位,不加会无效果 20150115
    if (right($TitleHeight, 1) != '%' && right($TitleHeight, 2) != 'px' && $TitleHeight != '' && $TitleHeight != 'auto') {
        $TitleHeight = $TitleHeight . 'px';
    }
    if (right($TitleWidth, 1) != '%' && right($TitleWidth, 2) != 'px' && $TitleWidth != '' && $TitleWidth != 'auto') {
        $TitleWidth = $TitleWidth . 'px';
    }
    //内容高
    $ContentHeight = aspTrim($ContentHeight);
    //自动加px单位,不加会无效果 20150115
    if (right($ContentHeight, 1) != '%' && right($ContentHeight, 2) != 'px' && $ContentHeight != '' && $ContentHeight != 'auto') {
        $ContentHeight = $ContentHeight . 'px';
    }
    //内容宽
    $ContentWidth = aspTrim($ContentWidth);
    //自动加px单位,不加会无效果 20150115
    if (right($ContentWidth, 1) != '%' && right($ContentWidth, 2) != 'px' && $ContentWidth != '' && $ContentWidth != 'auto') {
        $ContentWidth = $ContentWidth . 'px';
    }
    if ($ContentHeight != '') {
        $ContentCss = 'height:' . $ContentHeight . ';';
    }
    if ($ContentWidth != '') {
        $ContentCss = $ContentCss . 'width:' . $ContentWidth . ';';
    }
    $content = '';
    $content = readColumn($id);
    //标题宽
    if ($TitleWidth != '') {
        $content = replace($content, '<div class="tvalue">', '<div class="tvalue" style=\'width:' . $TitleWidth . ';\'>');
    }
    //内容高
    if ($ContentCss != '') {
        $content = replace($content, '<div class="ccontent">', '<div class="ccontent" style=\'' . $ContentCss . '\'>');
    }
    //call echo(ContentWidth,ContentCss)
    $content = replace($content, '栏目标题', $ColumeTitle);
    $content = replace($content, '栏目内容', $ColumeContent);
    $readColumeSetTitle = $content;
    return @$readColumeSetTitle;
}
Exemple #19
0
function endsWith($str, $check)
{
    return right($str, strlen($check)) == $check;
}
Exemple #20
0
if ($_SESSION[$keyMaster] == '0') {
    $strsql = "INSERT INTO [{$table}] ({$buscaPor}) VALUES('-');";
    $results = $GLOBALS['db']->exec($strsql);
    if (!$results) {
        $err = $GLOBALS['db']->errorInfo();
        echo '<hr>' . $strsql . '<hr>Error: ' . $err[2];
        exit;
    }
    $_SESSION[$keyMaster] = $GLOBALS['db']->lastInsertId();
}
if (isset($editsql)) {
    $strsql = $editsql;
} else {
    $strsql = "select * from {$table} where {$keyMaster}=" . $_SESSION[$keyMaster];
}
if (right($strsql, 2) == '=0') {
    $strsql = offLast($strsql) . $_SESSION[$keyMaster];
}
?>
<html>

<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta content="es" http-equiv="Content-Language">
<link href="../../../cgi_bin/jss/jss.css" rel="stylesheet" type="text/css">
<script src="../../../cgi_bin/jss/jss.js" type="text/javascript"></script>
<script src="../../../cgi_bin/jss/jssColor.js" type="text/javascript"></script>
<title>tableForm</title>
<base target="_self">
<script type="text/javascript">
var puntero;
Exemple #21
0
function getScanFunctionNameList($content)
{
    $splStr = '';
    $i = '';
    $YesASP = '';
    $YesWord = '';
    $Sx = '';
    $s = '';
    $Wc = '';
    $Zc = '';
    $s1 = '';
    $AspCode = '';
    $SYHCount = '';
    $UpWord = '';
    $FunList = '';
    $s2 = '';
    $UpWordn = '';
    $tempS = '';
    $DimList = '';
    $YesFunction = '';
    //函数是否为真
    $YesASP = false;
    //是ASP 默认为假
    $YesFunction = false;
    //是函数 默认为假
    $YesWord = false;
    //是单词 默认为假
    $SYHCount = 0;
    //双引号默认为0
    $splStr = aspSplit($content, vbCrlf());
    //分割行
    //循环分行
    foreach ($splStr as $key => $s) {
        //循环每个字符
        for ($i = 1; $i <= len($s); $i++) {
            $Sx = mid($s, $i, 1);
            //Asp开始
            if ($Sx == '<' && $Wc == '') {
                //输出文本必需为空 Wc为输出内容 如"<%" 排除 修改于20140412
                if (mid($s, $i + 1, 1) == '%') {
                    $YesASP = true;
                    //ASP为真
                    $i = $i + 1;
                    //加1而不能加2,要不然<%function Test() 就截取不到
                }
                //ASP结束
            } else {
                if ($Sx == '%' && mid($s, $i + 1, 1) == '>' && $Wc == '') {
                    //Wc为输出内容
                    $YesASP = false;
                    //ASP为假
                    $i = $i + 1;
                    //不能加2,只能加1,因为这里定义ASP为假,它会在下一次显示上面的 'ASP运行为假
                }
            }
            if ($YesASP == true) {
                //输入文本
                if ($Sx == '"' || $Wc != '') {
                    //双引号累加
                    if ($Sx == '"') {
                        $SYHCount = $SYHCount + 1;
                    }
                    //判断是否"在最后
                    if ($SYHCount % 2 == 0) {
                        if (mid($s, $i + 1, 1) != '"') {
                            $Wc = $Wc . $Sx;
                            $s1 = right(replace(mid($s, 1, $i - len($Wc)), ' ', ''), 1);
                            //必需放在这里,要不会出错
                            if ($YesFunction == true) {
                                $AspCode = $AspCode . $Wc;
                            }
                            //函数代码累加
                            $SYHCount = 0;
                            $Wc = '';
                            //清除
                        } else {
                            $Wc = $Wc . $Sx;
                        }
                    } else {
                        $Wc = $Wc . $Sx;
                    }
                } else {
                    if ($Sx == '\'') {
                        //注释则退出
                        if ($YesFunction == true) {
                            $AspCode = $AspCode . mid($s, $i, -1);
                        }
                        break;
                        //字母
                    } else {
                        if (checkABC($Sx) == true || $Sx == '_' && $Zc != '' || $Zc != '') {
                            $Zc = $Zc . $Sx;
                            $s1 = lCase(mid($s . ' ', $i + 1, 1));
                            if (inStr('abcdefghijklmnopqrstuvwxyz0123456789', $s1) == 0 && ($s1 == '_' && $Zc != '')) {
                                //最简单判断
                                $tempS = mid($s, $i + 1, -1);
                                if (inStr('|function|sub|', '|' . lCase($Zc) . '|')) {
                                    //函数开始
                                    if ($YesFunction == false && lCase($UpWord) != 'end') {
                                        $YesFunction = true;
                                        $s2 = mid($s, $i + 2, -1);
                                        $s2 = mid($s2, 1, inStr($s2, '(') - 1);
                                        $FunList = $FunList . $s2 . vbCrlf();
                                    } else {
                                        if ($YesFunction == true && lCase($UpWord) == 'end') {
                                            //获得上一个单词
                                            $AspCode = $AspCode . $Zc . vbCrlf();
                                            $YesFunction = false;
                                        }
                                    }
                                }
                                $UpWord = $Zc;
                                //记住当前单词
                                if ($YesFunction == true) {
                                    $AspCode = $AspCode . $Zc;
                                }
                                $Zc = '';
                            }
                        }
                    }
                }
            }
            doEvents();
        }
    }
    $getScanFunctionNameList = $FunList;
    return @$getScanFunctionNameList;
}
function deleteAllMakeHtml()
{
    $filePath = '';
    //栏目
    $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn order by sortrank asc');
    while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) {
        if ($rsx['nofollow'] == false) {
            $filePath = getRsUrl($rsx['filename'], $rsx['customaurl'], '/nav' . $rsx['id']);
            if (right($filePath, 1) == '/') {
                $filePath = $filePath . 'index.html';
            }
            aspEcho('栏目filePath', '<a href=\'' . $filePath . '\' target=\'_blank\'>' . $filePath . '</a>');
            DeleteFile($filePath);
        }
    }
    //文章
    $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail order by sortrank asc');
    while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) {
        if ($rsx['nofollow'] == false) {
            $filePath = getRsUrl($rsx['filename'], $rsx['customaurl'], '/detail/detail' . $rsx['id']);
            if (right($filePath, 1) == '/') {
                $filePath = $filePath . 'index.html';
            }
            aspEcho('文章filePath', '<a href=\'' . $filePath . '\' target=\'_blank\'>' . $filePath . '</a>');
            DeleteFile($filePath);
        }
    }
    //单页
    $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'onepage order by sortrank asc');
    while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) {
        if ($rsx['nofollow'] == false) {
            $filePath = getRsUrl($rsx['filename'], $rsx['customaurl'], '/page/detail' . $rsx['id']);
            if (right($filePath, 1) == '/') {
                $filePath = $filePath . 'index.html';
            }
            aspEcho('单页filePath', '<a href=\'' . $filePath . '\' target=\'_blank\'>' . $filePath . '</a>');
            DeleteFile($filePath);
        }
    }
}
 public function display($arraydata, $y_axis = 0, $fielddata = false, $maxheight = 0)
 {
     $this->Rotate($arraydata["rotation"]);
     if ($arraydata["rotation"] != "") {
         if ($arraydata["rotation"] == "Left") {
             $w = $arraydata["width"];
             $arraydata["width"] = $arraydata["height"];
             $arraydata["height"] = $w;
             $this->pdf->SetXY($this->pdf->GetX() - $arraydata["width"], $this->pdf->GetY());
         } elseif ($arraydata["rotation"] == "Right") {
             $w = $arraydata["width"];
             $arraydata["width"] = $arraydata["height"];
             $arraydata["height"] = $w;
             $this->pdf->SetXY($this->pdf->GetX(), $this->pdf->GetY() - $arraydata["height"]);
         } elseif ($arraydata["rotation"] == "UpsideDown") {
             //soverflow"=>$stretchoverflow,"poverflow"
             $arraydata["soverflow"] = true;
             $arraydata["poverflow"] = true;
             //   $w=$arraydata["width"];
             // $arraydata["width"]=$arraydata["height"];
             //$arraydata["height"]=$w;
             $this->pdf->SetXY($this->pdf->GetX() - $arraydata["width"], $this->pdf->GetY() - $arraydata["height"]);
         }
     }
     if ($arraydata["type"] == "SetFont") {
         $arraydata["font"] = strtolower($arraydata["font"]);
         $fontfile = $this->fontdir . '/' . $arraydata["font"] . '.php';
         if (file_exists($fontfile) || $this->bypassnofont == false) {
             $fontfile = $this->fontdir . '/' . $arraydata["font"] . '.php';
             $this->pdf->SetFont($arraydata["font"], $arraydata["fontstyle"], $arraydata["fontsize"], $fontfile);
         } else {
             $arraydata["font"] = "freeserif";
             if ($arraydata["fontstyle"] == "") {
                 $this->pdf->SetFont('freeserif', $arraydata["fontstyle"], $arraydata["fontsize"], $this->fontdir . '/freeserif.php');
             } elseif ($arraydata["fontstyle"] == "B") {
                 $this->pdf->SetFont('freeserifb', $arraydata["fontstyle"], $arraydata["fontsize"], $this->fontdir . '/freeserifb.php');
             } elseif ($arraydata["fontstyle"] == "I") {
                 $this->pdf->SetFont('freeserifi', $arraydata["fontstyle"], $arraydata["fontsize"], $this->fontdir . '/freeserifi.php');
             } elseif ($arraydata["fontstyle"] == "BI") {
                 $this->pdf->SetFont('freeserifbi', $arraydata["fontstyle"], $arraydata["fontsize"], $this->fontdir . '/freeserifbi.php');
             } elseif ($arraydata["fontstyle"] == "BIU") {
                 $this->pdf->SetFont('freeserifbi', "BIU", $arraydata["fontsize"], $this->fontdir . '/freeserifbi.php');
             } elseif ($arraydata["fontstyle"] == "U") {
                 $this->pdf->SetFont('freeserif', "U", $arraydata["fontsize"], $this->fontdir . '/freeserif.php');
             } elseif ($arraydata["fontstyle"] == "BU") {
                 $this->pdf->SetFont('freeserifb', "U", $arraydata["fontsize"], $this->fontdir . '/freeserifb.php');
             } elseif ($arraydata["fontstyle"] == "IU") {
                 $this->pdf->SetFont('freeserifi', "IU", $arraydata["fontsize"], $this->fontdir . '/freeserifbi.php');
             }
         }
     } elseif ($arraydata["type"] == "subreport") {
         return $this->runSubReport($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "MultiCell") {
         if ($fielddata == false) {
             $this->checkoverflow($arraydata, $this->updatePageNo($arraydata["txt"]), '', $maxheight);
         } elseif ($fielddata == true) {
             $this->checkoverflow($arraydata, $this->updatePageNo($this->analyse_expression($arraydata["txt"], $arraydata["isPrintRepeatedValues"])), $maxheight);
         }
     } elseif ($arraydata["type"] == "SetXY") {
         $this->pdf->SetXY($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis);
     } elseif ($arraydata["type"] == "Cell") {
         //                print_r($arraydata);
         //              echo "<br/>";
         $this->pdf->Cell($arraydata["width"], $arraydata["height"], $this->updatePageNo($arraydata["txt"]), $arraydata["border"], $arraydata["ln"], $arraydata["align"], $arraydata["fill"], $arraydata["link"] . "", 0, true, "T", $arraydata["valign"]);
     } elseif ($arraydata["type"] == "Rect") {
         if ($arraydata['mode'] == 'Transparent') {
             $style = '';
         } else {
             $style = 'FD';
         }
         //      $this->pdf->SetLineStyle($arraydata['border']);
         $this->pdf->Rect($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $style, $arraydata['border'], $arraydata['fillcolor']);
     } elseif ($arraydata["type"] == "RoundedRect") {
         if ($arraydata['mode'] == 'Transparent') {
             $style = '';
         } else {
             $style = 'FD';
         }
         //
         //        $this->pdf->SetLineStyle($arraydata['border']);
         $this->pdf->RoundedRect($arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $arraydata["radius"], '1111', $style, $arraydata['border'], $arraydata['fillcolor']);
     } elseif ($arraydata["type"] == "Ellipse") {
         //$this->pdf->SetLineStyle($arraydata['border']);
         $this->pdf->Ellipse($arraydata["x"] + $arraydata["width"] / 2 + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis + $arraydata["height"] / 2, $arraydata["width"] / 2, $arraydata["height"] / 2, 0, 0, 360, 'FD', $arraydata['border'], $arraydata['fillcolor']);
     } elseif ($arraydata["type"] == "Image") {
         //echo $arraydata["path"];
         $path = $this->analyse_expression($arraydata["path"]);
         $imgtype = substr($path, -3);
         $arraydata["link"] = $arraydata["link"] . "";
         if ($imgtype == 'jpg' || right($path, 3) == 'jpg' || right($path, 4) == 'jpeg') {
             $imgtype = "JPEG";
         } elseif ($imgtype == 'png' || $imgtype == 'PNG') {
             $imgtype = "PNG";
         }
         //echo $path;
         if (file_exists($path) || $this->left($path, 4) == 'http') {
             //$path="/Applications/XAMPP/xamppfiles/simbiz/modules/simantz/images/modulepic.jpg";
             //  $path="/simbiz/images/pendingno.png";
             if ($arraydata["link"] == "") {
                 $this->pdf->Image($path, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $imgtype, $arraydata["link"]);
             } else {
                 //                 if($arraydata['linktarget']=='Blank' && strpos($_SERVER['HTTP_USER_AGENT'],"Safari")!==false &&     strpos($_SERVER['HTTP_USER_AGENT'],"Chrome")==false){
                 //                        $href="javascript:window.open('".$arraydata["link"]."');";
                 //                        $imagehtml='<A  href="'.$href.'"><img src="'.$path.'" '.
                 //                                'width="'. $arraydata["width"] .'" height="'.$arraydata["height"].'" ></A>';
                 //                        $this->pdf->writeHTMLCell($arraydata["width"],$arraydata["height"],
                 //                            $arraydata["x"]+$this->arrayPageSetting["leftMargin"],$arraydata["y"]+$y_axis,$imagehtml);
                 //                 }
                 //                else
                 $this->pdf->Image($path, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], $imgtype, $arraydata["link"]);
             }
         } elseif ($this->left($path, 22) == "data:image/jpeg;base64") {
             $imgtype = "JPEG";
             $img = str_replace('data:image/jpeg;base64,', '', $path);
             $imgdata = base64_decode($img);
             $this->pdf->Image('@' . $imgdata, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], '', $arraydata["link"]);
         } elseif ($this->left($path, 22) == "data:image/png;base64,") {
             $imgtype = "PNG";
             // $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
             $img = str_replace('data:image/png;base64,', '', $path);
             $imgdata = base64_decode($img);
             $this->pdf->Image('@' . $imgdata, $arraydata["x"] + $this->arrayPageSetting["leftMargin"], $arraydata["y"] + $y_axis, $arraydata["width"], $arraydata["height"], '', $arraydata["link"]);
         }
     } elseif ($arraydata["type"] == "SetTextColor") {
         $this->textcolor_r = $arraydata['r'];
         $this->textcolor_g = $arraydata['g'];
         $this->textcolor_b = $arraydata['b'];
         if ($this->hideheader == true && $this->currentband == 'pageHeader') {
             $this->pdf->SetTextColor(100, 33, 30);
         } else {
             $this->pdf->SetTextColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
         }
     } elseif ($arraydata["type"] == "SetDrawColor") {
         $this->drawcolor_r = $arraydata['r'];
         $this->drawcolor_g = $arraydata['g'];
         $this->drawcolor_b = $arraydata['b'];
         $this->pdf->SetDrawColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "SetLineWidth") {
         $this->pdf->SetLineWidth($arraydata["width"]);
     } elseif ($arraydata["type"] == "break") {
     } elseif ($arraydata["type"] == "Line") {
         $printline = false;
         if ($arraydata['printWhenExpression'] == "") {
             $printline = true;
         } else {
             $printline = $this->analyse_expression($arraydata['printWhenExpression']);
         }
         if ($printline) {
             $this->pdf->Line($arraydata["x1"] + $this->arrayPageSetting["leftMargin"], $arraydata["y1"] + $y_axis, $arraydata["x2"] + $this->arrayPageSetting["leftMargin"], $arraydata["y2"] + $y_axis, $arraydata["style"]);
         }
     } elseif ($arraydata["type"] == "SetFillColor") {
         $this->fillcolor_r = $arraydata['r'];
         $this->fillcolor_g = $arraydata['g'];
         $this->fillcolor_b = $arraydata['b'];
         $this->pdf->SetFillColor($arraydata["r"], $arraydata["g"], $arraydata["b"]);
     } elseif ($arraydata["type"] == "lineChart") {
         $this->showLineChart($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "barChart") {
         $this->showBarChart($arraydata, $y_axis, 'barChart');
     } elseif ($arraydata["type"] == "pieChart") {
         $this->showPieChart($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "stackedBarChart") {
         $this->showBarChart($arraydata, $y_axis, 'stackedBarChart');
     } elseif ($arraydata["type"] == "stackedAreaChart") {
         $this->showAreaChart($arraydata, $y_axis, $arraydata["type"]);
     } elseif ($arraydata["type"] == "Barcode") {
         $this->showBarcode($arraydata, $y_axis);
     } elseif ($arraydata["type"] == "CrossTab") {
         $this->showCrossTab($arraydata, $y_axis);
     }
 }
function webStat($folderPath)
{
    $dateTime = '';
    $content = '';
    $splStr = '';
    $thisUrl = '';
    $goToUrl = '';
    $caiShu = '';
    $c = '';
    $fileName = '';
    $co = '';
    $ie = '';
    $xp = '';
    $goToUrl = serverVariables('HTTP_REFERER');
    $thisUrl = 'http://' . serverVariables('HTTP_HOST') . serverVariables('SCRIPT_NAME');
    $caiShu = serverVariables('QUERY_STRING');
    if ($caiShu != '') {
        $thisUrl = $thisUrl . '?' . $caiShu;
    }
    $goToUrl = @$_REQUEST['GoToUrl'];
    $thisUrl = @$_REQUEST['ThisUrl'];
    $co = @$_GET['co'];
    $dateTime = now();
    $content = serverVariables('HTTP_USER_AGENT');
    $content = replace($content, 'MSIE', 'Internet Explorer');
    $content = replace($content, 'NT 5.0', '2000');
    $content = replace($content, 'NT 5.1', 'XP');
    $content = replace($content, 'NT 5.2', '2003');
    $splStr = aspSplit($content . ';;;;', ';');
    $ie = $splStr[1];
    $xp = aspTrim($splStr[2]);
    if (right($xp, 1) == ')') {
        $xp = mid($xp, 1, len($xp) - 1);
    }
    $c = '来访' . $goToUrl . vbCrlf();
    $c = $c . '当前:' . $thisUrl . vbCrlf();
    $c = $c . '时间:' . $dateTime . vbCrlf();
    $c = $c . 'IP:' . getIP() . vbCrlf();
    $c = $c . 'IE:' . getBrType('') . vbCrlf();
    $c = $c . 'Cookies=' . $co . vbCrlf();
    $c = $c . 'XP=' . $xp . vbCrlf();
    $c = $c . 'Screen=' . @$_REQUEST['screen'] . vbCrlf();
    //屏幕分辨率
    $c = $c . '用户信息=' . serverVariables('HTTP_USER_AGENT') . vbCrlf();
    //用户信息
    $c = $c . '-------------------------------------------------' . vbCrlf();
    //c=c & "CaiShu=" & CaiShu & vbcrlf
    $fileName = $folderPath . Format_Time(now(), 2) . '.txt';
    CreateAddFile($fileName, $c);
    $c = $c . vbCrlf() . $fileName;
    $c = replace($c, vbCrlf(), '\\n');
    $c = replace($c, '"', '\\"');
    //Response.Write("eval(""var MyWebStat=\""" & C & "\"""")")
    $splxx = '';
    $nIP = '';
    $nPV = '';
    $ipList = '';
    $s = '';
    $ip = '';
    //判断是否显示回显记录
    if (@$_REQUEST['stype'] == 'display') {
        $content = getFText($fileName);
        $splxx = aspSplit($content, vbCrlf() . '-------------------------------------------------' . vbCrlf());
        $nIP = 0;
        $nPV = 0;
        $ipList = '';
        foreach ($splxx as $key => $s) {
            if (inStr($s, '当前:') > 0) {
                $s = vbCrlf() . $s . vbCrlf();
                $ip = ADSql(getStrCut($s, vbCrlf() . 'IP:', vbCrlf(), 0));
                $nPV = $nPV + 1;
                if (inStr(vbCrlf() . $ipList . vbCrlf(), vbCrlf() . $ip . vbCrlf()) == false) {
                    $ipList = $ipList . $ip . vbCrlf();
                    $nIP = $nIP + 1;
                }
            }
        }
        Rw('document.write(\'网长统计 | 今日IP[' . $nIP . '] | 今日PV[' . $nPV . '] \')');
    }
    $webStat = $c;
    return @$webStat;
}
Exemple #25
0
function local_link($id_art, $id_prop, $lg)
{
    global $l;
    $txt = "";
    $values = val_prop($id_art, $id_prop);
    $values = array_unique($values);
    if (count($values) > 0) {
        for ($i = 0; $i < count($values); $i++) {
            if (isset($values[$i])) {
                $site = loc_val($values[$i], $id_prop);
                if (right($site, 1) == "/") {
                    $site = left($site, strlen($site) - 1);
                }
                if (strpos($site, "louvre")) {
                    $site = str_replace("www.", "", $site);
                }
                if ($site != "") {
                    if ($txt != "") {
                        $txt .= "</br>";
                    }
                    $txt .= "<b>" . label_item($values[$i], $lg) . "</b>&nbsp;: ";
                    /* Easter egg */
                    if ($lg == "mu") {
                        $txt .= "<a href=\"" . $site . "\" class=\"externe\">Houba</a>";
                    } else {
                        $txt .= "<a href=\"" . $site . "\" class=\"externe\">" . str_replace("http://", "", $site) . "</a>";
                    }
                }
            }
        }
    }
    return $txt;
}
Exemple #26
0
function delJsNote($content)
{
    $splstr = '';
    $s = '';
    $c = '';
    $isMultiLineNote = '';
    $s2 = '';
    $isMultiLineNote = false;
    //多行注释默认为假
    $splstr = aspSplit($content, vbCrlf());
    foreach ($splstr as $key => $s) {
        $s2 = PHPTrim($s);
        if ($isMultiLineNote == true) {
            if (len($s2) >= 2) {
                if (right($s2, 2) == '*/') {
                    $isMultiLineNote = false;
                }
            }
            $s = '';
        } else {
            if (left($s2, 2) == '/*') {
                if (right($s2, 2) != '*/') {
                    $isMultiLineNote = true;
                }
                $s = '';
            } else {
                if (left($s2, 2) == '//') {
                    $s = '';
                }
            }
        }
        $c = $c . $s . vbCrlf();
    }
    $delJsNote = $c;
    return @$delJsNote;
}
function formatting($content, $action)
{
    $i = '';
    $endStr = '';
    $s = '';
    $c = '';
    $labelName = '';
    $startLabel = '';
    $endLabel = '';
    $endLabelStr = '';
    $nLevel = '';
    $isYes = '';
    $parentLableName = '';
    $nextLableName = '';
    //下一个标题名称
    $isA = '';
    //是否为A链接
    $isTextarea = '';
    //是否为多行输入文本框
    $isScript = '';
    //脚本语言
    $isStyle = '';
    //Css层叠样式表
    $isPre = '';
    //是否为pre
    $startLabel = '<';
    $endLabel = '>';
    $nLevel = 0;
    $action = '|' . $action . '|';
    //层级
    $isA = false;
    $isTextarea = false;
    $isScript = false;
    $isStyle = false;
    $isPre = false;
    $content = replace(replace($content, vbCrlf(), chr(10)), vbTab(), '    ');
    for ($i = 1; $i <= len($content); $i++) {
        $s = mid($content, $i, 1);
        $endStr = mid($content, $i, -1);
        if ($s == '<') {
            if (inStr($endStr, '>') > 0) {
                $s = mid($endStr, 1, inStr($endStr, '>'));
                $i = $i + len($s) - 1;
                $s = mid($s, 2, len($s) - 2);
                if (right($s, 1) == '/') {
                    $s = PHPTrim(left($s, len($s) - 1));
                }
                $endStr = right($endStr, len($endStr) - len($s) - 2);
                //最后字符减去当前标签  -2是因为它有<>二个字符
                //注意之前放在labelName下面
                $labelName = mid($s, 1, inStr($s . ' ', ' ') - 1);
                $labelName = lCase($labelName);
                //call echo("labelName",labelName)
                if ($labelName == 'a') {
                    $isA = true;
                } else {
                    if ($labelName == '/a') {
                        $isA = false;
                    } else {
                        if ($labelName == 'textarea') {
                            $isTextarea = true;
                        } else {
                            if ($labelName == '/textarea') {
                                $isTextarea = false;
                            } else {
                                if ($labelName == 'script') {
                                    $isScript = true;
                                } else {
                                    if ($labelName == '/script') {
                                        $isScript = false;
                                    } else {
                                        if ($labelName == 'style') {
                                            $isStyle = true;
                                        } else {
                                            if ($labelName == '/style') {
                                                $isStyle = false;
                                            } else {
                                                if ($labelName == 'pre') {
                                                    $isPre = true;
                                                } else {
                                                    if ($labelName == '/pre') {
                                                        $isPre = false;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                $endLabelStr = $endLabel;
                $nextLableName = getHtmlLableName($endStr, 0);
                //不为压缩HTML
                if (inStr($action, '|ziphtml|') == false && $isPre == false) {
                    if ($isA == false) {
                        if (inStr('|a|strong|u|i|s|script|', '|' . $labelName . '|') == false && '/' . $labelName != $nextLableName && inStr('|/a|/strong|/u|/i|/s|/script|', '|' . $nextLableName . '|') == false) {
                            $endLabelStr = $endLabelStr . chr(10);
                        }
                    }
                }
                //单标签最后加个 /   20160615
                if (inStr('|br|hr|img|input|param|meta|link|', '|' . $labelName . '|') > 0) {
                    $s = $s . ' /';
                }
                $s = $startLabel . $s . $endLabelStr;
                //不为压缩HTML
                if (inStr($action, '|ziphtml|') == false && $isPre == false) {
                    //处理这个            aaaaa</span>
                    if ($isA == false && $isYes == false && left($labelName, 1) == '/' && $labelName != '/script' && $labelName != '/a') {
                        //排除这种    <span>天天发团</span>     并且判断上一个字段不等于vbcrlf换行
                        if ('/' . $parentLableName != $labelName && right(aspTrim($c), 1) != chr(10)) {
                            $s = chr(10) . $s;
                        }
                    }
                }
                $parentLableName = $labelName;
                $isYes = true;
            }
        } else {
            if ($s != '') {
                $isYes = false;
                //call echo("isPre",isPre)
                if ($isPre == false) {
                    if ($s == chr(10)) {
                        if ($isTextarea == false && $isScript == false && $isStyle == false) {
                            $s = '';
                        } else {
                            if ($isScript == true) {
                                if (inStr($action, '|zipscripthtml|') > 0) {
                                    $s = ' ';
                                }
                            } else {
                                if ($isStyle == true) {
                                    if (inStr($action, '|zipstylehtml|') > 0) {
                                        $s = '';
                                    }
                                } else {
                                    if ($isTextarea == true) {
                                        if (inStr($action, '|ziptextareahtml|') > 0) {
                                            $s = '';
                                        }
                                    } else {
                                        $s = chr(10);
                                    }
                                }
                            }
                        }
                        // Right(Trim(c), 1) = ">")   为在压缩时用到
                    } else {
                        if ((right(aspTrim($c), 1) == chr(10) || right(aspTrim($c), 1) == '>') && PHPTrim($s) == '' && $isTextarea == false && $isScript == false) {
                            $s = '';
                        }
                    }
                }
            }
        }
        $c = $c . $s;
    }
    $c = replace($c, chr(10), vbCrlf());
    $formatting = $c;
    return @$formatting;
}
 public function showBarcode($data, $y)
 {
     $type = strtoupper($data['barcodetype']);
     $height = $data['height'];
     $width = $data['width'];
     $x = $data['x'];
     $y = $data['y'] + $y;
     $textposition = $data['textposition'];
     $code = $data['code'];
     $code = $this->analyse_expression($code);
     $modulewidth = $data['modulewidth'];
     if ($textposition == "" || $textposition == "none") {
         $withtext = false;
     } else {
         $withtext = true;
     }
     $style = array('border' => false, 'vpadding' => 'auto', 'hpadding' => 'auto', 'text' => $withtext, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 1, 'module_height' => 1);
     //[2D barcode section]
     //DATAMATRIX
     //QRCODE,H or Q or M or L (H=high level correction, L=low level correction)
     // -------------------------------------------------------------------
     // PDF417 (ISO/IEC 15438:2006)
     /*
      The $type parameter can be simple 'PDF417' or 'PDF417' followed by a
      number of comma-separated options:
      'PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6'
      Possible options are:
          a  = aspect ratio (width/height);
          e  = error correction level (0-8);
          Macro Control Block options:
          t  = total number of macro segments;
          s  = macro segment index (0-99998);
          f  = file ID;
          o0 = File Name (text);
          o1 = Segment Count (numeric);
          o2 = Time Stamp (numeric);
          o3 = Sender (text);
          o4 = Addressee (text);
          o5 = File Size (numeric);
          o6 = Checksum (numeric).
      Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional.
      To use a comma character ',' on text options, replace it with the character 255: "\xff".
     */
     switch ($type) {
         case "PDF417":
             $this->pdf->write2DBarcode($code, 'PDF417', $x, $y, $width, $height, $style, 'N');
             break;
         case "DATAMATRIX":
             //$this->pdf->Cell( $width,10,$code);
             if (left($code, 3) == "QR:") {
                 $code = right($code, strlen($code) - 3);
                 $this->pdf->write2DBarcode($code, 'QRCODE', $x, $y, $width, $height, $style, 'N');
             } else {
                 $this->pdf->write2DBarcode($code, 'DATAMATRIX', $x, $y, $width, $height, $style, 'N');
             }
             break;
         case "CODE128":
             $this->pdf->write1DBarcode($code, 'C128', $x, $y, $width, $height, $modulewidth, $style, 'N');
             // $this->pdf->write1DBarcode($code, 'C128', $x, $y, $width, $height,"", $style, 'N');
             break;
         case "EAN8":
             $this->pdf->write1DBarcode($code, 'EAN8', $x, $y, $width, $height, $modulewidth, $style, 'N');
             break;
         case "EAN13":
             $this->pdf->write1DBarcode($code, 'EAN13', $x, $y, $width, $height, $modulewidth, $style, 'N');
             break;
         case "CODE39":
             $this->pdf->write1DBarcode($code, 'C39', $x, $y, $width, $height, $modulewidth, $style, 'N');
             break;
         case "CODE93":
             $this->pdf->write1DBarcode($code, 'C93', $x, $y, $width, $height, $modulewidth, $style, 'N');
             break;
     }
 }
Exemple #29
0
                <br><br>
                <p>
                    Since our purpose is to ensure that at least this website stays up to date with the latest 
                    happenings in the college, we would highly appreciate it if we could get timely inputs and
                    positive and constructive criticism from you. 
                    After all, this website was created for the benefit of all BITians.
                    So ensure that you <a href="contact.php">stay in touch</a> and we will do the same.
                </p>
                <br><br><br>
                <hr>
                <p>
                    DISCLAIMER : Neither is BIT Unofficial affiliated to, nor is (was/will be) a sister web-site
                    to the Official one.<br>
                    BIT Unofficial in no way(s) claims (or will ever claim) to be the web-site created / endorsed by 
                    Bangalore Institute Of Technology, V.V Pura, Bangalore - 560004. <br>
                    As the name of the website suggests and as it has been repeatedly pointed out <i>this is <span class="redText">
                    not</span> the official Bangalore Institute Of Technology website.</i>
                </p>	
                <div id="jmplink"> <a href="#top">Jump To Top </a></div>
            </div>	<!-- End of content div -->
            <?php 
right();
?>
	
        </section>
        <?php 
footer();
?>
    </body>
</html>	
include_once "class/Accounts.php";
$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
$org = new Organization();
//$bp = new BPartner();
$acc = new Accounts();
$header = array("Accounts", "", "");
$w = array(130, 30, 30);
$papertype = "A4";
if ($_POST['action'] == 'reloadchart') {
    $organization_id = $_REQUEST['organization_id'];
    $seriesname = explode("|||", $_POST['seriesname']);
    $allvalue = explode("|||", $_POST['allvalue']);
    $allmonth = explode(",", $_POST['allmonth']);
    $k = 0;
    foreach ($allmonth as $m) {
        $allmonth[$k] = right($m, 5);
        $k++;
    }
    include "../simantz/class/pchart/pChart/pData.class";
    include "../simantz/class/pchart/pChart/pChart.class";
    $DataSet = new pData();
    $i = 0;
    foreach ($allvalue as $rowarray) {
        $i++;
        $tmpvalue = array();
        $arrvalue = explode(",", $rowarray);
        $DataSet->AddPoint($arrvalue, "Serie" . $i);
    }
    $i++;
    $seriesname_i = $i;
    $DataSet->AddPoint($seriesname, "Serie" . $i);