template_dir = 'templates/templates'; $smarty->compile_dir = 'templates/templates_c'; $smarty->cache_dir = 'templates/cache'; $smarty->config_dir = 'templates/configurari'; //include clase noi include 'classes/database.php'; include 'classes/rpl.php'; include 'classes/categs.php'; include 'classes/products.php'; include 'classes/banks.php'; include 'classes/cart.php'; include 'classes/cities.php'; include 'classes/locations.php'; include 'classes/sources.php'; include 'classes/streets.php'; include 'classes/orders.php'; include 'classes/popups.php'; include 'classes/users.php'; include 'classes/employee.php'; //end include clase noi //define link location $segment=explode("/",$_GET['var1']); $tip=$segment[0]; $idp=$segment[1]; //end define link location //default title $title='Trenta Pizza POS'; //end default title //init database $db=new bazaDate(); $connect=$db->connect($dbhost,$dbname,$dbuser,$dbpass); //init database //login if ($_SESSION['employee']<1) { if ($_POST['step']=='auth') { if (strlen($_POST['utilizator'])>5 and strlen($_POST['parola'])>5) { $employee=new employee(); if ($employee->login($_POST['utilizator'],$_POST['parola'])>0) header("Location: ".$dir.'kassa'); else $smarty->assign('errorAuth', 'Eroare autentificare'); } else $smarty->assign('errorAuth', 'Eroare autentificare'); } $smarty->display('login.html'); exit(); } //end login //init locations class $locations=new locations(); //categorii pp if ($tip=='kassa') { if ($idp=='assign') { $newUser=new users(); $newUser->assignUserToSession($segment[2],$segment[3]); header("Location: ".$dir.'kassa'); } if ($idp=='unAssignUser') { $newUser=new users(); $newUser->unAssignUser(); header("Location: ".$dir.'kassa'); } //categorii $categs=new categs(); $smarty->assign('categs', $categs->listLinks()); //end categorii //afisare produse in tab-uri $produse=new products(); $content.=$produse->productsIntoCatsTab(); //end afisare produse in tab-uri //popup if ($_SESSION['user']<1) { $popups=new popups(); $smarty->assign('popupNoUser', $popups->popupNoUser($_SESSION['user'])); } //end popup //detalii user if ($_SESSION['user']>0) { $users=new users(); $cart=new shoppingCart(); if ($cart->checkHasLostCart() and $_SESSION['frontOffice']<1) { $smarty->assign('shoppingCartContents','Recuperare Comanda Pierduta'); } $popups=new popups(); $smarty->assign('popupCheckout',$popups->popupToFinishOrder()); $smarty->assign('popupToppings',$popups->popupChooseTopping()); $smarty->assign('popupOrderHistory',$popups->popupForClientHistory()); if ($_SESSION['frontOffice']>1) $smarty->assign('userDetails', '
Schimba Client
'.$unAssign.$users->userDetails($_SESSION['user']).'
'.$users->userAddress($_SESSION['user'],$_SESSION['userAddress']).'
Locatie Livrare: '.$locations->getLocationById($_SESSION['userDeliveryAreaId']).'
Comenzi client
'); } //end detalii user } //end categorii pp //finish order if ($_SESSION['user']>0 and $tip=='finishOrder') { $order=new order(); $orderId=$order->finishOrder(0); //0 - source for call center /* $content='
'; $content.='

Comanda a fost plasata

'; $content.=$order->getOrderById($orderId); $content.='
'; */ $cart=new shoppingCart(); $cart->golire_cos(); $popups=new popups(); $smarty->assign('popupOrderFinished',$popups->popupOrderFinished($orderId)); } //end finish order $smarty->assign('postSearch', $_POST['search']); $smarty->assign('rand', date("YmdHis")); $smarty->assign('dir', $dir); $smarty->assign('hour',date("H:i")); $smarty->assign('title', $title); $smarty->assign('content', $content); if ($tip=='kitchen') $smarty->display('kitchen.html'); else $smarty->display('index.html'); ?>