<?php
$insArrdt=array();
$usArr=array();
foreach($invoiceData as $invoiceDatadt)
{
   $insArrdt['transaction_id']= $invoiceDatadt->transaction_id;
   $insArrdt['account_id']= $invoiceDatadt->account_id;
   $insArrdt['user_id']= $invoiceDatadt->user_id;
   $insArrdt['amount']= $invoiceDatadt->amount;
    $insArrdt['currency']= $invoiceDatadt->currency;
    $insArrdt['payment_status']= $invoiceDatadt->payment_status;
    $insArrdt['debit_credit']= $invoiceDatadt->debit_credit;
    $insArrdt['commments']= $invoiceDatadt->commments;
    $insArrdt['insert_datetime']= $invoiceDatadt->insert_datetime;
     $insArrdt['payment_mode']= $invoiceDatadt->payment_mode;
	 $insArrdt['recharge_amount']= $invoiceDatadt->recharge_amount;
	 $insArrdt['payment_gateway_amount']= $invoiceDatadt->payment_gateway_amount;
	 $insArrdt['gst_amount']= $invoiceDatadt->gst_amount; 
	  
                  
}

foreach($userData as $userDatadt)
{
    //first_name,last_name,email_address,phone_number,phone_country_code
   $usArr['first_name']= $userDatadt->first_name;
   $usArr['last_name']= $userDatadt->last_name;
   $usArr['email_address']= $userDatadt->email_address;
   $usArr['phone_number']= $userDatadt->phone_number;
   $usArr['phone_country_code']= $userDatadt->phone_country_code;
   
           
}
$name= $usArr['first_name'].' '. $usArr['last_name'];
$phone='+'.$usArr['phone_country_code'].'-'.$usArr['phone_number'];

/*echo "<pre>";
print_r($userAdv);
die;*/
?>

<!DOCTYPE html>
<html lang="en-US">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
      <title>VolaAds</title>
	  <link rel="stylesheet" href="<?php echo Config::get('app.local_url'); ?>invoicecss/bootstrap.min.css"> 
	  <script src="<?php echo Config::get('app.local_url'); ?>invoicecss/bootstrap.bundle.min.js"></script> 
	  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
	  <script type="text/javascript" src="<?php echo Config::get('app.local_url'); ?>invoicecss/invoicestyle.css"></script>
   </head>
<style>
body{
    margin-top:20px;
    background:#eee;
	/*font-size: 20px;*/
}

.invoice {
    background: #fff;
    padding: 20px
}

.invoice-company {
    font-size: 20px
}

.invoice-header {
    margin: 0 -20px;
    background: #f0f3f4;
    padding: 20px
}

.invoice-date,
.invoice-from,
.invoice-to {
    display: table-cell;
    width: 30%
}

.invoice-from,
.invoice-to {
    padding-right: 20px
}

.invoice-date .date,
.invoice-from strong,
.invoice-to strong {
    font-size: 16px;
    font-weight: 600
}

.invoice-date {
    text-align: left;
    padding-left: 20px
}

.invoice-price {
    background: #f0f3f4;
    display: table;
    width: 100%
}

.invoice-price .invoice-price-left,
.invoice-price .invoice-price-right {
    display: table-cell;
    padding: 20px;
    font-size: 20px;
    font-weight: 600;
    width: 75%;
    position: relative;
    vertical-align: middle
}

.invoice-price .invoice-price-left .sub-price {
    display: table-cell;
    vertical-align: middle;
    padding: 0 20px
}

.invoice-price small {
    font-size: 12px;
    font-weight: 400;
    display: block
}

.invoice-price .invoice-price-row {
    display: table;
    float: left
}

.invoice-price .invoice-price-right {
    width: 25%;
    background: #2d353c;
	/*background: #f0f3f4;*/
    color: #fff;
    font-size: 28px;
    text-align: right;
    vertical-align: bottom;
    font-weight: 300
}

.invoice-price .invoice-price-right small {
    display: block;
    opacity: .6;
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 12px
}

.invoice-footer {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    font-size: 10px
}

.invoice-note {
    color: #999;
    margin-top: 80px;
    font-size: 85%
}

.invoice>div:not(.invoice-footer) {
    margin-bottom: 20px
}

.btn.btn-white, .btn.btn-white.disabled, .btn.btn-white.disabled:focus, .btn.btn-white.disabled:hover, .btn.btn-white[disabled], .btn.btn-white[disabled]:focus, .btn.btn-white[disabled]:hover {
    color: #2d353c;
    background: #fff;
    border-color: #d9dfe3;
}

.column {
  float: left;
  width: 33.33%;
  padding: 10px;
}

/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
}
</style>   
   <body>
		<!--Invoice section start here-->
		<div class="container">
		   <div class="col-md-12">
			  <div class="invoice">
				 <!-- begin invoice-company -->
				 <div class="invoice-company text-inverse f-w-600">
					<span class="pull-right hidden-print">
					<a href="javascript:;" onclick="window.print()" class="btn btn-sm btn-white m-b-10 p-l-5"><i class="fa fa-print t-plus-1 fa-fw fa-lg"></i> Print</a>
					</span>
					Collectcent Digital Media Pvt Ltd
				 </div>
				 <!-- end invoice-company -->
				 <!-- begin invoice-header -->
				
				 <div class="invoice-header">
					<div class="row">
						<div class="column">
							<div class="invoice-from">
							   <small><b>From</b></small>
							   <address class="m-t-5 m-b-5">
								  <strong class="text-inverse">Collectcent Digital Media Pvt Ltd</strong><br>
								  Akashneem Marg 68, DLF Phase II, Gurgaon, Haryana 122002 ­ India<br/>
								Tel: +91 911610116<br/>
								Email: support@vola.ad<br/>
								HSN Code: 998361
							   </address>
							</div>
						
						</div>
						<div class="column">
							<div class="invoice-to">
							   <small><b>To</b></small>
							   <address class="m-t-5 m-b-5">
								  <strong class="text-inverse">Company Name: </strong><?php echo (isset($userAdv['company']) && $userAdv['company'] !="") ? $userAdv['company'] : "NA"; ?><br>
								  <strong class="text-inverse">Contact Name: &nbsp;&nbsp;&nbsp;</strong><?php echo (isset($userAdv['contact_name']) && $userAdv['contact_name'] !="") ? $userAdv['contact_name']." ".$userAdv['last_name'] : "NA"; ?><br>
								  <strong class="text-inverse">Mobile No.:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><?php echo (isset($userAdv['contact_phone']) && $userAdv['contact_phone'] !="") ? $userAdv['contact_phone'] : "NA"; ?><br>
								  <strong class="text-inverse">Email-Id:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><?php echo (isset($userAdv['contact_email']) && $userAdv['contact_email'] !="") ? $userAdv['contact_email'] : "NA"; ?><br>
								  <strong class="text-inverse">PAN No.:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><?php echo (isset($userAdv['pan_number']) && $userAdv['pan_number'] !="") ? $userAdv['pan_number'] : "NA"; ?><br>
								  <strong class="text-inverse">GST No.:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><?php echo (isset($userAdv['gst_no']) && $userAdv['gst_no'] !="") ? $userAdv['gst_no'] : "NA"; ?><br>
								  <strong class="text-inverse">Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><?php echo (isset($userAdv['registration_address']) && $userAdv['registration_address'] !="") ? nl2br($userAdv['registration_address']) : "NA"; ?>
								  <strong class="text-inverse">Zipcode:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><?php echo (isset($userAdv['contact_postal_code']) && $userAdv['contact_postal_code'] !="") ? nl2br($userAdv['contact_postal_code']) : "NA"; ?>
							   </address>
							</div>
						</div>
						<div class="column">
							<div class="invoice-date">
							   <small><b>Invoice Detail</b></small>
							   <div class="m-t-5 m-b-5"><strong class="text-inverse">Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><?php echo date('d-M-Y', strtotime($insArrdt['insert_datetime']));  ?><br/>
								 <strong class="text-inverse">Service Month:&nbsp;</strong><?php echo date('F', strtotime($insArrdt['insert_datetime']));  ?><br>
								<strong class="text-inverse">Transaction Id:&nbsp;&nbsp;</strong><?php echo $insArrdt['transaction_id']; ?><br>
								<strong class="text-inverse">Payment Mode:&nbsp;</strong><?php echo $insArrdt['payment_mode']; ?><br>
								</div>
							</div>
						</div>
					</div>
				</div>
				 <!-- end invoice-header -->
				 <!-- begin invoice-content -->
				 <div class="invoice-content">
					<!-- begin table-responsive -->
					<div class="table-responsive">
					   <table class="table table-invoice">
						  <thead>
							 <tr>
								<th>Service Name</th>
								<th class="text-right" >Recharge Amount</th>
								<th class="text-right">Payment Gatway FEE</th>
								<th class="text-right">GST</th>
								<th class="text-right">Total Amount</th>
							 </tr>
						  </thead>
						  <tbody>
							 <tr>
								<td>
								   <span class="text-inverse">Performance CPI / Branding CPM Campaign</span><br>
								</td>
								<td class="text-center">$<?php echo number_format($insArrdt["recharge_amount"], 2); ?></td>
								<td class="text-center">$<?php echo number_format($insArrdt["payment_gateway_amount"], 2); ?></td>
								<td class="text-center">$<?php echo number_format($insArrdt["gst_amount"], 2); ?></td>
								<td class="text-center">$<?php echo number_format($insArrdt["amount"], 2); ?></td>
							 </tr>
						</tbody>
					   </table>
					</div>
					<!-- end table-responsive -->
					<!-- begin invoice-price -->
					<div class="invoice-price">
					   <div class="invoice-price-left">
						  <div class="invoice-price-row">
							 <div class="sub-price">
								<small>Recharge Amount</small>
								<span class="text-inverse">$<?php echo number_format($insArrdt["recharge_amount"], 2); ?></span>
							 </div>
							 <div class="sub-price">
								<i class="fa fa-plus text-muted"></i>
							 </div>
							 <div class="sub-price">
								<small>Payment Gatway FEE</small>
								<span class="text-inverse">$<?php echo number_format($insArrdt["payment_gateway_amount"], 2); ?></span>
							 </div>
							 <div class="sub-price">
								<i class="fa fa-plus text-muted"></i>
							 </div>
							 <div class="sub-price">
								<small>GST</small>
								<span class="text-inverse">$<?php echo number_format($insArrdt["gst_amount"], 2); ?></span>
							 </div>
						</div>
					   </div>
					   <div class="invoice-price-right">
						  <small>TOTAL</small> <span class="f-w-600">$<?php echo number_format($insArrdt["amount"], 2); ?></span>
					   </div>
					</div>
					<!-- end invoice-price -->
				 </div>
				 <!-- end invoice-content -->
				 <!-- begin invoice-note -->
				 <div class="invoice-note">
					* We're here to help if you need it. Visit the <a href="https://vola.ad/faq" target="_blank">Help Centre</a> for more info or write to support@vola.ad</a>
				 </div>
				 <!-- end invoice-note -->
				 <!-- begin invoice-footer -->
				 <div class="invoice-footer">
					<p class="text-center m-b-5 f-w-600">
					   THANK YOU FOR YOUR BUSINESS
					</p>
					<p class="text-center">
					   <span class="m-r-10">Copyright © <?php echo date('Y'); ?> Vola.Ad<br>
                                        <span> Akashneem Marg 68, DLF Phase II, Gurgaon, Haryana 122002 ­ India</span></span>
					
					</p>
				 </div>
				 <!-- end invoice-footer -->
			  </div>
		   </div>
		</div>
		<!--Invoice section end here-->
   
   </body>
</html>
