/* if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){ $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $redirect); exit(); } */ session_start(); include_once 'config.php'; require('classes/Smarty/Smarty.class.php'); $smarty = new Smarty(); $smarty->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', '