Exemple #1
0
 // проход по первой строке
 foreach ($ca as $k => $i) {
     if ($i != $heading[$k]) {
         $_SESSION['errm'][] = 'Неверный формат файла';
         return array(0, 0);
     }
     $keys[] = $i;
 }
 $Products = new Products();
 $Parser = new Parser();
 // ini_set('memory_limit', '728M');
 ini_set('max_execution_time', 3000);
 $k = $l = $i = 0;
 foreach ($array as $row) {
     $res = array_combine($keys, $row);
     if (isset($res['url']) && $res['url'] !== '' && !$Products->SetFieldsByRewrite(G::StrToTrans($res['name']))) {
         // print_r($res['name']);
         // print_r('</br>');
         // var_dump(G::StrToTrans($res['name']));
         // print_r('</br>');
         // var_dump(!$Products->SetFieldsByRewrite(G::StrToTrans($res['name'])));die();
         if ($Parser->parseUrl($res['url'])) {
             $k++;
             sleep(3);
         } else {
             $l++;
         }
     } else {
         $i++;
     }
 }
Exemple #2
0
<?php

if (!isset($GLOBALS['Rewrite'])) {
    header('Location: /404/');
    exit(0);
}
$Products = new Products();
$Products->SetFieldsByRewrite($GLOBALS['Rewrite'], 1);
$product = $Products->fields;
$product['images'] = $Products->GetPhotoById($product['id_product']);
$tpl->Assign('product', $product);
if (isset($_REQUEST['id_gift']) && is_numeric($_REQUEST['id_gift'])) {
    $Products->SetFIeldsById($_REQUEST['id_gift']);
    $gift = $Products->fields;
    $gift['images'] = $Products->GetPhotoById($gift['id_product']);
    $tpl->Assign('gift', $gift);
}
echo $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_product_label.tpl');
exit(0);