public function indexAction() { try { $db = new Group_Model_DbTable_DbChangeCollteral(); if ($this->getRequest()->isPost()) { $search = $this->getRequest()->getPost(); } else { $search = array('adv_search' => '', 'status_search' => -1); } //print_r($search);exit(); $rs_rows = $db->getAllChangeCollteral($search); //call frome model $glClass = new Application_Model_GlobalClass(); $rs_rows = $glClass->getImgActive($rs_rows, BASE_URL, true); $list = new Application_Form_Frmtable(); $collumns = array("BRANCH", "OWNER_CODE", "OWNER_NAME", "FROM", "TO", "COLLTERAL_TYPE", "NUMBER_CODE", "OWNER", "DATE", "NOTE", "STATUS", "USER_ID"); $link = array('module' => 'callecterall', 'controller' => 'chengcallecterall', 'action' => 'edit'); // print_r($rs_rows);exit(); $this->view->list = $list->getCheckList(0, $collumns, $rs_rows, array('branch_id' => $link, 'owner_code_id' => $link, 'owner_id' => $link)); } catch (Exception $e) { Application_Form_FrmMessage::message("Application Error"); echo $e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } $fm = new Group_Form_Frmchangecollteral(); $frm = $fm->FrmChangeCollteral(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_changeCollteral = $frm; }
public function indexAction(){ try{ $db = new Group_Model_DbTable_DbChangeCollteral(); if($this->getRequest()->isPost()){ $search=$this->getRequest()->getPost(); } else{ $search = array( 'adv_search' => '', 'status_search' => -1, 'start_date'=>date('Y-m-d'), 'end_date'=>date('Y-m-d')); } $rs_rows= $db->getAllChangeCollteral($search);//call frome model $arr=array(); if(!empty($rs_rows))foreach ($rs_rows as $index =>$rs ){ $arr[]=array( 'id'=>$rs['id'], 'branch_id'=>$rs['branch_id'], 'client_name'=>$rs['client_name'], 'from'=>'from', 'to'=>$rs['to'], 'date'=>$rs['date'], 'note'=>$rs['id'], 'status'=>$rs['status'], 'user_id'=>$rs['user_id'], ); $rows = $db->getColleteralById($rs['id']); $from_array=''; $to_array=''; foreach($rows as $key =>$row){ $from_array.=$row['from_collateral']. ' ,'; $to_array.=$row['collateral']. ' ,'; } $arr[$index]['from']=$from_array; $arr[$index]['to']=$to_array; } $glClass = new Application_Model_GlobalClass(); $rs_rows = $glClass->getImgActive($arr, BASE_URL, true); $list = new Application_Form_Frmtable(); $collumns = array("BRANCH_NAME","CUSTOMER_NAME","FROM","TO","DATE","NOTE","STATUS","BY"); $link=array( 'module'=>'group','controller'=>'changecollteral','action'=>'edit', ); $this->view->list=$list->getCheckList(0, $collumns,$rs_rows,array('branch_id'=>$link,'owner_code_id'=>$link,'owner_id'=>$link)); }catch (Exception $e){ Application_Form_FrmMessage::message("Application Error"); echo $e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } $fm = new Group_Form_Frmchangecollteral(); $frm = $fm->FrmChangeCollteral(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_changeCollteral = $frm; }