I am trying shows pdf summary to user before download. There is pdf detail page to shows user pdf cover image, name, description, price, summary and buy now button.
Here's user wants to read summary of report then click on summary button and open model to read embed pdf. After read summary he wants to buy then will click on buy now button.
So, i want show only 2 pdf page on summary button. There is summary and buy now pdf report is same.
I tryed show summary of report, but there is show full pdf.
Here's my code below:-
public function raReportDetail($id){
$reportdetail = '';
$result = $this->connect()->query("SELECT * FROM wm_report WHERE id='$id'");
if($result->num_rows>0){
$row=$result->fetch_assoc();
$reportdetail ='
<div class="col-lg-4 col-md-4 col-sm-12">
<div class="large-5 column">
<div class="xzoom-container">
<img class="img-fluid" src="cover_images/'.$row['cover_img'].'">
</div>
</div>
</div>
<div class="col-lg-8 col-md-8 col-sm-12">
<div class="content-report-detail">
<div class="large-12 column">
<h3>'.$row['name'].'</h3>
</div>
<hr>
<div class="price-wrap">
<h3>Price: <i class="fa fa-rupee"></i> '.$row['price'].'/- </h3>
</div>
<div class="large-7 product-detail">
<p style="text-align: justify;">'.$row['description'].'</p>
<div class="ro-options">
<div class="no-row">
<div class="cart-btn-price">
<ul>
<li>
<a href="" data-toggle="modal" data-target="#Summary"> Summary </a> </li>
<li>
<a href="buy-report.php?id='.$row['id'].'"> Buy Now </a>
</li>
</ul>
</div>
</div>
<div class="sku-code">
<span class="posted_in">Categary: '.$row['category'].'</span>
|
<span class="posted_in">SKU Code : '.$row['sku'].'</span>
</div>
</div>
</div>
</div>
</div>
<div id="Summary" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 style="display: contents;">Summary of '.$row['name'].'</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<embed src="report/'.$row['report'].'" frameborder="0" width="100%" height="400px">
</div>
</div>
</div>
</div>
';
}else{
$reportdetail = 'Something Went Wrong';
}
return $reportdetail;
}