include 'conf/conf.main.php';
include 'admin/conf/conf.tts.php';
include 'admin/class/class.sql.php';
$sql = new Sql($cfg['db']['host'], $cfg['db']['username'], $cfg['db']['password'], $cfg['db']['dbname']);
$sql->run('SET NAMES UTF8');
$article_content = file_get_contents("javafuncs.include.me");
$query = "SELECT " .
"products.id, " .
"pr_name, " .
"pr_desc, " .
"pr_price, " .
"pr_proc, " .
"su_id, " .
"products.ct_id, " .
"ct_name, " .
"ct_desc " .
"FROM products " .
"JOIN categories ON (categories.id=products.ct_id) " .
"JOIN suppliers ON (suppliers.id=products.su_id) " .
"WHERE (ct_lng='" . $cfg['lng'] . "' OR ct_lng='universal') AND products.pr_status='1' " .
((isset($_GET['product_id']) && $_GET['product_id'] > 0) ? "AND products.id=" . $_GET['product_id'] . " " : "") .
" ORDER BY products.gen, products.ct_id, pr_name ASC " .
((isset($_GET['product_id']) && $_GET['product_id'] > 0) ? " LIMIT 1 " : "");
$sql->query($query);
if ($sql->result && $sql->num_rows() > 0) {
$article_content .= '
' . "\r\n";
$last = "";
$i = 0;
/* $article_content .= '' . "\r\n";
$article_content .= 'Цены только для клиентов ТТС. | ';
$article_content .= '
';*/
if (!isset($_GET['product_id'])) {
$article_content .= '' . "\r\n";
$article_content .= '';
if (isset($_GET['product_id']) && $_GET['product_id'] > 0)
$article_content .= 'id';
else
$article_content .= '';
$article_content .= ' | ';
/* $article_content .= 'Название | ';
$article_content .= 'Цена | ';
*/
$article_content .= '
';
}
while ($row = $sql->fetch_assoc()) {
$i++;
if ($last != $row['ct_name']) {
$article_content .= '';
$article_content .= '';
$article_content .= '' . "\r\n";
$article_content .= ' | ';
if (isset($_GET['product_id']) && $_GET['product_id'] > 0) {
$article_content .= '';
$article_content .= '' . htmlspecialchars(stripslashes($row['pr_name'])) . ' | ';
if ($row['su_id'] == "7" ) {
$article_content .= ' | ';
} else {
$article_content .= '' . number_format((($row['pr_price'] * $row['pr_proc'] / 100 + $row['pr_price']) /100 * $PVM + $row['pr_price'] * $row['pr_proc'] / 100 + $row['pr_price']), 2, ".", " ") . ' ' . $cfg['currency'] . ' | ';
$article_content .= '' . number_format(((($row['pr_price'] * $row['pr_proc'] / 100 + $row['pr_price']) /100 * $PVM + $row['pr_price'] * $row['pr_proc'] / 100 + $row['pr_price']) * 3.4528), 2, ".", " ") . ' ' . 'Lt' . ' | ';
};
} else {
$article_content .= '';
$article_content .= '' . htmlspecialchars(stripslashes($row['ct_name'])) . ' | ';
};
$article_content .= ' | ';
$article_content .= ' ';
$article_content .= '' . "\r\n";
$article_content .= ' | ';
$article_content .= ' | ';
$article_content .= ' ';
$article_content .= '' . "\r\n";
$article_content .= ' | ';
$article_content .= ' | ';
$article_content .= ' ';
$article_content .= ' ';
$article_content .= ' |
';
$last = $row['ct_name'];
}
if (isset($_GET['product_id']) && $_GET['product_id'] > 0) {
$article_content .= '' . "\r\n";
$article_content .= '' . stripslashes(trim($row['pr_desc'])) . ' |
| ';
$article_content .= '
';
} else {
/* ";
# if ($row['ct_id'] == "3" ) {
# $img = "";
# };
# if ($row['ct_id'] == "19" ) {
# $img = "";
# };
# if ($row['ct_id'] == "20" ) {
# $img = "";
# };
# if ($row['ct_id'] == "21" ) {
# $img = "";
# };
# if (preg_match("/]*>)/ui", stripslashes(trim($row['pr_desc'])), $out00)) {
# if (preg_match("/jpeg|jpg|png|gif|bmp/ui", $out00[1], $oud)) {
# $img = "";
# };
$article_content .= '' . "\r\n";
$article_content .= '' . "\r\n";
$article_content .= ' | ' . $img . ' | ';
$article_content .= ' | ' . htmlspecialchars(stripslashes($row['pr_name'])) . ' | ';
if ($row['su_id'] == "7" || $row['pr_price'] == 0.00) {
$article_content .= ' | ';
} else {
$article_content .= ' | ';
$article_content .= ' | ';
};
$article_content .= '
';
$article_content .= '';
$article_content .= ' | ';
$article_content .= '
' . "\r\n";
$article_content .= ' |
';
}
/*
* td nowrap valign="top" colspan="7">
* ?=$row['pr_desc']; ?>
* /td>
* /tr> */
}
$article_content .= '
';
}
$sql->close();
?>
ЗАО "Транстелесервис" : Мобильная связь
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
В ВИСАГИНАСЕ:
85.206.223.30
|
|
|
|
|
|
|
|
|
|
|
©
2005 ЗАО “TRANSTELESERVIS” |
|
Седулинос
ал. 18, 31122 Висагинас / Тел.: +370 386 70011 / факс:
+370 386 70394 |
|
|
|
|
|
|
|