Ejemplo n.º 1
0
include "config.inc.php";
include LANG_CONFIG;
@(include LANG_PATH . $_SESSION['lang']['label'] . '/' . LANG_PREV);
//inclusione dizionario preventivo
include DB;
include CLASS_pages;
$main = new pages($db_conn);
//Informazioni pagina
$curr_page = "preventivo";
$curr_page_id = 13;
$page = $main->getPage(TABLE_cms, $curr_page_id, $_SESSION['lang']['id']);
$cart = new cart($db_conn, PREV, false, 1, $_SESSION['lang']['id'], $lang['prev'], DIR);
$cart->listen_add();
$cart->listen_empty();
$cart->listen_edit();
$cart->listen_remove();
// FRAMEWORK CORREZIONE INPUT
require_once 'tools/php_captcha/php-captcha.inc.php';
include_once 'tools/checkform/' . $_SESSION['lang']['label'] . '_error_const.inc.php';
include_once 'tools/checkform/regole.php';
include_once 'tools/checkform/tipi.php';
include_once 'tools/checkform/form_handler.php';
$sonoun_opt = array("privato", "ingrosso");
$nations_opt = array("Italia", "Germania", "Spagna", "Francia", "Inghilterra");
$nation_default = "Italia";
$reg_codfisc = "/^[a-zA-Z]{6}[0-9]{2}[abcdehlmprstABCDEHLMPRST]{1}[0-9]{2}([a-zA-Z]{1}[0-9]{3})[a-zA-Z]{1}\$/";
$fields = array();
$fields['nome'] = new FrmField($_POST['nome'], $lang['prev']['label-name'], true, array(new StrRangeRule(2, 30)));
$fields['cognome'] = new FrmField($_POST['cognome'], $lang['prev']['label-surname'], true, array(new StrRangeRule(2, 30)));
$fields['sonoun'] = new FrmField($_POST['sonoun'], $lang['prev']['label-about'], true, array(new InListRule($sonoun_opt)));
$fields['email'] = new MailField($_POST['email'], $lang['prev']['label-mail'], true);