Example #1
0
}
$email_blast_type = array('Action', 'Newsletter', 'Donation Appeal', 'Devo Event', 'Event', 'Update', 'Kicker', 'Welcome', 'Other');
if ($_REQUEST['email_blast_type']) {
    $options['email_blast_type'] = $_REQUEST['email_blast_type'];
}
if ($_REQUEST['campaign']) {
    $options['campaign'] = $_REQUEST['campaign'];
}
if ($_REQUEST['date']) {
    $options['date'] = $_REQUEST['date'];
}
?>
<h1>Email Blasts</h1>
<form method="get" class="search">
Filter List By: <select name="campaign"><option value="">Select Department</option><?php 
echo campaign_options();
?>
</select>
<select name="email_blast_type"><option value="">Select Type</option><?php 
foreach ($email_blast_type as $i) {
    echo '<option>' . $i . '</option>';
}
?>
</select>
<input placeholder="Date 0000-00-00" name="date" type="text">
	<input type="submit" value="Filter">

</form>

<?  echo email_list(2000,$options);
if ($_REQUEST['order']) {
    $orderby = 'order by ' . $_REQUEST['order'];
}
$sql = 'select * from source_code_map ' . $orderby;
$S = $db->Execute($sql) or die($db->errorMsg());
$s = $S->GetArray();
echo '<table class="table xtable-bordered"><thead><tr><th>source</th><th>source type category</th><th>source type subcategory</th><th>source campaign</th><th>source type note</th><th>source type</th><th>referal code</th><th>count</th><th>new</th><th></th></tr> </thead><tbody>';
foreach ($s as $i) {
    echo '<tr><td>' . $i['source'];
    echo '<a href="#"source-code-id=' . $i['id'] . ' class="show-form"><i class="icon-pencil"></i></a>';
    echo '<div class="source-form" id="source-form-' . $i['id'] . '"><form action="' . $_SERVER['PHP_SELF'] . '" method="post">
<input type="hidden" name="id" value="' . $i['id'] . '"> 
<label>Category</label><select name="source_type_category">' . source_type_options($i['source_type_category']) . '</select>

<label>Sub Category</label><input type="text" name="source_type_subcategory" value="' . $i['source_type_subcategory'] . '" class="span2">
<label>Campaign</label><select name="source_campaign">' . campaign_options($i['source_campaign']) . '</select>
<label>Note</label><input type="text" name="source_type_note" value="' . $i['source_type_note'] . '" class="span2">
<label>Referral</label><input type="text" name="source_referral" value="' . $i['source_referral'] . '" class="span2">

<label>KEY</label><input type="text" name="source_key" value="' . $i['source_key'] . '" class="span2">

<input type="hidden" name="new" value="0">
<input type="submit" value="update">
</form></div>';
    echo '</td><td>' . $i['source_type_category'] . '</td><td>' . $i['source_type_subcategory'] . '</td><td>' . $i['source_campaign'] . '</td><td>' . $i['source_type_note'] . '</td><td>' . $i['source_type'] . '</td><td>' . $i['referral_code'] . '</td><td>' . $i['ct'] . '</td><td>' . $i['new'] . '</td><td><a href="" class="edit">edit</a></td></tr>';
}
echo ' </tbody></table>';
function add_missing_codes()
{
    global $db;
    $x = 0;