How use where condition in left join in Laravel? - php

I want to retrieve all media in left side and if media contain data will fill those data.
Here is my view:
<tbody>
<?php $i= 0; ?>
#foreach($print as $get)
#if(count($get->media_id)>0 && $get->Status === "Approved")
<tr>
<?php $i++; ?>
<td style="font-size: 16px; width: 25px; "><?php echo $i; ?></td>
<td style="font-size: 16px; width: 30px">{{$get->media_name}}</td>
<td style="font-size: 16px; width: 98px">{{$get->Date_Occured}}</td>
<td style="font-size: 16px; width: 80px">{{$get->Page_Number}}</td>
<td style="font-size: 16px; width: 150px">{{$get->Content_title}}</td>
<td style="font-size: 16px; width: 470px">{!! nl2br(e($get->Content_Description)) !!}</td>
</tr>
#endif
#endforeach
#foreach($media as $medias )
<?php $i++; ?>
<tr>
<td style="font-size: 16px; width: 25px; "><?php echo $i; ?></td>
<td style="font-size: 16px; width: 30px">{{$medias['media_name']}}</td>
<td style="font-size: 16px; width: 98px"></td>
<td style="font-size: 16px; width: 80px"></td>
<td style="font-size: 16px; width: 150px"></td>
<td style="font-size: 16px; width: 470px">Hakuna Taarifa kwa Leo</td>
</tr>
#endforeach
</tbody>
Here is my controller:
public function printpreview() {
$print = DB::table('media')
->leftjoin('content_forms', 'media.id', "=", 'content_forms.media_id')
->select('media.*','content_forms.*')
->whereDate('content_forms.created_at', DB::raw('CURDATE()'))
->get();
$media = media::all()->toArray();
return view('pdf.printview', compact('print', 'media'));
}

Related

Woocommerce HTML email template add product image

I need to add product image to my html email template that is custom build by me.
I can not able to find any hook that will add product image to my html email template with below shared code
I'd appreciate it if you helped.
<table style="width: 70%" >
<tr>
<th style="font-weight: normal; width: 24%" >
<p style="margin-left: 30px;">Produkt Artikel :</p>
</th>
<th style="width: 150%; height: 25px;font-weight: normal; text-align: left;" >
<div class="inputt" class="inputt" style="background-color: #e9ecef; padding: 7px; margin-left: 15px;border-radius: 0.55rem; height: 30px;" >
<?php echo $product_name; ?>
</div>
</th>
</tr>
</table>
<table style="width: 70%">
<tr>
<th style="font-weight: normal; width: 22%" >
<p style="margin-left: 30px;">Produktdetail :</p>
</th>
<th style="width: 150%; height: 25px;font-weight: normal; text-align: left;" >
<div class="inputt" style="background-color: #e9ecef; padding: 7px; margin-left: 15px;border-radius: 0.55rem; width: 50%;">
<?php wc_display_item_meta($item, array('label_before' =>esc_attr( $text_align), ) ); ?>
</div>
</th>
</tr>
</table>
<table style="width: 70%" >
<tr>
<th style="font-weight: normal; width: 22%" >
<p style="margin-left: 30px;">Vorname : </p>
</th>
<th style="width: 30%; height: 25px;font-weight: normal; text-align: left;" >
<div class="inputt" class="inputt" style="background-color: #e9ecef; padding: 7px; margin-left: 15px;border-radius: 0.55rem; height: 30px;" >
<?php echo wp_kses_post( wptexturize( $order->get_billing_first_name() ) ); ?>
</div>
</th>
<th style="font-weight: normal; width: 22%" >
<p style="margin-left: 30px;">Nachname :</p>
</th>
<th style="width: 150%; height: 25px;font-weight: normal; text-align: left;" >
<div class="inputt" class="inputt" style="background-color: #e9ecef; padding: 7px; margin-left: 15px;border-radius: 0.55rem; height: 30px;" >
<?php echo wp_kses_post( wptexturize( $order->get_billing_last_name() ) ); ?>
</div>
</th>
</tr>
</table>

Loops, what and how to use? (for, while, and foreach)

What's up guys!
I have a problem and I can not think of a solution.
I need to make a report using DOMPDF.
In this report, i need to print some employee information. In each page it is necessary to have header for the signature of the person in charge.
I have a group of employees. They are divided by departments.
I need a "break the page" loop when I change the employee's department or when I print 15 employees. After that, the loop should print the rest of the employees and execute the same rules if you change the employee's department again or have already been printed 15 employees.
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Relatório Geral</title>
<style>
body {
margin-top: -20px;
margin-left: -20px;
margin-right: -5px;
padding:0
}
.borda3 {
border:1px solid #999;
padding: 5px;
}
#borda2 td {
border: 1px solid #999;
border-collapse: collapse;
width: auto;
}
.centro {
text-align: center;
}
.tabela {
width: 100%;
}
span {
font-size: 100px;
}
td {
font-size: 11px;
}
html {
font-family: sans-serif;
}
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 1px solid #ddd;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
text-align: center;
font-size: 9px;
}
#customers td {
text-align: left;
font-size: 10px;
}
#customers a {
font-size: 10px;
}
.nome{
width: 180px;
}
.matricula{
width: 15px;
}
.numeros{
width: 15px;
}
.logo{
padding-left: 50px;
}
.logo a strong{
font-size: 15px;
text-align: center;
}
.logo a{
font-size: 12px;
}
.assinatura{
font-size: 9px;
margin-left: 60px;
}
</style>
</head>
{{--beginning of the loop--}}
<body>
<table class="tabela borda3">
<tr>
<td width="40%" class="centro">
<table class="logo">
<tr>
<td>
<img style="margin-left:20px; margin-top: -20px;width:220px; height: 65px;" src="img/logo_sarh.jpg">
</td>
</tr>
<tr>
<td>
<label for=""><a><strong> </strong></a></label><br>
</td>
</tr>
<tr>
<td><a>Referência:</a></td>
</tr>
<tr>
<td><a>Período:</a></td>
</tr>
</table>
</td>
<td width="40%" class="centro">
<table class="assinatura">
<tr>
<td style="height: 30px; text-align: left"><label for="">Em: _____/ _____/___________</label></td>
</tr>
<tr>
<td style="padding-bottom: -20px; height: 50px; text-align: center">
<label for="">____________________________________________</label><br>
<label style="font-size: 10px" for=""> SUPERVISOR</label>
</td>
</tr>
<tr>
<td style="height: 30px; text-align: left"><label for="">VISTO</label></td>
</tr>
<tr>
<td style="padding-bottom: -10px; height: 50px; text-align: center">
<label for="">____________________________________________</label><br>
<label style="font-size: 10px" for=""> SECRETÁRIO(A)</label>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table id="customers">
<tr>
<th class="nome">Nome</th>
<th class="matricula">Matrícula</th>
<th class="numeros">Dias</th>
<th class="numeros">Faltas</th>
<th class="numeros">Vac</th>
<th class="numeros">LSV</th>
<th class="numeros">L M</th>
<th class="numeros">Aci. Trab</th>
<th class="numeros">Adi. Not</th>
<th class="numeros">H.E Normal D</th>
<th class="numeros">H.E Normal N</th>
<th class="numeros">H.E Dom/Fer. D</th>
<th class="numeros">H.E Dom/Fer. N</th>
<th class="numeros">Ins.</th>
</tr>
{{--beginning of the loop--}}
<tr>
<td style="height: 20px;"><a>Augusto Damasceno Pedrozo</a></td>
<td style="height: 20px;"><a>12345678</a></td>
<td style="height: 20px;"><a>30</a></td>
<td style="height: 20px;"><a>2</a></td>
<td style="height: 20px;"><a>2</a></td>
<td style="height: 20px;"><a>2</a></td>
<td style="height: 20px;"><a>2</a></td>
<td style="height: 20px;"><a>2</a></td>
<td style="height: 20px;"><a>2</a></td>
<td style="height: 20px;"><a>20,02</a></td>
<td style="height: 20px;"><a>20,02</a></td>
<td style="height: 20px;"><a>20,02</a></td>
<td style="height: 20px;"><a>20,02</a></td>
<td style="height: 20px;"><a>20</a></td>
</tr>
<tr>
<td style="height: 20px;" colspan="14">Observação:</td>
</tr>
{{--end of the loop--}}
</table>
</body>
{{--end of the loop--}}
</html>
Could anyone give me some direction to solve this?
I think you want something like this:
#foreach($customers as $customer)
#while ($loop->index <= 15)
<!-- build table row here -->
#endwhile
<!-- page break -->
#endforeach
in laravel there is a loop variable
this variable tracks the current index and some other things
you can check if the current index is smaller or equal to 15, perform page break, grab next, check if department is same as before, repeat
for the department changes you can set a variable which holds the current department and compare it in the loop like:
#if($current_dep !== $cust->department)
<!-- page break -->
#endif
don't forget to check for last record
#while(!$loop->last)
#endwhile
further information on the $loop variable: https://laravel.com/docs/5.7/blade#the-loop-variable

rwd-table Font not visible in Mobile devices

.rwd-table {
margin: 1em 0;
min-width: 300px;
}
.rwd-table tr, th, td{
border: 2px solid #000000;
}
.rwd-table tr {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
.rwd-table th {
display: none;
}
.rwd-table td {
display: block;
}
.rwd-table td:first-child {
padding-top: .5em;
}
.rwd-table td:last-child {
padding-bottom: .5em;
}
.rwd-table td:before {
content: attr(data-th) " ";
font-weight: bold;
width: 13.5em;
display: inline;
}
#media (min-width: 480px) {
.rwd-table td:before {
display: none;
}
}
.rwd-table th, .rwd-table td {
text-align: left;
}
#media (min-width: 480px) {
.rwd-table th, .rwd-table td {
display: table-cell;
padding: .25em .5em;
}
.rwd-table th:first-child, .rwd-table td:first-child {
padding-left: 0;
}
.rwd-table th:last-child, .rwd-table td:last-child {
padding-right: 0;
}
}
body {
text-rendering: optimizeLegibility;
color: #000000;
background: #eee;
}
h1 {
font-weight: normal;
letter-spacing: -1px;
color: #000000 !important;
}
.rwd-table {
background: #fff;
color: #000000;
border-radius: .4em;
}
.rwd-table tr {
border-color: #fff;
}
.rwd-table th, .rwd-table td {
margin: .5em 1em;
}
#media (min-width: 480px) {
.rwd-table th, .rwd-table td {
padding: 1em !important;
-webkit-text-fill-color: rgba(0, 0, 0, 1);
-webkit-opacity: 1;
color: rgba(0, 0, 0, 1);
background: white;
}
}
.rwd-table th, .rwd-table td:before {
color: black;
}
<table class="rwd-table">
<tr>
<td colspan="2" style="text-align: center; color: black;"><?php the_field( 'header_note_payment' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Account Name </td>
<td bgcolor="" style="color: black;"><?php the_field( 'account_name' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Bank Name </td>
<td bgcolor="" style="color: black;"><?php the_field( 'bank_name' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Branch Code</td>
<td bgcolor="" style="color: black;"><?php the_field( 'branch_code' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Account No</td>
<td bgcolor="" style="color: black;"><?php the_field( 'account_number' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">IBAN</td>
<td bgcolor="" style="color: black;"><?php the_field( 'iban' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Currency</td>
<td bgcolor="" style="color: black;"><?php the_field( 'currency' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">SWIFT Code</td>
<td bgcolor="" style="color: black;"><?php the_field( 'swift_code' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Bank Address</td>
<td bgcolor="" style="color: black;"><?php the_field( 'bank_address' ); ?></td>
</tr>
<tr style="text-align: center; color: black;">
<td colspan="2"><?php the_field( 'footer_note_payment' ); ?></td>
</tr>
</table>
<table class="rwd-table">
<tr>
<td colspan="2" style="text-align: center; color: black;"><?php the_field( 'header_note_payment' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Account Name </td>
<td bgcolor="" style="color: black;"><?php the_field( 'account_name' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Bank Name </td>
<td bgcolor="" style="color: black;"><?php the_field( 'bank_name' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Branch Code</td>
<td bgcolor="" style="color: black;"><?php the_field( 'branch_code' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Account No</td>
<td bgcolor="" style=" color: rgba(0, 0, 0, 1) !important;">011 650 777 003</td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">IBAN</td>
<td bgcolor="" style="color: black;"><?php the_field( 'iban' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Currency</td>
<td bgcolor="" style="color: black;"><?php the_field( 'currency' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">SWIFT Code</td>
<td bgcolor="" style="color: black;"><?php the_field( 'swift_code' ); ?></td>
</tr>
<tr>
<td bgcolor="#A8CCC9" style="color: black;">Bank Address</td>
<td bgcolor="" style="color: black;"><?php the_field( 'bank_address' ); ?></td>
</tr>
<tr style="text-align: center; color: black;">
<td colspan="2"><?php the_field( 'footer_note_payment' ); ?></td>
</tr>
</table>
I have added css code & html code as well, please do let me know where exactly i am going wrong. fighting with this particular line from past two days.
Tried using different css style but, everything works on the desktop screens, but in the mobile screen, only Heading gets displayed i.e. ACCOUNT NUMBER.
Shouldn't it be <?=the_field('account_number')?> BTW, 'account no' isn't the heading - its just the previous cell, a sibling.

Error somehow related to using the footer of library mpdf

I'm using CodeIgniter with the mpdf library to create pdf files.
It works just fine until I try to add a footer.
Every time I add the footer, whenever I try to open the generated file I get this error:
File Does Not Begin With '%PDF-' Local\EWH-6160-0
If I skip the footer, it works fine, I don't understand how the error is related to the footer.
This is the controller that creates the pdf:
public function print_beneficiaries($cod){
$mpdf = new mPDF( 'utf-8', 'A3' );
$name = $this->natural_md->client_name($cod);
$account = $this->formats->retrieve_account($cod);
$data = $this->formats->beneficiaries( $cod );
$date = $this->formats->mult_contract( $cod );
$list = array();
if($data > 0){
$i = 1;
foreach ( $data as $benef ){
array_push( $list, array(
'cod' => $cod,
'id_beneficiary' => $benef['id_beneficiary'],
'name' => $benef['beneficiary_name'],
'relationship' => $benef['relationship'],
'benef_percentage' => $benef['benef_percentage'],
'identification' => $benef['identification'],
'identification_type' => $benef['identification_type'],
'address' => $benef['address'],
'email' => $benef['email'],
'telephone' => $benef['telephone'],
'celphone' => $benef['celphone'],
'letter' => $this->utilities->get_letter($i)
) );
$i = $i + 1;
}
}
else
$list = array();
$mpdf->SetFooter("{PAGENO}/{nb}");
$mpdf->WriteHTML($this->load->view( 'pdf/pn_beneficiaries', array(
'list' => $list,
'account_name' => ucwords($name[0]['names']),
'account_id' => $account == null ? 0 : $account->id,
'account' => $account == '' ? 0 :$cuenta->account_name,
'day' => sprintf('%02d', $date[0]['day']),
'month' => sprintf('%02d', $date[0]['month']),
'year' => $date[0]['year'],
), true ) );
$mpdf->Output("Beneficiaries - ".$cod.".pdf", "I");
}
The view from which the controller retrieves the data is this:
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>Beneficiaries</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="<?php echo base_url();?
>/assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="<?php echo base_url();?
>/assets/css/font.css" />
<style>
body{
color: #0a0a0a;
font-size: 12px;
font-family: Calibri, sans-serif;
}
.foot{
position: absolute;
bottom: 0;
left: 900px;
width: 100%;
float: right;
}
.espacio{
margin-top: 4px;
width: 900px;
}
.espacio h3{
text-align: center;
font-weight: 700;
}
.per{
font-size: 14px;
text-align: justify;
}
table{
font-size: 16px;
}
th{
padding:4px;
text-align: center;
}
table.border td{
border: solid 2px #B1B1B1;
}
td{
padding:4px;
}
u{
height: 2px;
}
.logo{
text-align: center;
}
#media print {
#with_print {
display: none;
}
}
</style>
</head>
<body>
<header>
<div class="row">
<div class="container logo">
<img src="<?php echo base_url();?>/assets/img/logo-inver-
new.jpg" width="180px">
</div>
</div>
</header>
<div class="container espacio" >
<h3>
Beneficiary designation
</h3>
<div class="espacio per">
<p>
some text
</p>
</div>
<div class="row">
<div class="container">
<table border="1" class="border">
<tr>
<td colspan="3" style=" background-color: #30859B; color: #fff;
font-size: 16px; margin: 5px;">Fecha</td>
</tr>
<tr>
<td style=" font-size: 16px;"><?php echo $day; ?></td>
<td style=" font-size: 16px;"><?php echo $month; ?></td>
<td style=" font-size: 16px;"><?php echo $year; ?></td>
</tr>
</table>
</div>
</div>
<br>
<div class="row">
<?php $cont = 0; $filas=count($list);?>
<?php foreach ($list as $row):?>
<div class="container">
<table border="1" align="center" class="border">
<tr>
<td colspan="2" style=" background-color: #30859B; color:
#fff;">Beneficiario <?php echo $row['letter']; ?></td>
</tr>
<tr>
<td colspan="2">Nombre del Beneficiario: <span style="font-
size: 18px; font-style: italic; color:
#2b2b2b;">  <?php echo $row['name']; ?> </span>
</td>
</tr>
<tr>
<td style="width: 500px;">Parentesco: <span style="font-
size: 18px; font-style: italic; color:
#2b2b2b;">  <?php echo $row['relationship']; ?>
</span> </td>
<td style="width: 500px;">% del Beneficiario: <span
style="font-size: 18px; font-style: italic; color:
#2b2b2b;">  
<?php
if(!empty($row['benef_percentage']))
{echo $row['benef_percentage'].' %';}
?></span> </td>
</tr>
<tr>
<td>No. Identificación: <span style="font-size: 18px; font-
style: italic; color: #2b2b2b;">  <?php echo
$row['identification']; ?></span> </td>
<td>Tipo de Identificación: <span style="font-size: 18px;
font-style: italic; color: #2b2b2b;">  <?php echo
$row['identification_type']; ?> </span> </td>
</tr>
<tr>
<td colspan="2">Dirección del Beneficiario: <span
style="font-size: 18px; font-style: italic; color:
#2b2b2b;">   <?php echo $row['address']; ?>
</span> </td>
</tr>
<tr>
<td colspan="2">Correo Electrónico: <span style="font-size:
18px; font-style: italic; color: #2b2b2b;">   <?
php echo $row['email']; ?></span> </td>
</tr>
<tr>
<td>Teléfono Domicilio: <span style="font-size: 18px; font-
style: italic; color: #2b2b2b;">  <?php echo
$row['telephone']; ?></span> </td>
<td>Teléfono Celular: <span style="font-size: 18px; font-
style: italic; color: #2b2b2b;">  <?php echo
$row['celphone']; ?> </span> </td>
</tr>
</table>
</div>
<?php $cont++;
if ($cont%5==0 && $filas>5) {
echo '
<pagebreak>
';
}
?>
<?php endforeach; ?>
</div>
<br>
<div class="col-xs-12">
<table style="margin-top: 10px;">
<tr>
<td>Nombre de la cuenta: <?php echo $filas ?></td>
<td style="border-bottom: solid 1px #000; width: 100%"><?php
if (isset($account) && ($account!='')) {
echo $account;
}else{
echo $account_name;
}
?></td>
</tr>
</table>
</div>
<div class="col-xs-12 espacio">
<p style="text-align: justify;"><span style=" font-weight:
bold;">Nota:</span>Other text</p>
</div>
<div class="col-xs-12">
<table style="margin-top: 10px;">
<tr >
<td style="width: 100px;"></td>
<td style="border-top: solid 1px #000; width: 250px; text-
align: center; font-size: 16px;" >Firma del Cliente</td>
<td style="width: 100px;"></td>
<td style="border-top: solid 1px #000; ; width: 350px; text-
align: center; font-size: 16px;" >Firma del
Cliente<br>Cuenta Mancomunada</td>
<td style="width: 100px;"></td>
<td style="border-top: solid 1px #000;width: 290px; text-
align: center; font-size: 16px;">
Firma del Funcionario IPB
</td>
</tr>
</table>
</div>
</div>
</div>
</body>
I found the answer in a similar post. I opened the file on word and the error was: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead on the mpdf.php file line 12492. I searched for the solution, just change the original code: $hd = preg_replace('/\{DATE\s+(.*?)\}/e',"date('\\1')",$hd); to this: $hd = preg_replace_callback('/\{DATE\s+(.*?)\}/m', function($m){ return date($m[1]);},$hd);

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++)
{}

Categories