FORM last
This commit is contained in:
parent
f7eda095c9
commit
014b349733
@ -1492,52 +1492,63 @@ class PD_Controller extends REST_Controller {
|
|||||||
$result_array = $this->PD_Model->getPDFormDetails($pd_id,$pd_form_id);
|
$result_array = $this->PD_Model->getPDFormDetails($pd_id,$pd_form_id);
|
||||||
$final_data = array();
|
$final_data = array();
|
||||||
|
|
||||||
// if($pd_form_id == 1)
|
|
||||||
// {
|
|
||||||
//print_r($result_array);
|
//print_r($result_array);
|
||||||
|
|
||||||
|
|
||||||
$group = array();
|
$overall = array();
|
||||||
$pre_iter = 1;
|
$pre_group = "";
|
||||||
|
$pre_iter = "";
|
||||||
$t1 = array();
|
$t1 = array();
|
||||||
$t2 = array();
|
$t2 = array();
|
||||||
|
$group = array();
|
||||||
foreach($result_array as $rkey => $result)
|
foreach($result_array as $rkey => $result)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($result['iteration'] != "" || $result['iteration'] != null)
|
if($result['iteration'] != "" || $result['iteration'] != null)
|
||||||
{
|
{
|
||||||
if($result['iteration'] == $pre_iter)
|
|
||||||
|
if($result['iter_column_name'] != $pre_group && $result['iter_column_name'] != $pre_iter)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$t1 = array();
|
||||||
$t1 = array_merge($t1,array($result['column_name']=>$result['column_value']));
|
$t2 = array();
|
||||||
$group[$result['iter_column_name']][$result['iteration']] = $t1;
|
$group = array();
|
||||||
$pre_iter = $result['iteration'];
|
// echo "New-".$result['iter_column_name'];
|
||||||
|
// print_r(array($result['column_name']=>$result['column_value']));
|
||||||
|
$t1 = array_merge($t1,array($result['column_name']=>$result['column_value']));
|
||||||
|
$group[$result['iter_column_name']][$result['iteration']] = $t1;
|
||||||
|
$pre_group = $result['iter_column_name'];
|
||||||
|
$pre_iter = $result['iteration'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$t2 = array_merge($t2,array($result['column_name']=>$result['column_value']));
|
// echo "old-".$result['iter_column_name'];
|
||||||
$group[$result['iter_column_name']][$result['iteration']] = $t2;
|
// print_r(array($result['column_name']=>$result['column_value']));
|
||||||
$pre_iter = $result['iteration'];
|
$t1 = array_merge($t1,array($result['column_name']=>$result['column_value']));
|
||||||
}
|
$group[$result['iter_column_name']][$result['iteration']] = $t1;
|
||||||
|
$pre_group = $result['iter_column_name'];
|
||||||
|
$pre_iter = $result['iteration'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$t = array($result['column_name']=>$result['column_value']);
|
$t = array($result['column_name']=>$result['column_value']);
|
||||||
//$final_data[] = $t;
|
|
||||||
$final_data = array_merge($final_data,$t);
|
$final_data = array_merge($final_data,$t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$final_data = array_merge($final_data,$group);
|
$final_data = array_merge($final_data,$group);
|
||||||
}
|
}
|
||||||
|
|
||||||
//$final_data[] = $group;
|
//$final_data = array_merge($final_data,$group);
|
||||||
|
|
||||||
|
|
||||||
$result_array = $final_data;
|
$result_array = $final_data;
|
||||||
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
if($result_array)
|
if($result_array)
|
||||||
{
|
{
|
||||||
@ -1615,6 +1626,11 @@ class PD_Controller extends REST_Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data['dataStatus'] = true;
|
||||||
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
|
//$data['records'] = $result_array;
|
||||||
|
$this->response($data,REST_Controller::HTTP_OK);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -735,15 +735,17 @@ class PD_Model extends SPARQ_Model {
|
|||||||
|
|
||||||
public function getPDFormDetails($pd_id,$pd_form_id)
|
public function getPDFormDetails($pd_id,$pd_form_id)
|
||||||
{
|
{
|
||||||
|
//echo $pd_id.'-'.$pd_form_id;
|
||||||
$this->db->SELECT('PDFORMDETAILS.iter_column_name,PDFORMDETAILS.iteration, PDFORMDETAILS.column_name, PDFORMDETAILS.column_id, PDFORMDETAILS.column_value, PDFORMDETAILS.createdon, PDFORMDETAILS.fk_createdby,USERPROFILE.first_name,USERPROFILE.last_name');
|
$this->db->SELECT('PDFORMDETAILS.iter_column_name,PDFORMDETAILS.iteration, PDFORMDETAILS.column_name, PDFORMDETAILS.column_id, PDFORMDETAILS.column_value, PDFORMDETAILS.createdon, PDFORMDETAILS.fk_createdby,USERPROFILE.first_name,USERPROFILE.last_name');
|
||||||
$this->db->FROM(PDFORMDETAILS.' as PDFORMDETAILS');
|
$this->db->FROM(PDFORMDETAILS.' as PDFORMDETAILS');
|
||||||
$this->db->JOIN(USERPROFILE.' as USERPROFILE','PDFORMDETAILS.fk_createdby = USERPROFILE.userid');
|
$this->db->JOIN(USERPROFILE.' as USERPROFILE','PDFORMDETAILS.fk_createdby = USERPROFILE.userid','LEFT');
|
||||||
$this->db->WHERE('PDFORMDETAILS.fk_pd_id',$pd_id);
|
$this->db->WHERE('PDFORMDETAILS.fk_pd_id',$pd_id);
|
||||||
$this->db->WHERE('PDFORMDETAILS.fk_form_id',$pd_form_id);
|
$this->db->WHERE('PDFORMDETAILS.fk_form_id',$pd_form_id);
|
||||||
$this->db->WHERE('PDFORMDETAILS.isactive',1);
|
$this->db->WHERE('PDFORMDETAILS.isactive',1);
|
||||||
//$this->db->ORDER_BY('PDFORMDETAILS.iteration');
|
//$this->db->ORDER_BY('PDFORMDETAILS.iteration');
|
||||||
$form_details = $this->db->GET()->result_array();
|
$form_details = $this->db->GET()->result_array();
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
//print_r($form_details);die();
|
||||||
return $form_details;
|
return $form_details;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user