txtLoginUsername=new QEmailTextBox($this); $this->txtLoginUsername->CssClass="stile1"; $this->txtLoginPwd=new QPasswordTextBox($this); $this->txtLoginPwd->CssClass="stile1"; $this->btnLogin=new QImageActionButton($this,null,'btnLoginClick',null,'/includes/img/box_home/bot_login.png'); */ $this->txtIscrEmail=new QEmailTextBox($this); $this->txtIscrEmail->SetCustomAttribute('placeholder','Inserisci...'); $this->txtCodAttivazione=new QTextBox($this); $this->txtCodAttivazione->SetCustomAttribute('placeholder','Inserisci...'); $this->checkPrivacy = new QCheckBox($this, 'checkPrivacyReg'); $this->checkPrivacy->Text = 'Acconsento al trattamento dei dati personali come da'; $this->btnIscr=new QButton($this); $this->btnIscr->Text = 'VAI'; $this->btnIscr->CssClass='hp_imgtext_btn'; $this->btnIscr->AddAction(new QClickEvent(), new QAjaxAction('btnIscrClick')); if(QApplication::QueryString('shareCode')) { $this->txtCodAttivazione->Text = QApplication::QueryString('shareCode'); QApplication::ExecuteJavaScript('$("#cod_reg_box").show()'); QApplication::ExecuteJavaScript('$("#cod_reg_check").prop(\'checked\', true);'); } if($this->IsUserLogged()){ //$this->gallery = PmBanner::Get(null,null,'HOME_PAGE_GALLERY_LOG'); $this->gallery = PmBanner::LoadHomeBanners('HOME_PAGE_GALLERY_LOG'); }else{ //$this->gallery = PmBanner::Get(null,null,'HOME_PAGE_GALLERY_NO_LOG'); $this->gallery = PmBanner::LoadHomeBanners('HOME_PAGE_GALLERY_NO_LOG'); } if($this->IsUserLogged()){ $this->user = $this->GetLoggedUser(); $this->btnCatCatalog = new QControlProxy($this); $this->btnCatCatalog->AddAction(new QClickEvent(), new QAjaxAction('btnCatCatalog_click')); $this->catalogPanel = new ProductsListPanel($this); $this->catalogPanel->CssClass = 'hp_product_panel_cont'; $this->catalogPanel->showTitle = false; $this->catalogPanel->showPaginator = false; $this->catalogPanel->showAllButtonVisible = true; $this->catalogPanel->showAllButtonCallback = array($this, "catalogPanelShowAllButtonCallback"); $this->catalogPanel->databind(); $this->primaryCats = manual_query("select * from pm_categoria where id_categoria_parent is null and is_active = 1 order by nome desc", false, true); } $this->moreInfo = new QControlProxy($this); $this->moreInfo->AddAction(new QClickEvent(), new QAjaxAction('btnMoreInfo_click')); $this->altLoginPanel = new QLoginBox($this); $this->altLoginPanel->Template = __DOCROOT__ . "/tpl/controls/QLoginBoxHP.tpl.php"; if(isset($_GET["showLogin"])){ $this->popupPanel->panel = $this->loginbox; $this->loginbox->showSelection = true; $this->popupPanel->Show(); } $this->puntivendita = PmPuntovendita::QueryArray( QQ::AndCondition( QQ::Equal(QQN::PmPuntovendita()->IsSportello, false), QQ::OrCondition( QQ::Equal(QQN::PmPuntoVendita()->NascondiSuSito, 0), QQ::IsNull(QQN::PmPuntovendita()->NascondiSuSito) ) ), QQ::OrderBy(QQN::PmPuntovendita()->Prov) ); } public function catalogPanelShowAllButtonCallback() { $this->catalogPanel->itemsPerPage = 999; $this->catalogPanel->databind(); $this->catalogPanel->showAllButtonVisible = false; $this->catalogPanel->MarkAsModified(); } public function btnCatCatalog_click($a,$b,$c) { $this->catalogPanel->category = PmCategoria::Load($c); $this->catalogPanel->databind(); $this->catalogPanel->MarkAsModified(); } public function btnIscrClick() { if(!$this->checkPrivacy->Checked){ QApplication::DisplayAlert("È obbligatorio accettare la normativa sul trattamento dei dati personali"); return; } $strEmail=$this->txtIscrEmail->Text; $strCodice=$this->txtCodAttivazione->Text; if(!$strEmail){ QApplication::DisplayAlert('Inserire la propria email'); return; } PmUtente::FindUserWaitingForPwd($strEmail); /*$blnOk=PmUtente::CheckEmailForRegistration($strEmail); if($blnOk==2){ QApplication::Redirect('reg_email_check.php?err=2'); } if($blnOk==1){ QApplication::Redirect('reg_email_check.php?res=ok'); } else if($blnOk==-1){ QApplication::DisplayAlert("Inserire un email valida"); } else{ if ($strCodice != null && $strCodice != "") { if (PmUtente::CheckCodeForRegistration($strEmail, $strCodice)) { QApplication::Redirect('reg_email_check.php?res=ok'); } else { QApplication::Redirect('reg_email_check.php?err=c'); } } QApplication::Redirect('reg_email_check.php'); }*/ PmUtente::VerificaEmailHome($strEmail, $strCodice); } public function btnMoreInfo_click(){ QApplication::Redirect("convenzioni.php"); } } IndexForm::Run('IndexForm','tpl/index.tpl.php'); ?>