require_once ("../inc/userOwnership.php"); $label_rep_query = "SELECT o.email as email, o.office_phone as office_phone, v.vendor_id FROM vendor v LEFT JOIN orchadmin_users o ON v.assigned_to = o.id WHERE v.vendor_id = ".QueryFormatNumber($_SESSION['S_VENDOR_ID']); if(!$rs = $mysqli->query($label_rep_query)) showerror($label_rep_query); $row = $rs->fetch_object(); // If User is Non DA then get the subaccount email id from session else get the vendor email id. $subaccount_email_id = isset($_SESSION['Alw']['subaccount_contact_email']) ? $_SESSION['Alw']['subaccount_contact_email'] : ''; if($UserObj->isAllowed("","","footercontactemail") && isset($subaccount_email_id)){ $assignedToEmail = $subaccount_email_id; $contactText = "Your Distributor Contact:"; }else{ $contactText = "Your Orchard Contact:"; $assignedToEmail = $row->email; if (!$assignedToEmail){//if DA email id is not set then show the default email id. $assignedToEmail = 'clientservices@theorchard.com'; } } ?>