Пример #1
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);
     }
 }
Пример #2
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);
     }
 }
Пример #3
0
 public function selectCustomer($sender, $param)
 {
     if ($param->Item->IDColumn->Text == $this->User->UserDB->id) {
         $url = $this->Service->constructUrl('User.PersonalData');
         $this->Response->redirect($url);
     } else {
         $this->userEdit = TblUsers::finder()->findBy_id($param->Item->IDColumn->Text);
         $this->EDIT_CUSTOMER_DATA->Text = Prado::localize('Edita_Data_Customer') . " " . $this->userEdit->name . " " . $this->userEdit->surname;
         $this->editable->Visible = true;
         $this->Email->Text = $this->userEdit->email;
         $this->Name->Text = $this->userEdit->name;
         $this->Surname->Text = $this->userEdit->surname;
         $this->Telephone->Text = $this->userEdit->telephone;
         $this->MobileTelephone->Text = $this->userEdit->mobile_telephone;
         $this->Fax->Text = $this->userEdit->fax;
         $this->Cost->Text = $this->userEdit->cost;
         $this->Piva->Text = $this->userEdit->piva;
         $this->CodiceFiscale->Text = $this->userEdit->codice_fiscale;
         $criteria = new TActiveRecordCriteria();
         $criteria->OrdersBy['id'] = 'desc';
         $classifiche = TblClassifica::finder()->findAll($criteria);
         $this->DDLClassifica->DataSource = $classifiche;
         $this->DDLClassifica->dataBind();
         $this->DDLClassifica->SelectedValue = $this->userEdit->tbl_classifica_id;
         $this->Circolo->Text = $this->userEdit->name_circolo;
         $this->DateNascita->setTimeStamp(strtotime($this->userEdit->date_nascita));
         $this->setViewState('userEdit', $this->userEdit);
     }
 }
Пример #4
0
 public function onLoad($param)
 {
     $this->Page->Title = Prado::localize('Confirm');
     $id = 0;
     $code = "";
     if (isset($_GET["id"])) {
         $id = $_GET["id"];
     }
     if (isset($_GET["code"])) {
         $code = $_GET["code"];
     }
     if ($id != 0 && $code != "") {
         $user = TblUsers::finder()->findBy_id($id);
         if ($user != null) {
             if ($user->active == 1) {
                 $this->result->Text = Prado::localize('USER_ALREADY_ACTIVE') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
             } else {
                 if ($user->confirm_code != $code) {
                     $this->result->Text = Prado::localize('USER_WRONG_CODE') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
                 } else {
                     $user->active = 1;
                     $user->save();
                     $this->result->Text = Prado::localize('ACTIVATION_OK');
                 }
             }
         } else {
             $this->result->Text = Prado::localize('USER_NOT_EXIST') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
         }
     } else {
     }
 }
Пример #5
0
 public function sendMail($sender, $param)
 {
     if ($this->IsValid) {
         $userRecord = TblUsers::finder()->findBy_email($this->Email->Text);
         $number = mt_rand(1000000000, 9999999999.0);
         $userRecord->password = md5($number);
         $userRecord->save();
         $this->SendNewPWD($userRecord, $number);
         $url = $this->Service->constructUrl('Home');
         $this->Response->redirect($url);
     }
 }
Пример #6
0
 /**
  * Logs out the current user and redirect to homepage.
  */
 public function actionLogout()
 {
     $loginUserID = Yii::app()->user->getId();
     TblUsers::model()->updateByPk($loginUserID, array('LoginStatus' => 0));
     Yii::app()->user->logout();
     $this->redirect(Yii::app()->getBaseUrl(true));
 }
Пример #7
0
 public function exportExcel()
 {
     $objPHPExcel = new PHPExcel();
     $row = 1;
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $row, Prado::localize('JobID'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, $row, Prado::localize('Date Stringing'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(2, $row, Prado::localize('Customer'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(3, $row, Prado::localize('Racquet'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(4, $row, Prado::localize('SerialRacquet'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(5, $row, Prado::localize('Stringer'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(6, $row, Prado::localize('StringingMachine'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(7, $row, Prado::localize('StringMains'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(8, $row, Prado::localize('Tension'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(9, $row, Prado::localize('Prestretch'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(10, $row, Prado::localize('StringCross'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(11, $row, Prado::localize('Tension'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(12, $row, Prado::localize('Prestretch'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(13, $row, Prado::localize('StringingType'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(14, $row, Prado::localize('DynamicTension'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(15, $row, Prado::localize('Stencyl'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(16, $row, Prado::localize('GrommetsGuard'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(17, $row, Prado::localize('Grips'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(18, $row, Prado::localize('Overgrips'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(19, $row, Prado::localize('TotalPrice'));
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(20, $row, Prado::localize('NoteStringing'));
     $objPHPExcel->getActiveSheet()->getStyle('A1:Z1')->getFont()->setBold(true);
     $this->CreateArrayJobsCustomer($this->FilterCollection_brand->getNoFieldCondition(), $this->FilterCollection_model->getNoFieldCondition(), $this->FilterCollection_serial->getNoFieldCondition());
     $row = $row + 2;
     for ($j = 0; $j < count($this->DataJobsCustomer); $j++) {
         $job = $this->DataJobsCustomer[$j];
         $stringJob = $this->formatJob($job->id);
         $racquetCustomer = TblRacquetsUser::finder()->findBy_id($job->tbl_racquets_user_id);
         $customer = TblUsers::finder()->findBy_id($racquetCustomer->tbl_users_id);
         $racquetModel = TblRacquets::finder()->findBy_id($racquetCustomer->tbl_racquets_id);
         $brandRacquet = TblBrands::finder()->findBy_id($racquetModel->tbl_brands_id);
         $stringingMachine = TblStringingMachines::finder()->findBy_id($job->tbl_stringing_machines_id);
         $brandStringingMachine = TblBrands::finder()->findBy_id($stringingMachine->tbl_brands_id);
         $mainString = TblStrings::finder()->findBy_id($job->tbl_strings_id_main);
         $brandMainString = TblBrands::finder()->findBy_id($mainString->tbl_brands_id);
         $gaugeMainString = TblGauges::finder()->findBy_id($mainString->tbl_gauges_id);
         //$row->gauge_desc = $gauge->usa . " (" . $gauge->diameter.")";
         $crossString = TblStrings::finder()->findBy_id($job->tbl_strings_id_cross);
         $brandCrossString = TblBrands::finder()->findBy_id($crossString->tbl_brands_id);
         $gaugeCrossString = TblGauges::finder()->findBy_id($crossString->tbl_gauges_id);
         $stringingJobType = TblStringingJobType::finder()->findBy_id($job->tbl_stringing_type_id);
         $stencyl = Prado::localize('No');
         if ($job->stencyl == 1) {
             $stencyl = Prado::localize('Yes');
         }
         $grommet = Prado::localize('No');
         if ($job->grommets_guard == 1) {
             $grommet = Prado::localize('Yes');
         }
         $gripString = Prado::localize('No');
         if ($job->tbl_grip_id != 0) {
             $grip = TblGrips::finder()->findBy_id($job->tbl_grip_id);
             $brand = TblBrands::finder()->findBy_id($grip->tbl_brands_id);
             $gripString = $brand->description . " " . $grip->model;
         }
         $overgripString = Prado::localize('No');
         if ($job->tbl_overgrip_id != null) {
             $overgrip = TblOvergrips::finder()->findBy_id($job->tbl_overgrip_id->id);
             $brand = TblBrands::finder()->findBy_id($overgrip->tbl_brands_id);
             $overgripString = $brand->description . " " . $overgrip->model;
         }
         $y = substr($job->date_stringing, 0, 4);
         $m = substr($job->date_stringing, 5, 2);
         $d = substr($job->date_stringing, 8, 2);
         $dateString = $d . "-" . $m . "-" . $y;
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, $row, $stringJob);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, $row, $dateString);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(2, $row, $customer->name . ' ' . $customer->surname);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(3, $row, $brandRacquet->description . ' ' . $racquetModel->model);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(4, $row, $racquetCustomer->serial);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(5, $row, $this->User->UserDB->name . ' ' . $this->User->UserDB->surname);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(6, $row, $brandStringingMachine->description . ' ' . $stringingMachine->model);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(7, $row, $brandMainString->description . ' ' . $mainString->model);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(8, $row, $job->weight_main . ' ' . $this->User->UserDB->weight_unit->description);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(9, $row, $job->prestretch_main . ' %');
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(10, $row, $brandCrossString->description . ' ' . $crossString->model);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(11, $row, $job->wieght_cross . ' ' . $this->User->UserDB->weight_unit->description);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(12, $row, $job->prestretch_cross . ' %');
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(13, $row, $stringingJobType->description);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(14, $row, $job->dynamic_tension);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(15, $row, $stencyl);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(16, $row, $grommet);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(17, $row, $gripString);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(18, $row, $overgripString);
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(19, $row, $job->total_price);
         //$objPHPExcel->getActiveSheet()->getStyle('D'.$row)->getNumberFormat()->setFormatCode('0.00');
         $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(20, $row, $job->note);
         $row++;
     }
     $objPHPExcel->getActiveSheet()->setTitle(Prado::localize('CLAIM_CHECK'));
     $objPHPExcel->setActiveSheetIndex(0);
     header('Content-Type: application/vnd.ms-excel');
     header('Content-Disposition: attachment;filename="export.xls"');
     header('Cache-Control: max-age=0');
     header('Cache-Control: max-age=1');
     header('Expires: Mon, 26 Jul 2030 05:00:00 GMT');
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     header('Cache-Control: cache, must-revalidate');
     header('Pragma: public');
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
     $objWriter->save('php://output');
 }
Пример #8
0
 public function SendMail()
 {
     $stringJob = $this->formatJob((int) $this->Request['idJob']);
     $job = TblStringingJobs::finder()->findBy_id((int) $this->Request['idJob']);
     $racquetCustomer = TblRacquetsUser::finder()->findBy_id($job->tbl_racquets_user_id);
     $customer = TblUsers::finder()->findBy_id($racquetCustomer->tbl_users_id);
     $mail = new PHPMailer();
     $mail->IsSMTP();
     // enable SMTP
     $mail->SMTPDebug = 1;
     // debugging: 1 = errors and messages, 2 = messages only
     $mail->SMTPAuth = true;
     $mail->Host = $this->Application->Parameters['SMTP_HOST'];
     $mail->Port = $this->Application->Parameters['SMTP_PORT'];
     $mail->Username = $this->Application->Parameters['SMTP_USERNAME'];
     $mail->Password = $this->Application->Parameters['SMTP_PASSWORD'];
     $mail->SetFrom($this->User->UserDB->email, $this->User->UserDB->surname . " " . $this->User->UserDB->name);
     $mail->Subject = Prado::localize("StringingMailSubject");
     $body = "Dear " . $customer->name . " " . $customer->surname . "<br>";
     /*$body .= "Thank you for registering at the StringTools. Before we can activate your account one last step must be taken to complete your registration.";
     		$body .= "<br><br>";
     		$body .= "Please note - you must complete this last step to become a registered member. You will only need to visit this URL once to activate your account.";
     		$body .= "<br><br>";
     		$body .= "To complete your registration, please visit this URL:";
     		$body .= "<br>";
     		$body .= $this->Application->Parameters['SITE_LINK']."/index.php?page=User.Confirm&id=".$userRecord->id."&code=".$userRecord->confirm_code;
     		$body .= "<br><br>";
     		$body .= "Please be sure not to add extra spaces. You will need to type in your username and activation number on the page that appears when you visit the URL.";
     		$body .= "<br><br>";
     		$body .= "Your Username is: ".$userRecord->username;
     		$body .= "<br>";
     		$body .= "Your Activation ID is: ".$userRecord->confirm_code;
     		$body .= "<br><br>";
     		$body .= "If you are still having problems signing up please contact a member of our support staff at ".$this->Application->Parameters['EMAIL_ADMIN'];
     		$body .= "<br><br>";
     		$body .= "All the best,";
     		$body .= $this->Application->Parameters['SITE_LINK'];
     		$mail->IsHTML(true);
     		$mail->Body =$body;
     		$mail->AddAddress($customer->email);
     		if(!$mail->Send()) {
     			echo "errore SendMail:".$mail->ErrorInfo;
     			$error = 'Mail error: '.$mail->ErrorInfo;
     			return false;
     		} else {
     			//echo " SendMail ok";
     			$error = 'Message sent!';
     			return true;
     		}*/
 }
Пример #9
0
 public function selectCustomer($sender, $param)
 {
     $item = $param->Item;
     $this->zone_list_racquets_customer->Visible = true;
     $this->zone_list_add_racquets_customer->Visible = false;
     $this->btnAddRacquet->Visible = true;
     $this->btnCancelSelect->Visible = true;
     $this->userSelect = TblUsers::finder()->findBy_id($param->Item->IDColumn->Text);
     $this->setViewState('userSelect', $this->userSelect);
     $this->LBL_LIST_RACQUETS_USER->Text = Prado::localize('List racquets insert for the customer') . " " . $this->userSelect->name . " " . $this->userSelect->surname;
     $this->loadDataUserRacquets();
     $this->DataGridUserRacquets->DataSource = $this->DataUserRacquets;
     $this->DataGridUserRacquets->dataBind();
 }
 public function saveAddClicked()
 {
     $idUser = null;
     $idUser = (int) $this->Request['idUser'];
     $customer = TblUsers::finder()->findBy_id($idUser);
     $modify = false;
     if ($this->getViewState('userRacquetSelect', null) == null) {
         $this->userRacquetSelect = new TblRacquetsUser();
         $this->userRacquetSelect->tbl_racquets_id = $this->getViewState('racquetSelect', null)->id;
         $this->userRacquetSelect->tbl_users_id = $customer->id;
     } else {
         //$this->userRacquetSelect=$this->getViewState('userRacquetSelect',null);
         //$modify = true;
     }
     $this->userRacquetSelect->tbl_grip_size_id = $this->DDLGripSize->SelectedValue;
     $this->userRacquetSelect->serial = $this->Serial->Text;
     $this->userRacquetSelect->weight_unstrung = $this->WeightUnstrung->Text;
     $this->userRacquetSelect->weight_strung = $this->WeightStrung->Text;
     $this->userRacquetSelect->balance = $this->Balance->Text;
     $this->userRacquetSelect->swingweight = $this->Swingweight->Text;
     $this->userRacquetSelect->stiffness = $this->Stiffness->Text;
     $this->userRacquetSelect->date_buy = $this->DateBuy->getDataOk();
     $this->userRacquetSelect->note = $this->Note->Text;
     $this->userRacquetSelect->save();
     if ($modify) {
         $logRacquetUser = new LogRacquetUser();
         $logRacquetUser->id_tbl_racquet_user = $this->userRacquetSelect->id;
         $logRacquetUser->weight_unstrung = $this->WeightUnstrung->Text;
         $logRacquetUser->weight_strung = $this->WeightStrung->Text;
         $logRacquetUser->balance = $this->Balance->Text;
         $logRacquetUser->swingweight = $this->Swingweight->Text;
         $logRacquetUser->stiffness = $this->Stiffness->Text;
         $logRacquetUser->date_modify = date('c');
         $logRacquetUser->note = $this->Note->Text;
         $logRacquetUser->save();
     }
     $this->Response->redirect($this->Service->constructUrl('User.CustomersRacquets', array('idUser' => $idUser), false));
 }
Пример #11
0
    function makeHtmlJob($job)
    {
        //.''.   '..'
        $stringJob = $this->formatJob($job->id);
        $racquetCustomer = TblRacquetsUser::finder()->findBy_id($job->tbl_racquets_user_id);
        $customer = TblUsers::finder()->findBy_id($racquetCustomer->tbl_users_id);
        $racquetModel = TblRacquets::finder()->findBy_id($racquetCustomer->tbl_racquets_id);
        $brandRacquet = TblBrands::finder()->findBy_id($racquetModel->tbl_brands_id);
        $stringingMachine = TblStringingMachines::finder()->findBy_id($job->tbl_stringing_machines_id);
        $brandStringingMachine = TblBrands::finder()->findBy_id($stringingMachine->tbl_brands_id);
        $mainString = TblStrings::finder()->findBy_id($job->tbl_strings_id_main);
        $brandMainString = TblBrands::finder()->findBy_id($mainString->tbl_brands_id);
        $gaugeMainString = TblGauges::finder()->findBy_id($mainString->tbl_gauges_id);
        //$row->gauge_desc = $gauge->usa . " (" . $gauge->diameter.")";
        $crossString = TblStrings::finder()->findBy_id($job->tbl_strings_id_cross);
        $brandCrossString = TblBrands::finder()->findBy_id($crossString->tbl_brands_id);
        $gaugeCrossString = TblGauges::finder()->findBy_id($crossString->tbl_gauges_id);
        $stringingJobType = TblStringingJobType::finder()->findBy_id($job->tbl_stringing_type_id);
        $stencyl = Prado::localize('No');
        if ($job->stencyl == 1) {
            $stencyl = Prado::localize('Yes');
        }
        $grommet = Prado::localize('No');
        if ($job->grommets_guard == 1) {
            $grommet = Prado::localize('Yes');
        }
        $gripString = Prado::localize('No');
        if ($job->tbl_grip_id != 0) {
            $grip = TblGrips::finder()->findBy_id($job->tbl_grip_id);
            $brand = TblBrands::finder()->findBy_id($grip->tbl_brands_id);
            $gripString = $brand->description . " " . $grip->model;
        }
        $overgripString = Prado::localize('No');
        if ($job->tbl_overgrip_id != 0) {
            $overgrip = TblOvergrips::finder()->findBy_id($job->tbl_overgrip_id);
            $brand = TblBrands::finder()->findBy_id($overgrip->tbl_brands_id);
            $overgripString = $brand->description . " " . $overgrip->model;
        }
        $y = substr($job->date_stringing, 0, 4);
        $m = substr($job->date_stringing, 5, 2);
        $d = substr($job->date_stringing, 8, 2);
        $dateString = $d . "-" . $m . "-" . $y;
        $htmlMain = '<table border="1"  cellpadding="2">
						<tr>
							<td colspan="4" ><span style="font-weight:bold">' . Prado::localize('StringMains') . '</span>
							</td>
						</tr>
						<tr>
							<td colspan="4" align="center">' . $brandMainString->description . ' ' . $mainString->model . ' ' . $gaugeMainString->usa . ' (' . $gaugeMainString->diameter . ')
							</td>
						</tr>
						<tr>
							<td >' . Prado::localize('Tension') . '
							</td>
							<td >' . $job->weight_main . ' ' . $this->User->UserDB->weight_unit->description . ' 
							</td>
							<td >' . Prado::localize('Prestretch') . '
							</td>
							<td >' . $job->prestretch_main . ' %
							</td>
						</tr>
					</table>';
        $htmlCross = '<table border="1"  cellpadding="2">
						<tr>
							<td colspan="4" ><span style="font-weight:bold">' . Prado::localize('StringCross') . '</span>
							</td>
						</tr>
						<tr>
							<td colspan="4" align="center">' . $brandCrossString->description . ' ' . $crossString->model . ' ' . $gaugeCrossString->usa . ' (' . $gaugeCrossString->diameter . ')
							</td>
						</tr>
						<tr>
							<td >' . Prado::localize('Tension') . '
							</td>
							<td >' . $job->wieght_cross . ' ' . $this->User->UserDB->weight_unit->description . ' 
							</td>
							<td >' . Prado::localize('Prestretch') . '
							</td>
							<td >' . $job->prestretch_cross . ' %
							</td>
						</tr>
					</table>';
        $html = '<table border="1"  cellpadding="4"> 
					<tr>
						<td>' . Prado::localize('JobID') . '
						</td>
						<td >' . $stringJob . ' 
						</td>
						<td>' . Prado::localize('Date Stringing') . '
						</td>
						<td >' . $dateString . ' 
						</td>
					</tr>
					<tr>
						<td>' . Prado::localize('Customer') . '
						</td>
						<td colspan="3">' . $customer->name . ' ' . $customer->surname . ' 
						</td>
					</tr>
					<tr>
						<td>' . Prado::localize('Racquet') . '
						</td>
						<td colspan="3">' . $brandRacquet->description . ' ' . $racquetModel->model . '
						</td>
					</tr>
					<tr>
						<td>' . Prado::localize('SerialRacquet') . '
						</td>
						<td colspan="3">' . $racquetCustomer->serial . ' 
						</td>
					</tr>
					<tr>
						<td>' . Prado::localize('Stringer') . '
						</td>
						<td colspan="3">' . $this->User->UserDB->name . ' ' . $this->User->UserDB->surname . ' 
						</td>
					</tr>
					<tr>
						<td>' . Prado::localize('StringingMachine') . '
						</td>
						<td colspan="3">' . $brandStringingMachine->description . ' ' . $stringingMachine->model . ' 
						</td>
					</tr>
					<tr>
						<td colspan="4">' . $htmlMain . '
						</td>
					</tr>
					<tr>
						<td colspan="4">' . $htmlCross . '
						</td>
					</tr>
					<tr>
						<td width="25%">' . Prado::localize('StringingType') . '
						</td>
						<td width="25%">' . $stringingJobType->description . '
						</td>
						<td width="25%">' . Prado::localize('DynamicTension') . '
						</td>
						<td width="25%">' . $job->dynamic_tension . ' 
						</td>
					</tr>
					<tr>
						<td>' . Prado::localize('Stencyl') . '
						</td>
						<td>' . $stencyl . '
						</td>
						<td>' . Prado::localize('GrommetsGuard') . '
						</td>
						<td>' . $grommet . ' 
						</td>
					</tr>
					<tr >
						<td width="15%">' . Prado::localize('Grips') . '
						</td>
						<td width="35%">' . $gripString . '
						</td>
						<td width="15%">' . Prado::localize('Overgrips') . '
						</td>
						<td width="35%">' . $overgripString . ' 
						</td>
					</tr>
					<tr>
						<td width="20%">' . Prado::localize('TotalPrice') . '
						</td>
						<td width="80%">' . $job->total_price . ' 
						</td>
					</tr>
					<tr>
						<td width="20%">' . Prado::localize('NoteStringing') . '
						</td>
						<td width="80%">' . $job->note . ' 
						</td>
					</tr>
				</table>';
        return $html;
    }
Пример #12
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $this->Page->Title = Prado::localize('ManageJob');
     $this->Search->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/search.gif';
     $this->Cancel->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/cancel.gif';
     $this->Back->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/list-job.gif';
     $this->Cancel_2->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/cancel.gif';
     $this->Save->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/save.gif';
     $this->CalculatePrice->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/calculate-price.gif';
     $this->Delete->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/delete.gif';
     $idUser = null;
     $idUser = (int) $this->Request['idUser'];
     $idJob = null;
     $idJob = (int) $this->Request['idJob'];
     $idCloneJob = null;
     $idCloneJob = (int) $this->Request['idCloneJob'];
     if ($idUser != null) {
         if (!$this->IsPostBack) {
             $this->zone_list_racquets_customer->Visible = true;
             $this->customer = TblUsers::finder()->findBy_id($idUser);
             $this->setViewState('customer', $this->customer);
             $this->MANAGE_JOB_TITLE->Text = Prado::localize('NewJob') . " " . $this->customer->name . " " . $this->customer->surname;
             $this->editable->Visible = false;
             $this->DataGridUserRacquets->DataSource = $this->DataUserRacquets;
             $this->DataGridUserRacquets->dataBind();
             $this->Delete->visible = false;
         }
     } else {
         if ($idJob != null) {
             if (!$this->IsPostBack) {
                 $this->zone_list_racquets_customer->Visible = false;
                 $this->_edit_job = TblStringingJobs::finder()->findBy_id($idJob);
                 $racquetCustomer = TblRacquetsUser::finder()->findBy_id($this->_edit_job->tbl_racquets_user_id);
                 $this->customer = TblUsers::finder()->findBy_id($racquetCustomer->tbl_users_id);
                 $this->setViewState('customer', $this->customer);
                 $this->MANAGE_JOB_TITLE->Text = Prado::localize('EditJob') . " " . $this->customer->name . " " . $this->customer->surname;
                 $this->editable->Visible = false;
                 $this->DataGridUserRacquets->DataSource = $this->DataUserRacquets;
                 $this->DataGridUserRacquets->dataBind();
                 $i = 0;
                 foreach ($this->DataUserRacquets as $row) {
                     if ($row->id == $racquetCustomer->id) {
                         $this->DataGridUserRacquets->SelectedItemIndex = $i;
                     }
                     $i++;
                 }
                 $this->createEditZone($this->_edit_job, false);
                 $this->Delete->visible = true;
             }
         } else {
             if ($idCloneJob != null) {
                 if (!$this->IsPostBack) {
                     $this->zone_list_racquets_customer->Visible = false;
                     $this->_edit_job = TblStringingJobs::finder()->findBy_id($idCloneJob);
                     $racquetCustomer = TblRacquetsUser::finder()->findBy_id($this->_edit_job->tbl_racquets_user_id);
                     $this->customer = TblUsers::finder()->findBy_id($racquetCustomer->tbl_users_id);
                     $this->setViewState('customer', $this->customer);
                     $this->MANAGE_JOB_TITLE->Text = Prado::localize('EditJob') . " " . $this->customer->name . " " . $this->customer->surname;
                     $this->editable->Visible = false;
                     $this->DataGridUserRacquets->DataSource = $this->DataUserRacquets;
                     $this->DataGridUserRacquets->dataBind();
                     $i = 0;
                     foreach ($this->DataUserRacquets as $row) {
                         if ($row->id == $racquetCustomer->id) {
                             $this->DataGridUserRacquets->SelectedItemIndex = $i;
                         }
                         $i++;
                     }
                     $this->createEditZone($this->_edit_job, true);
                     $this->Delete->visible = true;
                 }
             } else {
                 if (!$this->IsPostBack) {
                     $this->editable->Visible = false;
                     $this->DataGridUserRacquets->DataSource = $this->DataUserRacquets;
                     $this->DataGridUserRacquets->dataBind();
                 }
             }
         }
     }
 }
Пример #13
0
 /**
  * Checks if the specified (username, password) is valid.
  * This method is required by TDbUser.
  * @param string username
  * @param string password
  * @return boolean whether the username and password are valid.
  */
 public function validateUser($username, $password)
 {
     // use UserRecord Active Record to look for the (username, password) pair.
     return TblUsers::finder()->findBy_username_AND_password($username, md5($password));
 }