コード例 #1
0
 public function registra_cliente($data)
 {
     $err = 0;
     $id_user = $this->is_new_user($data['email']->val);
     if ($id_user == -1) {
         $id_user = parent::create_id('cliente');
         if ($this->db->Execute("INSERT INTO cliente VALUES(?,?,?,'',?,?,?,?,CURDATE(),0)", array($id_user, ucwords(strtolower($this->purifica($data['nome']->val))), ucwords(strtolower($this->purifica($data['cognome']->val))), strtolower($this->purifica($data['sonoun']->val)), strtolower($this->purifica($data['email']->val)), $this->purifica($data['telefono']->val), $_SERVER['REMOTE_ADDR']))) {
         } else {
             $err = -1;
         }
     } else {
         if ($this->db->Execute("UPDATE cliente SET nome=?,cognome=?,tipo=?,tel=? WHERE id=?", array(ucwords(strtolower($this->purifica($data['nome']->val))), ucwords(strtolower($this->purifica($data['cognome']->val))), strtolower($this->purifica($data['sonoun']->val)), $this->purifica($data['telefono']->val), $id_user))) {
         } else {
             $err = -2;
         }
     }
     //Registrazione dati spedizione
     if (isset($data['nazione'])) {
         $this->registra_spedizione($id_user, $data);
     }
     //Registrazione della fatturazione
     if (isset($data['ragsoc'])) {
         $this->registra_fatturazione($id_user, $data);
     }
     return array('err' => $err, 'id_usr' => $id_user);
 }
コード例 #2
0
 public function verifica_token($token)
 {
     $v = -1;
     $token = parent::purifica($token);
     //purifico la variabile
     if ($r = $this->db->Execute("SELECT id\n\t\t\t\t\t\t\t\t\t  FROM ordine\n\t\t\t\t\t\t\t\t\t  WHERE token=? AND tipo=2", array($token))) {
         if (!$r->EOF) {
             //ordine esistente
             $v = $r->fields['id'];
         }
     }
     return $v;
 }
コード例 #3
0
    /**
     * RENDERING DELLE CATEGORIE IN HOME PAGE
     * @param number $numCol numero di colonne da creare
     */
    public function menu_cat_home($numCol = 4)
    {
        $html = '';
        $r = $this->get_categorie();
        if ($r != -1) {
            $num_elem = ceil($r->RecordCount() / $numCol);
            //numero di elementi per colonna
            $i = 0;
            $col = 1;
            while (!$r->EOF) {
                if ($i % $num_elem == 0) {
                    if ($i > 0) {
                        $html .= '</ul>
							</div>';
                    }
                    $html .= '<div class="col-xs-12 col-sm-3 col-md-3">
							<ul class="animated fadeInLeft delay-500" data-id="' . $col . '">';
                    $col++;
                }
                $href = LINK == 'href' ? DIR . $this->diz['link']['href'] . '?nome=' . parent::getAliasUrl($r->fields['nome']) . '&amp;id=' . $r->fields['id'] : DIR . $this->diz['link']['alias'] . parent::getAliasUrl($r->fields['nome']) . '-' . $r->fields['id'];
                $html .= '<li><a href="' . $href . '" title="' . sprintf($this->diz['title'], $r->fields['nome']) . '">' . $r->fields['nome'] . '</a></li>';
                if ($i + 1 == $r->RecordCount()) {
                    $html .= '</ul>
						</div>';
                }
                $i++;
                $r->MoveNext();
            }
        }
        return $html;
    }