<?php 

require('vendor/autoload.php');

use Spipu\Html2Pdf\Html2Pdf;

$html2pdf = new Html2Pdf();

$imgurl = $_GET['id'];
$fullurl = $imgurl.".png";
$balance = $_GET['balance'];
$margin = $_GET['margin'];
$avail_margin = $_GET['avail_margin'];
$un_earning = $_GET['un_earning'];
$openOrders = $_GET['openOrders'];
$openTrades = $_GET['openTrades'];
$ag = $_GET['ag'];
$mg = $_GET['mg'];
$dg = $_GET['dg'];
$tdpro = $_GET['tdpro'];
$wkpro = $_GET['wkpro'];
$monPro = $_GET['monPro'];
$hyPro = $_GET['hyPro'];
$ypro = $_GET['ypro'];
$tppro = $_GET['tppro'];


$data = '<p style="font-weight:900;font-size:16px;">Account Summary</p><img style="width:100%;height:300px;" src=\'reports/'.$fullurl.'\'/><table style="width:100%;"><tr style="width:100%;"><td style="width:33%;">Amount Balance : '.$balance.'</td><td style="width:33%;">Current Margin : '.$margin.'</td><td style="width:33%;">Available Margin : '.$avail_margin.'</td></tr><tr style="width:100%;margin-top:15px;"><td style="width:33%;padding-top:30px;">Unrealized Earning : '.$un_earning.'</td><td style="width:33%;padding-top:30px;">Open Orders : '.$openOrders.'</td><td style="width:33%;padding-top:30px;">Open Trades : '.$openTrades.'</td></tr><tr style="width:100%;margin-top:15px;"><td style="width:33%;padding-top:30px;">Daily Goal : '.$dg.'</td><td style="width:33%;padding-top:30px;">Monthly Goal : '.$mg.'</td><td style="width:33%;padding-top:30px;">Annual Goal : '.$ag.'</td></tr><tr style="width:100%;margin-top:15px;"><td style="width:33%;padding-top:30px;">Today Profit : '.$tdpro.'</td><td style="width:33%;padding-top:30px;">Weekly Profit : '.$wkpro.'</td><td style="width:33%;padding-top:30px;">Monthly Profit : '.$monPro.'</td></tr><tr style="width:100%;margin-top:15px;"><td style="width:33%;padding-top:30px;">Half Year Profit : '.$hyPro.'</td><td style="width:33%;padding-top:30px;">Yearly Profit : '.$ypro.'</td><td style="width:33%;padding-top:30px;">Total Profit : '.$tppro.'</td></tr></table>';

$html2pdf->writeHTML($data);

echo $html2pdf->output('summary.pdf','D');



?>