SCORE CHART SMALL ISSUES PANTHOMJS

This commit is contained in:
velz 2019-03-15 11:18:32 +05:30
parent bf9410cb40
commit 5094f49a18
11 changed files with 420 additions and 148 deletions

View File

@ -659,7 +659,7 @@ class PD_Controller extends REST_Controller {
$ch = curl_init();
$timeout = 5;
$url = 'https:/ssa.sineedge.com/officertracking/'.$randomString;
$url = 'https://ssa.sineedge.com/officertracking/'.$randomString;
//echo "$url";
curl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
@ -682,8 +682,8 @@ class PD_Controller extends REST_Controller {
unset($pd_details['mobile_no']);
$pd_details['OTP'] = $OTP;
$client = new \GuzzleHttp\Client();
$response = $client->post( $url);
// $client = new \GuzzleHttp\Client();
// $response = $client->post($url);
SMS_GUPSHUP::sendSMS($msg,$no);
}
@ -3344,14 +3344,14 @@ class PD_Controller extends REST_Controller {
$temp_netmargin = ($temp_netprofit/$total_sales_itemwise) * 100;
}
$overall_summary_report['sales_calculated_by_itemwise']['sales_revenue'] = $total_sales_itemwise;
$purchases_flag ? $overall_summary_report['sales_calculated_by_itemwise']['purchases'] = $temp_purchases : $overall_summary_report['sales_calculated_by_itemwise']['cost_of_goods_sold'] = $temp_purchases;
$overall_summary_report['sales_calculated_by_itemwise']['grossprofit'] = $temp_grossprofit;
$overall_summary_report['sales_calculated_by_itemwise']['business_expenses'] = $overall_business_expenses_total;
$overall_summary_report['sales_calculated_by_itemwise']['netprofit'] = $temp_netprofit;
$overall_summary_report['sales_calculated_by_itemwise']['house_hold_expenses'] = $overall_household_total;
$overall_summary_report['sales_calculated_by_itemwise']['disposable_income'] = $temp_netprofit - $overall_household_total;
$overall_summary_report['sales_calculated_by_itemwise']['netmargin'] = $temp_netmargin;
$overall_summary_report['sales_calculated_by_itemwise']['sales_revenue'] = round($total_sales_itemwise);
$purchases_flag ? $overall_summary_report['sales_calculated_by_itemwise']['purchases'] = round($temp_purchases) : $overall_summary_report['sales_calculated_by_itemwise']['cost_of_goods_sold'] = round($temp_purchases);
$overall_summary_report['sales_calculated_by_itemwise']['grossprofit'] = round($temp_grossprofit);
$overall_summary_report['sales_calculated_by_itemwise']['business_expenses'] = round($overall_business_expenses_total);
$overall_summary_report['sales_calculated_by_itemwise']['netprofit'] = round($temp_netprofit);
$overall_summary_report['sales_calculated_by_itemwise']['house_hold_expenses'] = round($overall_household_total);
$overall_summary_report['sales_calculated_by_itemwise']['disposable_income'] = round($temp_netprofit - $overall_household_total);
$overall_summary_report['sales_calculated_by_itemwise']['netmargin'] = round($temp_netmargin,2);
}
if($sales_by_item_monthwise_flag == 1)
@ -3403,14 +3403,14 @@ class PD_Controller extends REST_Controller {
$temp_netmargin = ($temp_netprofit/$total_sales_monthwise) * 100;
}
$overall_summary_report['sales_calculated_by_monthwise']['sales_revenue'] = $total_sales_monthwise;
$purchases_flag ? $overall_summary_report['sales_calculated_by_monthwise']['purchases'] = $temp_purchases : $overall_summary_report['sales_calculated_by_monthwise']['cost_of_goods_sold'] = $temp_purchases;
$overall_summary_report['sales_calculated_by_monthwise']['grossprofit'] = $temp_grossprofit;
$overall_summary_report['sales_calculated_by_monthwise']['business_expenses'] = $overall_business_expenses_total;
$overall_summary_report['sales_calculated_by_monthwise']['netprofit'] = $temp_netprofit;
$overall_summary_report['sales_calculated_by_monthwise']['house_hold_expenses'] = $overall_household_total;
$overall_summary_report['sales_calculated_by_monthwise']['disposable_income'] = $temp_netprofit - $overall_household_total;
$overall_summary_report['sales_calculated_by_monthwise']['netmargin'] = $temp_netmargin;
$overall_summary_report['sales_calculated_by_monthwise']['sales_revenue'] = round($total_sales_monthwise);
$purchases_flag ? $overall_summary_report['sales_calculated_by_monthwise']['purchases'] = round($temp_purchases) : $overall_summary_report['sales_calculated_by_monthwise']['cost_of_goods_sold'] = round($temp_purchases);
$overall_summary_report['sales_calculated_by_monthwise']['grossprofit'] = round($temp_grossprofit);
$overall_summary_report['sales_calculated_by_monthwise']['business_expenses'] = round($overall_business_expenses_total);
$overall_summary_report['sales_calculated_by_monthwise']['netprofit'] = round($temp_netprofit);
$overall_summary_report['sales_calculated_by_monthwise']['house_hold_expenses'] = round($overall_household_total);
$overall_summary_report['sales_calculated_by_monthwise']['disposable_income'] = round($temp_netprofit - $overall_household_total);
$overall_summary_report['sales_calculated_by_monthwise']['netmargin'] = round($temp_netmargin,2);
@ -3441,14 +3441,14 @@ class PD_Controller extends REST_Controller {
}
$overall_summary_report['sales_declared_by_customer']['sales_revenue'] = $total_sales_declared_by_customer;
$purchases_flag ? $overall_summary_report['sales_declared_by_customer']['purchases'] = $temp_purchases : $overall_summary_report['sales_declared_by_customer']['cost_of_goods_sold'] = $temp_purchases;
$overall_summary_report['sales_declared_by_customer']['grossprofit'] = $temp_grossprofit;
$overall_summary_report['sales_declared_by_customer']['business_expenses'] = $overall_business_expenses_total;
$overall_summary_report['sales_declared_by_customer']['netprofit'] = $temp_netprofit;
$overall_summary_report['sales_declared_by_customer']['house_hold_expenses'] = $overall_household_total;
$overall_summary_report['sales_declared_by_customer']['disposable_income'] = $temp_netprofit - $overall_household_total;
$overall_summary_report['sales_declared_by_customer']['netmargin'] = $temp_netmargin;
$overall_summary_report['sales_declared_by_customer']['sales_revenue'] = round($total_sales_declared_by_customer);
$purchases_flag ? $overall_summary_report['sales_declared_by_customer']['purchases'] = round($temp_purchases) : $overall_summary_report['sales_declared_by_customer']['cost_of_goods_sold'] = round($temp_purchases);
$overall_summary_report['sales_declared_by_customer']['grossprofit'] = round($temp_grossprofit);
$overall_summary_report['sales_declared_by_customer']['business_expenses'] = round($overall_business_expenses_total);
$overall_summary_report['sales_declared_by_customer']['netprofit'] = round($temp_netprofit);
$overall_summary_report['sales_declared_by_customer']['house_hold_expenses'] = round($overall_household_total);
$overall_summary_report['sales_declared_by_customer']['disposable_income'] = round($temp_netprofit - $overall_household_total);
$overall_summary_report['sales_declared_by_customer']['netmargin'] = round($temp_netmargin,2);
}
@ -3465,9 +3465,9 @@ class PD_Controller extends REST_Controller {
if(isset($overall_summary_report['sales_calculated_by_monthwise']['netmargin'])){ $temp_netmargin_array = array_merge($temp_netmargin_array,array($overall_summary_report['sales_calculated_by_monthwise']['netmargin'])); }
if(isset($overall_summary_report['sales_calculated_by_itemwise']['netmargin'])){ $temp_netmargin_array = array_merge($temp_netmargin_array,array($overall_summary_report['sales_calculated_by_itemwise']['netmargin'])); }
$overall_summary_report['consolidated_report']['consolidated_sales_revenue'] = round(array_sum($temp_sales_array) / count($temp_sales_array),2);
$overall_summary_report['consolidated_report']['consolidated_sales_revenue'] = round(array_sum($temp_sales_array) / count($temp_sales_array));
$overall_summary_report['consolidated_report']['consolidated_nermagin'] = round(array_sum($temp_netmargin_array) / count($temp_netmargin_array),2);
$overall_summary_report['consolidated_report']['consolidated_nerprofit'] = round($overall_summary_report['consolidated_report']['consolidated_sales_revenue'] * ($overall_summary_report['consolidated_report']['consolidated_nermagin'] / 100 ),2);
$overall_summary_report['consolidated_report']['consolidated_nerprofit'] = round($overall_summary_report['consolidated_report']['consolidated_sales_revenue'] * ($overall_summary_report['consolidated_report']['consolidated_nermagin'] / 100 ));
return ($overall_summary_report);
@ -3489,7 +3489,9 @@ class PD_Controller extends REST_Controller {
public function getLatestPDReportBlob_post()
{
$records = $this->post('records');
$pdid = $records['pd_id'];
//print_r($records);die();
$records = $records['pd_id'];
$pdid = $records['startId'];
$version_id = $records['version_id'];
$version_no = "";
@ -3593,12 +3595,12 @@ class PD_Controller extends REST_Controller {
{
//$result_array[0]['content']
$where_condition_array = array("pd_id" => $pdid);
$temp_array = array('is_original_report_created'=>1,'pd_report_latest_version_blob'=>null,'pd_report_latest_version' => 0);
$temp_array = array('is_original_report_created'=>1,'pd_report_latest_version_blob'=>$temp,'pd_report_latest_version' => 0);
if($is_regenerate != 0)
{
//$result_array[0]['content']
$temp_array = array('is_original_report_created'=>1,'pd_report_latest_version_blob'=>null,'pd_report_latest_version'=>$data['pd_master_details'][0]['pd_report_latest_version'] + 1);
$temp_array = array('is_original_report_created'=>1,'pd_report_latest_version_blob'=>$temp,'pd_report_latest_version'=>$data['pd_master_details'][0]['pd_report_latest_version'] + 1);
}
@ -3651,7 +3653,7 @@ class PD_Controller extends REST_Controller {
$pdid = $records['pd_id'];
$blob = $records['content'];
$fk_updatedby = $records['fk_updatedby'];
$fk_createdby = $records['fk_createdby'];
//$fk_createdby = $records['fk_createdby'];
//Get PD Master Details
$pd_master_details = $this->PD_Model->getPDMasterDetails($pdid);
$main_applicant_name = $pd_master_details[0]['main_applicant'];
@ -3696,7 +3698,7 @@ class PD_Controller extends REST_Controller {
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{
$urls = $this->getALLPDReportsSingedURLs($bucketname,$key);
$urls = $this->getALLPDReportsSingedURLs($bucketname,$key,$pdid);
if($id != null || $id != "" )
{
$data['dataStatus'] = true;
@ -4283,6 +4285,8 @@ class PD_Controller extends REST_Controller {
public function codeigniterViewTest_post()
{
$records = $this->post('records');
$pdid = $records['pd_id'];
$is_regenerate = 0;
if(isset($records['regenerate']))
{
@ -4293,6 +4297,28 @@ class PD_Controller extends REST_Controller {
$data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
$data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
$data['pd_score'] = $this->calculateScore($pdid);
$score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],2) : 0;
//echo $score_for_chart;
//GENERATE CHART PART
$jsdata = file_get_contents(APPPATH.'/views/js/phantomchart.js');
$jsdata = substr_replace($jsdata,$score_for_chart,(strpos($jsdata,"score")+8),5);
//echo $jsdata;
file_put_contents(APPPATH.'/views/js/phantomchart.js',$jsdata,LOCK_EX);
$str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js';
exec($str,$ou);
//print_r($ou);
$chart_img_path = APPPATH.'/views/report_templates/chart.png';
$type = pathinfo($chart_img_path, PATHINFO_EXTENSION);
$chart_img_content = file_get_contents($chart_img_path);
$base64_pdscore_chart_url = 'data:image/' . $type . ';base64,' . base64_encode($chart_img_content);
$data['base64_pdscore_chart_url'] = $base64_pdscore_chart_url;
// echo $data['base64_pdscore_chart_url'];
//die();
//GENERATE CHART PART
//print_r($data['pd_score']);die();
//GET ALL PROCESSED JSON
for($i = 1;$i<=25;$i++)
@ -4317,7 +4343,7 @@ class PD_Controller extends REST_Controller {
//End of PDF Gen using DOM PDF
$output_file2 = APPPATH."/docs/sample.pdf";
$ti = file_put_contents($output_file2, $pdf_doc);
//echo $ti;
echo $ti; die();
$dat['dataStatus'] = true;
$dat['status'] = REST_Controller::HTTP_OK;
$dat['records'] = $ti;

Binary file not shown.

View File

@ -1872,7 +1872,7 @@ class GETPROCESSEDJSON
$master_tables_field_names = $CI->config->item('master_tables_field_names');
$master_tables_pkid = $CI->config->item('master_tables_pkid');
print_r($raw_json);
//print_r($raw_json);
foreach($raw_json['addresses'] as $raw_json_key => $address)
{
// GET KEYS FROM MASTER TABLE FOR SUPPLIER FORM

View File

@ -21,10 +21,17 @@ class Pdfgenerator
public function generate($html, $filename='', $stream=TRUE, $paper = 'A4', $orientation = "portrait")
{
// echo 'stream'.$html.'tttt';
$dompdf = new Dompdf(array('enable_remote' => true));
$dompdf = new Dompdf(array('enable_remote' => true,'DOMPDF_ENABLE_PHP'=>true));
$dompdf->load_html($html);
$dompdf->set_paper($paper, $orientation);
$dompdf->render();
$canvas = $dompdf->get_canvas();
//$font = Font_Metrics::get_font("helvetica", "bold");
$font = null;
$canvas->page_text(515,750, "Page {PAGE_NUM} of {PAGE_COUNT}", $font,8, array(0,0,0));
if ($stream) {
$dompdf->stream($filename.".pdf", array("Attachment" => 0));
} else {

View File

@ -1067,7 +1067,7 @@ class PD_Model extends SPARQ_Model {
if($result->OTP == $pddata['OTP'])
{
$fields = ('is_otp_done');
$where_condition_array = array('pd_id' => $pdotp['pd_id']);
$where_condition_array = array('pd_id' => $pddata['pd_id']);
$this->PD_Model->updateRecords($fields,PDTRIGGER,$where_condition_array);
$result = true;
@ -1255,7 +1255,7 @@ class PD_Model extends SPARQ_Model {
$assessed_income = array();
//get sales_declared_by_customer details
$fields = array('sdc_id','sales_declared_by_customer','margin_per','margin_value');
$fields = array('sdc_id','sales_declared_by_customer','margin_per','margin_value','comments');
$where_condition_array = array('fk_pd_id'=>$pdid,'isactive'=>1);
$sales_declared_by_customer = $this->selectCustomRecords($fields,$where_condition_array,SALESDECLAREDBYCUSTOMER);
//get Gross Profit calculatio Mode details
@ -1264,7 +1264,7 @@ class PD_Model extends SPARQ_Model {
$gross_profit_calculation_type = $this->selectCustomRecords($fields,$where_condition_array,PDASSESSEDINCOMEESTIMATIONOFGROSSPROFITTYPE);
//get sales_calculated_by_itemwise details
$fields = array('sci_id','sales_item','sales_qty','UOM.name as uom_name','fk_uom_id','FREQUENCY.name as frequency_name','rate_per_unit','fk_frequency_id','annual_sale_value','margin_final_value','margin_per','margin_per_uom');
$fields = array('sci_id','sales_item','sales_qty','UOM.name as uom_name','fk_uom_id','FREQUENCY.name as frequency_name','rate_per_unit','fk_frequency_id','annual_sale_value','margin_final_value','margin_per','margin_per_uom','uom_other','comments');
$table = SALESCALCULATEDBYITEMWISE.' as SALESCALCULATEDBYITEMWISE';
$where_condition_array = array('fk_pd_id'=>$pdid,'SALESCALCULATEDBYITEMWISE.isactive'=>1);
$joins = array(
@ -1277,7 +1277,7 @@ class PD_Model extends SPARQ_Model {
$sales_items_by_months = array();
$this->db->SELECT('sim_id,sales_item,margin_value,margin_per');
$this->db->SELECT('sim_id,sales_item,margin_value,margin_per,comments');
$this->db->FROM(SALESITEMMONTHWISE.' as SALESITEMMONTHWISE');
$this->db->WHERE('SALESITEMMONTHWISE.fk_pd_id',$pdid);
$this->db->WHERE('SALESITEMMONTHWISE.isactive',1);
@ -1329,7 +1329,7 @@ class PD_Model extends SPARQ_Model {
//Get purchase_details
$fields = array('purchase_id','purchase_item','purchase_qty','UOM.name as uom_name','fk_uom_id','FREQUENCY.name as frequency_name','rate_per_unit','fk_frequency_id','annual_purchase_value');
$fields = array('purchase_id','purchase_item','purchase_qty','UOM.name as uom_name','fk_uom_id','FREQUENCY.name as frequency_name','rate_per_unit','fk_frequency_id','annual_purchase_value','uom_other','comments');
$table = PDPURCHASEDETAILS.' as PDPURCHASEDETAILS';
$where_condition_array = array('fk_pd_id'=>$pdid,'PDPURCHASEDETAILS.isactive'=>1);
$joins = array(
@ -1339,7 +1339,7 @@ class PD_Model extends SPARQ_Model {
//Get business_expenses
$fields = array('pd_expense_id','PDBUSINESSEXPENSES.expense_item_id','BUSINESSEXPENSES.expense_item','FREQUENCY.name as frequency_name','fk_frequency_id','expense_value','annual_expenses_value');
$fields = array('pd_expense_id','PDBUSINESSEXPENSES.expense_item_id','BUSINESSEXPENSES.expense_item','FREQUENCY.name as frequency_name','fk_frequency_id','expense_value','annual_expenses_value','comments');
$table = PDBUSINESSEXPENSES.' as PDBUSINESSEXPENSES';
$where_condition_array = array('fk_pd_id'=>$pdid,'PDBUSINESSEXPENSES.isactive'=>1);
$joins = array(
@ -1350,7 +1350,7 @@ class PD_Model extends SPARQ_Model {
//Get house_hold_expenses
$fields = array('household_expense_id','expense_item','FREQUENCY.name as frequency_name','fk_frequency_id','expense_value','annual_expense_value');
$fields = array('household_expense_id','expense_item','FREQUENCY.name as frequency_name','fk_frequency_id','expense_value','annual_expense_value','comments');
$table = PDHOUSEHOLDEXPENSES.' as PDHOUSEHOLDEXPENSES';
$where_condition_array = array('fk_pd_id'=>$pdid,'PDHOUSEHOLDEXPENSES.isactive'=>1);
$joins = array(
@ -1359,7 +1359,7 @@ class PD_Model extends SPARQ_Model {
//get Other Business Income details
$fields = array('PDBUSINESSINCOME.pd_business_income_id', 'PDBUSINESSINCOME.fk_pd_id', 'PDBUSINESSINCOME.business_income_id', 'PDBUSINESSINCOME.income_value', 'PDBUSINESSINCOME.fk_frequency_id', 'PDBUSINESSINCOME.annual_income_value','PDBUSINESSINCOME.fk_createdby','PDBUSINESSINCOME.other_income_item','PDBUSINESSINCOME.other_frequncy_item','FREQUENCY.name as frequency_name','BUSINESSINCOME.business_income_item');
$fields = array('PDBUSINESSINCOME.pd_business_income_id', 'PDBUSINESSINCOME.fk_pd_id', 'PDBUSINESSINCOME.business_income_id', 'PDBUSINESSINCOME.income_value', 'PDBUSINESSINCOME.fk_frequency_id', 'PDBUSINESSINCOME.annual_income_value','PDBUSINESSINCOME.fk_createdby','PDBUSINESSINCOME.other_income_item','PDBUSINESSINCOME.other_frequncy_item','FREQUENCY.name as frequency_name','BUSINESSINCOME.business_income_item','comments');
$table = PDBUSINESSINCOME.' as PDBUSINESSINCOME';
$where_condition_array = array('fk_pd_id'=>$pdid,'PDBUSINESSINCOME.isactive'=>1);
$joins = array(

View File

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

View File

@ -12,14 +12,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
.page_break { page-break-before: always; }
@page {
margin: 100px 50px;
font-family:Helvetica, Arial, sans-serif;
font-family:Helvetica,Arial;
}
footer {
header {
position: fixed;
bottom: 5px;
top: -70px;
left: 0px;
right: 0px;
height: 30px;
height: 20px;
/** Extra personal styles **/
/*background-color: #03a9f4;
@ -27,6 +27,21 @@ defined('BASEPATH') OR exit('No direct script access allowed');
text-align: right;
/*line-height: 35px;*/
}
footer {
position: fixed;
bottom: 5px;
left: 0px;
right: 0px;
height: 30px;
font-size: 10px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: left;
/*line-height: 35px;*/
}
.table2 {
border: 1px solid black;
@ -48,28 +63,45 @@ defined('BASEPATH') OR exit('No direct script access allowed');
tfoot{
color:#e00201;
}
/* metert gauge css */
.sc-gauge { width:200px; height:200px; margin:200px auto; }
.sc-background { position:relative; height:100px; margin-bottom:10px; background-color:#fff; border-radius:150px 150px 0 0; overflow:hidden; text-align:center; }
.sc-mask { position:absolute; top:20px; right:20px; left:20px; height:80px; background-color:#555888; border-radius:150px 150px 0 0 }
.sc-percentage { position:absolute; top:100px; left:-200%; width:400%; height:400%; margin-left:100px; background-color:#00aeef; }
.sc-percentage { transform:rotate(158deg); transform-origin:top center; }
.sc-min { float:left; }
.sc-max { float:right; }
.sc-value { position:absolute; top:50%; left:0; width:100%; font-size:48px; font-weight:700 }
/* metert gauge css */
</style>
</head>
<body style="font-size:13px;margin:25px 25px">
<!-- Define header and footer blocks before your content
<header>
Our Code World
</header> -->
<body style="font-size:13px;margin:25px 50px">
<footer>
<hr>
<div><img style="width:150;height:40px;" src='http://ssa.sineedge.com/sparqapi/logo/sinelogo.png' /></div>
Copyright@Sineedge
</footer>
<header>
<div><img style="width:150;height:50px;opacity: 0.5;" src='http://ssa.sineedge.com/sparqapi/logo/sinelogo.png' /></div>
<hr>
</header>
<!-- Wrap the content of your PDF inside a main tag -->
<?php $loan_form = json_decode($pd_processed_forms[10][0]['processed_json'],true);
?>
<?php
//echo "<br><br><br><br><br><br><br><br><br>";
echo "<br><br><br><br><br><br><br><br><br>";
setlocale(LC_MONETARY, 'en_IN');
echo "<div>";
echo "<h1><center>PERSONAL DISCUSSION REPORT</center></h1> ";
@ -91,7 +123,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
</tbody>
</table>
<?php
echo "<p>Loan Amount Applied For </p>";
@ -104,15 +136,27 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tbody>
</table>
</p>";
echo "<div class='page_break'></div>";
echo "<br><br>";
echo "<p><b>Score Summary</b></p>";
echo "General Section Score :".number_format($pd_score['score_summary']['general']['actual_score'],2,'.','.')."<br>";
echo "Business Section Score :".number_format($pd_score['score_summary']['business']['actual_score'],2,'.','.')."<br>";
echo "Final Remarks Score :".number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.','.')."<br>";
echo "Final PD Score :".number_format($pd_score['score_summary']['overall_score']['final_score'],2,'.','.')."<br>";
echo "<h2>Executive Summary</h2>";
// echo "General Section Score :".number_format($pd_score['score_summary']['general']['actual_score'],2,'.','.')."<br>";
// echo "Business Section Score :".number_format($pd_score['score_summary']['business']['actual_score'],2,'.','.')."<br>";
// echo "Final Remarks Score :".number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.','.')."<br>";
// echo "Final PD Score :".number_format($pd_score['score_summary']['overall_score']['final_score'],2,'.','.')."<br>";
?>
<table>
<tr> <td>General Section Score</td> <td><?php echo number_format($pd_score['score_summary']['general']['actual_score'],2,'.','.')?></td></tr>
<tr> <td>Business Section Score</td> <td><?php echo number_format($pd_score['score_summary']['business']['actual_score'],2,'.','.')?></td></tr>
<tr> <td>Final Remarks Score</td> <td><?php echo number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.','.')?></td></tr>
<tr> <td>Final PD Score</td> <td><?php echo number_format($pd_score['score_summary']['overall_score']['final_score'],2,'.','.')?></td></tr>
</table>
<?php
echo "<br><br>";
//####################### CHART #############################
echo '<p><img src="'.$base64_pdscore_chart_url.'" style="float:center;width:600px;height:350px;"/></p>';
//######################### CHART ###########################
echo "<div class='page_break'></div>";
//####################General Section Statred########################
$general_form = json_decode($pd_processed_forms[18][0]['processed_json'],true);

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,137 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.zingchart.com/zingchart.min.js"></script>
<script>
zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/";
ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "ee6b7db5b51705a13dc2339db3edaf6d"];
</script>
<style>
html,
body {
height: 100%;
width: 100%;
}
#myChart {
height: 100%;
width: 100%;
min-height: 150px;
}
.zc-ref {
display: none;
}
</style>
</head>
<body>
<div id='myChart'><a class="zc-ref" href="https://www.zingchart.com/">Charts by ZingChart</a></div>
<script>
<!-- window.feed = function(callback) { -->
<!-- var tick = {}; -->
<!-- tick.plot0 = Math.ceil(350 + (Math.random() * 500)); -->
<!-- callback(JSON.stringify(tick)); -->
<!-- }; -->
var currentLocation = window.location;
var str = currentLocation;
var arr = str.split("=");
var myConfig = {
type: "gauge",
globals: {
fontSize: 25
},
plotarea: {
marginTop: 80
},
plot: {
size: '100%',
valueBox: {
placement: 'center',
text: '%v', //default
fontSize: 30,
rules: [{
rule: '%v >= 80',
text: '%v<br>EXCELLENT'
}, {
rule: '%v < 80 && %v > 60',
text: '%v<br>Good'
}, {
rule: '%v < 60&& %v > 30',
text: '%v<br>Fair'
}, {
rule: '%v <= 30',
text: '%v<br>Poor'
}]
}
},
tooltip: {
borderRadius: 10
},
scaleR: {
aperture: 180,
minValue: 0,
maxValue: 100,
step: 10,
center: {
visible: false
},
tick: {
visible: false
},
item: {
offsetR: 0,
rules: [{
rule: '%i == 9',
offsetX: 15
}]
},
labels: ['0', '10', '20','30', '40', '50', '60', '70', '80', '90', '100'],
ring: {
size: 60,
rules: [{
rule: '%v <= 50',
backgroundColor: '#E53935'
}, {
rule: '%v > 50 && %v < 70',
backgroundColor: '#EF5350'
}, {
rule: '%v >= 70 && %v < 80',
backgroundColor: '#FFA726'
}, {
rule: '%v >= 80',
backgroundColor: '#29B6F6'
}]
}
},
refresh: {
type: "feed",
transport: "js",
url: "feed()",
interval: 1500,
resetTimeout: 1000
},
series: [{
values: [30], // starting value
backgroundColor: 'black',
indicator: [10, 10, 10, 10, 0.75],
animation: {
effect: 2,
method: 1,
sequence: 4,
speed: 500
},
}]
};
zingchart.render({
id: 'myChart',
data: myConfig,
height: 500,
width: '100%'
});
</script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -1,95 +1,141 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
//echo $_SERVER['REQUEST_URI'];
$score = substr($_SERVER['REQUEST_URI'],(strripos($_SERVER['REQUEST_URI'],"?")+1));
?><!DOCTYPE html>
<html lang="en">
<html>
<title>PDSCORE CHART</title>
<head>
<meta charset="utf-8">
<title>Welcome to CodeIgniter</title>
<style type="text/css">
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#body {
margin: 0 15px 0 15px;
}
p.footer {
text-align: right;
font-size: 11px;
border-top: 1px solid #D0D0D0;
line-height: 32px;
padding: 0 10px 0 10px;
margin: 20px 0 0 0;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
</style>
<script src="https://cdn.zingchart.com/zingchart.min.js"></script>
<script>
zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/";
ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "ee6b7db5b51705a13dc2339db3edaf6d"];
</script>
<style>
html,
body {
height: 100%;
width: 100%;
}
#myChart {
height: 100%;
width: 100%;
min-height: 150px;
}
.zc-ref {
display: none;
}
</style>
</head>
<body>
<div id='myChart'><a class="zc-ref" href="https://www.zingchart.com/">Charts by ZingChart</a></div>
<script>
<!-- window.feed = function(callback) { -->
<!-- var tick = {}; -->
<!-- tick.plot0 = Math.ceil(350 + (Math.random() * 500)); -->
<!-- callback(JSON.stringify(tick)); -->
<!-- }; -->
<div id="container">
<h1>Welcome to CodeIgniter!</h1>
<h1><?php $INDUSTRYCLASSIFICATION = 'INDUSTRYCLASSIFICATION';
//$id = 'INDUSTRYCLASSIFICATIONID';
echo constant($INDUSTRYCLASSIFICATION.'ID');
?></h1>
<div id="body">
<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
<p>If you would like to edit this page you'll find it located at:</p>
<code>application/views/welcome_message.php</code>
<p>The corresponding controller for this page is found at:</p>
<code>application/controllers/Welcome.php</code>
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
</div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT === 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p>
</div>
var myConfig = {
type: "gauge",
globals: {
fontSize: 25
},
plotarea: {
marginTop: 80
},
plot: {
size: '100%',
valueBox: {
placement: 'center',
text: '%v', //default
fontSize: 30,
rules: [{
rule: '%v >= 80',
text: '%v<br>EXCELLENT'
}, {
rule: '%v < 80 && %v > 60',
text: '%v<br>Good'
}, {
rule: '%v < 60&& %v > 30',
text: '%v<br>Fair'
}, {
rule: '%v <= 30',
text: '%v<br>Poor'
}]
}
},
tooltip: {
borderRadius: 10
},
scaleR: {
aperture: 180,
minValue: 0,
maxValue: 100,
step: 10,
center: {
visible: false
},
tick: {
visible: false
},
item: {
offsetR: 0,
rules: [{
rule: '%i == 9',
offsetX: 15
}]
},
labels: ['0', '10', '20','30', '40', '50', '60', '70', '80', '90', '100'],
ring: {
size: 60,
rules: [{
rule: '%v <= 40',
backgroundColor: '#E53935'
}, {
rule: '%v > 40 && %v < 70',
backgroundColor: '#ff9900'
}, {
rule: '%v >= 70 && %v < 80',
backgroundColor: '#99ff66'
}, {
rule: '%v >= 80',
backgroundColor: '#33cc33'
}]
}
},
refresh: {
type: "feed",
transport: "js",
url: "feed()",
interval: 1500,
resetTimeout: 1000
},
series: [{
values: [<?php echo $score;?>], // starting value
backgroundColor: 'black',
indicator: [10, 10, 10, 10, 0.75],
animation: {
effect: 2,
method: 1,
sequence: 4,
speed: 500
},
}]
};
zingchart.render({
id: 'myChart',
data: myConfig,
height: 500,
width: '100%'
});
</script>
</body>
</html>