diff --git a/api/application/config/api_user_auth_config.php b/api/application/config/api_user_auth_config.php index bbf223a8..97511e38 100644 --- a/api/application/config/api_user_auth_config.php +++ b/api/application/config/api_user_auth_config.php @@ -30,7 +30,7 @@ $config['api_user_auth_info'] = array( 'saveNewUser' => array(10), -'updateExistUser' => array(10), +'updateExistUser' => array(10,4,5), //'getUsersDetails' => array(), //'triggerNewPD' => array(1,2,3,10,11,12,13,1,15,16,17,18,19,20), //'updatePDMaster' => array(1,2,3,10,11,12,13,1,15,16,17,18,19,20), diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 811a5230..b194808f 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -29,6 +29,7 @@ class PD_Controller extends REST_Controller { $this->load->model('PD_Model'); $this->load->library('AWS_S3'); + $this->load->library('AWS_COGNITO'); $this->load->library('AWS_SNS'); $this->load->helper('GETPDFORMDETAILS'); $this->load->helper('GETPROCESSEDJSON'); @@ -5567,7 +5568,14 @@ public function getPDFormDetailsJSON_post() //$this->demo(5); //$this->demo(0); + + + + // + //$this->aws_cognito->adminSetUserPassword('aditya.raikar@imgc.com'); + + //die(); $is_regenerate = 0; if(isset($records['regenerate'])) { @@ -5648,18 +5656,10 @@ public function getPDFormDetailsJSON_post() //echo "*******************************************"; $t = $this->load->view('report_templates/JSONTOREPORT',$data,true); //$t = $this->load->view('temp_html.html',null,true); - echo $t; - die(); - + //echo $t; + //die(); + $t = file_get_contents($this->external_path ."/pd_reports/" . $pdid . "/sample.html"); $total_replaces = substr_count($t,''); - //echo $total_replaces; - //echo $t; die(); - //echo "*************************************"; - //echo strpos($t,''); - //echo "*************************************"; - //$t = substr_replace($t,'X',strpos($t,''),strlen('')); - - // substr_replace($t,'X',strpos($t,''),strpos($t, '', strpos($t,''))); for($i = 0 ;$i < $total_replaces;$i++) { $start_pos = strpos($t,''); @@ -5675,7 +5675,13 @@ public function getPDFormDetailsJSON_post() } //echo $t; - + //$t = file_get_contents($this->external_path ."/pd_reports/" . $pdid . "/sample.html"); + $start_pos = strpos($t,''); + $end_pos = $start_pos + 10; + $t = substr_replace($t,'',$end_pos,0); + $t = substr_replace($t,'',0,0); + $t = substr_replace($t,'',-1,0); + //file_put_contents($this->external_path ."/pd_reports/" . $pdid . "/sample2.html",$t); //PDF Gen using DOM PDF //$this->pdfgenerator->setEncryption('test1234'); $pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); @@ -6714,7 +6720,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $location_watermarktext="Location: ".$doc['link']; $font = APPPATH."docs/robold.ttf"; //metion font and it's location $fontsize="12"; - $x = imagesy($imagetobewatermark); + $x = imagesx($imagetobewatermark); $y = imagesy($imagetobewatermark); $water_mark_text_color = imagecolorallocate($imagetobewatermark, 225, 0, 0); @@ -7374,6 +7380,18 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $records = $this->post('records'); $pdid = $records['pdid']; $content = $records['content']; + if($content != "") + { + + $report_data = $content; + $start_pos = strpos($report_data,''); + $end_pos = $start_pos + 10; + $report_data = substr_replace($report_data,'',$end_pos,0); + $report_data = substr_replace($report_data,'',0,0); + $report_data = substr_replace($report_data,'',-1,0); + + + } $fk_createdby = $records['fk_createdby']; $random_string = $records['random_string']; $pd_report_time = date('Y-m-d-h-i-s'); @@ -7455,11 +7473,34 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $random_string = $this->uri->segment(2); EXTERNAL_DIR_CHECK::checkExternalDirectory($pdid); $records = $this->post('myData'); + + + $report_data = ''; if($records) { $report_data = $records; - + $start_pos = strpos($report_data,''); + $end_pos = $start_pos + 10; + $report_data = substr_replace($report_data,'',$end_pos,0); + $report_data = substr_replace($report_data,'',0,0); + $report_data = substr_replace($report_data,'',-1,0); + + + $total_replaces = substr_count($t,''); + for($i = 0 ;$i < $total_replaces;$i++) + { + $start_pos = strpos($t,''); + + $end_pos = strpos($t, '', strpos($t,'')); + $end_pos = $end_pos + 14; + //echo $start_pos.'-';echo $end_pos.'-';echo ($end_pos - $start_pos).'-'; + + $t = substr_replace($t,'',$start_pos,($end_pos - $start_pos)); + + $t = substr_replace($t,'',strpos($t,''),(strlen(''))); + + } } else { diff --git a/api/application/libraries/AWS_COGNITO.php b/api/application/libraries/AWS_COGNITO.php new file mode 100644 index 00000000..86f5b8d1 --- /dev/null +++ b/api/application/libraries/AWS_COGNITO.php @@ -0,0 +1,58 @@ +CI =& get_instance(); + $this->cognito_properties = array('region'=>'ap-south-1','version'=>'latest','credentials' => array( + 'key' =>$this->CI->config->item('cognito_resource_key'), + 'secret' => $this->CI->config->item('cognito_resource_secret') + )); + $this->client = CognitoIdentityProviderClient::factory($this->cognito_properties); + // echo "Called"; + // $this->setCors('lender8');die(); + + } + + + + public function adminResetPassword($user_name) + { + $result = $this->client->adminResetUserPassword([ + 'UserPoolId' => $this->CI->config->item('sine_egde_pool_id'), // REQUIRED + 'Username' => $user_name, // REQUIRED + ]); + print_r($result); + } + + + public function adminSetUserPassword($user_name) + { + //print_r('adminSetUserPassword'); + $result = $this->client->adminSetUserPassword([ + 'Password' => 'temp1234', // REQUIRED + 'Permanent' => false, + 'UserPoolId' => $this->CI->config->item('sine_egde_pool_id'), // REQUIRED + 'Username' => $user_name, // REQUIRED + ]); + print_r($result); + } + +} + +?> \ No newline at end of file diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 5bf3cd4b..21a6c459 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -842,7 +842,7 @@ class PD_Model extends SPARQ_Model { if($result_array[0]['fk_pd_type'] == "" || $result_array[0]['fk_pd_type'] == null || $result_array[0]['fk_pd_type'] == 0){ $mandatory_fields[] = 'fk_pd_type'; } - if($result_array[0]['fk_customer_segment'] == "" || $result_array[0]['fk_customer_segment'] == null || result_array[0]['fk_customer_segment'] == 0){ $mandatory_fields[] = 'fk_customer_segment'; } + if($result_array[0]['fk_customer_segment'] == "" || $result_array[0]['fk_customer_segment'] == null || $result_array[0]['fk_customer_segment'] == 0){ $mandatory_fields[] = 'fk_customer_segment'; } if($result_array[0]['loan_amount'] == "" || $result_array[0]['loan_amount'] == null){ $mandatory_fields[] = 'loan_amount'; } diff --git a/api/index.php b/api/index.php index 679c7619..25ec6399 100644 --- a/api/index.php +++ b/api/index.php @@ -76,7 +76,7 @@ define('ENVIRONMENT','development'); } - + //echo ENVIRONMENT; /* *--------------------------------------------------------------- * ERROR REPORTING