<?php
error_reporting(E_ALL);
ini_set('display_errors' ,1);
require "connection.php";
$to = "jasmine@hotmail.com";
$subject = "CURRENT_DATE";
?>
<?php
$query= "SELECT client_id, count(client_id) AS rows, array_agg(insurance) AS insurance from vouchers WHERE parsing_date=CURRENT_DATE GROUP BY client_id";
$result = pg_query($conn,$query);
?>
<!DOCTYPE html>
<html>
<head>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<link href = "http://fonts.googleapis.com/css?family=Roboto:400">
<style>
.responstable {
margin: 1em 0;
width: 100%;
overflow: hidden;
background: #FFF;
color: #024457;
border-radius: 10px;
border: 1px solid #167F92;
word-wrap: break-word;
}
.responstable tr {
border: 1px solid #D9E4E6;
}
.responstable tr:nth-child(odd) {
background-color: #EAF3F3;
}
</style>
</head>
<body>
<div class="container-fluid">
<div>
<h1>Clients</h1>
</div>
<table class="responstable" rules='all' style='border-collapse: collapse;'>
<thead>
<tr>
<th>Client id</th>
<th>Number of rows</th>
<th>Insurance</th>
</tr>
</thead>
<?php
while($row = pg_fetch_array($result))
{
$find ='{';
$replace = '' ;
$arr = $row['insurance'];
$insurance3= str_replace($find,$replace,$arr);
$insurance = str_replace('"',' ',$insurance3);
?>
<tbody>
<td><?php echo $row['client_id']; ?></td>
<td><?php echo $row['rows'];?></td>
<td><?php echo $insurance; ?></td>
</tr>
<?php }
?> </tbody>
</table>
</div>
</body>
</html>
<?php
$headers = "HI";
mail($to,$subject,$message,$headers);
?>
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.