public function selectAddRacquet($sender, $param)
 {
     $this->racquetSelect = TblRacquets::finder()->findBy_id($param->Item->IDColumnRacquet->Text);
     $this->setViewState('racquetSelect', $this->racquetSelect);
     //var_dump($this->getViewState('userSelect',null));
     //var_dump($this->getViewState('racquetSelect',null));
     $this->editable->Visible = true;
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['description'] = 'asc';
     $brands = TblBrands::finder()->findAll($criteria);
     $this->DDLBrands->DataSource = $brands;
     $this->DDLBrands->dataBind();
     $this->DDLBrands->SelectedValue = $this->racquetSelect->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->racquetSelect->tbl_racquets_pattern_id;
     $this->Model->Text = $this->racquetSelect->model;
     $this->HeadSize->Text = $this->racquetSelect->head_size;
     $this->Length->Text = $this->racquetSelect->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->Serial->Text = "";
     $this->WeightUnstrung->Text = $this->racquetSelect->weight_unstrung;
     $this->WeightStrung->Text = $this->racquetSelect->weight_strung;
     $this->Balance->Text = $this->racquetSelect->balance;
     $this->Swingweight->Text = $this->racquetSelect->swingweight;
     $this->Stiffness->Text = $this->racquetSelect->stiffness;
     $this->BeamWidth->Text = $this->racquetSelect->beam_width;
     $this->DateBuy->setTimeStamp(strtotime("now"));
     $this->Note->Text = $this->racquetSelect->note;
     $this->setViewState('userRacquetSelect', null);
 }
Example #2
0
 protected function CreateArrayUserRacquets($brand = '', $model = '', $serial = '')
 {
     $param = array();
     $param['id'] = $this->getViewState('customer', null)->id;
     $param['serial'] = "%" . $serial . "%";
     $param['brand'] = "%" . $brand . "%";
     $param['model'] = "%" . $model . "%";
     $sqlmap = Prado::getApplication()->Modules['sqlmap']->Client;
     $this->_data_user_racquets = $sqlmap->queryForList("SelectTblRacquetUser", $param);
     foreach ($this->_data_user_racquets as $row) {
         $row->racquet = TblRacquets::finder()->findBy_id($row->tbl_racquets_id);
         $row->grip = TblGripSize::finder()->findBy_id($row->tbl_grip_size_id);
     }
     $brand_name = array();
     $model = array();
     $i = 0;
     foreach ($this->_data_user_racquets as $row) {
         $brand = TblBrands::finder()->findBy_id($row->racquet->tbl_brands_id);
         $brand_name[$i] = $brand->description;
         $row->racquet->brand_name = $brand->description;
         $model[$i] = $row->racquet->model;
         $i++;
     }
     array_multisort($brand_name, SORT_ASC, SORT_STRING, $model, SORT_ASC, SORT_STRING, $this->_data_user_racquets);
 }