db; $objCatalogs = $setup->setupClass ("Catalogs"); function escapeLoc ($loc) { $patterns = array (); $patterns[0] = '/&/'; $patterns[1] = '/\'/'; $patterns[2] = '/"/'; $patterns[3] = '/>/'; $patterns[4] = '/db->getOne ('select new_code from catalogs_modifications where active=1 and product_id=? and new_code<>""', array ( $product_id )); } print ''; print ""; print "" . date ("Y-m-d h:m") . ""; print "ExtremStyle"; print ""; print ""; $res = $db->getAll ("select * from catalogs_rubrics where is_xml=?", array ( 0 ), DB_FETCHMODE_ASSOC); // print_r($res); $rubrics = array (); print ""; foreach ($res as $row) { $rubrics[] = $row['id']; print ""; print "" . $row['id'] . ""; print "" . $row['parent_id'] . ""; print "" . $row['name'] . ""; print ""; } print ""; print ""; foreach ($rubrics as $rub) { $res = $db->getAll (" select p.*,r.translit as rubric_translit,r.is_xml2,b.name as brend,r.list_name from catalogs_products p LEFT JOIN catalogs_rubrics r ON r.id=p.rubric_id LEFT JOIN catalogs_brends b ON b.id=p.brend_id where p.rubric_id=? and p.count_modifications>0", array ( $rub ), DB_FETCHMODE_ASSOC); foreach ($res as $row) { print ""; print "" . $row['id'] . ""; print "" . $row['rubric_id'] . ""; if ($row['rubric_id'] != 14055) print "0" . $row['id'] . ""; print ""; print "" . htmlspecialchars (escapeLoc ($row['brend'])) . ""; $row['ph1'] = $objCatalogs->getFilterPh1 ($row['id']); $f = $objCatalogs->viewFilterProduct ($row['id']); $f_arr = array (); foreach ($f as $_f) { $f_arr[] = $_f['name']; } $f_str = (count ($f_arr) > 0) ? implode (', ', $f_arr) : ''; print "" . htmlspecialchars (escapeLoc ($row['ph1'])) . ' ' . htmlspecialchars (escapeLoc ($row['list_name'])) . ' ' . htmlspecialchars (escapeLoc ($row['brend'])) . ' ' . htmlspecialchars (escapeLoc ($row['name'])) . ' ' . htmlspecialchars (escapeLoc ($f_str)) . ' ' . modCodeNew ($row['id']) . ""; print "" . htmlspecialchars (nohtml (stripcslashes ($row['text']))) . ""; print "http://extremstyle.ua/" . htmlspecialchars (escapeLoc ($row['rubric_translit'])) . "-catalogs/" . htmlspecialchars (escapeLoc ($row['translit'])) . "-" . $row['id'] . "/"; print "http://extremstyle.ua/uploaded/pic/catalogs/products/" . $row['pic'] . ""; print "" . round ($row['cine'] - ($row['cine'] * $row['salepc'] / 100)) . ""; // print"" . $row['cine'] . ""; print "" . $row['cine'] . ""; print ""; print "Íà ñêëàäå"; print ""; IF ($row['is_xml2'] == 1 && $row['rubric_id'] != 14055) { if ($row['sex'] == 1) $sex = 'Ìóæñêîé'; elseif ($row['sex'] == 2) $sex = 'Æåíñêèé'; elseif ($row['sex'] == 3) $sex = 'Äåòñêèé'; elseif ($row['sex'] == 4) $sex = 'Óíèñåêñ'; else $sex = ''; $res_m = $db->getAll (" select * from catalogs_modifications where active=1 and product_id=?", array ( $row['id'] ), DB_FETCHMODE_ASSOC); foreach ($res_m as $row_m) { print '' . $row_m['size'] . ''; print '' . (($row['rubric_id'] == 14055) ? $row_m['color'] : $row_m['color2']) . ''; print '' . $sex . ''; print ''; print ''; print '' . htmlspecialchars (escapeLoc ($row['list_name'])) . ''; print ''; print ''; print ''; } } print ""; } } print ""; print ""; ?>