fetch_data(); } protected function fetch_data(){ // les data... $this->transactype_list=array(); $rqt = "select * from transactype order by transactype_name"; $res = mysql_query($rqt); $i=0; if(mysql_num_rows($res)){ while($row = mysql_fetch_object($res)){ $this->transactype_list[$i]['id'] = $row->transactype_id; $this->transactype_list[$i]['name'] = $row->transactype_name; $this->transactype_list[$i]['unit_price'] = $row->transactype_unit_price; $this->transactype_list[$i]['quick_allowed'] = $row->transactype_quick_allowed; $i++; } } } public function get_form(){ global $msg; global $transactype_list_form, $charset; foreach ($this->transactype_list as $index =>$transactype){ if ($parity++ % 2) $pair_impair = "even"; else $pair_impair = "odd"; if($transactype['quick_allowed']) $quick_allowed="x"; else $quick_allowed=""; $form.= " ".htmlentities($transactype['name'],ENT_QUOTES, $charset)." ".htmlentities($transactype['unit_price'],ENT_QUOTES, $charset)." ".htmlentities($quick_allowed,ENT_QUOTES, $charset)." "; } $transactype_list_form = str_replace('!!transactype_list!!', $form, $transactype_list_form); return $transactype_list_form; } public function proceed(){ global $action; switch($action) { case 'add': break; default: break; } } public function get_data(){ return $this->transactype_list; } public function get_count(){ return count($this->transactype_list); } }