Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] can't save transaction without details
#1

[eluser]maria clara[/eluser]
hi to all,

i'm creating a function for saving the details. but when i click the save button..it shows me "can't save transaction without details"..

here's my code for the function detailpost() in my controller:

Code:
//-----------------------------------------------------------------------

    function detailpost()
    {

        $crudColumns =  array(
            'id'=>'company_access_id'
            ,'company_id'=>'company_id'
            ,'company_code'=>'company_code'
            ,'company_name'=>'company_name'
        );
        $crudTableName = 'erp_sec_companyaccess';
        $postConfig['id'] = 'company_access_id';

        $postConfig['search'] = '_search';             /* search */
        $postConfig['searchField'] = 'searchField'; /* searchField */
        $postConfig['searchOper'] = 'searchOper';     /* searchOper */
        $postConfig['searchStr'] = 'searchString';     /* searchString */
        $postConfig['action'] = 'oper';             /* action variable */
        $postConfig['sortColumn'] = 'sidx';         /* sort column */
        $postConfig['sortOrder'] = 'sord';             /* sort order */
        $postConfig['page'] = 'page';                 /* current requested page */
        $postConfig['limit'] = 'rows';                /* restrict number of rows to return */
        $crudConfig['row'] = 'cell';                 /* row data identifier */
        $crudConfig['read'] = 'oper';                 /* action READ keyword *//* set to be the same as action keyword for default */
        $crudConfig['create'] = 'add';                /* action CREATE keyword */
        $crudConfig['update'] = 'edit';                /* action UPDATE keyword */
        $crudConfig['delete'] = 'del';                /* action DELETE keyword */
        $crudConfig['totalPages'] = 'total';        /* total pages */
        $crudConfig['totalRecords'] = 'records';    /* total records */
        $crudConfig['responseSuccess'] = 'success';    /* total records */
        $crudConfig['responseFailure'] = 'fail';    /* total records */
        /* end of jqgrid specific settings */
        //$o=null;

        function fnSearchCondition($searchOperation, $searchString){
            switch($searchOperation){
                case 'eq': $searchCondition = '= "'.$searchString.'"'; break;
                case 'ne': $searchCondition = '!= "'.$searchString.'"'; break;
                case 'bw': $searchCondition = 'LIKE "'.$searchString.'%"'; break;
                case 'ew': $searchCondition = 'LIKE "%'.$searchString.'"'; break;
                case 'cn': $searchCondition = 'LIKE "%'.$searchString.'%"'; break;
                case 'lt': $searchCondition = '< "'.$searchString.'"'; break;
                case 'gt': $searchCondition = '> "'.$searchString.'"'; break;
                case 'le': $searchCondition = '<= "'.$searchString.'"'; break;
                case 'ge': $searchCondition = '>= "'.$searchString.'"'; break;
                
            }
            return $searchCondition;
        }
        function fnCleanInputVar($string){
            return $string;
        }

        foreach ($postConfig as $key => $value){
            if(isset($_REQUEST[$value])){
                $postConfig[$key] = fnCleanInputVar($_REQUEST[$value]);
            }
        }
        foreach ($crudColumns as $key => $value){
            if(isset($_REQUEST[$key])){
                $crudColumnValues[$key] = '"'.fnCleanInputVar($_REQUEST[$key]).'"';
            }
        }

        switch($postConfig['action']){
            case $crudConfig['create']:
                $c = "";
                $dt['company_code'] = $this->input->post('company_code');
                $sec_exist = $this->Sec_users_db->getDetails($dt);
                
                if ($sec_exist)
                {
                    $c .= 'Company ID already exists.';
                    $data['action'] = 'exist';
                }
                else
                {
                $fields = array(
                        'company_code'
                        ,'company_name'
                        );
                
                foreach ($fields as $field)
                {if (isset($_POST[$field])) $dt[$field] = $this->input->post($field);}

                $item = $this->input->post("item");        
                $data['item'] = $this->Sec_users_db->save($dt,$item);
                }
                break;
            case $crudConfig['update']:
                $sql = 'update '.$crudTableName.' set ';
                foreach($crudColumns as $key => $value){ $updateArray[$key] = $value.'='.$crudColumnValues[$key]; };
                $sql .= implode(',',$updateArray);
                $sql .= ' where company_id = '.$crudColumnValues['id'];
                mysql_query( $sql );
                break;
            case $crudConfig['delete']:
                $this->db->where('company_id', $this->input->post('id'));
                $this->db->delete($crudTableName);
                    
                break;
            }
        
        if (isset($data)) echo json_encode($data);
    }
//-----------------------------------------------------------------------

i attached also the image before and after i submit the details.

glad to see replies..
thanks in advance,

kahtrina


Messages In This Thread
[SOLVED] can't save transaction without details - by El Forum - 02-02-2010, 08:18 PM
[SOLVED] can't save transaction without details - by El Forum - 02-02-2010, 10:59 PM
[SOLVED] can't save transaction without details - by El Forum - 02-02-2010, 11:15 PM
[SOLVED] can't save transaction without details - by El Forum - 02-02-2010, 11:20 PM
[SOLVED] can't save transaction without details - by El Forum - 02-02-2010, 11:28 PM
[SOLVED] can't save transaction without details - by El Forum - 02-03-2010, 07:44 PM
[SOLVED] can't save transaction without details - by El Forum - 02-03-2010, 07:52 PM
[SOLVED] can't save transaction without details - by El Forum - 02-03-2010, 07:59 PM
[SOLVED] can't save transaction without details - by El Forum - 02-03-2010, 08:12 PM
[SOLVED] can't save transaction without details - by El Forum - 02-03-2010, 08:21 PM
[SOLVED] can't save transaction without details - by El Forum - 02-03-2010, 10:00 PM
[SOLVED] can't save transaction without details - by El Forum - 02-03-2010, 10:16 PM
[SOLVED] can't save transaction without details - by El Forum - 02-03-2010, 11:11 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 12:17 AM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 12:20 AM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 07:45 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 10:13 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:28 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:34 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:35 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:36 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:43 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:45 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:45 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:48 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:50 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:53 PM
[SOLVED] can't save transaction without details - by El Forum - 02-04-2010, 11:58 PM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:01 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:10 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:13 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:18 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:29 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:29 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:33 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:45 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:52 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 12:58 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 01:03 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 01:05 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 01:05 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 01:08 AM
[SOLVED] can't save transaction without details - by El Forum - 02-05-2010, 06:42 PM
[SOLVED] can't save transaction without details - by El Forum - 02-07-2010, 06:57 PM
[SOLVED] can't save transaction without details - by El Forum - 02-07-2010, 07:51 PM
[SOLVED] can't save transaction without details - by El Forum - 02-07-2010, 09:05 PM
[SOLVED] can't save transaction without details - by El Forum - 02-07-2010, 09:40 PM
[SOLVED] can't save transaction without details - by El Forum - 02-07-2010, 09:52 PM
[SOLVED] can't save transaction without details - by El Forum - 02-07-2010, 11:23 PM
[SOLVED] can't save transaction without details - by El Forum - 02-07-2010, 11:30 PM
[SOLVED] can't save transaction without details - by El Forum - 02-07-2010, 11:37 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 12:02 AM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 12:08 AM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 12:13 AM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 12:20 AM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 12:27 AM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 12:33 AM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 12:45 AM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 12:55 AM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 07:37 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 07:55 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 08:01 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 08:06 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 08:10 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 08:11 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 08:16 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 08:23 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 08:32 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 09:11 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 09:38 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 09:41 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 09:45 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 09:54 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 10:07 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 10:17 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 11:03 PM
[SOLVED] can't save transaction without details - by El Forum - 02-08-2010, 11:54 PM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 12:08 AM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 12:29 AM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 12:36 AM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 12:41 AM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 07:33 PM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 08:36 PM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 08:40 PM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 08:51 PM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 08:56 PM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 10:07 PM
[SOLVED] can't save transaction without details - by El Forum - 02-09-2010, 11:27 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:11 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:23 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:32 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:35 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:38 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:47 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:52 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:55 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 09:59 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 10:01 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 10:04 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 10:07 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 10:45 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 10:59 PM
[SOLVED] can't save transaction without details - by El Forum - 02-14-2010, 11:01 PM
[SOLVED] can't save transaction without details - by El Forum - 02-15-2010, 01:56 AM
[SOLVED] can't save transaction without details - by El Forum - 02-15-2010, 07:40 PM
[SOLVED] can't save transaction without details - by El Forum - 02-15-2010, 09:08 PM
[SOLVED] can't save transaction without details - by El Forum - 02-15-2010, 09:13 PM
[SOLVED] can't save transaction without details - by El Forum - 02-15-2010, 11:00 PM
[SOLVED] can't save transaction without details - by El Forum - 03-03-2010, 01:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB