Example #1
0
 public function addUser($paramUser)
 {
     $colonne = '';
     $valori = '\'';
     //        $paramRow = mysqli_real_escape_string($this->connessione, $paramRow);
     foreach ($paramUser as $key => $value) {
         // scarto i campi non buoni mediante le etichette
         $cutente = USingleton::getInstances('CUtente');
         if ($key == 'password') {
             $value = $cutente->maskPassword($value);
         }
         if ($key != 'ripeti_password') {
             $colonne = $colonne . $key . ', ';
             $valori = $valori . $value . '\', \'';
         }
         if ($key == 'nDocumento') {
             $colonne .= 'stato, admin, ';
             $valori = substr($valori, 0, strlen($valori) - 2);
             $valori .= 'FALSE, FALSE, \'';
         }
     }
     $colonne = substr($colonne, 0, strlen($colonne) - 2);
     $valori = substr($valori, 0, strlen($valori) - 3);
     $query = 'INSERT INTO ' . $this->table . ' (' . $colonne . ') VALUE (' . $valori . ');';
     return $this->executeQuery($query);
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     USingleton::getInstances('FDatabase');
     $this->table = 'UserRecovery';
     $this->keytable = 'Email';
 }
Example #3
0
 public function __construct()
 {
     $this->_table = 'utente';
     $this->_key = 'numero_tel';
     $this->_return_class = 'EUtente';
     USingleton::getInstance('Fdb');
 }
 public function __construct()
 {
     parent::__construct();
     USingleton::getInstances('FDatabase');
     $this->table = 'Prenotazione_Parcheggio';
     $this->keytable = 'id';
 }
Example #5
0
 /**
  * Smista le domande per i template da assegnare
  * @return mixed
  */
 public function smista($paramEmail)
 {
     $vhome = USingleton::getInstances('VHome');
     switch ($vhome->getController()) {
         case 'utente':
             $cutente = USingleton::getInstances('CUtente');
             $tmp = $cutente->smista($paramEmail);
             $vhome->setContent($tmp);
             break;
         case 'mezzo':
             $cmezzo = USingleton::getInstances('CMezzo');
             $tmp = $cmezzo->smista();
             $vhome->setContent($tmp);
             break;
         case 'parcheggio':
             $cparcheggio = USingleton::getInstances('CParcheggio');
             $tmp = $cparcheggio->smista();
             $vhome->setContent($tmp);
             break;
         case 'prenotazione':
             $cprenotazione = USingleton::getInstances('CPrenotazione');
             $tmp = $cprenotazione->smista();
             $vhome->setContent($tmp);
             break;
         default:
             $tmp = $vhome->fetch('./templates/slideshow.tpl');
             $vhome->setContent($tmp);
             return $vhome->processaTemplate('Home_default');
     }
 }
Example #6
0
 private function proceduraRiconsegna()
 {
     // recupero i dati dalla view
     $vprenotazione = USingleton::getInstances('VPrenotazione');
     $idPrenotazione = $vprenotazione->getIdPrenotazione();
     $idParcheggio = $vprenotazione->getIdParcheggio();
     return $vprenotazione->setRedirectText($this->chiudiPrenotazione($idPrenotazione, $idParcheggio));
 }
Example #7
0
 public function __construct()
 {
     $this->_table = 'ordine_prodotto';
     $this->_key = array("id_ordine", "id_prodotto");
     $this->_auto_increment = FALSE;
     $this->_return_class = 'EOrdineProdotto';
     USingleton::getInstance('Fdb');
 }
Example #8
0
 public function __construct()
 {
     $this->_table = 'categoria';
     $this->_key = 'id';
     $this->_auto_increment = TRUE;
     $this->_return_class = 'ECategoria';
     USingleton::getInstance('Fdb');
 }
Example #9
0
 public function __construct()
 {
     parent::__construct();
     USingleton::getInstances('FDatabase');
     $this->table = 'Prenotazione';
     $this->keytable = 'id';
     $this->resultClass = 'EPrenotazione';
 }
Example #10
0
 private function esitoRimuovi($temp)
 {
     $vparcheggio = USingleton::getInstances('VParcheggio');
     if ($temp == 1) {
         return $vparcheggio->setRedirectText('Parcheggio rimosso con successo');
     } else {
         return $vparcheggio->setRedirectText($temp);
     }
 }
Example #11
0
 protected function impostaBarraLateraleTemplate($paramType)
 {
     // assegno la barra laterale
     if ($paramType == 'default') {
         $this->assign('left_zone', $this->fetch('./templates/barra_laterale_default.tpl'));
     } else {
         $vutente = USingleton::getInstances('VUtente');
         $this->assign('left_zone', $this->fetch('./templates/barra_laterale_admin.tpl'));
     }
 }
Example #12
0
 public function salva()
 {
     $prodotto = $_POST;
     $prodotto->id = $_POST->id;
     $FProdotto = USingleton::getInstance('FProdotto');
     $result = $FProdotto->update($prodotto);
     if ($this->isAjax()) {
         echo $this->respondeAjaxObject($result);
     }
 }
Example #13
0
 public function getDatiParcheggio()
 {
     $vmezzo = USingleton::getInstances('VParcheggio');
     $datiinseriti = array('id', 'indirizzo', 'citta', 'provincia');
     $dati = array();
     foreach ($datiinseriti as $elemento) {
         if (isset($_POST[$elemento])) {
             $dati[$elemento] = $_POST[$elemento];
         }
     }
     return $dati;
 }
Example #14
0
 public function __construct()
 {
     parent::__construct();
     global $config;
     $this->setTemplateDir($config['smarty']['template_dir']);
     $this->setCompileDir($config['smarty']['compile_dir']);
     $this->setConfigDir($config['smarty']['config_dir']);
     $this->setCacheDir($config['smarty']['cache_dir']);
     //initalization
     $CHome = USingleton::getInstance('CHome');
     $this->assign('logged', $CHome->isLogged());
     $this->assign('admin', $CHome->isAdmin());
 }
Example #15
0
 public function getDatiMezzo()
 {
     $vmezzo = USingleton::getInstances('VMezzo');
     $datiinseriti = array('targa', 'modello', 'cilindrata', 'carburante', 'km', 'colore', 'prezzo_giornaliero', 'immagine', 'stato');
     $dati = array();
     foreach ($datiinseriti as $elemento) {
         if (isset($_POST[$elemento])) {
             $dati[$elemento] = $_POST[$elemento];
         }
     }
     $dati['immagine'] = $this->getUploadImage();
     return $dati;
 }
Example #16
0
 /**
  * Ritorna tutte le informazioni sull'utente
  * @return type
  */
 public function infoUtente()
 {
     $session = USingleton::getInstance('USession');
     $numero_tel = $session->leggi_valore('numero_tel');
     $FUtente = USingleton::getInstance('FUtente');
     $utente = $FUtente->load($numero_tel);
     $obj = array('nome' => $utente->getNome(), 'cognome' => $utente->getCognome(), 'numero_tel' => $utente->getNumeroTel(), 'email' => $utente->getEmail(), 'via' => $utente->getVia(), 'citta' => $utente->getCitta(), 'cap' => $utente->getCap(), 'tipo_utente' => $utente->getTipo_utente());
     if ($this->isAjax()) {
         $this->respondeAjaxObject($obj);
     } else {
         return $obj;
     }
 }
Example #17
0
 public function smista()
 {
     if (!$this->getCarrello()) {
         $view = USingleton::getInstance('VCarrello');
         $view->set_layout('error');
         return $view->processaTemplate();
     }
     list($azione, $data) = explode('.', $this->getTask());
     if ($azione == 'default') {
         return $this->mostraCarrello();
     }
     if ($azione == 'aggiungi') {
         return $this->aggiungiProdotto($data);
     }
     if ($azione == 'elimina') {
         return $this->eliminaProdotto($data);
     }
 }
Example #18
0
 public function totaleOrdine($id_ordine)
 {
     $FOrdine = USingleton::getInstance('FOrdine');
     $prodottiOrdinati = $FOrdine->getOrdineProdotti($id_ordine);
     if ($prodottiOrdinati == FALSE) {
         return 0;
     } else {
         $tot = 0;
         foreach ($prodottiOrdinati as $item) {
             $id_prodotto = $item->getIdProdotto();
             $quantita_prodotto = $item->getQuantita();
             $FProdotto = USingleton::getInstance('FProdotto');
             $prodotto = $FProdotto->load($id_prodotto);
             $prezzo_prodotto = $prodotto->getPrezzo();
             $subTot = $prezzo_prodotto * $quantita_prodotto;
             $tot = $tot + $subTot;
         }
         return $tot;
     }
 }
Example #19
0
 private function richiestaCambioStato()
 {
     $vmezzo = USingleton::getInstances('VMezzo');
     $idMezzo = $vmezzo->getMezzoId();
     $fmezzo = new FMezzo();
     $fmezzoload = $fmezzo->load($idMezzo);
     if (!$fmezzoload) {
         return 'Mezzo non trovato';
     } else {
         $fmezzoload = $fmezzo->setStatus($fmezzoload['id'], !$fmezzoload['stato']);
         if (!$fmezzoload) {
             return 'Impossibile cambiare lo stato';
         } else {
             return 'Operazione effettuata con successo';
         }
     }
 }
Example #20
0
 public function aggiungiModuloLogin($utente = null)
 {
     $VRegistrazione = USingleton::getInstance('VRegistrazione');
     $VRegistrazione->set_layout('default');
     if ($utente) {
         $VRegistrazione->assign('utente', $utente);
     }
     $modulo_login = $VRegistrazione->processaTemplate();
     $this->_side_content['modulo_login'] = $modulo_login;
 }
Example #21
0
 /**
  * Ritorna la lista dei prodotti appartenenti a un determinato ordine.
  * @param type $id_ordine
  * @return type
  */
 public function getOrdineProdotti($id_ordine)
 {
     $FOrdineProdotto = USingleton::getInstance('FOrdineProdotto');
     return $FOrdineProdotto->getProdottiByOrdine($id_ordine);
 }
Example #22
0
<?php

require_once 'include/autoload.inc.php';
require_once 'include/config.inc.php';
if (isset($_REQUEST['ajax'])) {
    $config['debug'] = false;
}
$CHome = USingleton::getInstance('CHome');
$CHome->impostaPagina();
Example #23
0
 /**
  * Smista le richieste ai vari controller
  * @return type
  */
 public function smista()
 {
     switch ($this->getController()) {
         case 'home':
             return $this->smistaInHome();
         case 'registrazione':
             $CRegistrazione = USingleton::getInstance('CRegistrazione');
             return $CRegistrazione->smista();
         case 'prodotto':
             $CProdotto = USingleton::getInstance('CProdotto');
             return $CProdotto->smista();
         case 'carrello':
             $CCarrello = USingleton::getInstance('CCarrello');
             return $CCarrello->smista();
         case 'ordine':
             $COrdine = USingleton::getInstance('COrdine');
             return $COrdine->smista();
         case 'utente':
             $CUtente = USingleton::getInstance('CUtente');
             return $CUtente->smista();
         default:
             $CProdotto = USingleton::getInstance('CProdotto');
             return $CProdotto->randomItems();
     }
 }
Example #24
0
function SS($name)
{
    return USingleton::getInstance($name);
}
Example #25
0
 /**
  * Utilizzata da ajax per capire se c'è un utente loggato
  * @return type
  */
 public function checkLog()
 {
     $sessione = USingleton::getInstance('USession');
     $numero = $sessione->leggi_valore('numero_tel');
     if ($numero) {
         return $this->respondeAjaxObject($numero);
     } else {
         return $this->respondeAjaxObject(false);
     }
 }
Example #26
0
 private function esitoAttivaUtente($paramFlag)
 {
     $vutente = USingleton::getInstances('VUtente');
     echo $paramFlag;
     if ($paramFlag != 0) {
         if ($paramFlag == 1) {
             return $vutente->setRedirectText('Operazione effettuata con successo');
         } else {
             return $vutente->setRedirectText('Si è verificato un errore');
         }
         return $vutente->setRedirectText('Utente non trovato');
     }
 }