Server : LiteSpeed
System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User : outerorb ( 1091)
PHP Version : 8.1.34
Disable Function : mail
Directory :  /home2/outerorb/dev.outerorbittech.com/erp/admin/

📁 Create New:
⬆️ Upload File:
Current Dir [ Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: send.php

Path: //home2/outerorb/dev.outerorbittech.com/erp/admin/send.php

Size: 11.01 KB

Permissions: 0644

<?php      
require 'connection.php';
include_once('TCPDF/tcpdf.php');

$aid=$_GET['aid'];

$inv_mst_query = "select * from client where aid='".$aid."'";    
$inv_mst_results = mysqli_query($cn,$inv_mst_query);   
$count = mysqli_num_rows($inv_mst_results);
if($count>0) 
{
	$inv_mst_data_row = mysqli_fetch_array($inv_mst_results, MYSQLI_ASSOC);

 
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('ZAPNIX');
$pdf->SetTitle('INVOICE');
$pdf->SetSubject('');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data

// set header and footer font

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);

// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

// set some language-dependent strings (optional)

// ---------------------------------------------------------

// set font
$pdf->SetFont('helvetica', 'B', 9);

// add a page
$pdf->AddPage();

$pdf->SetFont('helvetica', '', 10);

// -----------------------------------------------------------------------------

$content = ''; 

$content .= '
<table>
<tr>
<th colspan="3" style="text-align: center;color:#366092; font-size: 40px;border-top: 6px solid #366092;"><b>ZAPNIX INC.</b></th>
</tr>
<tr><br>
<th colspan="3" align="center" style="border-bottom: 6px solid #366092;"><b>INVOICE</b><br></th>
</tr>

</table>
';

// -----------------------------------------------------------------------------

$content .= '
<table cellpadding="3" cellspacing="3" nobr="true">
 <tr>
  <td style="color:#294970;">DATE : <span style="color:black; font-weight:700px">'.$inv_mst_data_row['date'].'</span></td>
  <td style="color:#366092;text-align:right;">INVOICE NO : <span style="color:black; font-weight:700px">'.$inv_mst_data_row['invno'].'</span> </td>
 </tr>
 <tr>
 <td style="color:#294970;">DUE : <span style="color:black; font-weight:700px">'.$inv_mst_data_row['date'].'</span></td>
  <td></td>
 </tr>
</table>
';

$content .= '
<table cellpadding="5" cellspacing="2">
<thead>

 <tr style="background-color:#366092;color:White;">
  <td width="400" align="left"><b>CUSTOMER INFO</b></td>
  <td width="240" align="center" ><b>DIGITAL MARKETING SERVICES</b></td>
 </tr>

 <tr style="background-color:#dce6f1;color:#366092;">
  <td  align="left">NAME : <span style="color:black; font-weight:700px">'.$inv_mst_data_row['name'].'</span> </td>
  <td  align="left">Clients Digital Marketing Profile</td>
 </tr>

 <tr style="background-color:#dce6f1;color:#366092;">
 <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:black; font-weight:700px">'.$inv_mst_data_row['type'].'</span></td>
 <td  align="left">Personalised Domain on www</td>
</tr>

<tr style="background-color:#dce6f1;color:#366092;">
<td  align="left">ADDRESS : <span style="color:black; font-weight:700px">'.$inv_mst_data_row['street'].'</span></td>
<td  align="left">Personalised Email Account</td>
</tr>

<tr style="background-color:#dce6f1;color:#366092;">
<td  align="left"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:black; font-weight:700px">'.$inv_mst_data_row['city'].', '.$inv_mst_data_row['state'].'- '.$inv_mst_data_row['zip'].'</span></td>
<td  align="left">Secured Digital Locker on cloud</td>
</tr>

<tr style="background-color:#dce6f1;color:#366092;">
<td  align="left">EMAIL :  <span style="color:black; font-weight:700px">'.$inv_mst_data_row['email'].'</span></td>
<td  align="left">Customised Network Management Software</td>
</tr>

<tr style="background-color:#dce6f1;color:#366092;">
<td  align="left">Alt EMAIL :  <span style="color:black; font-weight:700px">'.$inv_mst_data_row['altemail'].'</span></td>
<td  align="left"><b></b></td>
</tr>
</thead>
</table><br><br>
';


$path= "/home/outerorb/dev.outerorbittech.com/erp/admin/invoice/logo.jpg";
$total=0;
$inv_det_query = "select * from client where aid='".$aid."'";  
$inv_det_results = mysqli_query($cn,$inv_det_query);    
while($inv_det_data_row = mysqli_fetch_array($inv_det_results, MYSQLI_ASSOC))
{	
$amt=$inv_det_data_row['amount']-50;


$content .= '
<table cellpadding="3" cellspacing="2">
<thead>

 <tr style="background-color:#366092;color:White;">
  <td width="500" align="left"><b>JOB PERFORMED</b></td>
  <td width="140" align="center" ><b>AMOUNT</b></td>
 </tr>

 <tr>
  <td  align="left" style="border: 1px dotted grey"><b>Digital Marketing Services</b></td>
  <td  align="center" style="border: 1px dotted grey;"><b>$ '.$amt.'</b></td>
 </tr>

 <tr>
 <td  align="left" style="border: 1px dotted grey;"><b>Customised Network Management Software</b></td>
 <td  align="center" style="border: 1px dotted grey;"><b>$ 50</b></td>
</tr>
</thead>
</table>
';
$total=$inv_det_data_row['amount'];
		}


$content .= '
<table cellpadding="10" cellspacing="2">
<thead>

 <tr style="color:#366092;">
  <td width="300" align="left"></td>
  <td width="200" align="right" ><b>SUBTOTAL</b></td>
  <td width="140" align="left" ><b>$ '.$total.'</b></td>
 </tr>

 <tr style="color:#366092">
  <td width="350" align="left" style="border-bottom: 3px solid black;"><b>COMMENTS</b></td>
  <td width="150" align="right"><b>SALES TAX RATE</b></td>
  <td width="140" align="left"><b>% </b></td>
 </tr>


 <tr style="color:black">
  <td align="left">Please include the invoice number as reference while paying</td>
 </tr>


 <tr style="color:#ff0000;">

    <td width="350" style="color:black;"><img src="@'.base64_encode(file_get_contents($path)).'" width=30 height=10></td>
	<td width="150" align="right" style="font-size: 13px;"><b>TOTAL</b></td>
	<td width="140" align="left" style="font-size: 14px;"><b>$ '.$total.' </b></td>
	
	</tr>

	<tr style="color:#366092">
	<td align="left"><b>Thank you for your business!</b></td>
   </tr>

   
 <tr style="color:black">
 <td width="600" align="center">Should you have any enquiries concerning this invoice, please contact us on 1-888-630-3350</td>
</tr>


<tr style="background-color:#366092; color:white; text-align: center; ">

<td width="640" style="font-weight:500;font-size:10px">Zapnix Inc. P.O. Box 18805 P.O. Box 18805 Tucson AZ 85710-9998</td>
 
 </tr>

 <tr style="background-color:#366092; color:white; text-align: center; ">

<td width="640" style="font-weight:500;font-size:10px">Tel: 1-888-630-3350  E-mail: support@zapnix.co Web: www.zapnix.co</td>
 
 </tr>

</thead>
</table>';

$pdf->writeHTML($content);


$file_location = "/home/outerorb/dev.outerorbittech.com/erp/admin/invoice/"; //add your full path of your server
//$file_location = "c:/xampp/htdocs/DigitalERP/images/"; //for local xampp server
$file_name =$inv_mst_data_row['invno'].'.pdf';
ob_end_clean();
$pdf->Output($file_location.$file_name, 'F'); // F means upload PDF file on some folder
//echo "Email send successfully!!";

	}
	else
	{
		echo 'Record not found for PDF.';
	}
	


	include('smtp/PHPMailerAutoload.php');

	
	$q="select * from client where aid='".$aid."'";
	
	$sq=mysqli_query($cn,$q);
	if($sq)
	{
		// check if any value found or not 
			if(mysqli_fetch_array($sq)>0)
			{
			$sq=mysqli_query($cn,$q);
			
				while($row=mysqli_fetch_array($sq))
				{
					$mail = new PHPMailer(true); 
	
					$mail->IsSMTP(); 
	
					$mail->SMTPAuth = true; 
					$mail->SMTPSecure = 'tls'; 
					$mail->Host = "smtp.gmail.com";
					$mail->Port = 587; 
					$mail->IsHTML(true);
					$mail->CharSet = 'UTF-8';
		$mail->Username = 'zapnixsales@gmail.com';
		$mail->Password = 'unqjppronwobdosd';
		$mail->setFrom('zapnixsales@gmail.com');
		
		$mail->Subject = 'Payment Confirmation for Your Digital Marketing Services with Zapnix Inc.';


		$mail->Body =  'Dear <b>'.$row['name'].' ,</b><br><br>I hope this email finds you well. We are delighted to welcome you as an upgraded user of Zapnix Inc., and we sincerely appreciate your trust in our digital marketing services.<br>
					<br>	
		We are writing to confirm that we have successfully received your payment for the comprehensive digital marketing services you recently signed up for. Kindly find the attachment as your invoice for the service.<br>
					<br>	
		Your commitment to taking your digital presence to the next level is commendable, and we are excited to partner with you on this journey. Our team of experts is now ready to work diligently on enhancing your online presence, increasing your personal profile’s visibility, and driving results that matter.<br>
				<br>		
		..........<b>Here&#8242;s what you can expect in the upcoming days: ..........</b><br><br>

		<b>Account Setup: </b>Our team will start by setting up your dedicated account and conducting a thorough analysis of your current online presence.<br>
<br>
		<b>Tailored Strategy: </b>Based on our analysis, we will create a customized digital marketing strategy to align with your life goals and objectives.<br>
<br>
		<b>Execution: </b>Our experts will begin implementing the various aspects of your digital marketing campaign, including but not limited to SEO, social media marketing, personal profile creation, and cloud storage for your memoirs.<br>
<br>
		<b>Regular Updates: </b>You will receive regular updates on the progress of your campaign, along with detailed reports that outline the key performance metrics.<br>
<br>
		<b>Support: </b>Our customer support team is here to assist you with any questions or concerns you may have throughout the process. Feel free to reach out at any time.<br>
<br>
		We are committed to delivering exceptional results and ensuring that your investment in digital marketing yields a substantial return. If you have any specific preferences or additional information you&#8242;d like to share with us, please don&#8242;t hesitate to let us know. Your input is valuable to us, and we want to ensure that our services are aligned with your unique business needs.<br>
<br>
		Once again, thank you for choosing Zapnix Inc. for your digital marketing needs. We are eager to get started and help you achieve your digital goals. If you have any questions or need further assistance, please do not hesitate to reach out to our dedicated support team.<br>
<br>
		Welcome to the Zapnix Inc. family, and let&#8242;s embark on this exciting digital journey together!<br>
<br><b>
		Best Regards,<br>
		
		Zapnix Digital Marketing Team,<br>
		Zapnix Inc.<br>
		info@zapnix.co<br>
		1-888-468-0335<br>
		https://zapnix.co<br>

		</b><br>

		<center>—INVOICE ATTACHED BELOW—</center>

';


		$mail->addAddress($row['email']);
		$mail->addAttachment($file_location.$file_name);
		$mail->SMTPOptions = array(
			'ssl' => array(
				'verify_peer' => false,
				'verify_peer_name' => false,
				'allow_self_signed' => true
			)
		);
		
		
	}

	if (!$mail->send()) {
		echo 'Mailer Error: ' . $mail->ErrorInfo;
	} else {
		echo '<script> alert("INVOICE SEND SUCCESSFULLY");
            window.location="data.php";    </script>';
	}
}
}
//----- End Code for generate pdf

?>

← Back to Directory Edit File 🔒 Chmod

WP File Manager