<?

include "classes/db.class.php";
include "classes/email.class.php";
function addDays($date, $days, $format = "Y-m-d")
{
    $date = new DateTime($date);
    $date->modify("$days days");
    return $date->format($format);
}


$html = "";
$db = new db();

$farm_res = $db->exec_query('farms', ['*'], '', '', '', '', '1', "ORDER BY record_id ASC");

while ($farm = $farm_res->fetch_assoc()) {



    echo $html;


    $body = "<h1>FULL ASSET SERVICE REPORT </h1>  <hr> $html";
    // if (count($amlost_due) > 1) {
    echo "SEND YES";
    $email_send = new email();
    $em = ['chris@elegantwork.co.za'];
    $names = ['CP'];
    $email_send->send_mail($em, $names, $body, "{$farm['farm_name']} SERVICE REPORT");

}
