core/api/modules/cart/index.php

28 lines
973 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
\DB::set("ALTER TABLE `cart` ADD `order` int(10) NULL");
ini_set( 'display_errors', 0 );
//Получаем данные пользователя
if ($_SESSION['user_id']){
$user=\DB::getAll("SELECT * FROM `users` WHERE `id`=?", $_SESSION['user_id']);
$smarty -> assign( 'user', $user );
//получаем организации пользователя
$orgs=\DB::getAll("SELECT * FROM `org` WHERE `id` IN (SELECT `org` FROM `users_orgs` WHERE `user`=?)", $_SESSION['user_id']);
$smarty -> assign( 'orgs', $orgs );
$ad=\DB::getAll("SELECT * FROM `adres_dostavki` WHERE `user_id`=?", $_SESSION['user_id']);
$smarty -> assign( 'ad', $ad );
}
//print_r(core::getCart());
$cart=core::getCart();
$smarty -> assign( 'itogcart', $cart['cart'] );
$smarty -> assign( 'summ', $cart['summ'] );
//Получить данные об организации
//Получить адреса доставки
?>