mpdf invoice not generating as I want it - php

This is the coding I am using to generate pdf invoice, I am using jquery to load div content of a php page inside $html, but it is not loading at all. I tried using hidden fields and javascript but none are working.
<?php
include("mpdf/mpdf.php");
$mpdf=new mPDF('win-1252','A4','','',20,15,48,25,10,10);
$mpdf->useOnlyCoreFonts = true; // false is default
$mpdf->SetProtection(array('print'));
$mpdf->SetTitle("Acme Trading Co. - Invoice");
$mpdf->SetAuthor("Acme Trading Co.");
$mpdf->SetWatermarkText("Paid");
$mpdf->showWatermarkText = true;
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->watermarkTextAlpha = 0.1;
$mpdf->SetDisplayMode('fullpage');
$html = '
<html>
<head>
<style>
body {font-family: sans-serif;
font-size: 10pt;
}
p { margin: 0pt;
}
td { vertical-align: top; }
.items td {
border-left: 0.1mm solid #000000;
border-right: 0.1mm solid #000000;
}
table thead td { background-color: #EEEEEE;
text-align: center;
border: 0.1mm solid #000000;
}
.items td.blanktotal {
background-color: #FFFFFF;
border: 0mm none #000000;
border-top: 0.1mm solid #000000;
border-right: 0.1mm solid #000000;
}
.items td.totals {
text-align: right;
border: 0.1mm solid #000000;
}
</style>
</head>
<body>
<!--mpdf
<htmlpageheader name="myheader">
<table width="100%"><tr>
<td width="50%" style="color:#0000BB;"><span style="font-weight: bold; font-size: 14pt;">Acme Trading Co.</span><br />123 Anystreet<br />Your City<br />GD12 4LP<br /><span style="font-size: 15pt;">☎</span> 01777 123 567</td>
<td width="50%" style="text-align: right;">Invoice No.<br /><span style="font-weight: bold; font-size: 12pt;">0012345</span></td>
</tr></table>
</htmlpageheader>
<htmlpagefooter name="myfooter">
<div style="border-top: 1px solid #000000; font-size: 9pt; text-align: center; padding-top: 3mm; ">
Page {PAGENO} of {nb}
</div>
</htmlpagefooter>
<sethtmlpageheader name="myheader" value="on" show-this-page="1" />
<sethtmlpagefooter name="myfooter" value="on" />
mpdf-->
<div style="text-align: right">Date: '.date('jS F Y').'</div>
<table width="100%" style="font-family: serif;" cellpadding="10">
<tr>
<td width="45%" style="border: 0.1mm solid #888888;"><span style="font-size: 7pt; color: #555555; font-family: sans;">SOLD TO:</span><br /><br />345 Anotherstreet<br />Little Village<br />Their City<br />CB22 6SO</td>
<td width="10%"> </td>
<td width="45%" style="border: 0.1mm solid #888888;"><span style="font-size: 7pt; color: #555555; font-family: sans;">SHIP TO:</span><br /><br />345 Anotherstreet<br />Little Village<br />Their City<br />CB22 6SO</td>
</tr>
</table>
**<div style="font-size:9px" id="serviced"><b>Service :</b></div>
<script type="text/javascript">
$(document).ready(function(){
$("#serviced").load("http://website.com/service.php #serviced")
})
</script>**
<div style="font-size:9px" id="tratyped"><b>Type of Transport :</b></div>
<div style="font-size:9px" id="custyped"><b>Type of Client</b></div>
<div style="font-size:9px" id="datepickerd"><b>Date :</b></div>
<div style="font-size:9px;display:none" id="timed"><b>Time :</b></div>
<div style="font-size:9px" id="departured"><b>Departure Address :</b></div>
<div style="font-size:9px" id="destinationd"><b>Arrival Address</b></div>
<div style="font-size:9px" id="passengerd"><b>No. of Passengers :</b></div>
<div style="font-size:9px" id="shairwelld"><b>No. of Chariwells :</b></div>
<div style="font-size:9px" id="babycd"><b>No. of Baby Chairs :</b></div>
<div style="font-size:9px" id="companiond"><b>No. of Companions :</b></div>
<div style="font-size:9px" id="luggaged"><b>No. of Luggages :</b></div>
<div style="font-size:9px" id="petd"><b>No. of Pets :</b></div>
<div style="font-size:9px" id="waitingd"><b>Waiting Time :</b></div>
<div style="font-size:9px" id="insuranced"><b>Insurance :</b></div>
<div style="font-size:9px" id="stopd"><b>Stop in Way :</b></div>
<div style="font-size:9px" id="dis"><b>Distance(app) :</b></div>
<div style="font-size:9px" id="tim"><b>Time(app) :</b></div>
<div style="font-size:9px" id="ht"><b>PRICE (HT) :</b></div>
<div style="font-size:9px" id="vat"><b>VAT :</b></div>
<div style="font-size:9px" id="ttc"><b>PRICE (TTC) :</b></div>
<div style="text-align: center; font-style: italic;">Payment terms: payment due in 28 days</div>
</body>
</html>
';
$mpdf->WriteHTML($html);
$mpdf->Output(); exit;
exit;
?>
I have bolded out the code where I am facing problem.
**<div style="font-size:9px" id="serviced"><b>Service :</b></div>
<script type="text/javascript">
$(document).ready(function(){
$("#serviced").load("http://website.com/service.php #serviced")
})
</script>**
I am trying to load the div content of a php page inside the $html in the above code, but it is not loading. I have tried everything I could but no luck so far.
Please help me with the code or suggestions.
Thanks!

Look at the documentation : http://mpdf1.com/manual/index.php
The JavaScript is not supported.
Parse your page for retrieve your #service (I can advising you this parser http://simplehtmldom.sourceforge.net/)
And then, just implement your text inside your HTML.
That can be like that :
Start by including the both library : mpdf & simplehtmldom.
include("mpdf/mpdf.php");
include("simple_html_dom.php");
Then for having the correct part of your page :
$html = file_get_html('http://yoururl.tld/');
$serviced = $html->find('div[id=serviced]', 0)->plaintext;
Then generate your PDF :
$mpdf = new mPDF('win-1252','A4','','',20,15,48,25,10,10);
... // Configure your PDF like you used to
$html = '<your html before the #serviced part>';
$html .= $serviced;
$html .= '</your html after the #serviced part>';
$mpdf->WriteHTML($html);
$mpdf->Output();
And tadaaaaa

Related

How do I define 'id'

Before anyone judges my coding, just know that I'm still learning the basics.
I'm facing an issue within my page which states as such:
Warning: Undefined array key "id" in C:\xampp\htdocs\Project\POLIMAS
Treatment Center\POLIMAS Treatment Center\ma\write-report.php on line
11
a screenshot of the error
I want to know how to solve this issue, now to make my question more understandable I will include the coding, I know it's most likely not secure, I need to finish my project by tomorrow, so I just want to solve this issue.
I have two pages, one which will direct towards this form, and another, that displays this form.
For the page that will direct the users towards the form, the coding is as follows:
<?php
require('database.php');
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Appointments</title>
<link rel="stylesheet" href="../css/dashboard.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<style>
<!--.btn{
background-color: red;
border: none;
color: white;
padding: 2px 2px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 40px;
margin: 4px 2px;
cursor: pointer;
border-radius: 20px;
}-->
#appointment {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#appointment td, #appointment th {
border: 1px solid #7e7f81;
padding: 8px;
}
#appointment tr:nth-child(even){background-color: #8399bb;}
#appointment tr:hover {background-color: #7e7f81;}
#appointment th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #69649b;
color: white;
}
</style>
<body>
<div class="wrapper">
<div class="header">
<img src="../images/POLIMAS Treatment Center.png" width="50%" height="100%" alt=""/></div>
<div class="sidebar">
<nav>
<ul>
<?php
$count=1;
$sel_query="Select * from ma";
$naem = mysqli_query($link,$sel_query);
while($row = mysqli_fetch_assoc($naem)){
?>
<li><a href="home-ma.php" class="logo">
<img src="../images/grid-img6.png" alt="logo">
<span class="nav-item"><?php echo $row["maName"]; ?></span>
</a></li>
<?php }?>
<li><a href="ma-appoiment.php">
<i class="fa fa-history"></i>
<span class="nav-iteam">View Appoiment</span>
</a></li>
<li><a href="ma-report.php">
<i class="fa fa-edit"></i>
<span class="nav-iteam">Report</span>
</a></li>
<li><a href="../index.html" class="logout">
<i class="fa fa-sign-out"></i>
<span class="nav-iteam">Logout</span>
</a></li>
</ul>
</nav>
</div>
<div class="content">
<center>
<!-- TABLE TOP ROW HEADINGS-->
<h1>Student Appointment</h1>
<table id="appointment" style="width:100%">
<tr>
<th>Appointment ID</th>
<th>Matrics Number</th>
<th>Appointment Status</th>
<th>Report</th>
<th>Delete</th>
</tr>
<?php
$count=1;
$sel_query="Select * from appointment";
$result = mysqli_query($link,$sel_query);
while($row = mysqli_fetch_assoc($result)){
?>
<tr>
<td align="center">
<?php echo $row["appID"]; ?></td>
<td align="center">
<?php echo $row["matricsNo"]; ?></td>
<td align="center"><?php if($row['appDecline']=="1")
echo "Approved";
else if($row['appDecline']=="2")
echo "Dissaproved";
else
echo "Pending"
?>
</td>
<td align="center"><i class="fa fa-book"></i>Write Report</td>
<td align="center"><a href="delete.php?id=<?php echo $row['appID']?>"
onclick="return confirm('Are you sure to delete this record?')"><i class="fa fa-trash"></i> Remove</a></td>
</tr><?php } ?>
</table>
</center>
</div>
<div class="footer">Content for class "footer" Goes Here</div>
</div>
</body>
</html>
The error states that my 'id' was not defined, however in line 130, I am pretty sure I already stated it </td>
For the page which display the form, the coding is as follows:
<?php
ini_set('display_errors', 1);
ini_set('log_errors',1);
error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
require ('../database.php');
if($link){
$sql = mysqli_query($link, "SELECT *
FROM appointment
WHERE appID = '" . $_REQUEST['id'] . "'");
$row = mysqli_fetch_array($sql);
}
else{
die("Error: Could not CONNECT." . mysqli_error($link));
}
if(isset($_POST['update'])){
$update = mysqli_query($link, "UPDATE appointment
SET studMeds = '" . $_REQUEST['studMeds'] ."',
maNotes = '" . $_REQUEST['maNotes'] . "'
WHERE appID = '" . $_REQUEST['id'] . "'");
header("Location: write-report.php");
}
mysqli_close($link);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Report</title>
<link rel="stylesheet" href="../css/dashboard.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<style type="text/css">
.form-style-5{
max-width: 500px;
padding: 10px 20px;
background: #f4f7f8;
margin: 10px auto;
padding: 20px;
background: #f4f7f8;
border-radius: 8px;
font-family: Georgia, "Times New Roman", Times, serif;
}
.form-style-5 fieldset{
border: none;
}
.form-style-5 legend {
font-size: 1.4em;
margin-bottom: 10px;
}
.form-style-5 label {
display: block;
margin-bottom: 8px;
}
.form-style-5 input[type="text"],
.form-style-5 input[type="date"],
.form-style-5 input[type="datetime"],
.form-style-5 input[type="email"],
.form-style-5 input[type="number"],
.form-style-5 input[type="search"],
.form-style-5 input[type="time"],
.form-style-5 input[type="url"],
.form-style-5 textarea,
.form-style-5 select {
font-family: Georgia, "Times New Roman", Times, serif;
background: rgba(255,255,255,.1);
border: none;
border-radius: 4px;
font-size: 15px;
margin: 0;
outline: 0;
padding: 10px;
width: 100%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
background-color: #e8eeef;
color:#8a97a0;
-webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.03) inset;
box-shadow: 0 1px 0 rgba(0,0,0,0.03) inset;
margin-bottom: 30px;
}
.form-style-5 input[type="text"]:focus,
.form-style-5 input[type="date"]:focus,
.form-style-5 input[type="datetime"]:focus,
.form-style-5 input[type="email"]:focus,
.form-style-5 input[type="number"]:focus,
.form-style-5 input[type="search"]:focus,
.form-style-5 input[type="time"]:focus,
.form-style-5 input[type="url"]:focus,
.form-style-5 textarea:focus,
.form-style-5 select:focus{
background: #d2d9dd;
}
.form-style-5 select{
-webkit-appearance: menulist-button;
height:35px;
}
.form-style-5 .number {
background: #353185;
color: #fff;
height: 30px;
width: 30px;
display: inline-block;
font-size: 0.8em;
margin-right: 4px;
line-height: 30px;
text-align: center;
text-shadow: 0 1px 0 rgba(255,255,255,0.2);
border-radius: 15px 15px 15px 0px;
}
.form-style-5 input[type="submit"],
.form-style-5 input[type="button"]
{
position: relative;
display: block;
padding: 19px 39px 18px 39px;
color: #FFF;
margin: 0 auto;
background: #353185;
font-size: 18px;
text-align: center;
font-style: normal;
width: 100%;
border: 1px solid #16a085;
border-width: 1px 1px 3px;
margin-bottom: 10px;
}
.form-style-5 input[type="submit"]:hover,
.form-style-5 input[type="button"]:hover
{
background: #2a2769;
}
</style>
<div class="wrapper">
<div class="header">
<img src="../images/POLIMAS Treatment Center.png" width="50%" height="100%" alt=""/></div>
<div class="sidebar">
<nav>
<ul>
<li><a href="home-ma.php" class="logo">
<img src="../images/grid-img6.png" alt="logo">
<span class="nav-item">Medical Assistant</span>
</a></li>
<li><a href="ma-appoiment.php">
<i class="fa fa-history"></i>
<span class="nav-iteam">View Appoiment</span>
</a></li>
<li><a href="ma-report.php">
<i class="fa fa-edit"></i>
<span class="nav-iteam">Report</span>
</a></li>
<li><a href="../index.html" class="logout">
<i class="fa fa-sign-out"></i>
<span class="nav-iteam">Logout</span>
</a></li>
</ul>
</nav>
</div>
<div class="form-style-5">
<form action="" method="POST">
<fieldset>
<legend>Student Appointment Report</legend>
<input type="hidden" name="new" value="1" />
<input type="text" name="appID" size="6" value="<?php echo $row['appID'];?>" disabled>
<input type="text" name="matricsNo" size="6" value="<?php echo $row['matricsNo'];?>" disabled>
<input type="text" name="appTime" size="6" value="<?php echo $row['appTime'];?>" disabled>
<input type="text" name="appStatus" size="6" value="<?php echo $row['appStatus'];?>" disabled>
<input type="text" name="studMeds" size="6" placeholder="Medication Used">
</fieldset>
<input type="submit" name="update" value="Complete Report" />
</form>
</div>
<div class="footer">Content for class "footer" Goes Here</div>
</div>
</body>
</html>
The error which lies on the 11th line is this:
$sql = mysqli_query($link, "SELECT *
FROM appointment
WHERE appID = '" . $_REQUEST['id'] . "'");
Why is my 'id' key undefined? I thought that I declared it on the previous page with </td>. My other pages face no error such as this one, and they're identical as well. Please, help me solve this issue, I'm pretty sure I made the question very clear.

HTML to PDF first page Blank

I'm converting HTML to PDF and its working fine but the issue is when I generate PDF first page of PDF is blank. All records are set from second page of that PDF.
I'm Using Codeigniter framework.And using below package
#package Html2pdf
* #author Laurent MINGUET <webmaster#html2pdf.fr>
* #copyright 2017 Laurent MINGUET
Below is the code which doing all that.
try {
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output($pdfname.'.pdf','D');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}
Below is html content
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="x-apple-disable-message-reformatting">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Invoice</title>
<style type="text/css">
body {background-color: rgb(204,204,204); margin: 0; padding: 0;}
.header {margin-bottom: 40px;}
/*.header div {width: 700px;}*/
.text-right {text-align: right;}
.table-value td { border-bottom: 1px solid #e7ecf1;
border-right: 1px solid #e7ecf1;
border-left: 1px solid #e7ecf1;}
.table-value th{ border-top: 1px solid #e7ecf1;
border-bottom: 2px solid #c8c8c8;
border-right: 1px solid #e7ecf1;
border-left: 1px solid #e7ecf1;}
</style>
</head>
<body>
<!-- <page size="A4"> -->
<div class="header">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="width: 100%; font-size: 11pt;">
<tr>
<td colspan="1" style="width: 360px;">
<img src="http://test.com/assets/image-2019-05-13-16-32-28-565.png" style="width: 60%;">
</td>
<td colspan="1" valign="middle" style=" text-align: right; width: 350px;">
<p style="margin: 0;">Test</p>
<p style="margin: 0;">Test</p>
<p style="margin: 0;">Test</p>
</td>
</tr>
</table>
</div>
<div class="content">
<div class="content-box" style="padding-bottom: 30px; border-bottom: 1px solid #000; margin-bottom: 50px;">
<p style="color: #d71383;font-size: 36px;margin-bottom: 10px;">Test</p>
<p></p>
<div style="line-height: 20px;">
<div style="margin-top: 0px;margin-bottom: 0px;" id="client-name">Test: <span>##COMPANYNAME##</span></div>
<div style="margin-top: 0px;margin-bottom: 0px;" id="client-contact">Test: <span>##USERNAME##</span></div>
<div style="margin-top: 0px;margin-bottom: 0px;" id="client-email">E-mail: <span>##EMAIL##</span></div>
<p></p>
<div style="margin-top: 0px;margin-bottom: 0px;" id="uren-periode">Test: <span>##FROMDATETODATE## </span></div>
<div style="margin-top: 0px;margin-bottom: 0px;" id="datum">Test: <span>##TODAYDATE##</span></div>
<div style="margin-top: 0px;margin-bottom: 0px;" id="total-aantal-uren">Total: <span>##HOURMIN##</span></div>
<div style="margin-top: 0px;margin-bottom: 0px;" id="hourly-rate">Test: <span>##HOURLYRATE##</span></div>
</div>
</div>
<div class="table-value-box">
<div class="table-responsive">
<table class="table-value" width="100%" cellspacing="0" cellpadding="0" role="presentation" style="max-width: 800px;margin: 0 auto; font-size: 11pt;">
<thead>
<tr>
<th style="width: 60px;text-align: center;vertical-align: middle;line-height: 5px; height: 25px;"><span>Ticket #</span></th>
<th style="width: 100px;text-align: center;vertical-align: middle;line-height: 5px; height: 25px;"><span>Datum</span></th>
<th style="width: 288px;text-align: center;vertical-align: middle;line-height: 5px; height: 25px;"><span>Onderwerp</span></th>
<th style="width: 158px;text-align: center;vertical-align: middle;line-height: 5px; height: 25px;"><span>Tijd</span></th>
<th style="width: 100px;text-align: center;vertical-align: middle;line-height: 5px; height: 25px;"><span>Status</span></th>
</tr>
</thead>
<tbody>
##DATA##
</tbody>
</table>
</div>
</div>
</div>
<!-- </page> -->
</body>
</html>
Any Help will be appreciated.
Without calling the constructor twice, Try the following :
try {
$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', [2, 2, 2, 5]);
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output($pdfname.'.pdf','D');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}
Also the number of pages and placement of page breaks depends highly on the structure of your html content. An empty <page> tag or a misplaced <div> could also create troubles while using html2pdf.
Incase the above solution doesn't workout , please post sample html document content, esp.the first few lines from the source of the browser, will try to help

How to update Dompdf header and footer in HTML

I am trying to display client details as a pdf using dompdf from HTML. Also added a header and footer in the pdf. Some contents in the pdf are displayed under the footer section.
This is the Image of pdf generated, here the data under Other Details are displayed under the footer section. How can change the alignment of content into the next page with a header and footer?
This is the code have written, give a solution
<html>
<head>
<title>Prescription</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
padding: 0;
margin: 0;
font-family: "Times New Roman", Times, serif;
}
header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 200px;
padding: 10px 50px;
background-color: #ccc;
border-bottom: 1px solid #1f1f1f;
z-index: 1000;
}
.text-center {
text-align: center;
}
.phone {
float: right;
margin-bottom: 10px;
margin-right: 150px;
}
.phone h4 {
text-align: center;
right: 50px;
}
main {
margin-top: 200px;
padding: 10px 50px;
}
.after-header {
height: 30px;
padding: 10px 0;
}
.patient-id {
float: left;
}
.date-day {
float: right;
}
.page-header {
margin-top: 5px;
padding: 5px;
background-color: aqua;
}
.page-header h2 {
font-family: monospace;
font-size: 20px;
text-align: center;
}
footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 50px;
border-bottom: 1px solid #1f1f1f;
border-top: 1px solid #1f1f1f;
z-index: 1000;
}
footer h3 {
padding-left: 50px;
}
.details {
margin-top: 0;
padding: 2px 0;
}
table {
margin: 5px 0;
width: 100%;
border-top: 1px dotted #1f1f1f;
border-right: 1px dotted #1f1f1f;
}
td {
text-align: justify;
padding: 10px;
border-bottom: 1px dotted #1f1f1f;
border-left: 1px dotted #1f1f1f;
}
table tr>td:first-child {
border-left: none;
}
label {
font-weight: bold;
font-size: 15px;
}
</style>
</head>
<body>
<header>
<div class="text-center">
<h1>SPECIALITY CLINIC</h1>
<h2>xxxxxxxx</sub>
</h2>
<h3>Pediatrition</h3>
</div>
<div class="phone">
<h4>Phone: xxxxx</h4>
</div>
</header>
<footer>
<h3>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.</h3>
</footer>
<main>
<div class="after-header">
<div class="patient-id">
<h3>Patient Id: 1001</h3>
</div>
<div class="date-day">
<h3>Date: 17/05/2019</h3>
</div>
</div>
<div class="page-header">
<h2>Patient Details</h2>
<hr>
</div>
<div class="details">
<div>
<div style="background-color: #f2f2f2; padding: 5px;">
<h3>General Details</h3>
</div>
</div>
<table>
<col width="10%">
<col width="20%">
<col width="10%">
<col width="10%">
<col width="30%">
<tr>
<td><label>Name:</label></td>
<td colspan="3"><label>Agreesh V S</label></td>
<td rowspan="4"><img src="img.jpg"></td>
</tr>
<tr>
<td><label>Age:</label></td>
<td><label>24</label></td>
<td><label>Gender: </label></td>
<td><label>Male</label></td>
</tr>
<tr>
<td><label>Phone: </label></td>
<td colspan="3"><label>9876543210</label></td>
</tr>
<tr>
<td><label>Email: </label></td>
<td colspan="3"><label>9876543210</label></td>
</tr>
</table>
<div>
<div style="background-color: #f2f2f2; padding: 5px;">
<h3>Personal Details</h3>
</div>
</div>
<table>
<col width="50%">
<col width="50%">
<tr>
<td><label>Date Of Birth:</label></td>
<td colspan="3"><label>18/04/1995</label></td>
</tr>
<tr>
<td><label>Weight</label></td>
<td><label>65 KG</label></td>
</tr>
<tr>
<td><label>Weight at Birth </label></td>
<td colspan="3"><label>2.5 KG</label></td>
</tr>
<tr>
<td><label>Blood Group </label></td>
<td colspan="3"><label>B+ve</label></td>
</tr>
</table>
<div>
<div style="background-color: #f2f2f2; padding: 5px;">
<h3>Other Details</h3>
</div>
</div>
<table>
<col width="50%">
<col width="50%">
<tr>
<td><label>Date Of Birth:</label></td>
<td colspan="3"><label>18/04/1995</label></td>
</tr>
<tr>
<td><label>Weight</label></td>
<td><label>65 KG</label></td>
</tr>
<tr>
<td><label>Weight at Birth </label></td>
<td colspan="3"><label>2.5 KG</label></td>
</tr>
<tr>
<td><label>Blood Group </label></td>
<td colspan="3"><label>B+ve</label></td>
</tr>
</table>
</div>
</main>
</body>
</html>
Keep in mind that when Dompdf positions content it is based on the bounds of the body. If you have a header/footer on the page you need to push it outside the bounds of the body or it will overlap the document content.
A small tweak to your CSS should fix things. First, add a page margin to accommodate your header. Something along the lines of:
#page {
margin: 220px 1in 1in 1in;
}
Then modify the top positioning of your header to push it into that space:
header {
position: fixed;
top: -200px;
left: 0;
right: 0;
height: 200px;
padding: 10px 50px;
background-color: #ccc;
border-bottom: 1px solid #1f1f1f;
z-index: 1000;
}

How to send bulk email by click button at one time using codeigniter

How to send bulk email by clicking button at one time using codeigniter...I got an error while doing bulk email in codeigniter.I need to rectify this one..i need help for this problem
This is my controller
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Send_all extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->helper('url');
$this->load->database();
$this->load->library(array('session', 'form_validation'));
$this->load->model('user_model');
$this->load->model('Gst_model');
$this->load->model('Report_model');
}
public function index($email_cript, $vendor_id)
{
$VendorEmail = base64_decode($email_cript);
$this->db->where('VendorEmail', $VendorEmail);
$query=$this->db->get('gst_vendormaster');
$cust_details= $query->result();
$data['cust_details'] = $cust_details;
//$mail_to = "$VendorEmail";
//$mail_count= count($mail_to);
$to_mail = explode(',', $VendorEmail);
$mail_count= count($to_mail);
for($VendorEmail=0;$VendorEmail < $mail_count;$VendorEmail++)
{
$data['VendorEmail'] = $cust_details[0]->VendorEmail;
print_r($VendorEmail);
$config = array(
'protocol' => 'sendmail',
'mailtype' => 'html',
'charset' => 'UTF-8',
);
$this->load->library('email');
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->set_mailtype("html");
$mail_id = TRIM($to_mail[$VendorEmail]);
$message =
'<p> </p>
<table class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;" border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#f6f6f6">
<tbody>
<tr>
<td style="font-family: sans-serif; font-size: 14px; vertical-align: top;" valign="top"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13.3333px;"> </span></span></td>
<td class="container" style="font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; margin: 0 auto !important; max-width: 580px; padding: 10px; width: 580px;" valign="top" width="580">
<div class="content" style="box-sizing: border-box; display: block; margin: 0 auto; max-width: 580px; padding: 10px;">
<table class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; box-shadow: 0px 2px 18px 0px rgba(0,0,0,2); width: 100%; background: #fff; border-radius: 3px;" border="0" width="100%">
<tbody>
<tr>
<td class="wrapper" style="font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;" valign="top">
<table style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="font-family: sans-serif; font-size: 14px; vertical-align: top;" valign="top">
<p><img src="http://www.miisky.com/ci/GST.png" alt="" width="85" height="84" /> <strong>GST - IMPLEMENTATION <img src="http://www.aarmsvaluechain.com/images/value-chain.png" alt="" width="98" height="84" /> </strong></p>
<p>Dear Sir / Madam,</p>
<p>As you are aware, the Government of India introduced Good and Service Tax (“GST”) in August, 2016 which will subsume the existing indirect taxes in India such as value added tax (“VAT”), service tax, central excise, entertainment tax, entry tax etc.. </p>
<p>As part of the GST regime, various state governments have initiated the GST enrolment process of existing VAT taxpayer registered with various State VAT departments. Accordingly, we would request you to confirm if you have completed the enrolment process and obtained the provisional ID from relevant State VAT department. In the event, the enrolment process is yet to commence in State in which you are registered as a VAT taxpayer, we would request you to confirm the receipt of the provisional ID at the earliest possible.</p>
<p>The process of enrolment and obtaining provisional IDs from State VAT department is provided on http://tutorial.gst.gov.in/video/module/index.html. </p>
<p>We have already have got the Provisional Registration Certificate and details of the same is provided below.</p>
<!--Left off format-->
<table cellpadding="5px" align="center" border="4">
<tbody>
<tr><th>Name of the Assesse</th><th>Provisional ID</th></tr>
<tr>
<td>Emerson Process Management Chennai Private Limited</td>
<td>33AAACF0483F1Z3</td>
</tr>
</tbody>
</table>
<p>We would also request you to identify and ascertain the HSN (Harmonized System of Nomenclature) number of the products supplied to us under the Agreement. Under the model GST laws, HSN code of the product must be mentioned in the invoice issued by you..</p>
<p>Separately, with the introduction of GST and model GST laws, the existing agreement needs be amended to incorporate for fresh/ revised covenants and obligations considering GST laws, and regarding revised commercials, as the parties may mutually decide. Accordingly, discussions in this regard would be initiated in due course.</p>
<p>We request you to provide your Provisional id details as per the below format:</p>
<table style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: auto;" border="0" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td style="font-family: sans-serif; font-size: 14px; vertical-align: top; background-color: #00ff99; border-radius: 0px; text-align: center;" align="center" valign="top" bgcolor="#00ff99"><a style="display: inline-block; color: #ffffff; width: 500px; background-color: #00ff99; border: solid 1px #00ff99; border-radius: 5px; box-shadow: 0px 2px 18px 0px rgba(0,0,0,0.5); box-sizing: border-box; cursor: pointer; text-decoration: none; font-size: 14px; font-weight: bold; margin: 0; padding: 12px 25px; text-transform: capitalize; border-color: #00ff99;" title="GSTN Number Updation" href="http://www.miisky.com/ci/index.php/Customerlink/vendorRecive/'.$vendor_id.'"><span style="color: #000000; font-family: Arial, Helvetica, sans-serif;">Click to view the GSTN Updation form</span></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>We hereby authorize M/S. Arms Value Chain Private Limited to collect and consolidate GST Registration details and request you to please share the details to them.</p>
<p>We look forward to your full support in smooth transition to the GST regime.</p>
<br />
<p>Best Regards,</p>
<p>S Hariharan <br /> Emerson Process Management Chennai Pvt. Ltd | 147, Rajiv Gandhi Salai (OMR) | Karapakkam Village | Chennai | 600097 | INDIA <br /> T +91 44 4903 4373 | F +91 44 4903 4400 <br /> hariharan.s#Emerson.com
<p>CIN:U93090TN 1985 PTC 024245</p>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<div class="footer" style="clear: both; padding-top: 10px; text-align: center; width: 100%;">
<table style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="content-block" style="font-family: sans-serif; vertical-align: top; padding-top: 10px; padding-bottom: 10px; font-size: 12px; color: #999999; text-align: center;" align="center" valign="top"><span style="color: #000000; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13.3333px;"><span class="apple-link" style="color: #000000; font-size: 12px; text-align: center;"><strong>Powered by:AARMS value chain pvt ltd</strong></span> <br /><br /></span></span></td>
</tr>
<tr>
<td class="content-block powered-by" style="font-family: sans-serif; vertical-align: top; padding-top: 10px; padding-bottom: 10px; font-size: 12px; color: #999999; text-align: center;" align="center" valign="top"><span style="color: #000000; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13.3333px;"> </span></span></td>
</tr>
</tbody>
</table>
</div>
<p><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13.3333px;"> </span></span></p>
<div> </div>';
$from_mail = 'your#vendor.com';
$from_name = 'GST-MIISKY';
$reply_to = 'innovations#miisky.com';
$subject = "Online GSTIN Updation!";
//$file_name = $datamail['varafile'];
//$path = realpath('uploads/abstract');
// Read the file content
//$file = $path . '/' . $file_name;
$this->load->library('email', $config);
$this->email->from($from_mail, $from_name);
$this->email->to($mail_id);
$this->email->cc('innovations#miisky.com');
$this->email->subject($subject);
$this->email->message($message);
//$this->email->attach($file);
}
if ($this->email->send()) {
$this->session->set_flashdata('msg','<div class="alert alert-success text-center">Mail Succesfully Sent!</div>');
redirect('Vendor_retrieve');
}
}
}
This is my view page
<?php $firm_name = $this->session->userdata('firm_name');
if(!isset($firm_name)){ redirect ('Welcome');}
?>
<link href="<?php echo base_url("assets/css/radiostyle.css"); ?>" rel="stylesheet">
<head>
<style type="text/css">
#import url("http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css");
/*
FORM STYLING
*/
#fileselector {
margin: 10px;
}
#upload-file-selector {
display:none;
}
.margin-correction {
margin-right: 10px;
}
.page-heading {
border-top: 0;
padding: 0px 10px 10px 10px;
}
input, button, select, textarea{
margin: 10px;
}
.ibox-content {
background-color: #ffffff;
color: inherit;
padding: 15px 20px 20px 20px;
border-color: #e7eaec;
border-image: none;
border-style: none;
border-width: 1px 0px;
}
.filterable {
margin-top: 10px;
}
.filterable .panel-heading .pull-right {
margin-top: -20px;
}
.filterable .filters input[disabled] {
background-color: transparent;
border: none;
cursor: auto;
box-shadow: none;
padding: 0;
height: auto;
}
.filterable .filters input[disabled]::-webkit-input-placeholder {
color: #333;
}
.filterable .filters input[disabled]::-moz-placeholder {
color: #333;
}
.filterable .filters input[disabled]:-ms-input-placeholder {
color: #333;
}
.form-control, .single-line {
width: 90%;
}
.btn-group-xs>.btn, .btn-xs {
padding: 0px 15px;
line-height: 1;
}
.btn {
border-radius: 3px;
}
.btn-info {
background-color: #ffffff;
border-color: #ffffff;
color: #191717;
font-weight: bolder;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
</style>
</head>
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-12 text-center">
<h1>GST - Vendor</h1>
</div>
</div>
<br><div style="text-align: center;">
<label class="control control--radio">Vendor
<input type="radio" onclick="document.location='<?php echo base_url(); ?>index.php/Vendor_retrieve';" name="radio1" checked="checked" />
<div class="control__indicator"></div>
</label>
<label class="control control--radio">Customer
<input type="radio" onclick="document.location='<?php echo base_url(); ?>index.php/Customer_retrieve';" name="radio2" />
<div class="control__indicator"></div>
</label>
<label class="control control--radio">Product
<input type="radio" onclick="document.location='<?php echo base_url(); ?>index.php/Product_retrieve';" name="radio3" />
<div class="control__indicator"></div>
</label>
<label class="control control--radio">Item
<input type="radio" onclick="document.location='<?php echo base_url(); ?>index.php/Item_retrieve';" name="radio4" />
<div class="control__indicator"></div>
</label>
<label class="control control--radio">Rate
<input type="radio" onclick="document.location='<?php echo base_url(); ?>index.php/Category_retrieve';" name="radio5" />
<div class="control__indicator"></div>
</label>
<label class="control control--radio">Location
<input type="radio" onclick="document.location='<?php echo base_url(); ?>index.php/Vendorlocation';" name="radio6" />
<div class="control__indicator"></div>
</label>
</div>
<div class="fh-breadcrumb">
<div class="full-height">
<div class="full-height-scroll white-bg border-left">
<?php echo $this->session->flashdata('msg'); ?>
<?php echo $this->session->flashdata('message'); ?>
<div class="element-detail-box">
<div class="table-responsive">
<table class='table table-bordered'>
<thead>
<tr>
<th> # </th>
<th> VendorID </th>
<th> VendorCode </th>
<th> VendorName </th>
<th> VendorEmail </th>
<th> VendorMobile </th>
<th> VendorAddress </th>
<th> Department </th>
<th> Division </th>
<th> State </th>
<th> City </th>
<th> CST_NO </th>
<th> TIN_NO </th>
<th> VAT_NO </th>
<th> SGST_NO </th>
<th> CGST_NO </th>
<th> IGST_NO </th>
<th> MSME_RegNO </th>
<th> MSME_Category </th>
<th> Send Mail</th>
<th> Edit </th>
<th> Delete </th>
</thead>
<tbody>
<?php for ($i = 0; $i < count($catlist); ++$i) { ?>
<tr>
<td><?php echo ($i+1); ?></td>
<td><?php echo $catlist[$i]->VendorID; ?></td>
<td><?php echo $catlist[$i]->VendorCode; ?></td>
<td><?php echo $catlist[$i]->VendorName; ?></td>
<td><?php echo $catlist[$i]->VendorEmail; ?></td>
<td><?php echo $catlist[$i]->VendorMobile; ?></td>
<td><?php echo $catlist[$i]->VendorAddress; ?></td>
<td><?php echo $catlist[$i]->Department; ?></td>
<td><?php echo $catlist[$i]->Division; ?></td>
<td><?php echo $catlist[$i]->State; ?></td>
<td><?php echo $catlist[$i]->City; ?></td>
<td><?php echo $catlist[$i]->CST_NO; ?></td>
<td><?php echo $catlist[$i]->TIN_NO; ?></td>
<td><?php echo $catlist[$i]->VAT_NO; ?></td>
<td><?php echo $catlist[$i]->SGST_NO; ?></td>
<td><?php echo $catlist[$i]->CGST_NO; ?></td>
<td><?php echo $catlist[$i]->IGST_NO; ?></td>
<td><?php echo $catlist[$i]->MSME_RegNO; ?></td>
<td><?php echo $catlist[$i]->MSME_Category; ?></td>
<?php $encoded_mail = base64_encode($catlist[$i]->VendorEmail);?>
<?php $encoded_id = base64_encode($catlist[$i]->VendorID);?>
<td><?php echo anchor('Vendormail/index/'.$encoded_mail .'/'.$encoded_id , 'Send Mail', 'class="btn btn-info"');?></td>
<td><a style=" background-color: rgba(106, 200, 35, 0.61);" href="<?php echo base_url(); ?>index.php/Vendor_retrieve/edit_data/<?php echo $catlist[$i]->VendorID?>" class="btn btn-info" role="button">Edit</a></td>
<!-- <td><?php echo anchor('Vendor_retrieve/edit_data/'.$catlist[$i]->VendorID, ' Edit');?></td> -->
<td><a style=" background-color: #f85959;" href="<?php echo base_url(); ?>index.php/Vendor_retrieve/delete_data/<?php echo $catlist[$i]->VendorID?>" class="btn btn-info" role="button">Delete</a></td>
<!-- <td><?php echo anchor('Vendor_retrieve/delete_data/'.$catlist[$i]->VendorID, ' Delete');?></td> -->
</tr>
<?php } ?>
</tbody>
</table>
<a <?php echo anchor('Send_all/index/'.$encoded_mail .'/'.$encoded_id , 'Send All', 'class="btn btn-info"');?></a>
</div>
</div>
</div>
</div>
</div>
Try below code it may help
$this->load->library('email');
$this->email->initialize($config);
replace your for each code
for($VendorEmail=0;$VendorEmail < count($cust_details);$VendorEmail++)
{}

DOMPDF is not generating dynamic image using PHP

I am generating a pdf using DOMPDF but in that the image is not displaying instead it is throwing an error "Image not found".
Here is my code :
require_once "dompdf_config.inc.php";
require_once('html2_pdf_lib/html2pdf.class.php');
include_once('../config.php');
$file = "www/test/mytest.php";
$html=file_get_contents($file);
$dompdf = new DOMPDF();
//$dompdf->load_html($my_html);
$dompdf->load_html_file('https://www.lettertowomen.com/admin/dompdf/www/test/mytest.php?id=111');
$dompdf->render();
$dompdf->stream("sample.pdf");
mytest.php
<body>
<form action="" method="POST">
<table width="1000" height="1000" style="background-color: #b91781;font-family: 'DejaVuSerif'; color: #ffffff;font-size: 20px;">
<tbody><tr>
<td width="249" valign="middle" align="center">
<div style="height: 595; width: 249; text-align: left;padding-top:140px;">
<img src="<?php echo base_url;?>uploads/<?php echo $result['image'];?>" style="border-radius: 159px;
width: 159px; height:225px;margin:70px auto 0;">
</div>
</td>
<td width="583" valign="middle" align="center">
<div style="height: 188px; width: 448px; text-align: left;">
<span style="display: block;
float: left;">To <span style="font-size: 22px; font-weight: 700; line-height: 34px; position: relative; top: 17px;"><?php echo $result['recipient_name'];?></span>
</span><br><br>
<div style="clear: both; display: inline-block; min-height: 160px; padding: 0px 18px; margin: 28px auto 0px;color: #ffffff">From the day you were born,<br>
I fell in love with you my girl.<br>
And when you bloomed like a rose without a single thorn,<br>
You turned my entire life into a most precious pearl.<br>
Your love and care for me is a beautiful dawn,<br>
That marks the end of darkness left to unfurl.<br><br>
Feeling blessed to have you as my daughter. </div>
<br><br>
<span style="display: block;
float: right;">From<span style="font-size: 22px; font-weight: 700; line-height: 34px; position: relative; top: 18px;"><?php echo $result['sender_name'];?></span>
</span></div>
</td>
</tr>
</tbody></table>
</form>
</body>
</html>
everything is displaying but image is not displayed. I have check already asked question in stackoverflow : dompdf not displaying image generated by PHP file but it is not working in my case
Also I have set DOMPDF_ENABLE_REMOTE = true
Thanks in advance
You can use Base64 image data
$html = '<div>
<p>IMAGE</p>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABMCAIAAACnG28HAAAABmJLR0QA/wD/AP%2BgvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1AgeBS42B7vBqgAAEhBJREFUeNrtnd%2BPHEcVhfcfBoknxAOIh0g88EsIIqKI1UprObYVe23FwQmskO0EYSskkCgkEo5MCMgoGBABhBDkIXzV3%2Byh6Onu6ZnZ2Zm1u1Qa9fb0VFfdOvfcW7du9%2B59NpWpbKDsTSKYygSsqUzAmsoErKlMZQLWVDZeHj3%2B67vvf/DSjZcODy/%2B9N5bH374O85MwJrKWpACT/vPfe%2B5Z5/97re/8cxXv/L1rz3DwcEPngdhS8FrAtZUZgWWuvHiJcBkBVugivrlL30RbB0eHLx5784ErKksUWCj6zd/DHqAEZD6wuc/x8GNo6uvvnLLPwGZZnEC1lSWsH1CSnKyiq3LV657Ust45dLFCVhTGVXACoiJOyWe8LHEmSdfu3NbK7krphBtgDzp0zR/uynSt3/xJl65AKLKVaDq4YN3WQny%2Bdrxy5cv7MNb1KXs4AaBRc/UhqX4cyrDnhCOjjhgptfHKI3IVVR569Wb1/78x0f1ZWCL88BrKbraFLAgT/CkNkzAOi2uCqqs6/AWremtp7Log8D%2B/emnrSvhLSC1LKo2AixFoD8ItQIv2GtCxvp0VTvXiHcdqbLcC6RwzJkjUTUPLI1Pi8a2Ayw6gaMXKb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Hpry9iT51zM7dloEFHkTeGG1UNZeQ7Ct07sbG/zTpe8nOgMgroTsFYpeSWOby7Z8ZCvGbnZK5yAtdPAmqV9jk5N22LxscRkZpfHIauHhH0v5gSsXSlmUJ2L7Skjunn/Vt447MtRzKKegDWVVTzCkpJ1eDGvfjRb32f4NmTKJ2A9FcWnhvKWnrwrS4RtYh99AtZTUcqLSU8eAa/fpy17TYw1ldWtoW5W3ouc9yX3vZRlAtZUFhcfi8q/PMlrz/2/hxOwprKWNfTB2sTfh9%2BBPQFrKmOtoU/x5%2BVQG32qYgLW00Va/vcb/z3nRu81AevpKr5tYPi9EhOwprK7ZQLWVCZgTeX8lP8CuDenorrKqfIAAAAASUVORK5CYII%3D">
</div>':
require_once('dompdf/dompdf_config.inc.php');
$dompdf = new DOMPDF ();
$dompdf->load_html ($html);
$dompdf->render ();
$dompdf->stream ("Test.pdf", array ("Attachment" => false));
Get the image from php in base64:
//getIMG.php?data=1&id=123
if ($data == 1) {
echo "data:image/".$adj->type.";base64,"
.str_replace ("\n", "", base64_encode ($adj->imageBinary));
}
For showing the image, you have to go to your dompdf source file like
..dompdf\src\Image\Cache.php
In the Cache.php file, you will search .... and make chrootValid true.. by default it will be false.
$chrootValid = true;
save it and try now...
Hope it will work

Categories