Welcome Guest, Not a member yet? Register   Sign In
RE:[help!!!] A PHP Error was encountered
#14

[eluser]maria clara[/eluser]
im calling the save_detail() from the controller with this code:

Code:
case $crudConfig['create']:
                $c = "";
                $data['action'] = $this->input->post('action');
                $item = $this->input->post("item");
                $dt['tran_no'] = $this->input->post('tran_no');
                $ccm_exist = $this->CCM_receipt_db->getDetails($dt);
                
                if ($ccm_exist && $item!=$ccm_exist['receipt_id'])
                {
                    $c .= 'Receipt No. already exists.';
                    $data['action'] = 'exist';
                }
                else
                {
                    $fields = array(
                            "tran_no"
                            ,"client_id"
                            ,"remarks"    
                            ,"inv_total"
                            ,"pay_total"
                            ,"others_total"
                            ,"pdc"
                            ,"cash"
                            ,"ewt"
                            ,"evat"
                            );
                    
                foreach ($fields as $field)
                {
                    if (isset($_POST[$field])) $dt[$field] = $this->input->post($field);
                }
                
                $item = $this->input->post("item");        
                $company = $this->session->userdata('company');
                $dt['company_id'] = $company['company_id'];
                //$dt['sales_date'] = convertDate($this->input->post("sales_date"));
                
                $rows = $this->input->post("row0");    
    
                $data['item'] = $this->CCM_receipt_db->save($dt,$item,$rows,'','','');
                
                //if Sales Invoice type is equal to invoice, auto generate DR
                
                
                
                if($dt['company_id']=='34')
                {    
    
                    $fields = array(
                            "client_id"
                            ,"remarks"
                            ,"gross"
                            );
                    
                    foreach ($fields as $field)
                    {
                        if (isset($_POST[$field])) $dtDR[$field] = $this->input->post($field);
                    }
                    $company = $this->session->userdata('company');
                    $dtDR['company_id'] = $company['company_id'];
                    $dtDR['dr_no'] = "DR-".$dt['tran_no'];
                    $dtDR['dr_date'] = $dt['date'];
                    $dtDR['type_id'] = '108'; //AUTO-DR
                    $dtDR['doc_type_id'] = '89'; //DOC 1
                    
                    $this->CCM_receipt_db->save_DR($dtDR,$rows);
            }

tables are joined so there is a save function when im adding data.


Messages In This Thread
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 09:49 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 09:55 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 10:08 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 10:13 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 10:24 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 10:28 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 10:37 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 10:59 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 11:03 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 11:06 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 11:08 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 11:11 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 11:21 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-11-2010, 11:26 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 12:22 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 12:32 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 12:37 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 12:45 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 12:50 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 01:07 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 01:14 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 01:25 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 01:37 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 08:47 AM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 07:26 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 07:31 PM
RE:[help!!!] A PHP Error was encountered - by El Forum - 01-12-2010, 07:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB