\n"); $error_message = getLanguageText('ERRORMSG-ACCESS-DENIED'); include "form.messages.php"; return; } // // Build a database query based on the input data provided // if (!$_POST) return; extract($_POST); $PrimaryTable = "sales_contacts"; // // Define the default query to be used // $Parameters = ""; $EmailField = "email"; $Recipients = array("name","school_name","school_city","email"); $Alignment = array("left","left","left","left"); $Category = "Sales Contacts Broadcast"; $Description = "Broadcast to Hot Lunch Sales Contacts"; $Where = ""; // // Handle any parameters // if (isset($selected_email) && strlen($selected_email)) { $Where .= "AND email = '$selected_email' "; } // Process updated selection list if (array_key_exists('sel',$_POST)) { if (is_array($_POST['sel'])) { $_POST['sel'] = join(",", $_POST['sel']); } $Where .= " and record_num IN ({$_POST['sel']}) "; $Description .= " (custom recipient list)"; } // Build the query $Query = "SELECT * " . "FROM sales_contacts " . "WHERE email is not null " . "AND email != '' " . "AND active = 'Y' " . $Where . "ORDER BY email,name"; // create attachment list if (array_key_exists('attachments',$_POST)) { if (is_array($_POST['attachments'])) { $attachments = $_POST['attachments'] = join(",", $_POST['attachments']); } } // // Determine how many emails will be sent // $results = db_query($Query); $num_rows = db_num_rows($results); ?>