<?php

$stmt = $GLOBALS['con']->prepare("SELECT `clientname`,`email`,`pri_contact_name`,`pri_contact_email`,`sec_contact_name`,`sec_contact_email` FROM `clientdetails` WHERE `statuslive`='1' ORDER BY `clientname` ASC")or die(mysqli_error($GLOBALS['con']));
$stmt->execute();$s=$stmt->get_result();$stmt->close();
$c='';
while($d=mysqli_fetch_array($s)){
if($d['clientname']!="" && $d['email']!=""){$c.='<option class="option-label" value="NULL" disabled>'.$d['clientname'].'</option>';}
if($d['email']!=""){$c.='<option value="'.$d['email'].'">Main Email: '.$d['email'].'</option>';
//if($d['finance_email']!=""){$c.='<option value="'.$d['finance_email'].'">finance_email Email</option>';}
if($d['pri_contact_name']!="" && $d['pri_contact_email']!=""){$c.='<option value="'.$d['pri_contact_email'].'">Primary Contact: '.$d['pri_contact_name'].'</option>';}
if($d['sec_contact_name']!="" && $d['sec_contact_email']!=""){$c.='<option value="'.$d['sec_contact_email'].'">Secondary Contact: '.$d['sec_contact_name'].' </option>';}
}
else{}
}
$list=$c;



$stmt = $GLOBALS['con']->prepare("SELECT `location`,`email` FROM `dd_hse` ORDER BY `location` ASC")or die(mysqli_error($GLOBALS['con']));
$stmt->execute();$s=$stmt->get_result();$stmt->close();
$hselist='';
while($d=mysqli_fetch_array($s)){
if($d['location']!="" && $d['email']!=""){$h.='<option value="'.$d['email'].'" >'.$d['location'].'</option>';}
}
$hselist=$h;
?>