[eluser]cestaz18[/eluser]
Hey! can i join in discussion ...we are working in the same project..
i also done ur print_r($_POST);
and i got this response in my firebug console...
Quote:Array
(
[_search] => false
[nd] => 1264558821403
[rows] => 10
[page] => 1
[sidx] => company_code
[sord] => asc
)
<br />
<b>Fatal error</b>: ob_start() [<a href='ref.outcontrol'>ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in <b>C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\comunion\system\libraries\Exceptions.php</b> on line <b>162</b><br />
i think the $item is working but it doesn't display in our detail list table..
hope u find out the problem..
tnx in advance..^^
Code: function getDetailList() //Show the list of registered user with company details
{
$item = $this->input->post('item');
[b]print_r($_POST);[/b]
$page = $this->input->post('page');
$limit = $this->input->post('rows'); // get how many rows we want to have into the grid
$sidx = $this->input->post('sidx'); // get index row - i.e. user click to sort
$sord = $this->input->post('sord'); // get the direction
if (!$sidx) $sidx = 'sec_companyaccess.user_id'; // if we not pass at first time index use the first column for the index
if (!$sord) $sord = 'desc';
//$page = 1;
if (!$page) $page = 1;
if (!$limit) $limit = 25;
$start = (($page-1) * $limit);
$this->db->start_cache();
$this->db->join('maint_company','sec_companyaccess.company_id=maint_company.company_id','left');
$this->db->join('sec_users ','sec_companyaccess.user_id=sec_users.user_id','left');
$item = $this->input->post('sec_users.user.id');
$this->db->from('sec_companyaccess');
#$this->db->where("sec_companyaccess.user_id", $item);
$this->db->where("sec_companyaccess.user_id", $item);
$count = $this->db->count_all_results();
if( $count > 0 && $limit > 0) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit * $page - $limit; // do not put $limit*($page - 1)
if($start <0) $start = 0;
$this->db->select("sec_companyaccess.company_access_id as pkey,sec_companyaccess.company_access_id, maint_company.company_code, maint_company.company_name,sec_companyaccess.company_id ");
$this->db->order_by($sidx,$sord);
//$this->db->limit($rp, $start);
$query = $this->db->get("sec_companyaccess");
$this->db->flush_cache();
$data['db'] = $query;
$data['page'] = $page;
$data['totalpages'] = $total_pages;
$data['totalrecords']=$count;
return $data;
}
this is the complete error i got in print_r($POST)...
Quote:POST http://localhost/comunion/sec_users/detaillistview
POST http://localhost/comunion/sec_users/detaillistview
200 OK
2.18s
jquery....min.js (line 19)
POST http://localhost/comunion/sec_users/post
POST http://localhost/comunion/sec_users/post
200 OK
2.19s
jquery....min.js (line 19)
ParamsHeadersPostPutResponseCacheHTMLJSON
{"action":"view","db":{"item":"2","username":"CGAMBOA","last_name":"Gamboa","first_name":"Cris","middle_initial":"P","role_id":"3","role_code":"DIVMANAGER","role_desc":"Division Manager","dept_id":"4","dept_code":"DEV&RES;","dept_desc":"Development and Research"},"count":{"detFlex1":"1"},"response":""}
syntax error
[Break on this error] [_search] => false\n
jquery....min.js (line 12)
POST http://localhost/comunion/sec_users/detaillistview
POST http://localhost/comunion/sec_users/detaillistview
200 OK
200ms
jquery....min.js (line 19)
ParamsHeadersPostPutResponseCacheHTML
Array
(
[_search] => false
[nd] => 1264559314963
[rows] => 10
[page] => 1
[sidx] => company_code
[sord] => asc
)
<br />
<b>Fatal error</b>: ob_start() [<a href='ref.outcontrol'>ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in <b>C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\comunion\system\libraries\Exceptions.php</b> on line <b>162</b><br />
syntax error
[Break on this error] [_search] => false\n
jquery....min.js (line 12
[eluser]Ben Edmunds[/eluser]
Welcome
It's normal for that to give an error, doesn't matter cause all we wanted to do was see whats being posted.
Your post array contains:
Code: [_search] => false
[nd] => 1264558821403
[rows] => 10
[page] => 1
[sidx] => company_code
[sord] => asc
so item is not being posted and is why you are not getting anything from $this->input->post('item').
Hope that helps.
[eluser]maria clara[/eluser]
yeah you're right $item is not being posted. does a filtering affects it why it is not posting?? because our filtering is for a flexigrid but we're using jqgrid now...
[eluser]cestaz18[/eluser]
ah ukie i found it...
but in our previous flexigrid table..this $item = $this->input->post('item'); is working..but when we change our flexigrid to jqgrid table..it is not working ...
hmmm..do u know why it is that happening??
[eluser]maria clara[/eluser]
when i changed this:
Code: $this->db->where("sec_companyaccess.user_id", $item);
to
Code: $this->db->where("sec_companyaccess.user_id", 1);
the DetailListView is showing the data when i select a row from the ListView. but when i changed it back still this
Code: $item = $this->input->post('item');
is not posting its value for the $item.
[eluser]maria clara[/eluser]
here's my controller:
Code: function post()
{
$c = "";
$data['action'] = $this->input->post('action');
//$item = $this->input->post('item');
if ($data['action']=='view')
{
$dt['user_id'] = $this->input->post("item");
$details = $this->User->getDetails($dt);
if ($details)
{
$data['db'] = array('item'=>$dt['user_id'],
'username'=>$details['username'],
'last_name'=>$details['last_name'],
'first_name'=>$details['first_name'],
'middle_initial'=>$details['middle_initial'],
'role_id'=>$details['role_id'],
'role_code'=>$details['role_code'],
'role_desc'=>$details['role_desc'],
'dept_id'=>$details['dept_id'],
'dept_code'=>$details['dept_code'],
'dept_desc'=>$details['dept_desc']
);
$data['count'] = $this->User->countDetailList($dt);
//$data['count'] = 0;
}
$data['response'] = $c;
$json['json'] = $data;
$this->load->vars($data);
$this->load->view('template/ajax',$json);
}
here's my model:
Code: function getDetailList() //Show the list of registered user with company details
{
$item = $this->input->post("item");
//print_r($_POST);
$page = $this->input->post('page');
$limit = $this->input->post('rows'); // get how many rows we want to have into the grid
$sidx = $this->input->post('sidx'); // get index row - i.e. user click to sort
$sord = $this->input->post('sord'); // get the direction
$query = $this->input->post('query');
$qtype = $this->input->post('qtype');
if (!$sidx) $sidx = 'sec_companyaccess.user_id'; // if we not pass at first time index use the first column for the index
if (!$sord) $sord = 'desc';
if (!$page) $page = 1;
if (!$limit) $limit = 25;
$start = (($page-1) * $limit);
$this->db->start_cache();
$this->db->join('maint_company','sec_companyaccess.company_id=maint_company.company_id','left');
$this->db->join('sec_users ','sec_companyaccess.user_id=sec_users.user_id','left');
//$item = $this->input->post('sec_users.user.id');
$this->db->from('sec_companyaccess');
$this->db->where("sec_companyaccess.user_id", $item);
//$this->db->where("sec_companyaccess.user_id", 1);
$count = $this->db->count_all_results();
if( $count > 0 && $limit > 0) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit * $page - $limit; // do not put $limit*($page - 1)
if($start <0) $start = 0;
$this->db->select("sec_companyaccess.company_access_id as pkey,sec_companyaccess.company_access_id, maint_company.company_code, maint_company.company_name,sec_companyaccess.company_id ");
$this->db->order_by($sidx,$sord);
$this->db->limit($limit, $start);
$query = $this->db->get("sec_companyaccess");
$this->db->flush_cache();
$data['db'] = $query;
$data['page'] = $page;
$data['totalpages'] = $total_pages;
$data['totalrecords']=$count;
return $data;
}
hope anyone can help me..;(
[eluser]maria clara[/eluser]
hi,,
i have a problem with these scripts..
Code: $item = $this->input->post("item");
$this->db->join('maint_company','sec_companyaccess.company_id=maint_company.company_id','left');
$this->db->join('sec_users ','sec_companyaccess.user_id=sec_users.user_id','left');
#$item = $this->input->post('sec_users.user.id');
$this->db->from('sec_companyaccess');
$this->db->where("sec_companyaccess.user_id", $item);
$count = $this->db->count_all_results();
the $item is not populating any value for the rowid so that i have not getting the details from my master grid..
but when i change
Code: $this->db->where("sec_companyaccess.user_id", $item);
to
Code: $this->db->where("sec_companyaccess.user_id", 1);
the $item is now populating...
can anyone help me???
glad to see replies..
thanks in advance..
regards,
kahtrina
|