PD CATEGORY WEIGHTAGE

This commit is contained in:
velz 2018-10-16 19:29:17 +05:30
parent d77df52983
commit 88624c9fb0
3 changed files with 58 additions and 1 deletions

View File

@ -87,7 +87,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto
// define login route name for token verification
//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors
//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllTemplates/:any)'); // no errors
defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getQuestionsForTemplateCreation'); // no errors
defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'schdulePD'); // no errors
/*********************AWS resources Constants*************************************************/
defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic');
@ -309,5 +309,8 @@ defined('ENTITYPDPRICEINFOID') OR define('ENTITYPDPRICEINFOID','entity_pdprice_i
defined('VENDORCITYMAP') OR define('VENDORCITYMAP','m_vendor_city_map');
defined('VENDORCITYMAPID') OR define('VENDORCITYMAPID','vendor_city_map_id');
defined('PDCATEGORYWEIGHTAGE') OR define('PDCATEGORYWEIGHTAGE','t_pd_category_weightage');
defined('PDCATEGORYWEIGHTAGEID') OR define('PDCATEGORYWEIGHTAGEID','pd_category_weightage_id');

View File

@ -352,6 +352,7 @@ class Common_Masters_Controller extends REST_Controller {
{
$records = $this->post('records');
// print_r($records);die;
$result = array();
if(!empty($records))
{
foreach($records['teamDetails'] as $users)
@ -364,6 +365,8 @@ class Common_Masters_Controller extends REST_Controller {
$result = $this->Common_Masters_Model->updateRecords($record,PDOFFICIERSDETAILS,$where_condition_array);
}
}
if(count($result) > 0)
{
$data['dataStatus'] = true;

View File

@ -593,6 +593,28 @@ class PD_Controller extends REST_Controller {
*/
public function schdulePD_post()
{
$records['fk_pd_id'] = 40;
$fields = array('fk_pd_template_id');
$where_condition_array = array('pd_id'=>$records['fk_pd_id']);
$res_array = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER);
//print_r($res_array);
if(count($res_array))
{
$template_id = $res_array[0]['fk_pd_template_id'];
echo $template_id;
$fields = array('fk_question_category_id','weightage');
$where_condition_array = array('fk_template_id'=>$template_id);
$res_array = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATECATEGORYWEIGHTAGE);
print_r($res_array);
foreach($res_array as $key => $category)
{
$temp_data = array('fk_pd_id'=>$records['fk_pd_id'],'fk_category_id'=>$category['fk_question_category_id'],'pd_category_weightage'=>$category['weightage']);
$this->PD_Model->saveRecords($temp_data,PDCATEGORYWEIGHTAGE);
}
}
die();
$records = $this->post('records');
if($records['schedule_time'] != "" || $records['schedule_time'] != null)
{
@ -602,6 +624,35 @@ class PD_Controller extends REST_Controller {
$temp_array = array('pd_status' => SCHEDULED,'fk_updatedby'=>$records['fk_scheduled_by'],'updatedon'=>$records['createdon'],'scheduled_on'=>$records['schedule_time']);
$pd_id_modified = $this->PD_Model->updateRecords($temp_array,PDTRIGGER,$where_condition_array);
/******* Code Snippt for Save Template Category Weightage info to PD category Info*/
$fields = array('fk_pd_template_id');
$where_condition_array = array('pd_id'=>$records['fk_pd_id']);
$res_array = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER);
if(count($res_array))
{
$fields = array('fk_pd_template_id');
$where_condition_array = array('pd_id'=>$records['fk_pd_id']);
$res_array = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTRIGGER);
if(count($res_array))
{
$template_id = $res_array[0]['fk_pd_template_id'];
$fields = array('fk_question_category_id','weightage');
$where_condition_array = array('fk_template_id'=>$template_id);
$template_categories = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATECATEGORYWEIGHTAGE);
foreach($template_categories as $key => $category)
{
$temp_data = array('fk_pd_id'=>$records['fk_pd_id'],'fk_category_id'=>$category['fk_question_category_id'],'pd_category_weightage'=>$category['weightage']);
$this->PD_Model->saveRecords($temp_data,PDCATEGORYWEIGHTAGE);
}
}
}
/******* End of Code Snippt Save Template Category Weightage info to PD category Info*/
if($pd_id_modified != "" || $pd_id_modified != null)
{
PDALERTS::pdnotification($records['fk_pd_id']);