<?php 
class Pos_response_model extends CI_Model {
	public function _consruct(){
		parent::_construct();
 	}

    public function insertCustomQuote($postData =array()){
        $squence = str_pad(rand(1111,9999),4,0,STR_PAD_LEFT);
        $insertArray = array(
                            'pos_resp_code'=>'PSRESP'.date('ymd').$squence,
                            'req_id'=>$postData['reqId'],
                            'pos_id'=>$this->session->userdata('pos_id'),
                            'cost'=>$postData['amount'],
                            'total'=>$postData['amount'],
                            'pos_parts'=>$postData['partId'],
                            'status'=>1
                        );
        if($this->db->insert('pos_response',$insertArray)){
            if($this->db->update('pos_request',array('status'=>5),array('id'=>$postData['reqId']))){
                return 1;
            }
        }
    }

}
?>