<title><?php echo e($res->center_name); ?></title>

<p align="center" style="font-size:25px"><?php echo e($res->center_name); ?></p>

<table width="80%" align="center" border="1" style="text-align:center" cellspacing="0" cellpadding="10">

<tr>
<td width="50%"><b>Center Name</b></td>
<td width="50%"><?php echo e($res->center_name); ?></td>
</tr>

<tr>
<td><b>Person Name</b></td>
<td><?php echo e($res->person_name); ?></td>
</tr>

<tr>
<td><b>Mobile</b></td>
<td><?php echo e($res->mobile); ?></td>
</tr>

<tr>
<td><b>Email</b></td>
<td><?php echo e($res->email); ?></td>
</tr>

<tr>
<td><b>Address</b></td>
<td><?php echo e($res->address); ?></td>
</tr>

<tr>
<td><b>Status</b></td>
<td><?php if($res->status == 1){ echo "<span style='color:green;font-size:20px'>Active</span>"; } ?>
	<?php if($res->status == 0){ echo "<span style='color:red;font-size:20px'>DeActiveted</span>"; } ?>
</td>
</tr>

<tr>
<td><b>User Name</b></td>
<td><?php echo e($res->user_name); ?></td>
</tr>

<tr>
<td><b>Password</b></td>
<td><?php echo e($res->shw_password); ?></td>
</tr>

<?php
$student = DB::table("student")->where('center_id',$res->id)->count();
?>

<tr>
<td><b>Total Student</b></td>
<td><b><?php echo e($student); ?></b></td>
</tr>

<?php
$d 	= strtotime($res->valid_date);
$od = date("d-M-Y", $d);
?>

<tr>
<td><b>Valid Date</b></td>
<td><span style="color:green;font-size:20px"><?php echo e($od); ?></span></td>
</tr>

</table>

<br>

<?php
$payments = DB::table("user_payment")->where("user_id",$res->id)->where('res',1)->orderBy('date_added','DESC')->get();

if(count($payments) > 0)
{
?>
<p align="center" style="font-size:25px">Payment Details</p>
<table width="80%" align="center" border="1" style="text-align:center" cellspacing="0" cellpadding="10">

<tr>

<td><b>Order No</b></td>
<td><b>Invoice Id</b></td>
<td><b>Amount</b></td>
<td><b>Plan</b></td>
<td><b>Date Added</b></td>

</tr>

<?php
foreach($payments as $payment)
{
	$d 	= strtotime($payment->date_added);
	$od = date("d-M-Y", $d);
	
	$total[] = $payment->amount;
?>

<tr>
<td><?php echo e($payment->order_no); ?></td>
<td><?php echo e($payment->invoice_id); ?></td>
<td>Rs.<?php echo e($payment->amount); ?></td>
<td><?php echo e($payment->plan); ?></td>
<td><?php echo e($od); ?></td>
</tr>
<?php } ?>

<tr>
<td>&nbsp;</td>
<td><b>Total :</b></td>
<td><b>Rs.<?php echo e(array_sum($total)); ?></b></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

</table>

<?php }?>

