MEQ ROLE ADDED
This commit is contained in:
parent
90efee3cc7
commit
2d06c4c735
@ -288,6 +288,7 @@ $route['saveSalesPD'] = 'Sales_PD_Controller/saveSalesPD';
|
|||||||
$route['(downloadSalesPDReport/:any)'] = 'Sales_PD_Controller/getSalesPDReport';
|
$route['(downloadSalesPDReport/:any)'] = 'Sales_PD_Controller/getSalesPDReport';
|
||||||
$route['listSalesPD/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
$route['listSalesPD/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||||
$route['listSalesPD/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
$route['listSalesPD/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||||
|
$route['listSalesPD/(:any)/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||||
$route['saveSalesPDImage'] = 'Sales_PD_Controller/saveSalesPDImage';
|
$route['saveSalesPDImage'] = 'Sales_PD_Controller/saveSalesPDImage';
|
||||||
$route['saveSalesPDsection'] = 'Sales_PD_Controller/saveSalesPDsection';
|
$route['saveSalesPDsection'] = 'Sales_PD_Controller/saveSalesPDsection';
|
||||||
$route['getSalesPDSectionData'] = 'Sales_PD_Controller/getSalesPDSectionData';
|
$route['getSalesPDSectionData'] = 'Sales_PD_Controller/getSalesPDSectionData';
|
||||||
|
|||||||
@ -257,6 +257,7 @@ class Sales_PD_Controller extends REST_Controller {
|
|||||||
{
|
{
|
||||||
$lender_id = $this->uri->segment(2);
|
$lender_id = $this->uri->segment(2);
|
||||||
$user_id = $this->uri->segment(3);
|
$user_id = $this->uri->segment(3);
|
||||||
|
$role = $this->uri->segment(4);
|
||||||
$columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.createdon','SALES_PD_DATA.status','SALES_PD_DATA.sales_pd_type','SALES_PD_DATA.rand_string','SALES_PD_DATA.isactive'
|
$columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.createdon','SALES_PD_DATA.status','SALES_PD_DATA.sales_pd_type','SALES_PD_DATA.rand_string','SALES_PD_DATA.isactive'
|
||||||
// ,"DATE_FORMAT(SALES_PD_DATA.createdon,'%Y-%m-%d') as modify","DATE_ADD(CURDATE(),INTERVAL '-10' DAY) as currd",
|
// ,"DATE_FORMAT(SALES_PD_DATA.createdon,'%Y-%m-%d') as modify","DATE_ADD(CURDATE(),INTERVAL '-10' DAY) as currd",
|
||||||
// "(CURDATE()) as daye10"
|
// "(CURDATE()) as daye10"
|
||||||
@ -274,6 +275,7 @@ class Sales_PD_Controller extends REST_Controller {
|
|||||||
'jointype' => 'LEFT')
|
'jointype' => 'LEFT')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$or_where = array();
|
||||||
$where_condition_array['SALES_PD_DATA.isactive'] = 1;
|
$where_condition_array['SALES_PD_DATA.isactive'] = 1;
|
||||||
if(is_numeric($lender_id))
|
if(is_numeric($lender_id))
|
||||||
{
|
{
|
||||||
@ -288,14 +290,21 @@ class Sales_PD_Controller extends REST_Controller {
|
|||||||
|
|
||||||
// ----END OF FILTERING THE LAST 10 DAYS RECORDS---
|
// ----END OF FILTERING THE LAST 10 DAYS RECORDS---
|
||||||
|
|
||||||
if($user_id && is_numeric($user_id))
|
if($role && is_numeric($role) && $role == 15) //if role area sales head the pull all meq cases
|
||||||
|
{
|
||||||
|
$where_condition_array['SALES_PD_DATA.product_id'] = (ENVIRONMENT == 'production' ? 23 : 22);
|
||||||
|
$or_where['SALES_PD_DATA.createdby'] = $user_id;
|
||||||
|
}
|
||||||
|
else if($user_id && is_numeric($user_id))
|
||||||
{
|
{
|
||||||
$where_condition_array['SALES_PD_DATA.createdby'] = $user_id;
|
$where_condition_array['SALES_PD_DATA.createdby'] = $user_id;
|
||||||
}
|
}
|
||||||
$order_by = 'SALES_PD_DATA.sales_pd_id';
|
|
||||||
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC');
|
|
||||||
|
|
||||||
//print_r($this->db->last_query());die();
|
$order_by = 'SALES_PD_DATA.sales_pd_id';
|
||||||
|
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC','',$or_where);
|
||||||
|
|
||||||
|
// print_r($this->db->last_query());die();
|
||||||
|
// print_r(count($sales_pd_data));die();
|
||||||
if(count($sales_pd_data))
|
if(count($sales_pd_data))
|
||||||
{
|
{
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
|
|||||||
@ -52,11 +52,11 @@ class User_Management_Controller extends REST_Controller {
|
|||||||
$roles = "";
|
$roles = "";
|
||||||
$lender_hierarchy = "";
|
$lender_hierarchy = "";
|
||||||
$pdofficer = "";
|
$pdofficer = "";
|
||||||
|
$user_config = "";
|
||||||
|
|
||||||
if($this->post('roles')){ $roles = json_decode($this->post('roles'),true); }
|
if($this->post('roles')){ $roles = json_decode($this->post('roles'),true); }
|
||||||
if($this->post('pdofficer')){ $pdofficer = json_decode($this->post('pdofficer'),true); }
|
if($this->post('pdofficer')){ $pdofficer = json_decode($this->post('pdofficer'),true); }
|
||||||
|
if($this->post('user_config')){ $user_config = json_decode($this->post('user_config'),true); }
|
||||||
|
|
||||||
|
|
||||||
$records = json_decode($this->post('records'),true);
|
$records = json_decode($this->post('records'),true);
|
||||||
|
|
||||||
@ -152,8 +152,22 @@ class User_Management_Controller extends REST_Controller {
|
|||||||
//print_r($pdofficer);
|
//print_r($pdofficer);
|
||||||
$this->User_Management_Model->saveRecords($pdofficer,PDOFFICIERSDETAILS);
|
$this->User_Management_Model->saveRecords($pdofficer,PDOFFICIERSDETAILS);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//save user configs
|
||||||
|
if($user_config)
|
||||||
|
{
|
||||||
|
if(array_key_exists('salespd_products', $user_config))
|
||||||
|
{
|
||||||
|
$salespd_products = (implode(',',$user_config['salespd_products']));
|
||||||
|
$arr = array('fk_user_id' => $user_id,'config_type' => 1,'data' => $salespd_products);
|
||||||
|
$this->db->set($arr);
|
||||||
|
$res = $this->db->insert(USERCONFIG);
|
||||||
|
//print_r($res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if($user_id != '' || $user_id != null)
|
if($user_id != '' || $user_id != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -180,15 +194,21 @@ class User_Management_Controller extends REST_Controller {
|
|||||||
$roles = "";
|
$roles = "";
|
||||||
$lender_hierarchy = "";
|
$lender_hierarchy = "";
|
||||||
$pdofficer = "";
|
$pdofficer = "";
|
||||||
|
$user_config = "";
|
||||||
|
|
||||||
if($this->post('pdofficer')){ $pdofficer = json_decode($this->post('pdofficer'),true);}
|
if($this->post('pdofficer')){ $pdofficer = json_decode($this->post('pdofficer'),true);}
|
||||||
if($this->post('lender_hierarchy')){ $lender_hierarchy = json_decode($this->post('lender_hierarchy'),true); }
|
if($this->post('lender_hierarchy')){ $lender_hierarchy = json_decode($this->post('lender_hierarchy'),true); }
|
||||||
|
if($this->post('user_config')){ $user_config = json_decode($this->post('user_config'),true); }
|
||||||
|
|
||||||
|
|
||||||
$records = json_decode($this->post('records'),true);
|
$records = json_decode($this->post('records'),true);
|
||||||
// $records = array_filter($recordsData);
|
// $records = array_filter($recordsData);
|
||||||
$roles = json_decode($this->post('roles'),true);
|
$roles = json_decode($this->post('roles'),true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// $lender_hierarchy = json_decode($this->post('lender_hierarchy'),true);
|
// $lender_hierarchy = json_decode($this->post('lender_hierarchy'),true);
|
||||||
|
|
||||||
if(!empty($_FILES['profilepic']['tmp_name']))
|
if(!empty($_FILES['profilepic']['tmp_name']))
|
||||||
@ -281,6 +301,22 @@ class User_Management_Controller extends REST_Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//update user configs
|
||||||
|
if($user_config)
|
||||||
|
{
|
||||||
|
if(array_key_exists('salespd_products', $user_config))
|
||||||
|
{
|
||||||
|
$salespd_products = (implode(',',$user_config['salespd_products']));
|
||||||
|
$arr = array('fk_user_id' => $records['userid'],'config_type' => 1,'data' => $salespd_products);
|
||||||
|
$this->db->set($arr);
|
||||||
|
$this->db->where('fk_user_id', $records['userid']);
|
||||||
|
$res = $this->db->update(USERCONFIG);
|
||||||
|
//print_r($res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($modified != '' || $modified != null || $modified != 0)
|
if($modified != '' || $modified != null || $modified != 0)
|
||||||
{
|
{
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
|
|||||||
@ -93,7 +93,7 @@ class SPARQ_Model extends CI_Model {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getJoinRecords($columns,$table,$joins,$where_condition_array = array(),$order_by_cloumn = '',$order_by = 'ASC',$print_query = '')
|
public function getJoinRecords($columns,$table,$joins,$where_condition_array = array(),$order_by_cloumn = '',$order_by = 'ASC',$print_query = '',$or_where)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@ -112,6 +112,15 @@ class SPARQ_Model extends CI_Model {
|
|||||||
$this->db->WHERE($key,$condition);
|
$this->db->WHERE($key,$condition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(count($or_where))
|
||||||
|
{
|
||||||
|
$this->db->or_group_start();
|
||||||
|
foreach($or_where as $key => $condition)
|
||||||
|
{
|
||||||
|
$this->db->WHERE($key,$condition);
|
||||||
|
}
|
||||||
|
$this->db->group_end();
|
||||||
|
}
|
||||||
|
|
||||||
if($order_by != '')
|
if($order_by != '')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,6 +45,11 @@ class User_Management_Model extends SPARQ_Model {
|
|||||||
// print_r($result);die;
|
// print_r($result);die;
|
||||||
if(count($result) > 0 )
|
if(count($result) > 0 )
|
||||||
{
|
{
|
||||||
|
foreach ($result as $key => $value)
|
||||||
|
{
|
||||||
|
$result[$key]['user_config'] = $this->getUserConfigDetails($value['userid']);
|
||||||
|
}
|
||||||
|
|
||||||
$result_data['data_status'] = true;
|
$result_data['data_status'] = true;
|
||||||
$result_data['data'] = $result;
|
$result_data['data'] = $result;
|
||||||
return $result_data;
|
return $result_data;
|
||||||
|
|||||||
@ -259,6 +259,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||||||
echo '</tbody></table>';
|
echo '</tbody></table>';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<br>
|
||||||
<table class="scorecard_table"><tbody>
|
<table class="scorecard_table"><tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="thlargefont" colspan="10" >Institution Details</th>
|
<th class="thlargefont" colspan="10" >Institution Details</th>
|
||||||
@ -290,9 +291,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3">Number of beds</td>
|
<td colspan="3">Number of beds</td>
|
||||||
<td class = "tdcenteralign" colspan="2" ><?php echo ($section4['how_many_beds'])?></td>
|
<td class = "tdcenteralign" colspan="2" ><?php echo (isset($section4['how_many_beds']) && $section4['how_many_beds'] != '' ? $section4['how_many_beds'] : '-') ?></td>
|
||||||
<td colspan="2">Occupancy ratio </td>
|
<td colspan="2">Occupancy ratio </td>
|
||||||
<td class = "tdcenteralign" colspan="3"> <?php echo ($section4['occupancy_ratio'])?></td>
|
<td class = "tdcenteralign" colspan="3"> <?php echo (isset($section4['occupancy_ratio']) && $section4['occupancy_ratio'] != '' ? $section4['occupancy_ratio'] : '-')?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php if( (!strcasecmp($section4['instituion_vitage'], 'Hospital')) || (!strcasecmp($section4['instituion_vitage'], 'Nursing Home'))){ ?>
|
<?php if( (!strcasecmp($section4['instituion_vitage'], 'Hospital')) || (!strcasecmp($section4['instituion_vitage'], 'Nursing Home'))){ ?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -256,7 +256,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||||||
echo '<tr> <td colspan="3">Address Type / Ownership</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['address_type']['address_type'].$ownership_type.'</td></tr>';
|
echo '<tr> <td colspan="3">Address Type / Ownership</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['address_type']['address_type'].$ownership_type.'</td></tr>';
|
||||||
if(isset($pd_section_data[8]['is_business_address']) && strtolower($pd_section_data[8]['is_business_address']) == 'yes')
|
if(isset($pd_section_data[8]['is_business_address']) && strtolower($pd_section_data[8]['is_business_address']) == 'yes')
|
||||||
{
|
{
|
||||||
echo '<tr> <td colspan="3">Business operating duration<br> from this address </td> <td class = "tdcenteralign" colspan="7">'.($pd_section_data[8]['business_years'].' Year(s)'.(isset($pd_section_data[8]['business_months']) && $pd_section_data[8]['business_months'] != '' ? ' & ' . $pd_section_data[8]['business_months'] .' Month(s)': '')).'</td> </tr>';
|
echo '<tr> <td colspan="3">Period for which business has been <br>in operation from this address </td> <td class = "tdcenteralign" colspan="7">'.($pd_section_data[8]['business_years'].' Year(s)'.(isset($pd_section_data[8]['business_months']) && $pd_section_data[8]['business_months'] != '' ? ' & ' . $pd_section_data[8]['business_months'] .' Month(s)': '')).'</td> </tr>';
|
||||||
}
|
}
|
||||||
echo '<tr> <td colspan="3">PD locality</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_locality']['locality_name'].'</td></tr>';
|
echo '<tr> <td colspan="3">PD locality</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_locality']['locality_name'].'</td></tr>';
|
||||||
echo '<tr> <td colspan="3">Location Approach</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_location']['description'].'</td></tr>';
|
echo '<tr> <td colspan="3">Location Approach</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_location']['description'].'</td></tr>';
|
||||||
@ -1288,28 +1288,28 @@ Business run by the applicant</td><td colspan="4"><?php echo $pd_section_data[1
|
|||||||
|
|
||||||
|
|
||||||
<div id="page_break"> </div>
|
<div id="page_break"> </div>
|
||||||
<table class="scorecard_table">
|
<!-- <table class="scorecard_table">
|
||||||
<tr><th class="thlargefont">Neighbourhood Check Details</th></tr>
|
<tr><th class="thlargefont">Neighbourhood Check Details</th></tr>
|
||||||
</table>
|
</table>
|
||||||
<table class="scorecard_table">
|
<table class="scorecard_table"> -->
|
||||||
|
|
||||||
<!-- <thead>
|
<!-- <thead>
|
||||||
|
|
||||||
<?php echo $pd_section_data[12]['display_data']['header_row']?>
|
<?php //echo $pd_section_data[12]['display_data']['header_row']?>
|
||||||
</thead> -->
|
</thead> -->
|
||||||
<tbody>
|
<!-- <tbody> -->
|
||||||
<?php echo $pd_section_data[17]['display_data']['first_row']?>
|
<?php //echo $pd_section_data[17]['display_data']['first_row']?>
|
||||||
<?php echo $pd_section_data[17]['display_data']['second_row']?>
|
<?php //echo $pd_section_data[17]['display_data']['second_row']?>
|
||||||
<?php echo $pd_section_data[17]['display_data']['third_row']?>
|
<?php //echo $pd_section_data[17]['display_data']['third_row']?>
|
||||||
<?php echo $pd_section_data[17]['display_data']['owner_row']?>
|
<?php //echo $pd_section_data[17]['display_data']['owner_row']?>
|
||||||
<?php echo $pd_section_data[17]['display_data']['five_row']?>
|
<?php //echo $pd_section_data[17]['display_data']['five_row']?>
|
||||||
<?php if($pd_section_data[17]['neighbourhood_remarks']) { echo $pd_section_data[17]['display_data']['fourth_row']; }?>
|
<?php //if($pd_section_data[17]['neighbourhood_remarks']) { echo $pd_section_data[17]['display_data']['fourth_row']; }?>
|
||||||
<!-- <?php echo $pd_section_data[17]['display_data']['siz_row']?>
|
<!-- <?php //echo $pd_section_data[17]['display_data']['siz_row']?>
|
||||||
<?php echo $pd_section_data[17]['display_data']['seven_row']?> -->
|
<?php //echo $pd_section_data[17]['display_data']['seven_row']?> -->
|
||||||
</tbody>
|
<!-- </tbody> -->
|
||||||
|
|
||||||
|
|
||||||
</table>
|
<!-- </table> -->
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user