Exemple #1
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');
 }
 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;
     		}*/
 }
    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;
    }
 public function selectRacquetCustomer($sender, $param)
 {
     $this->btnAddRacquet->visible = false;
     $this->btnCancelSelect->visible = false;
     $this->zone_list_add_racquets_customer->visible = false;
     $this->editable->Visible = true;
     $item = $param->Item;
     $this->TypeEdit->Text = Prado::localize('Edit racquet customer');
     $this->userRacquetSelect = TblRacquetsUser::finder()->findBy_id($param->Item->IDColumnUserRacquet->Text);
     $this->userRacquetSelect->racquet = TblRacquets::finder()->findBy_id($this->userRacquetSelect->tbl_racquets_id);
     $this->userRacquetSelect->grip = TblGripSize::finder()->findBy_id($this->userRacquetSelect->tbl_grip_size_id);
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['description'] = 'asc';
     $brands = TblBrands::finder()->findAll($criteria);
     $this->DDLBrands->DataSource = $brands;
     $this->DDLBrands->dataBind();
     $this->DDLBrands->SelectedValue = $this->userRacquetSelect->racquet->tbl_brands_id;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['description'] = 'asc';
     $patterns = TblRacquetsPattern::finder()->findAll($criteria);
     $this->DDLPatterns->DataSource = $patterns;
     $this->DDLPatterns->dataBind();
     $this->DDLPatterns->SelectedValue = $this->userRacquetSelect->racquet->tbl_racquets_pattern_id;
     $this->Model->Text = $this->userRacquetSelect->racquet->model;
     $this->HeadSize->Text = $this->userRacquetSelect->racquet->head_size;
     $this->Length->Text = $this->userRacquetSelect->racquet->length;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['europe_size'] = 'asc';
     $gripSize = TblGripSize::finder()->findAll($criteria);
     $gripSizeArray = array();
     foreach ($gripSize as $row) {
         $gripSizeArray[$row->id] = $row->europe_size . " (" . $row->usa_size . ")";
     }
     $this->DDLGripSize->DataSource = $gripSizeArray;
     $this->DDLGripSize->dataBind();
     $this->DDLGripSize->SelectedValue = $this->userRacquetSelect->tbl_grip_size_id;
     $this->Serial->Text = $this->userRacquetSelect->serial;
     $this->WeightUnstrung->Text = $this->userRacquetSelect->weight_unstrung;
     $this->WeightStrung->Text = $this->userRacquetSelect->weight_strung;
     $this->Balance->Text = $this->userRacquetSelect->balance;
     $this->Swingweight->Text = $this->userRacquetSelect->swingweight;
     $this->Stiffness->Text = $this->userRacquetSelect->stiffness;
     $this->BeamWidth->Text = $this->userRacquetSelect->racquet->beam_width;
     $this->DateBuy->setTimeStamp(strtotime($this->userRacquetSelect->date_buy));
     $this->Note->Text = $this->userRacquetSelect->note;
     $this->setViewState('userRacquetSelect', $this->userRacquetSelect);
 }
Exemple #5
0
 public function createEditZone($job, $clone)
 {
     $this->editable->Visible = true;
     if ($clone) {
         $this->DATA_JOB_TITLE->Text = Prado::localize('DataNewJob');
         $this->DateStringing->setTimeStamp(strtotime("now"));
     } else {
         $this->DATA_JOB_TITLE->Text = Prado::localize('EditNewJob') . " " . $this->formatJob($job->id);
         $this->DateStringing->setTimeStamp(strtotime($job->date_stringing));
     }
     $this->EDIT_RACQUET->Visible = true;
     $racquetUser = TblRacquetsUser::finder()->findBy_id($job->tbl_racquets_user_id);
     $racquet = TblRacquets::finder()->findBy_id($racquetUser->tbl_racquets_id);
     $brandRacquet = TblBrands::finder()->findBy_id($racquet->tbl_brands_id);
     $this->EDIT_RACQUET->Text = $brandRacquet->description . " " . $racquet->model . " " . $racquetUser->serial;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['model'] = 'asc';
     $striningMachineArray = array();
     $striningMachine = TblStringingMachines::finder()->findAll($criteria);
     foreach ($striningMachine as $row) {
         $brand = TblBrands::finder()->findBy_id($row->tbl_brands_id);
         $row->brand_name = $brand->description;
         $striningMachineArray[$row->id] = $row->brand_name . " " . $row->model;
     }
     $this->DDLStriningMachine->DataSource = $striningMachineArray;
     $this->DDLStriningMachine->dataBind();
     $this->DDLStriningMachine->SelectedValue = $job->tbl_stringing_machines_id;
     $i = 0;
     $brand_name = array();
     $model = array();
     $stringArray = array();
     $string = TblStrings::finder()->findAll();
     foreach ($string as $row) {
         $brand = TblBrands::finder()->findBy_id($row->tbl_brands_id);
         $row->brand_name = $brand->description;
         $brand_name[$i] = $row->brand_name;
         $model[$i] = $row->model;
         $i++;
         $gauge = TblGauges::finder()->findBy_id($row->tbl_gauges_id);
         $row->gauge_desc = $gauge->usa . " (" . $gauge->diameter . ")";
         $stringArray[$row->id] = $row->brand_name . " " . $row->model . " " . $row->gauge_desc;
     }
     asort($stringArray);
     $this->DDLStringMains->DataSource = $stringArray;
     $this->DDLStringMains->dataBind();
     $this->DDLStringMains->SelectedValue = $job->tbl_strings_id_main;
     $this->WeightMains->Text = $job->weight_main;
     $this->PrestretchMain->Text = $job->prestretch_main;
     $this->DDLStringCross->DataSource = $stringArray;
     $this->DDLStringCross->dataBind();
     $this->DDLStringCross->SelectedValue = $job->tbl_strings_id_cross;
     $this->WeightCross->Text = $job->wieght_cross;
     $this->PrestretchCross->Text = $job->prestretch_cross;
     if ($job->tbl_strings_id_main == $job->tbl_strings_id_cross && $job->weight_main == $job->wieght_cross) {
         $this->DDLStringCross->enabled = false;
         $this->WeightCross->enabled = false;
         $this->ActivateStringCross->Checked = false;
     } else {
         $this->DDLStringCross->enabled = true;
         $this->WeightCross->enabled = true;
         $this->ActivateStringCross->Checked = true;
     }
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['description'] = 'asc';
     $stringingJobTypeArray = array();
     $stringingJobType = TblStringingJobType::finder()->findAll($criteria);
     foreach ($stringingJobType as $row) {
         $stringingJobTypeArray[$row->id] = $row->description;
     }
     $this->DDLStringingType->DataSource = $stringingJobTypeArray;
     $this->DDLStringingType->dataBind();
     $this->DDLStringingType->SelectedValue = $job->tbl_stringing_type_id;
     $this->DynamicTension->Text = $job->dynamic_tension;
     $this->DDLStencyl->SelectedValue = $job->stencyl;
     $this->DDLGrommetsGuard->SelectedValue = $job->grommets_guard;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['model'] = 'asc';
     $gripsArray = array();
     $gripsArray[0] = Prado::localize('NoGrip');
     $grips = TblGrips::finder()->findAll($criteria);
     foreach ($grips as $row) {
         $brand = TblBrands::finder()->findBy_id($row->tbl_brands_id);
         $row->brand_name = $brand->description;
         $gripsArray[$row->id] = $row->brand_name . " " . $row->model;
     }
     $this->DDLGrips->SelectedValue = 0;
     $this->DDLGrips->DataSource = $gripsArray;
     $this->DDLGrips->dataBind();
     $this->DDLGrips->SelectedValue = $job->tbl_grip_id;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['model'] = 'asc';
     $overGripsArray = array();
     $overGripsArray[0] = Prado::localize('NoOvergrip');
     $overGrips = TblOvergrips::finder()->findAll($criteria);
     foreach ($overGrips as $row) {
         $brand = TblBrands::finder()->findBy_id($row->tbl_brands_id);
         $row->brand_name = $brand->description;
         $overGripsArray[$row->id] = $row->brand_name . " " . $row->model;
     }
     $this->DDLOvergrips->SelectedValue = 0;
     $this->DDLOvergrips->DataSource = $overGripsArray;
     $this->DDLOvergrips->dataBind();
     $this->DDLOvergrips->SelectedValue = $job->tbl_overgrip_id;
     $this->Note->Text = $job->note;
     $this->TotalPrice->Text = $job->total_price;
     if ($clone) {
         $this->Broken->Checked = false;
         $this->Cut->Checked = false;
         $this->DurationString->Text = "0";
         $this->NoteCustomer->Text = "";
     } else {
         $this->Broken->Checked = $job->broken;
         $this->Cut->Checked = $job->cut;
         $this->DurationString->Text = $job->duration_string;
         $this->NoteCustomer->Text = $job->note_customer;
     }
 }