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'; include 'classes/drivers.php'; include 'classes/filtre.php'; include 'classes/comenzi.php'; include 'mailNew.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='Anvelope Arcoplast'; //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.'articole'); } } } if ($_SESSION['employee']<1 and $_SESSION['user']<1 ) { if ($_POST['step']=='auth') { if (strlen($_POST['utilizator'])>5 and strlen($_POST['parola'])>5) { $user=new users(); if ($user->login($_POST['utilizator'],$_POST['parola'])>0) header("Location: ".$dir.'articole'); else $smarty->assign('errorAuth', 'Eroare autentificare'); } else $smarty->assign('errorAuth', 'Eroare autentificare'); } $smarty->display('login.html'); exit(); } //end login //logout if ($tip=='logout') { unset($_SESSION['employee']); unset($_SESSION['user']); // unset($_SESSION['cos']); header("Location: ".$dir); } //end logout if ($tip=='articole') { $filtre=new filtre(); $cart=new shoppingCart(); $produse=new products(); $content.='
'.$produse->productTableWithFilters().'
'; } if ($tip=='cart') { $produse=new products(); $content.='
'.$produse->productTableWithFilters(1).'
'; $cart=new shoppingCart(); $content.='

Finalizare Comanda

'.$cart->showPartenersToFin().'
'; } if ($tip=='setari' and $_SESSION['user']>0) { $users=new users(); $content.=''.$users->userSettings().''; } if ($tip=='solduri' and $_SESSION['user']>0) { $users=new users(); $content.='
'.$users->userSold().'
'; } if ($tip=='solduri' and $_SESSION['employee']>0) { $users=new users(); $content.='
'.$users->userSoldByEmployee().'
'; } if ($tip=='finish') { $cart=new shoppingCart(); $idComanda=$cart->finalizare_comanda(); if ($idComanda>0) header("Location: ".$dir.'checkoutOk/'.$idComanda); } if ($tip=='checkoutOk') { $content.='



Comanda '.$idp.' a fost inregistrata!

'; } if ($tip=='istoric' and ($_SESSION['user']>0 or $_SESSION['employee']>0)) { $comenzi=new comenzi(); if ($idp=='') { $content.='

'; if ($_SESSION['user']>0) $content.='Comenzile mele'; $content.='

'; if ($_SESSION['user']>0) $content.=$comenzi->istoricComenzi($_SESSION['user']); else if ($_SESSION['employee']>0) $content.=$comenzi->istoricComenziByEmployee($_SESSION['employeee']); $content.='
'; } else { $content.='
'.$comenzi->comandaCompleta(0,0,$segment[2]).'
'; } } if ($tip=='contact') { $content.='
'.$db->getField("SELECT text from contact where id=1",'text').'
'; } if ($tip=='facturi') { $content.='

Facturi

Numar FacturaClientData Facturii
6COMPANIE DEMO 190809-06-2021 Descarca factura
5COMPANIE DEMO 188509-06-2021 Descarca factura
4COMPANIE DEMO 113824-05-2021 Descarca factura
3COMPANIE DEMO 188524-05-2021 Descarca factura
2COMPANIE DEMO 190824-05-2021 Descarca factura
1COMPANIE DEMO 257720-05-2021 Descarca factura


'; } $smarty->assign('tipAuto',$_GET['tipAuto']); // meniu stanga default $leftFilters='
'.$GLOBALS['marcajeFiltru'].'
'; if ($_GET['tipAuto']=='camioane') { $leftFilters='
'.$GLOBALS['pozitiiFiltru'].'
'.$GLOBALS['marcajeFiltru'].'
'; } if ($_GET['tipAuto']=='industriale') { $leftFilters='
'; } if ($_GET['tipAuto']=='jante-camioane') { $leftFilters='
'.$GLOBALS['diametruFiltru'].'
'; } $scriptBottom.=' '; if ($_SESSION['pretCumparare']!=1) { $pretVanzareTop.=' Pret Vanzare '; } else { $pretVanzareTop.=' Pret Cumparare '; } $smarty->assign('pretVanzareTop', $pretVanzareTop); $smarty->assign('leftFilters', $leftFilters); $smarty->assign('scriptBottom', $scriptBottom); $smarty->assign('firma', ''.$_SESSION['numeFirma'].''); $smarty->assign('angajat', $_SESSION['numeAngajat'].' | '); $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); $smarty->display('index.html'); ?>