D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
admin-report
/
Filename :
daily-pi-report.php
back
Copy
<?php // include '../config.php'; $servername = "localhost"; $username = "shubmkcj_urbane"; $password = "admin@123##"; $dbname = "shubmkcj_urbane"; $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } mysqli_set_charset($conn,'utf8'); $amtMessg=''; $todayDate=date('j F Y'); $PreviousDate = date('j F Y', strtotime($todayDate.' - 1 day')); // $to = date("Y-m-d", strtotime($todate)); // date("Y-m-d", strtotime($row["date"])) // $form_formate_date = date_format($from_date,"Y-m-d"); $to='gurmeet@urbanemerchandising.cn'; // $to='designpitara1@gmail.com'; $from = 'admin@urbane.createerp.com'; $subject = "Daily Proforma Report as on ".$todayDate; $rowsv=''; $total_amt=0; $sql = "SELECT * FROM `proforma` where data_delete != 'yes' AND `date`='$todayDate' order by id desc"; $result = mysqli_query($conn,$sql); if (mysqli_num_rows($result) > 0){ while( $row = mysqli_fetch_array($result)){ $helping_id = $row['bill_pay_name']; $proforma_id=$row['proforma_id']; $p_date=$row['date']; $due_date=$row['due_date']; $get_bpn = mysqli_query($conn,"SELECT * FROM `contact` where id='$helping_id'"); $get_bpn_row = mysqli_fetch_assoc($get_bpn); $final_bill_pay_name = $get_bpn_row['bill_display_name']; $total_amt += sprintf('%0.2f', $row["amount_paid"]); $rowsv.=' <tr class="gradeX" style="font-size:13px"> <td>'.$p_date.'</td> <td>'.$proforma_id.'</td> <td>'. $final_bill_pay_name.'</td> <td>'. $due_date .'</td> <td>'. $row['amount_paid'] .'</td> </tr> '; $amtMessg='<tr> <th colspan="4" style="text-align:right;">Total Amount</th> <th>'.$total_amt.'</th> </tr>'; } }else{ $rowsv=' <tr class="gradeX" style="font-size:13px"> <td colspan="5" style="text-align:center;">No Records of this Dated '.$todayDate.' </th> </tr> '; $amtMessg=""; } $htmlContent=' <!DOCTYPE html> <html lang="en" xmlns="https://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="x-apple-disable-message-reformatting"> <style> .table { width: 100%; margin-left: 5px; border: 1px solid #CDCDCD; /*border-style:solid; border-width:1px; border-color:#000000;*/ margin: 15px; } .table th { background: none repeat scroll 0 0 #EEEEEE; padding: 10px; font-size: 14px; color: #000; border: 1px solid #CDCDCD; font-weight: 700; } .table tr { padding: 10px; font-size: 11px; height: 30px; border: 1px solid #CDCDCD; } .table tr td:first-child { font-weight: bold; text-align: left; border: 1px solid #CDCDCD; text-align: center; } .table td { padding-left: 3px; border: 1px solid #CDCDCD; color: #333333; text-align: center; } </style> </head> <body style="margin:0;padding:0;word-spacing:normal;"> <div role="article" aria-roledescription="email" lang="en" style="text-size-adjust:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;"><br> <h3 style="text-align:center"><b>Urbane Merchandising</b> Daily <strong>Proforma</strong> Report as on '.$todayDate.'</h3><br> <table role="presentation" style="" class="table table-bordered"> <thead> <tr class="theme-bg"> <th>Date</th> <th>Proforma Id</th> <th>Bill Pay Name</th> <th>Due Date</th> <th>Total Amount</th> </tr> </thead> <tbody> '.$rowsv.' '.$amtMessg.' </tbody> </table> </div> </body> </html> '; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers $headers .= "From: $from" . "\r\n"; // $headers .= "Reply-To: <$to>" . "\r\n"; // $headers .= 'Cc: ravindra@designpitara.com' . "\r\n"; $headers.="X-Mailer: PHP/" . phpversion(); $mail = mail( $to, $subject, $htmlContent, $headers ); ?>