Example #1
0
 public function createUser($sender, $param)
 {
     if ($this->IsValid) {
         $userRecord = new TblUsers();
         $userRecord->type_user_id = 2;
         $userRecord->username = $this->Username->Text;
         $userRecord->password = md5($this->Password->Text);
         $userRecord->active = 0;
         $userRecord->confirm_code = mt_rand(1000000000, 9999999999.0);
         $userRecord->name = $this->Name->Text;
         $userRecord->surname = $this->Surname->Text;
         $userRecord->email = $this->Email->Text;
         $userRecord->telephone = $this->Telephone->Text;
         $userRecord->mobile_telephone = $this->MobileTelephone->Text;
         $userRecord->fax = $this->Fax->Text;
         $userRecord->date_insert = date("c");
         $userRecord->piva = $this->Piva->Text;
         $userRecord->Save();
         $relSC = new RelStringerCustomer();
         $relSC->id_stringer = $userRecord->id;
         $relSC->id_customer = $userRecord->id;
         $relSC->Save();
         $this->SendMail($userRecord);
         $this->SendMailMe($userRecord);
         $url = $this->Service->constructUrl('User.Register', array('status' => 'OK'));
         $this->Response->redirect($url);
     }
 }
Example #2
0
 public function createUser($sender, $param)
 {
     if ($this->IsValid) {
         $userRecord = new TblUsers();
         $userRecord->type_user_id = 3;
         $userRecord->username = $this->Username->Text;
         $userRecord->password = md5($this->Password->Text);
         $userRecord->active = 1;
         $userRecord->confirm_code = mt_rand(1000000000, 9999999999.0);
         $userRecord->name = $this->Name->Text;
         $userRecord->surname = $this->Surname->Text;
         $userRecord->email = $this->Email->Text;
         $userRecord->telephone = $this->Telephone->Text;
         $userRecord->mobile_telephone = $this->MobileTelephone->Text;
         $userRecord->fax = $this->Fax->Text;
         $userRecord->cost = $this->Cost->Text;
         $userRecord->date_insert = date("c");
         $userRecord->piva = $this->Piva->Text;
         $userRecord->codice_fiscale = $this->CodiceFiscale->Text;
         $userRecord->tbl_classifica_id = $this->DDLClassifica->SelectedValue;
         $userRecord->name_circolo = $this->Circolo->Text;
         $userRecord->date_nascita = $this->DateNascita->getDataOk();
         $userRecord->Save();
         $relSC = new RelStringerCustomer();
         $relSC->id_stringer = $this->User->UserDB->id;
         $relSC->id_customer = $userRecord->id;
         $relSC->Save();
         $url = $this->Service->constructUrl('User.Customers');
         $this->Response->redirect($url);
     }
 }