예제 #1
0
 public function edit($list_id)
 {
     $ObjQuery = new queryModel();
     $ObjContacts = new contactsModel();
     $loggin_user = $ObjContacts->get_loggin_user_info();
     $data = $ObjQuery->array_to_data(array(), $loggin_user);
     if ($loggin_user == FALSE) {
         return Redirect::to('login');
     }
     if ($list_id) {
         $ObjQuery = new queryModel();
         $ObjList = new listingsModel();
         $ObjListClassify = new listingsClassificationsModel();
         $ObjListImage = new listingsImagesModel();
         $ObjClassify = new classificationsModel();
         $ObjTrades = new tradesModel();
         $ObjPreQualify = new preQualifyModel();
         $details_list = $ObjList->get_record_join(array('`j`.`' . $ObjList->tblid . '`=' => $list_id));
         $data = $ObjQuery->array_to_data($data, $details_list);
         $data['listclassify_rows'] = $ObjClassify->get_records();
         $records_listclassify = $ObjListClassify->get_records_join(array('`j`.`' . $ObjList->tblid . '`=' => $list_id));
         $data['records_listclassify'] = $ObjQuery->array_to_data_select_key('classify_id', $records_listclassify);
         $data['classifications_array'] = $details_list->list_classifications ? unserialize($details_list->list_classifications) : array();
         //$data['records_listvend'] = $ObjListVend->get_records( array('`'.$ObjList->tblid.'`='=>$list_id) );
         $data['show_uploaded_image_slider'] = $ObjListImage->show_uploaded_image_slider($list_id);
         $data['trades_rows'] = $ObjTrades->get_records();
         $data['trades_array'] = $details_list->list_trades ? unserialize($details_list->list_trades) : array();
         $prequalify = $ObjPreQualify->get_record(array('`list_id`=' => $list_id), array('ASC' => '`lpq_id`'));
         $data['lpq_id'] = $prequalify->lpq_id;
         return View::make('listings_edit', $data);
     } else {
         return Redirect::to('listings');
     }
 }