Send table and data format to email with php

0

How could you implement the design of the table so that it reaches the recipient email as shown in the query screen, if you have any suggestions or help in any way.

<!DOCTYPE html>
<html>
<body>
<form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<table border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#A4A4A4" style="font-size:15px">
<tr>
<tr>
<th colspan="12" BGCOLOR="#B2BABB"><font size="2.9">REGISTRO DE GANADORES</th>
</tr>
<th width="50" BGCOLOR="#B2BABB"><font size="2">ITEM </font></th>
<th width="55" BGCOLOR="#B2BABB"><font size="2">FECHA </font></th>
<th width="50" BGCOLOR="#B2BABB"><font size="2">OCURRENCIA</th>
<th width="50" BGCOLOR="#B2BABB"><font size="2">USER</th>
</tr>

<?php 
$fechaIni="";
$fechaFin="";
$suma=0;

if(isset($_POST['submit'])){
    $busca="";
    $busca1="";
    $busca=$_POST['busca'];
    $busca1=$_POST['busca1'];
    $f="";

$mysqli =new mysqli('localhost','','','');
$mysqli->set_charset("utf8");

if($busca!="" && $busca1!=""){
    $res= $mysqli->query("SELECT * FROM datos Where Fecha BETWEEN '$busca' AND '$busca1'");
    $concatenado=''; 
    $cabeza.="Item"."     "."Fecha"."      "."Ocurrencia"."        "."User";

    while($f=$res->fetch_array()){
    ?>
    <tr>
    <?php
    $concatenado .="<strong>".$f['Item']."</string><br>"."   ".$f['Fecha']."   ".$f['ocurrencia']."  ".$f['user']."\n";
    ?>
    </tr>
    <?php
    $concatenado .=$f['Item']."   ".$f['Fecha']."   ".$f['ocurrencia']."  ".$f['user']."\n";  
    ?>
    <tr>
    <td align="center"> <font size="1"><?php echo $f['Item'] ?></td>
    <td align="center"> <font size="1"><?php echo $f['Fecha'] ?></td>   
    <td align="center"> <font size="1"><?php echo $f['ocurrencia'] ?></td>
    <td align="center"><font size="1"><?php echo $f['user'] ?></td>
    </tr>
    <?php
    }

ini_set('date.timezone','America/Lima');
echo "<p align=right>".date("d/m/Y")."<br>".date("h:i:s");
    }
}
mail('[email protected]','mi titulo',$concatenado);  
?>

<div align="center">
</div>  
</body>
</html>
    
asked by user83962 16.11.2018 в 23:19
source

0 answers