PHANTOMJS DYNAMIC CHANGE

This commit is contained in:
velz 2019-05-27 13:09:28 +05:30
parent 9d6f8a127a
commit abad107251
3 changed files with 16 additions and 5 deletions

View File

@ -4039,6 +4039,8 @@ class PD_Controller extends REST_Controller {
$exact_script = $phantom_script[0]['script_content'];
//print_r($exact_script);
$apppath = str_replace('\\','/',APPPATH);
$exact_script = str_replace('{{APPPATH}}',$apppath,$exact_script);
$exact_script = str_replace('{{place_score_here}}',$score_for_chart,$exact_script);
//print_r($exact_script);die();
@ -4787,10 +4789,13 @@ class PD_Controller extends REST_Controller {
//Replacing Place holders
$apppath = str_replace('\\','/',APPPATH);
$satellite_script = str_replace('{{APPPATH}}',$apppath,$satellite_script);
$satellite_script = str_replace('{{ADDRESS}}',$geo_location,$satellite_script);
$satellite_script = str_replace('{{GEOLOCATION}}',$geo_location,$satellite_script);
$satellite_script = str_replace('{{API_KEY}}',$google_map_static_api_key,$satellite_script);
//echo $satellite_script;die();
file_put_contents(APPPATH.'/views/js/phantomsatellite.js',$satellite_script);
@ -4865,9 +4870,11 @@ class PD_Controller extends REST_Controller {
else if($i == 2) { $html_content = $this->load->view('general_scorecard',$general_score,true);}
//print_r($html_content);
$apppath = str_replace('\\','/',APPPATH);
$dsc_script_from_db = str_replace('{{APPPATH}}',$apppath,$dsc_script_from_db);
$dsc_script_from_db = str_replace('{{html_content}}',$html_content,$dsc_script_from_db);
$dsc_script_from_db = $i == 1 ? str_replace('{{img_name}}','dsc_business',$dsc_script_from_db) : str_replace('{{img_name}}','dsc_general',$dsc_script_from_db);
//print_r($dsc_script_from_db);die();
$logger = MYLOG::logFunction();
$logger->info('Score Card Graphical Representation called',array('card_type' => $i,'script' => $dsc_script_from_db));
//echo $dsc_script_from_db;
@ -4927,7 +4934,7 @@ class PD_Controller extends REST_Controller {
public function codeigniterViewTest_post()
{
//echo MYUTIL::customIndianNumberFormat(145263.45896);die();
$records = $this->post('records');
$pdid = $records['pd_id'];
@ -4950,7 +4957,7 @@ class PD_Controller extends REST_Controller {
// print_r($data['assessed_income_details']);
// echo "**************************";
//$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] );
$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] );
$score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],1) : 0;
//echo $score_for_chart;die();
@ -4962,7 +4969,11 @@ class PD_Controller extends REST_Controller {
$exact_script = $phantom_script[0]['script_content'];
//print_r($exact_script);
$apppath = str_replace('\\','/',APPPATH);
$exact_script = str_replace('{{APPPATH}}',$apppath,$exact_script);
$exact_script = str_replace('{{place_score_here}}',$score_for_chart,$exact_script);
$exact_script = str_replace('{{APPPATH}}',APPPATH,$exact_script);
//print_r($exact_script);die();
//GENERATE CHART PART

View File

@ -1 +1 @@
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 89;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 99.9;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 19 KiB