Fourth pass at adding key files

This commit is contained in:
dsainty
2024-06-17 22:30:36 +10:00
parent 08eb7b7da2
commit 67ccdbcc34
132 changed files with 11416 additions and 0 deletions

View File

@@ -0,0 +1,496 @@
<?PHP
/*NEED TO UPDATE:
- Only admins can view the drop down box
- Only users who have a registered advertiser account can request IOs
*/
include("config.php");
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
if(!is_logged_in($user)){
header('Location: '.$site_url);
exit();
}
$useruid = base64_decode($_SESSION['user_id']);
// set the page title
$pagetitle = "Add an Insertion Order";
// set meta tags
$meta_keywords = "add insertion order";
$meta_description = "create advertising insertion order request";
?>
<? include("include_common_head.php"); ?>
<?
if($_POST[add_campaign] == true){
include("add_X.php");
}
?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<?
if( $insert_success == true || $_GET[confirmed] == "yes" ) { ?>
<h1 class="content-title"><strong>Thank you</strong></h1>
<p class="cont">Thank you. Your insertion orer request should be added within 24 hours. You will now be redirected back to the add page.</p>
<META HTTP-EQUIV=Refresh CONTENT="4; URL=add.php">
<?
unset($insert_success);
unset($confirm_campaign);
?>
<? } else if( $confirm_campaign == true ) { ?>
<h1 class="content-title"><strong>Insertion Order Request: Step 2 of 2</strong></h1>
<? }else if( ($confirm_campaign != true) || ($_POST[add_campaign] != true) ){ ?>
<h1 class="content-title"><strong>Insertion Order Request: Step 1 of 2</strong></h1>
<? if (!$errmsg) { ?>
<p class="cont">This form allows for easy advertisement insertion order requests. Advertising collateral CANNOT be submitted via this form. This form is for insertion order request details only. Simply fill out the form below. Be sure to fill out every field. After filling out each field, click submit. <span style="color: red;">You will then be prompted to confirm your information before the information is sent to us.</span></p>
<?
} else { ?>
<p class="cont"><span style="color: red;"><? echo $errmsg; ?></span></p>
<? } ?>
<? }
// begin insert form
if( (($_POST[add_campaign] != true) || ($errmsg) || (($confirm_campaign != true) && ($_POST[insert_campaign] != true))) && $_GET[confirmed] != "yes") {
?>
<form enctype="multipart/form-data" action="add.php" method="post">
<? //var_dump($_POST); ?>
<div class="dtable form">
<div class="drow">
<div class="dcell name">Advertiser</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if(isset($_GET[account_id])) {
$account_id = $_GET[account_id];
$sql = "SELECT * FROM io_account WHERE account_id = \"".$account_id."\" LIMIT 1";
$fetch = mysql_fetch_array(mysql_query($sql) OR die(mysql_error()));
$account_name = $fetch[account_advertiser];
echo "This insertion order is being connected to advertiser: ".$advertiser;
echo ("<input type=\"hidden\" name=\"account_name\" value=\"".$account_name."\">");
echo ("<input type=\"hidden\" name=\"account_id\" value=\"".$account_id."\">");
} elseif (isset($_POST[account_id])) {
$account_id = $_POST[account_id];
$sql = "SELECT * FROM io_account WHERE account_id = \"".$account_id."\" LIMIT 1";
$fetch = mysql_fetch_array(mysql_query($sql)) OR die(mysql_error());
$account_name = $fetch[account_advertiser];
echo "This insertion order is being connected to advertiser: ".$account_name;
echo ("<input type=\"hidden\" name=\"account_name\" value=\"".$account_name."\">");
echo ("<input type=\"hidden\" name=\"account_id\" value=\"".$account_id."\">");
} else {
//echo ("please select the advertiser from the following drop down: ");
$ad_sql = "SELECT * FROM io_account WHERE 1=1";
$ad_results = mysql_query($ad_sql) OR die(mysql_error());
echo ("<select name=\"account_id\">");
while ($ad_row = mysql_fetch_array($ad_results)) {
echo ("<option value=\"$ad_row[account_id]\">$ad_row[account_advertiser]");
}
echo ("</select>");
} ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Campaign Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes($_POST[name]); ?>" type="text" name="name" class="txt lngtext" maxlength="80">
</div>
</div>
<div class="drow">
<div class="dcell name">300x250</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="hidden" name="300x250" value="0"><input value="1" type="checkbox" name="300x250" <? if($_POST['300x250'] == 1) {echo "checked";} ?>>
<? /* need to insert checking in case of edit here on the value side */ ?> Number of Impressions: <input value="<? echo stripslashes($_POST['300x250_impression']); ?>" type="text" name="300x250_impression" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">728x90</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="hidden" name="728x90" value="0"><input value="1" type="checkbox" name="728x90" <? if($_POST['728x90'] == 1) {echo "checked";} ?>>
<? /* need to insert checking in case of edit here on the value side */ ?> Number of Impressions: <input value="<? echo stripslashes($_POST['728x90_impression']); ?>" type="text" name="728x90_impression" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">300x600</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="hidden" name="300x600" value="0"><input value="1" type="checkbox" name="300x600" <? if($_POST['300x600'] == 1) {echo "checked";} ?>>
<? /* need to insert checking in case of edit here on the value side */ ?> Number of Impressions: <input value="<? echo stripslashes($_POST['300x600_impression']); ?>" type="text" name="300x600_impression" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">970x250</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="hidden" name="970x250" value="0"><input value="1" type="checkbox" name="970x250" <? if($_POST['970x250'] == 1) {echo "checked";} ?>>
<? /* need to insert checking in case of edit here on the value side */ ?> Number of Impressions: <input value="<? echo stripslashes($_POST['970x250_impression']); ?>" type="text" name="970x250_impression" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">Wallpaper</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="hidden" name="wallpaper" value="0"><input value="1" type="checkbox" name="wallpaper" <? if($_POST['wallpaper'] == 1) {echo "checked";} ?>>
<? /* need to insert checking in case of edit here on the value side */ ?> Number of Impressions: <input value="<? echo stripslashes($_POST['wallpaper_impression']); ?>" type="text" name="wallpaper_impression" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">Start Date</div>
<div class="dcell divider"></div>
<div class="dcell value">
<select name="month">
<option value="0">Month</option>
<option value="01" <? if(strcmp($_POST[month], "01") == 0){ echo ("selected"); } ?>>January</option>
<option value="02" <? if(strcmp($_POST[month], "02") == 0){ echo ("selected"); } ?>>February</option>
<option value="03" <? if(strcmp($_POST[month], "03") == 0){ echo ("selected"); } ?>>March</option>
<option value="04" <? if(strcmp($_POST[month], "04") == 0){ echo ("selected"); } ?>>April</option>
<option value="05" <? if(strcmp($_POST[month], "05") == 0){ echo ("selected"); } ?>>May</option>
<option value="06" <? if(strcmp($_POST[month], "06") == 0){ echo ("selected"); } ?>>June</option>
<option value="07" <? if(strcmp($_POST[month], "07") == 0){ echo ("selected"); } ?>>July</option>
<option value="08" <? if(strcmp($_POST[month], "08") == 0){ echo ("selected"); } ?>>August</option>
<option value="09" <? if(strcmp($_POST[month], "09") == 0){ echo ("selected"); } ?>>September</option>
<option value="10" <? if(strcmp($_POST[month], "10") == 0){ echo ("selected"); } ?>>October</option>
<option value="11" <? if(strcmp($_POST[month], "11") == 0){ echo ("selected"); } ?>>November</option>
<option value="12" <? if(strcmp($_POST[month], "12") == 0){ echo ("selected"); } ?>>December</option>
</select>
<select name="day">
<option value="0">Day</option>
<option value="01" <? if(strcmp($_POST[day], "01") == 0){ echo ("selected"); } ?>>1</option>
<option value="02" <? if(strcmp($_POST[day], "02") == 0){ echo ("selected"); } ?>>2</option>
<option value="03" <? if(strcmp($_POST[day], "03") == 0){ echo ("selected"); } ?>>3</option>
<option value="04" <? if(strcmp($_POST[day], "04") == 0){ echo ("selected"); } ?>>4</option>
<option value="05" <? if(strcmp($_POST[day], "05") == 0){ echo ("selected"); } ?>>5</option>
<option value="06" <? if(strcmp($_POST[day], "06") == 0){ echo ("selected"); } ?>>6</option>
<option value="07" <? if(strcmp($_POST[day], "07") == 0){ echo ("selected"); } ?>>7</option>
<option value="08" <? if(strcmp($_POST[day], "08") == 0){ echo ("selected"); } ?>>8</option>
<option value="09" <? if(strcmp($_POST[day], "09") == 0){ echo ("selected"); } ?>>9</option>
<option value="10" <? if(strcmp($_POST[day], "10") == 0){ echo ("selected"); } ?>>10</option>
<option value="11" <? if(strcmp($_POST[day], "11") == 0){ echo ("selected"); } ?>>11</option>
<option value="12" <? if(strcmp($_POST[day], "12") == 0){ echo ("selected"); } ?>>12</option>
<option value="13" <? if(strcmp($_POST[day], "13") == 0){ echo ("selected"); } ?>>13</option>
<option value="14" <? if(strcmp($_POST[day], "14") == 0){ echo ("selected"); } ?>>14</option>
<option value="15" <? if(strcmp($_POST[day], "15") == 0){ echo ("selected"); } ?>>15</option>
<option value="16" <? if(strcmp($_POST[day], "16") == 0){ echo ("selected"); } ?>>16</option>
<option value="17" <? if(strcmp($_POST[day], "17") == 0){ echo ("selected"); } ?>>17</option>
<option value="18" <? if(strcmp($_POST[day], "18") == 0){ echo ("selected"); } ?>>18</option>
<option value="19" <? if(strcmp($_POST[day], "19") == 0){ echo ("selected"); } ?>>19</option>
<option value="20" <? if(strcmp($_POST[day], "20") == 0){ echo ("selected"); } ?>>20</option>
<option value="21" <? if(strcmp($_POST[day], "21") == 0){ echo ("selected"); } ?>>21</option>
<option value="22" <? if(strcmp($_POST[day], "22") == 0){ echo ("selected"); } ?>>22</option>
<option value="23" <? if(strcmp($_POST[day], "23") == 0){ echo ("selected"); } ?>>23</option>
<option value="24" <? if(strcmp($_POST[day], "24") == 0){ echo ("selected"); } ?>>24</option>
<option value="25" <? if(strcmp($_POST[day], "25") == 0){ echo ("selected"); } ?>>25</option>
<option value="26" <? if(strcmp($_POST[day], "26") == 0){ echo ("selected"); } ?>>26</option>
<option value="27" <? if(strcmp($_POST[day], "27") == 0){ echo ("selected"); } ?>>27</option>
<option value="28" <? if(strcmp($_POST[day], "28") == 0){ echo ("selected"); } ?>>28</option>
<option value="29" <? if(strcmp($_POST[day], "29") == 0){ echo ("selected"); } ?>>29</option>
<option value="30" <? if(strcmp($_POST[day], "30") == 0){ echo ("selected"); } ?>>30</option>
<option value="31" <? if(strcmp($_POST[day], "31") == 0){ echo ("selected"); } ?>>31</option>
</select>
<select name="year">
<option value="2017" select="selected">2017</option>
</select>
</div>
</div>
<div class="drow">
<div class="dcell name">Repeat Date</div>
<div class="dcell divider"></div>
<div class="dcell value">
<select name="month_repeat">
<option value="0">Month</option>
<option value="01" <? if(strcmp($_POST[month_repeat], "01") == 0){ echo ("selected"); } ?>>January</option>
<option value="02" <? if(strcmp($_POST[month_repeat], "02") == 0){ echo ("selected"); } ?>>February</option>
<option value="03" <? if(strcmp($_POST[month_repeat], "03") == 0){ echo ("selected"); } ?>>March</option>
<option value="04" <? if(strcmp($_POST[month_repeat], "04") == 0){ echo ("selected"); } ?>>April</option>
<option value="05" <? if(strcmp($_POST[month_repeat], "05") == 0){ echo ("selected"); } ?>>May</option>
<option value="06" <? if(strcmp($_POST[month_repeat], "06") == 0){ echo ("selected"); } ?>>June</option>
<option value="07" <? if(strcmp($_POST[month_repeat], "07") == 0){ echo ("selected"); } ?>>July</option>
<option value="08" <? if(strcmp($_POST[month_repeat], "08") == 0){ echo ("selected"); } ?>>August</option>
<option value="09" <? if(strcmp($_POST[month_repeat], "09") == 0){ echo ("selected"); } ?>>September</option>
<option value="10" <? if(strcmp($_POST[month_repeat], "10") == 0){ echo ("selected"); } ?>>October</option>
<option value="11" <? if(strcmp($_POST[month_repeat], "11") == 0){ echo ("selected"); } ?>>November</option>
<option value="12" <? if(strcmp($_POST[month_repeat], "12") == 0){ echo ("selected"); } ?>>December</option>
</select>
<select name="day_repeat">
<option value="0">Day</option>
<option value="01" <? if(strcmp($_POST[day_repeat], "01") == 0){ echo ("selected"); } ?>>1</option>
<option value="02" <? if(strcmp($_POST[day_repeat], "02") == 0){ echo ("selected"); } ?>>2</option>
<option value="03" <? if(strcmp($_POST[day_repeat], "03") == 0){ echo ("selected"); } ?>>3</option>
<option value="04" <? if(strcmp($_POST[day_repeat], "04") == 0){ echo ("selected"); } ?>>4</option>
<option value="05" <? if(strcmp($_POST[day_repeat], "05") == 0){ echo ("selected"); } ?>>5</option>
<option value="06" <? if(strcmp($_POST[day_repeat], "06") == 0){ echo ("selected"); } ?>>6</option>
<option value="07" <? if(strcmp($_POST[day_repeat], "07") == 0){ echo ("selected"); } ?>>7</option>
<option value="08" <? if(strcmp($_POST[day_repeat], "08") == 0){ echo ("selected"); } ?>>8</option>
<option value="09" <? if(strcmp($_POST[day_repeat], "09") == 0){ echo ("selected"); } ?>>9</option>
<option value="10" <? if(strcmp($_POST[day_repeat], "10") == 0){ echo ("selected"); } ?>>10</option>
<option value="11" <? if(strcmp($_POST[day_repeat], "11") == 0){ echo ("selected"); } ?>>11</option>
<option value="12" <? if(strcmp($_POST[day_repeat], "12") == 0){ echo ("selected"); } ?>>12</option>
<option value="13" <? if(strcmp($_POST[day_repeat], "13") == 0){ echo ("selected"); } ?>>13</option>
<option value="14" <? if(strcmp($_POST[day_repeat], "14") == 0){ echo ("selected"); } ?>>14</option>
<option value="15" <? if(strcmp($_POST[day_repeat], "15") == 0){ echo ("selected"); } ?>>15</option>
<option value="16" <? if(strcmp($_POST[day_repeat], "16") == 0){ echo ("selected"); } ?>>16</option>
<option value="17" <? if(strcmp($_POST[day_repeat], "17") == 0){ echo ("selected"); } ?>>17</option>
<option value="18" <? if(strcmp($_POST[day_repeat], "18") == 0){ echo ("selected"); } ?>>18</option>
<option value="19" <? if(strcmp($_POST[day_repeat], "19") == 0){ echo ("selected"); } ?>>19</option>
<option value="20" <? if(strcmp($_POST[day_repeat], "20") == 0){ echo ("selected"); } ?>>20</option>
<option value="21" <? if(strcmp($_POST[day_repeat], "21") == 0){ echo ("selected"); } ?>>21</option>
<option value="22" <? if(strcmp($_POST[day_repeat], "22") == 0){ echo ("selected"); } ?>>22</option>
<option value="23" <? if(strcmp($_POST[day_repeat], "23") == 0){ echo ("selected"); } ?>>23</option>
<option value="24" <? if(strcmp($_POST[day_repeat], "24") == 0){ echo ("selected"); } ?>>24</option>
<option value="25" <? if(strcmp($_POST[day_repeat], "25") == 0){ echo ("selected"); } ?>>25</option>
<option value="26" <? if(strcmp($_POST[day_repeat], "26") == 0){ echo ("selected"); } ?>>26</option>
<option value="27" <? if(strcmp($_POST[day_repeat], "27") == 0){ echo ("selected"); } ?>>27</option>
<option value="28" <? if(strcmp($_POST[day_repeat], "28") == 0){ echo ("selected"); } ?>>28</option>
<option value="29" <? if(strcmp($_POST[day_repeat], "29") == 0){ echo ("selected"); } ?>>29</option>
<option value="30" <? if(strcmp($_POST[day_repeat], "30") == 0){ echo ("selected"); } ?>>30</option>
<option value="31" <? if(strcmp($_POST[day_repeat], "31") == 0){ echo ("selected"); } ?>>31</option>
</select>
<select name="year_repeat">
<option value="2017" select="selected">2017</option>
</select>Specify additional dates in NOTES
</div>
</div>
<div class="drow">
<div class="dcell name">Notes</div>
<div class="dcell divider"></div>
<div class="dcell value">
<textarea name="notes" rows="7" class="txt lngtext" placeholder="Please add any additional notes here. Additional repeat dates may be added here as well."><? if($_POST[notes]){ echo strip_tags(stripslashes($_POST[notes])); } ?></textarea>
</div>
</div>
<? if ($_SESSION[user_id] == $fetch[account_user_id_fk]) { ?>
<div class="drow">
<div class="dcell name">Signature</div>
<div class="dcell divider"></div>
<div class="dcell value">
By signing your name here, you are agreeing to the terms of the Slowtwitch Advertising Contract for this insertion order.<br />
<input value="" type="text" name="signature" class="txt midtext">
</div>
</div>
<? } ?>
<div class="drow actions">
<div class="dcell name"></div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="submit" value="Submit" class="btn">
<input type="hidden" name="add_campaign" value="true">
</div>
</div>
</div>
</form>
<? }
// end insert form
// begin confirmation form
if($confirm_campaign == true){
?>
Please confirm your information. If everything is correct, click the submit button. Otherwise, you may click the edit button to change your information before submitting.</div>
<br />
<? //var_dump($_POST); ?>
<div class="dtable form">
<div class="drow">
<div class="dcell name">Advertiser</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if (isset($_POST[account_name])) { echo stripslashes($_POST[account_name]); } else { $account_id = $_POST[account_id];
$sql = "SELECT * FROM io_account WHERE account_id = \"".$account_id."\" LIMIT 1";
$fetch = mysql_fetch_array(mysql_query($sql)) OR die(mysql_error());
$_POST[account_name] = $fetch[account_advertiser];
echo $_POST[account_name]; } ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes($_POST[name]); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">300x250</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if ($_POST['300x250'] == 1) { echo "Yes, for ".$_POST['300x250_impression']; } else { echo "No."; } ?>
</div>
</div>
<div class="drow">
<div class="dcell name">728x90</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if ($_POST['728x90'] == 1) { echo "Yes, for ".$_POST['728x90_impression']; } else { echo "No."; } ?>
</div>
</div>
<div class="drow">
<div class="dcell name">300x600</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if ($_POST['300x600'] == 1) { echo "Yes, for ".$_POST['300x600_impression']; } else { echo "No."; } ?>
</div>
</div>
<div class="drow">
<div class="dcell name">970x250</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if ($_POST['970x250'] == 1) { echo "Yes, for ".$_POST['970x250_impression']; } else { echo "No."; } ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Wallpaper</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if ($_POST['wallpaper'] == 1) { echo "Yes, for ".$_POST['wallpaper_impression']; } else { echo "No."; } ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Start Date</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo "$month/$day/$year"; ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Repeat Date</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if ($month_repeat != "0") { echo "$month_repeat/$day_repeat/$year_repeat"; } else { echo "No repeat set."; } ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Notes</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo strip_tags(stripslashes($_POST[notes])) ?>
</div>
</div>
<div class="drow actions">
<div class="dcell name"></div>
<div class="dcell divider"></div>
<div class="dcell value">
<form action="add.php" method="post">
<input type="hidden" name="name" value="<? echo stripslashes(htmlspecialchars($_POST[name])); ?>">
<input type="hidden" name="account_id" value="<? echo stripslashes(htmlspecialchars($_POST[account_id])); ?>">
<input type="hidden" name="account_name" value="<? echo stripslashes(htmlspecialchars($_POST[account_name])); ?>">
<input type="hidden" name="300x250" value="<? echo stripslashes(htmlspecialchars($_POST['300x250'])); ?>">
<input type="hidden" name="300x250_impression" value="<? echo stripslashes(htmlspecialchars($_POST['300x250_impression'])); ?>">
<input type="hidden" name="728x90" value="<? echo stripslashes(htmlspecialchars($_POST['728x90'])); ?>">
<input type="hidden" name="728x90_impression" value="<? echo stripslashes(htmlspecialchars($_POST['728x90_impression'])); ?>">
<input type="hidden" name="300x600" value="<? echo stripslashes(htmlspecialchars($_POST['300x600'])); ?>">
<input type="hidden" name="300x600_impression" value="<? echo stripslashes(htmlspecialchars($_POST['300x600_impression'])); ?>">
<input type="hidden" name="970x250" value="<? echo stripslashes(htmlspecialchars($_POST['970x250'])); ?>">
<input type="hidden" name="970x250_impression" value="<? echo stripslashes(htmlspecialchars($_POST['970x250_impression'])); ?>">
<input type="hidden" name="wallpaper" value="<? echo stripslashes(htmlspecialchars($_POST['wallpaper'])); ?>">
<input type="hidden" name="wallpaper_impression" value="<? echo stripslashes(htmlspecialchars($_POST['wallpaper_impression'])); ?>">
<input type="hidden" name="month" value="<? echo $_POST[month]; ?>">
<input type="hidden" name="day" value="<? echo $_POST[day]; ?>">
<input type="hidden" name="year" value="<? echo $_POST[year]; ?>">
<input type="hidden" name="month_repeat" value="<? echo $_POST[month_repeat]; ?>">
<input type="hidden" name="day_repeat" value="<? echo $_POST[day_repeat]; ?>">
<input type="hidden" name="year_repeat" value="<? echo $_POST[year_repeat]; ?>">
<input type="hidden" name="notes" value="<? echo stripslashes(htmlspecialchars($_POST[notes])); ?>">
<input type="hidden" name="add_campaign" value="true">
<input type="hidden" name="insert_campaign" value="true">
<input type="hidden" name="submitted_by" value="<? echo $useruid; ?>" >
<input type="submit" name="submit" value="Submit Info" class="btn float-left" style="margin-right: 5px;"/>
</form>
<form action="add.php" method="post">
<input type="hidden" name="name" value="<? echo stripslashes(htmlspecialchars($_POST[name])); ?>">
<input type="hidden" name="account_id" value="<? echo stripslashes(htmlspecialchars($_POST[account_id])); ?>">
<input type="hidden" name="account_name" value="<? echo stripslashes(htmlspecialchars($_POST[account_name])); ?>">
<input type="hidden" name="300x250" value="<? echo stripslashes(htmlspecialchars($_POST['300x250'])); ?>">
<input type="hidden" name="300x250_impression" value="<? echo stripslashes(htmlspecialchars($_POST['300x250_impression'])); ?>">
<input type="hidden" name="728x90" value="<? echo stripslashes(htmlspecialchars($_POST['728x90'])); ?>">
<input type="hidden" name="728x90_impression" value="<? echo stripslashes(htmlspecialchars($_POST['728x90_impression'])); ?>">
<input type="hidden" name="300x600" value="<? echo stripslashes(htmlspecialchars($_POST['300x600'])); ?>">
<input type="hidden" name="300x600_impression" value="<? echo stripslashes(htmlspecialchars($_POST['300x600_impression'])); ?>">
<input type="hidden" name="970x250" value="<? echo stripslashes(htmlspecialchars($_POST['970x250'])); ?>">
<input type="hidden" name="970x250_impression" value="<? echo stripslashes(htmlspecialchars($_POST['970x250_impression'])); ?>">
<input type="hidden" name="wallpaper" value="<? echo stripslashes(htmlspecialchars($_POST['wallpaper'])); ?>">
<input type="hidden" name="wallpaper_impression" value="<? echo stripslashes(htmlspecialchars($_POST['wallpaper_impression'])); ?>">
<input type="hidden" name="month" value="<? echo $_POST[month]; ?>">
<input type="hidden" name="day" value="<? echo $_POST[day]; ?>">
<input type="hidden" name="year" value="<? echo $_POST[year]; ?>">
<input type="hidden" name="month_repeat" value="<? echo $_POST[month_repeat]; ?>">
<input type="hidden" name="day_repeat" value="<? echo $_POST[day_repeat]; ?>">
<input type="hidden" name="year_repeat" value="<? echo $_POST[year_repeat]; ?>">
<input type="hidden" name="notes" value="<? echo stripslashes(htmlspecialchars($_POST[notes])); ?>">
<input type="hidden" name="confirm_campaign" value="0">
<input type="submit" name="submit" value="Edit Information" class="btn float-left" />
</form>
</div>
</div>
</div>
<?
}
//end confirmation form
?>
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,118 @@
<?PHP
if (!$_POST){ header('Location: '.$site_url); }
/*
FIELD NAMES:
campaign_id
campaign_account_id_fk
campaign_name
campaign_300x250
campaign_300x250_impression
campaign_728x90
campaign_728x90_impression
campaign_300x600
campaign_300x600_impression
campaign_970x250
campaign_970x250_impression
campaign_wallpaper
campaign_wallpaper_impression
campaign_date
campaign_date_repeat
campaign_signature
campaign_signature_timestamp
campaign_deploy_timestamp
campaign_screenshot_timestamp
campaign_invoice_timestamp
campaign_notes
campaign_archive
campaign_archive_timestamp
campaign_archive_prior_id_fk
*/
/* Need to ltrim and rtrim commas before insertion */
//Insert into database
//$pass = 'abc123';
$errmsg = NULL;
$insert_success = NULL;
//Check for blank fields
if ((!$_POST[name])) $errmsg = $errmsg."Campaign name cannot be left blank, ";
if ($_POST['300x250'] == 1 && $_POST['300x250_impression'] == "") { $errmsg = $errmsg."You must specify a number of impressions if you select 300x250 ad unit, "; }
if ($_POST['300x250'] == 1 && $_POST['300x250_impression'] != "" && !is_numeric($_POST['300x250_impression'])) { $errmsg = $errmsg."300x250 impressions must be a number, "; }
if ($_POST['728x90'] == 1 && $_POST['728x90_impression'] == "") { $errmsg = $errmsg."You must specify a number of impressions if you select 728x90 ad unit, "; }
if ($_POST['728x90'] == 1 && $_POST['728x90_impression'] != "" && !is_numeric($_POST['728x90_impression'])) { $errmsg = $errmsg."728x90 impressions must be a number, "; }
if ($_POST['300x600'] == 1 && $_POST['300x600_impression'] == "") { $errmsg = $errmsg."You must specify a number of impressions if you select 300x600 ad unit, "; }
if ($_POST['300x600'] == 1 && $_POST['300x600_impression'] != "" && !is_numeric($_POST['300x600_impression'])) { $errmsg = $errmsg."300x600 impressions must be a number, "; }
if ($_POST['970x250'] == 1 && $_POST['970x250_impression'] == "") { $errmsg = $errmsg."You must specify a number of impressions if you select 970x250 ad unit, "; }
if ($_POST['970x250'] == 1 && $_POST['970x250_impression'] != "" && !is_numeric($_POST['970x250_impression'])) { $errmsg = $errmsg."970x250 impressions must be a number, "; }
if ($_POST['wallpaper'] == 1 && $_POST['wallpaper_impression'] == "") { $errmsg = $errmsg."You must specify a number of impressions if you select wallpaper ad unit, "; }
if ($_POST['wallpaper'] == 1 && $_POST['wallpaper_impression'] != "" && !is_numeric($_POST['wallpaper_impression'])) { $errmsg = $errmsg."Wallpaper impressions must be a number, "; }
if ($_POST['month']==0) $errmsg = $errmsg.'Start month cannot be left blank, ';
if ($_POST['day']==0) $errmsg = $errmsg.'Start day cannot be left blank, ';
if (strlen($_POST['notes']) < 4) $errmsg = $errmsg."Notes cannot be left blank, ";
if (isset($errmsg)) {
$errmsg = rtrim($errmsg, ", ");
$errmsg = $errmsg."<br />";
}
// begin error message check
if(!$errmsg){
$account_id = $_POST['account_id'];
$name = trim($_POST['name']);
$date_repeat = NULL;
if (isset($_POST['day_repeat']) && isset($_POST['month_repeat'])) {
$year_repeat = $_POST['year_repeat'];
$month_repeat = $_POST['month_repeat'];
$day_repeat = $_POST['day_repeat'];
$date_repeat = "$year_repeat-$month_repeat-$day_repeat";
}
$ad_300x250 = $_POST['300x250'];
$ad_300x250_impression = trim($_POST['300x250_impression']);
$ad_728x90 = $_POST['728x90'];
$ad_728x90_impression = trim($_POST['728x90_impression']);
$ad_300x600 = $_POST['300x600'];
$ad_300x600_impression = trim($_POST['300x600_impression']);
$ad_970x250 = $_POST['970x250'];
$ad_970x250_impression = trim($_POST['900x250_impression']);
$ad_wallpaper = $_POST['wallpaper'];
$ad_wallpaper_impression = trim($_POST['wallpaper_impression']);
$year = $_POST['year'];
$month = $_POST['month'];
$day = $_POST['day'];
$date = "$year-$month-$day";
$notes = mysql_escape_string(nl2br(substr(trim($_POST['notes']), 0, 4096)));
// begin boolean check to see if we should insert the coach into the dbase
if($_POST[insert_campaign] == true){
$sql = "INSERT INTO io_campaign (`campaign_account_id_fk`, `campaign_name`, `campaign_300x250`, `campaign_300x250_impression`, `campaign_728x90`, `campaign_728x90_impression`, `campaign_300x600`, `campaign_300x600_impression`, `campaign_970x250`, `campaign_970x250_impression`, `campaign_wallpaper`, `campaign_wallpaper_impression`, `campaign_date`, `campaign_date_repeat`, `campaign_notes`) VALUES ('$account_id', '$name', '$ad_300x250', '$ad_300x250_impression', '$ad_728x90', '$ad_728x90_impression', '$ad_300x600', '$ad_300x600_impression', '$ad_970x250', '$ad_970x250_impression', '$ad_wallpaper', '$ad_wallpaper_impression', '$date', '$date_repeat', '$notes')";
//echo("campaign entered!<br />");
//echo($sql);
mysql_query($sql) OR die(mysql_error());
//exit();
$insert_success = true;
}else{
//echo("campaign NOT entered.");
$confirm_campaign = true;
}
// end insert check
}
// end error message check
?>

View File

@@ -0,0 +1,65 @@
<?PHP include("config.php");
// need to update code so that users are automatically taken to the page for their individual account here.
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
// set the page title
$pagetitle = "Advertiser Accounts";
// set meta tags
$meta_keywords = "advert io";
$meta_description = "tool for requesting an ad isertion";
?>
<? include("include_common_head.php"); ?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<h1 class="float-left">Admin: Advertiser Accounts</h1>
<? /**if (is_logged_in($user)) { ?>
<a href="<? echo $site_url . '/add.php' ?>" class="btn btn-white float-right">Request IO</a>
<? }**/ ?>
<hr class="line" />
<h2>All Advertisers</h2>
<hr />
<?
$ad_sql = "SELECT * FROM io_account WHERE 1=1";
$ad_results = mysql_query($ad_sql) OR die(mysql_error());
while ($ad_row = mysql_fetch_array($ad_results)) {
include("include_advertiser.php");
}
?>
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,127 @@
<?PHP
include("config.php");
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
$account_idhere = mysql_escape_string($_GET[account_id]);
$results = mysql_query("SELECT * FROM io_account WHERE account_id=".$account_idhere." LIMIT 1");
$row = mysql_fetch_array($results);
if (!$row){header('Location: '.$site_url.'/?error=invalid_id');}
// set the page title
$pagetitle = $row[account_advertiser];
// set meta tags
?>
<? include("include_common_head.php"); ?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<h1 class="float-left">Advertisers: Individual Account</h1>
<? if ($user) { ?>
<form method="post" action="account_edit.php?account_id=<? echo $row[account_id] ?>">
<input type="submit" value="Edit" class="nobutton btn btn-white float-right">
</form>
<? } ?>
<a href="" class="btn btn-white float-right">Back</a>
<hr class="line" />
<div class="details grid">
<div class="col-6-12">
<h2><? echo stripslashes(stripslashes($row[account_advertiser])) ; echo " "; ?></h2>
</div>
<div class="col-6-12 address">
</div>
<div class="col-6-12 contact">
</div>
<div class="clearfix"></div>
<br />
<div class="col-1-1">
<? include("include_buttons.php"); ?>
</div>
<div class="col-1-1 detail-block">
<h3>Main Point(s) of Contact</h3>
<div class="highlight-block">
Contact Name: <? echo stripslashes(htmlspecialchars($row[account_contact])); ?>
<br />
Email: <a href="mailto:<? echo $row[account_email]; ?>"><? echo stripslashes(htmlspecialchars($row[account_email])); ?></a><br />
Phone: <? echo stripslashes(htmlspecialchars($row[account_phone])); ?>
</div>
</div>
<div class="col-1-1 detail-block">
<h3>Mailing Address</h3>
<div class="highlight-block">
<? echo stripslashes(htmlspecialchars($row[account_address])); ?><br />
<? if ( $row[account_address_two] ) { echo stripslashes(htmlspecialchars($row[account_address_two]) . "<br />"); } ?>
<? echo stripslashes(htmlspecialchars($row[account_city])); ?>, <? echo stripslashes(htmlspecialchars($row[account_state])); ?> <? echo stripslashes(htmlspecialchars($row[account_zip])); ?><br />
</div>
</div>
<div class="col-1-1 detail-block">
<h3>Campaigns</h3>
<div class="highlight-block">
<strong>Active Campaigns:</strong>
<br />
<strong>Archived Campaigns:</strong>
</div>
</div>
<div class="col-1-1 detail-block">
<h3>Account Notes</h3>
<div class="highlight-block">
<strong>Invoice Via:</strong>
<?
$certification_list = "";
$temp[] = $row[account_invoice];
foreach($temp as $value) {
if ($value == "0") $certification_list = $certification_list."Snail, ";
if ($value == "1") $certification_list = $certification_list."Email";
};
$certification_list = rtrim($certification_list, ', ');
echo $certification_list;
?><br />
<strong>Notes:</strong> <? echo stripslashes(htmlspecialchars($row[account_notes])); ?><br />
</div>
</div>
</div>
<div class="content-divider-bottom"></div>
<? include ('comments_show.php'); ?>
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,419 @@
<?PHP
include("config.php");
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
if(!is_logged_in($user)){
header('Location: '.$site_url);
exit();
}
$useruid = base64_decode($_SESSION['user_id']);
// set the page title
$pagetitle = "Create Advertiser Account";
// set meta tags
$meta_keywords = "create advertiser account";
$meta_description = "create advertiser account for slowtwitch advertising.";
if($_POST[edit_account] == true){
include("advertiser_edit_X.php");
} elseif ($_POST[returning_to_edit] == true) {
$account_id = $_POST[account_id];
} elseif (isset($_GET[account_id])) {
$account_id = $_GET[account_id];
$sql = "SELECT * FROM io_account WHERE account_id = \"".$account_id."\" LIMIT 1";
$fetch = mysql_fetch_array(mysql_query($sql)) OR die(mysql_error());
//var_dump($fetch);
$_POST = $fetch;
} elseif (isset($_POST[account_id])) {
$account_id = $_POST[account_id];
$sql = "SELECT * FROM io_account WHERE account_id = \"".$account_id."\" LIMIT 1";
//var_dump($fetch);
$fetch = mysql_fetch_array(mysql_query($sql)) OR die(mysql_error());
$_POST = $fetch;
} else {
header('Location:'.$site_url.'?error=no_account_id_for_edit/');
}
/*
account_id
account_user_id_fk
account_advertiser
account_contact
account_phone
account_email
account_other
account_invoice
account_notes
*/
?>
<? include("include_common_head.php"); ?>
<?
if($_POST[edit_account] == true){
include("advertiser_edit_X.php");
}
?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<?
if( $insert_success == true || $_GET[confirmed] == "yes" ) { ?>
<h1 class="content-title"><strong>Thank you</strong></h1>
<p class="cont">Thank you. The advertiser account information for <? echo ("$advertiser"); ?> has been entered. You will now be redirected to the IO Insertion Order Add page.</p>
<?
$jump_sql = "SELECT * FROM io_account WHERE account_id = \"".$advertiser."\" LIMIT 1";
$jump_fetch = mysql_fetch_array(mysql_query($jump_sql)) OR die(mysql_error());
$account_id = $jump_fetch[account_id];
?>
<? $meta_jump = "<META HTTP-EQUIV=Refresh CONTENT=\"4; URL=add.php?account_id=".$account_id."\"";
echo $meta_jump;
unset($insert_success);
unset($confirm_account);
?>
<? } else if( $confirm_account == true ) { ?>
<h1 class="content-title"><strong>Admin: Edit Advertiser Account: Step 2 of 2</strong></h1>
<? }else if( ($confirm_account != true) || ($_POST[edit_account] != true) ){ ?>
<h1 class="content-title"><strong>Admin: Edit Advertiser Account: Step 1 of 2</strong></h1>
<? if (!$errmsg) { ?>
<p class="cont">This is for editing advertiser accounts. <span style="color: red;">You will then be prompted to confirm your information before the information is sent to us.</span></p>
<? } else { ?>
<p class="cont"><span style="color: red;"><? echo $errmsg; ?></span></p>
<? } ?>
<? }
// begin insert form
if( (($_POST[edit_account] != true) || ($errmsg) || (($confirm_account != true) && ($_POST[insert_account] != true))) && $_GET[confirmed] != "yes") {
?>
<form enctype="multipart/form-data" action="advertiser_edit.php" method="post">
<input type="hidden" name="account_id" value="<? echo $_POST[account_id]; ?>">
<? var_dump($_POST); ?>
<div class="dtable form">
<div class="drow">
<div class="dcell name">Company/Advertiser Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes($_POST[account_advertiser]); ?>" type="text" name="account_advertiser" class="txt lngtext" maxlength="80">
</div>
</div>
<div class="drow">
<div class="dcell name">Contact Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes(htmlspecialchars($_POST[account_contact])); ?>" type="text" name="account_contact" class="txt lngtext">
</div>
</div>
<div class="drow">
<div class="dcell name">Forum User ID (<a href="http://forum.slowtwitch.com/cgi-bin/admin/db.cgi?db=User;do=search_form">Numerical</a>)</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes($_POST[account_user_id_fk]); ?>" type="text" name="account_user_id_fk" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">Address</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="text" name="account_address" value="<? echo stripslashes(htmlspecialchars($_POST[account_address])); ?>" class="txt lngtext" />
</div>
</div>
<div class="drow">
<div class="dcell name">Address 2</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="text" name="account_address_two" value="<? echo stripslashes(htmlspecialchars($_POST[account_address_two])); ?>" class="txt lngtext" />
</div>
</div>
<div class="drow">
<div class="dcell name">City</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="text" name="account_city" value="<? echo stripslashes(htmlspecialchars($_POST[account_city])); ?>" class="txt shotext" />
</div>
</div>
<div class="drow">
<div class="dcell name">State</div>
<div class="dcell divider"></div>
<div class="dcell value">
<select name="account_state">
<option value="0">Choose a State/Province</option>
<?
foreach($state_list as $key=>$value) {
if(strcmp($_POST[account_state], $value) == 0){
$str = " selected=\"selected\"";
}
echo "<option value=\"$value\"$str>$value</option>";
$str = "";
}
?>
</select>
</div>
</div>
<div class="drow">
<div class="dcell name">Zip/Postal Code</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="text" name="account_zip" value="<? echo stripslashes(htmlspecialchars($_POST[account_zip])); ?>" class="txt shotext" />
</div>
</div>
<div class="drow">
<div class="dcell name">Phone</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes(htmlspecialchars($_POST[account_phone])); ?>" type="text" name="account_phone" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">E-mail</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes(htmlspecialchars($_POST[account_email])); ?>" type="text" name="account_email" class="txt midtext">
</div>
</div>
<div class="drow">
<div class="dcell name">Other Contacts</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo $_POST[account_other]; ?>" type="text" name="account_other" class="txt lngtext">
</div>
</div>
<script language="JavaScript">
function toggle(source) {
checkboxes = document.getElementsByName('account_invoice[]');
for(var i=0, n=checkboxes.length;i<n;i++) {
checkboxes[i].checked = source.checked;
}
}
</script>
<div class="drow">
<div class="dcell name">Invoice Via</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if(isset($_POST[account_invoice]) && !is_array($_POST[account_invoice])) { $_POST[account_invoice] = explode(",", $_POST[account_invoice]); }?>
<input type="checkbox" name="account_invoice[]" value="0" <? if(in_array("0", $_POST[account_invoice])) {echo "checked";} ?>>Snail
<input type="checkbox" name="account_invoice[]" value="1" <? if(in_array("1", $_POST[account_invoice])) {echo "checked";} ?>>Email
<input type="checkbox" onClick="toggle(this)" <? if(in_array("0", $_POST[account_invoice]) && in_array("1", $_POST[account_invoice])) {echo "checked";} ?>>Both
<? /* need to insert checking in case of edit here on the value side */ ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Notes</div>
<div class="dcell divider"></div>
<div class="dcell value">
<textarea name="account_notes" rows="7" class="txt lngtext" placeholder="Any additional notes go here."><? if($_POST[account_notes]){ echo strip_tags(stripslashes($_POST[account_notes])); } ?></textarea>
</div>
</div>
<div class="drow actions">
<div class="dcell name"></div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="submit" value="Submit" class="btn">
<input type="hidden" name="edit_account" value="true">
</div>
</div>
</div>
</form>
<? }
// end insert form
// begin confirmation form
if($confirm_account == true){
?>
Please confirm your information. If everything is correct, click the submit button. Otherwise, you may click the edit button to change your information before submitting.</div>
<br />
<div class="dtable form">
<div class="drow">
<div class="dcell name">Company/Advertiser Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes($_POST[account_advertiser]); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Contact Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes(htmlspecialchars($_POST[account_contact])); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Forum ID</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes(htmlspecialchars($_POST[account_user_id_fk])); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Address </div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[account_address])); ?></div>
</div>
<div class="drow">
<div class="dcell name">Address 2</div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[account_address_two])); ?></div>
</div>
<div class="drow">
<div class="dcell name">City</div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[account_city])); ?></div>
</div>
<div class="drow">
<div class="dcell name">State</div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[account_state])); ?></div>
</div>
<div class="drow">
<div class="dcell name">Zip</div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[account_zip])); ?></div>
</div>
<div class="drow">
<div class="dcell name">Phone</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes(htmlspecialchars($_POST[account_phone])); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Email</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes(htmlspecialchars($_POST[account_email])); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Other Contacts</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo $_POST[account_other]; ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Invoice Via</div>
<div class="dcell divider"></div>
<div class="dcell value">
<?
$certification_list = "";
foreach($_POST[account_invoice] as $value) {
if ($value == "0") $certification_list = $certification_list."Snail, ";
if ($value == "1") $certification_list = $certification_list."Email";
};
$certification_list = rtrim($certification_list, ', ');
echo $certification_list;
?>
</div>
</div>
<div class="drow">
<div class="dcell name">General Info</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo strip_tags(stripslashes($_POST[account_notes])) ?>
</div>
</div>
<div class="drow actions">
<div class="dcell name"></div>
<div class="dcell divider"></div>
<div class="dcell value">
<form action="advertiser_edit.php" method="post">
<input type="hidden" name="account_id" value="<? echo stripslashes(htmlspecialchars($_POST[account_id])); ?>">
<input type="hidden" name="account_advertiser" value="<? echo stripslashes(htmlspecialchars($_POST[account_advertiser])); ?>">
<input type="hidden" name="account_contact" value="<? echo stripslashes(htmlspecialchars($_POST[account_contact])); ?>">
<input type="hidden" name="account_user_id_fk" value="<? echo $_POST[account_user_id_fk]; ?>">
<input type="hidden" name="account_address" value="<? echo stripslashes(htmlspecialchars($_POST[account_address])); ?>">
<input type="hidden" name="account_address_two" value="<? echo stripslashes(htmlspecialchars($_POST[account_address_two])); ?>">
<input type="hidden" name="account_city" value="<? echo stripslashes(htmlspecialchars($_POST[account_city])); ?>">
<input type="hidden" name="account_state" value="<? echo $_POST[account_state]; ?>">
<input type="hidden" name="account_zip" value="<? echo $_POST[account_zip]; ?>">
<input type="hidden" name="account_phone" value="<? echo $_POST[account_phone]; ?>">
<input type="hidden" name="account_email" value="<? echo $_POST[account_email]; ?>">
<input type="hidden" name="account_other" value="<? echo $_POST[account_other]; ?>">
<input type="hidden" name="account_invoice" value="<? echo(implode(',', $_POST[account_invoice])); ?>">
<input type="hidden" name="account_notes" value="<? echo stripslashes(htmlspecialchars($_POST[account_notes])); ?>">
<input type="hidden" name="edit_account" value="true">
<input type="hidden" name="insert_account" value="true">
<input type="submit" name="submit" value="Submit Info" class="btn float-left" style="margin-right: 5px;"/>
</form>
<form action="advertiser_edit.php" method="post">
<input type="hidden" name="account_id" value="<? echo stripslashes(htmlspecialchars($_POST[account_id])); ?>">
<input type="hidden" name="account_advertiser" value="<? echo stripslashes(htmlspecialchars($_POST[account_advertiser])); ?>">
<input type="hidden" name="account_contact" value="<? echo stripslashes(htmlspecialchars($_POST[account_contact])); ?>">
<input type="hidden" name="account_user_id_fk" value="<? echo $_POST[account_user_id_fk]; ?>">
<input type="hidden" name="account_address" value="<? echo stripslashes(htmlspecialchars($_POST[account_address])); ?>">
<input type="hidden" name="account_address_two" value="<? echo stripslashes(htmlspecialchars($_POST[account_address_two])); ?>">
<input type="hidden" name="account_city" value="<? echo stripslashes(htmlspecialchars($_POST[account_city])); ?>">
<input type="hidden" name="account_state" value="<? echo $_POST[account_state]; ?>">
<input type="hidden" name="account_zip" value="<? echo $_POST[account_zip]; ?>">
<input type="hidden" name="account_phone" value="<? echo $_POST[account_phone]; ?>">
<input type="hidden" name="account_email" value="<? echo $_POST[account_email]; ?>">
<input type="hidden" name="account_other" value="<? echo $_POST[account_other]; ?>">
<input type="hidden" name="account_invoice" value="<? echo(implode(',', $_POST[account_invoice])); ?>">
<input type="hidden" name="account_notes" value="<? echo stripslashes(htmlspecialchars($_POST[account_notes])); ?>">
<input type="hidden" name="confirm_account" value="0">
<input type="hidden" name="returning_to_edit" value="1">
<input type="submit" name="submit" value="Edit Information" class="btn float-left" />
</form>
</div>
</div>
</div>
<?
}
//end confirmation form
?>
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,91 @@
<?PHP
if (!$_POST){ header('Location: '.$site_url); }
/*
FIELD NAMES:
account_id
account_user_id_fk
account_advertiser
account_contact
account_phone
account_email
account_other
account_invoice
account_notes
*/
/* Need to ltrim and rtrim commas before insertion */
//Insert into database
//$pass = 'abc123';
$errmsg = NULL;
$insert_success = NULL;
//Check for blank fields
if ((!$_POST[account_advertiser])) $errmsg = $errmsg."Account Name, ";
if ((!$_POST[account_contact])) $errmsg = $errmsg."Primary Contact, ";
if ((!$_POST[account_user_id_fk])) $errmsg = $errmsg."Forum ID #, ";
if (!$_POST[account_city]) $errmsg = $errmsg."City, ";
if (!$_POST[account_state]) $errmsg = $errmsg."State, ";
if (!$_POST[account_address]) $errmsg = $errmsg."Address, ";
if (!$_POST[account_phone]) $errmsg = $errmsg."Phone, ";
if (!$_POST[account_email]) $errmsg = $errmsg."Email, ";
if (!$_POST[account_invoice]) $errmsg = $errmsg."Invoice, ";
if (isset($errmsg)) {
$errmsg = "The following fields cannot be left blank: ".$errmsg."<br />";
$errmsg = rtrim($errmsg, ", ");
}
// begin error message check
if(!$errmsg){
$account_id = $_POST[account_id];
$account_advertiser = trim($_POST[account_advertiser]);
$account_contact = trim($_POST[account_contact]);
$account_user_id_fk = trim($_POST[account_user_id_fk]);
$account_address = mysql_escape_string(trim($_POST[account_address]));
if (isset($_POST['account_address_two'])) { $account_address_two = mysql_escape_string(trim($_POST[account_address_two])); } else { $account_address_two = NULL; }
$account_city = mysql_escape_string(trim($_POST[account_city]));
$account_state = $_POST[account_state];
$account_state_tag = strtolower(str_replace(" ","", $account_state));
$account_zip = mysql_escape_string(trim($_POST[account_zip]));
$account_phone = trim($_POST[account_phone]);
$account_email = mysql_escape_string(trim($_POST[account_email]));
$account_other = mysql_escape_string(trim($_POST[account_other]));
$account_invoice = mysql_escape_string($_POST[account_invoice]);
$account_notes = mysql_escape_string(nl2br(substr(trim($_POST[account_notes]), 0, 4096)));
// begin boolean check to see if we should insert the account into the dbase
if($_POST[insert_account] == true){
$sql = "UPDATE io_account SET
account_advertiser = '$account_advertiser',
account_user_id_fk = '$account_user_id_fk',
account_contact = '$account_contact',
account_address = '$account_address',
account_address_two = '$account_address_two',
account_city = '$account_city',
account_state = '$account_state',
account_zip = '$account_zip',
account_phone = '$account_phone',
account_email = '$account_email',
account_other = '$account_other',
account_invoice = '$account_invoice',
account_notes = '$account_notes'
WHERE account_id = $account_id";
//echo("account entered!");
//echo($sql);
mysql_query($sql) OR die(mysql_error());
//exit();
$insert_success = true;
}else{
//echo("shop NOT entered.");
$confirm_account = true;
}
// end insert check
}
// end error message check
?>

View File

@@ -0,0 +1,67 @@
<?PHP include("config.php");
// need to update code so that users are automatically taken to the page for their individual account here.
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
// set the page title
$pagetitle = "Advertiser Accounts";
// set meta tags
?>
<? include("include_common_head.php"); ?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<h1 class="float-left">Admin: Archived Ad Campaigns</h1>
<? /**if (is_logged_in($user)) { ?>
<a href="<? echo $site_url . '/add.php' ?>" class="btn btn-white float-right">Request IO</a>
<? }**/ ?>
<hr class="line" />
<h2>Archived Campaigns</h2>
<hr />
<?
$ad_sql = "SELECT io_campaign.campaign_id AS campaign_id, io_campaign.campaign_name AS campaign_name, io_campaign.campaign_date AS campaign_date, io_campaign.campaign_date_repeat AS campaign_date_repeat, io_campaign.campaign_account_id_fk AS campaign_account_id_fk, io_account.account_advertiser AS campaign_advertiser
FROM io_campaign
INNER JOIN io_account
ON io_campaign.campaign_account_id_fk=io_account.account_id WHERE io_campaign.campaign_archive = 1";
$ad_results = mysql_query($ad_sql) OR die(mysql_error());
while ($ad_row = mysql_fetch_array($ad_results)) {
include("include_campaign.php");
}
?>
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,67 @@
<?PHP include("config.php");
// need to update code so that users are automatically taken to the page for their individual account here.
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
// set the page title
$pagetitle = "Advertiser Accounts";
// set meta tags
?>
<? include("include_common_head.php"); ?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<h1 class="float-left">Admin: Current Ad Campaigns</h1>
<? /**if (is_logged_in($user)) { ?>
<a href="<? echo $site_url . '/add.php' ?>" class="btn btn-white float-right">Request IO</a>
<? }**/ ?>
<hr class="line" />
<h2>Active Campaigns</h2>
<hr />
<?
$ad_sql = "SELECT io_campaign.campaign_id AS campaign_id, io_campaign.campaign_name AS campaign_name, io_campaign.campaign_date AS campaign_date, io_campaign.campaign_date_repeat AS campaign_date_repeat, io_campaign.campaign_account_id_fk AS campaign_account_id_fk, io_account.account_advertiser AS campaign_advertiser
FROM io_campaign
INNER JOIN io_account
ON io_campaign.campaign_account_id_fk=io_account.account_id";
$ad_results = mysql_query($ad_sql) OR die(mysql_error());
while ($ad_row = mysql_fetch_array($ad_results)) {
include("include_campaign.php");
}
?>
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,140 @@
<?PHP
include("config.php");
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
$campaign_idhere = mysql_escape_string($_GET[campaign_id]);
$results = mysql_query("SELECT * FROM io_campaign WHERE campaign_id=".$campaign_idhere." LIMIT 1");
$row = mysql_fetch_array($results);
if (!$row){header('Location: '.$site_url.'/?error=invalid_id');}
// set the page title
$pagetitle = $row[campaign_advertiser];
// set meta tags
?>
<? include("include_common_head.php"); ?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<h1 class="float-left">Campaigns: Individual Campaigns</h1>
<? if ($user) { ?>
<form method="post" action="campaign_edit.php?campaign_id=<? echo $row[campaign_id] ?>">
<input type="submit" value="Edit" class="nobutton btn btn-white float-right">
</form>
<? } ?>
<a href="" class="btn btn-white float-right">Back</a>
<hr class="line" />
<div class="details grid">
<div class="col-6-12">
<h2><? echo stripslashes(stripslashes($row[campaign_name])) ; echo " "; ?></h2>
</div>
<div class="col-6-12 address">
</div>
<div class="col-6-12 contact">
</div>
<div class="clearfix"></div>
<br />
<div class="col-1-1">
<? include("include_buttons.php"); ?>
</div>
<div class="col-1-1 detail-block">
<h3>Advertiser</h3>
<div class="highlight-block">
<?
$acc_results = mysql_query("SELECT * FROM io_account WHERE account_id = '".$row[campaign_account_id_fk]."' LIMIT 1");
$acc_row = mysql_fetch_array($acc_results);
?>
Advertiser: <? echo stripslashes(htmlspecialchars($acc_row[account_advertiser])); ?>
<br />
Primary Contact: <? echo stripslashes(htmlspecialchars($acc_row[account_contact])); ?>
<br />
Email: <a href="mailto:<? echo $acc_row[account_email]; ?>"><? echo stripslashes(htmlspecialchars($row[account_email])); ?></a><br />
Phone: <? echo stripslashes(htmlspecialchars($row[account_phone])); ?>
</div>
</div>
<div class="col-1-1 detail-block">
<h3>Ad Units</h3>
<div class="highlight-block">
<?
if ($row[campaign_300x250] == 1) { echo ("300x250: ".$row[campaign_300x250_impression]."<br />"); }
if ($row[campaign_728x90] == 1) { echo ("728x90: ".$row[campaign_728x90_impression]."<br />"); }
if ($row[campaign_300x600] == 1) { echo ("300x600: ".$row[campaign_300x600_impression]."<br />"); }
if ($row[campaign_970x250] == 1) { echo ("970x250: ".$row[campaign_970x250_impression]."<br />"); }
if ($row[campaign_wallpaper] == 1) { echo ("wallpaper: ".$row[campaign_wallpaper_impression]."<br />"); }
?>
</div>
</div>
<div class="col-1-1 detail-block">
<h3>Campaign Dates</h3>
<div class="highlight-block">
<?
echo ("Start Date: ".date_format(date_create($row[campaign_date]), 'Y-m-d')."<br />");
echo ("Repeat Date: ".date_format(date_create($row[campaign_date_repeat]), 'Y-m-d')."<br />");
?>
</div>
</div>
<div class="col-1-1 detail-block">
<h3>Campaign Status</h3>
<div class="highlight-block">
<strong>Signed: </strong><? if (isset($row[campaign_signature_timestamp]) && $row[campaign_signature_timestamp] != "" && $row[campaign_signature_timestamp] != 0) { echo "Yes, by: ".$row[campaign_signature]." on: ".date_format(date_create($row[campaign_signature_timestamp]), 'Y-m-d')."<br />";} else { echo "No<br />"; } ?>
<strong>Deployed: </strong><? if (isset($row[campaign_deploy_timestamp]) && $row[campaign_deploy_timestamp] != "" && $row[campaign_deploy_timestamp] != 0) { echo "Yes, on: ".date_format(date_create($row[campaign_deploy_timestamp]), 'Y-m-d')."<br />";} else { echo "No<br />"; } ?>
<strong>Screenshot: </strong><? if (isset($row[campaign_screenshot_timestamp]) && $row[campaign_screenshot_timestamp] != "" && $row[campaign_screenshot_timestamp] != 0) { echo "Yes, on: ".date_format(date_create($row[campaign_screenshot_timestamp]), 'Y-m-d')."<br />";} else { echo "No<br />"; } ?>
<strong>Invoice: </strong><? if (isset($row[campaign_invoice_timestamp]) && $row[campaign_invoice_timestamp] != "" && $row[campaign_invoice_timestamp] != 0) { echo "Yes, on: ".date_format(date_create($row[campaign_invoice_timestamp]), 'Y-m-d')."<br />";} else { echo "No<br />"; } ?>
<strong>Active or Archived: </strong><?
$temp[] = $row[campaign_archive];
foreach($temp as $value) {
if ($value == "0") echo ("Active");
if ($value == "1") echo ("Archived on ".date_format(date_create($row[campaign_archive_timestamp]), 'Y-m-d')."<br />");
};
?>
</div>
</div>
<div class="col-1-1 detail-block">
<h3>Campaign Notes</h3>
<div class="highlight-block">
<strong>Notes:</strong> <? echo stripslashes(htmlspecialchars($row[campaign_notes])); ?><br />
</div>
</div>
</div>
<div class="content-divider-bottom"></div>
<? include ('comments_show.php'); ?>
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,14 @@
<?PHP
/*
USER
- sign-off
ADMIN
- deploy
- screenshot
- invoice
- archive
*/
?>

View File

@@ -0,0 +1,14 @@
<?PHP
/*
USER
- sign-off
ADMIN
- deploy
- screenshot
- invoice
- archive
*/
?>

View File

@@ -0,0 +1,29 @@
<?PHP
include("config.php");
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
if (!$_POST){ header('Location: '.$site_url); }
if ($_POST[action] == "archive") {
$sql = "UPDATE io_campaign SET campaign_archive = 1, campaign_archive_timestamp = '".date('Y-m-d')."' WHERE campaign_id = '$_POST[campaign_id]'";
} elseif ($_POST[action] == "screenshot") {
$sql = "UPDATE io_campaign SET campaign_screenshot_timestamp = '".date('Y-m-d')."' WHERE campaign_id = '$_POST[campaign_id]'";
} elseif ($_POST[action] == "invoice") {
$sql = "UPDATE io_campaign SET campaign_invoice_timestamp = '".date('Y-m-d')."' WHERE campaign_id = '$_POST[campaign_id]'";
} elseif ($_POST[action] == "deploy") {
$sql = "UPDATE io_campaign SET campaign_deploy_timestamp = '".date('Y-m-d')."' WHERE campaign_id = '$_POST[campaign_id]'";
} elseif ($_POST[action] == "unarchive") {
$sql = "UPDATE io_campaign SET campaign_archive = 0, campaign_archive_timestamp = '0' WHERE campaign_id = '$_POST[campaign_id]'";
}
//echo $sql;
//exit();
mysql_query($sql) or die(mysql_error());
header('Location: campaign_detail.php?campaign_id='.$_POST[campaign_id]);
?>

View File

@@ -0,0 +1,207 @@
<?
###########################################
#-----------Users login system------------#
###########################################
/*=========================================\
Author : Mohammed Ahmed(M@@king) \\
Version : 1.0 \\
Date Created: Aug 20 2005 \\
---------------------------- \\
Last Update: August 22 2005 \\
---------------------------- \\
Country : Palestine \\
City : Gaza \\
E-mail : m@maaking.com \\
MSN : m@maaking.com \\
AOL-IM : maa2pal \\
WWW : http://www.maaking.com \\
Mobile/SMS : 00972-599-622235 \\
\\
===========================================\
------------------------------------------*/
// NEED TO CHECK AGAINST SERVER VERSION
//skip the config file if somebody call it from the browser.
session_start();
if (eregi("config.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php"); die();
}
$main_table = "io_";
$field_lead_cpn = "campaign_";
$field_lead_acc = "account_";
$site_url = "/adio";
include("/var/home/slowtwitch/site/local/settings.php");
//added new code to fix compatibility issues.
//09-Nov-2005
$phpver = phpversion();
if ($phpver < '4.1.0') {
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
$_SERVER = $HTTP_SERVER_VARS;
}
if ($phpver >= '4.0.4pl1' && strstr($_SERVER["HTTP_USER_AGENT"],'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
} else if ($phpver > '4.0') {
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (extension_loaded('zlib')) {
$do_gzip_compress = TRUE;
ob_start(array('ob_gzhandler',5));
ob_implicit_flush(0);
header('Content-Encoding: gzip');
}
}
}
$phpver = explode(".", $phpver);
$phpver = "$phpver[0]$phpver[1]";
if ($phpver >= 41) {
$PHP_SELF = $_SERVER['PHP_SELF'];
}
if (!ini_get("register_globals")) {
#import_request_variables('GPC');
}
function curPageURL() {
$isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on");
$port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443")));
$port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : '';
$url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["SERVER_NAME"].$port.$_SERVER["REQUEST_URI"];
return $url;
}
function geocode($address) {
// Initialize delay in geocode speed
$delay = 0;
$base_url = "http://" . MAPS_HOST . "/maps/api/geocode/xml?"; // . "&key=" . KEY;
//echo ("Base URL: ".$base_url);
$status = "";
$geocode_pending = true;
while ($geocode_pending) {
$address = str_replace(" ", "+", $address);
$address = str_replace("#", "", $address);
$address = str_replace("\'", "", $address);
$address = str_replace("/", "", $address);
$request_url = $base_url . "address=" . $address . "&sensor=false"; //urlencode($address);
$request_url = mb_convert_encoding($request_url, "UTF-8", "auto");
//echo ($request_url."<br />");
// Create cUrl object to grab XML content using $request_url
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $request_url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$xmlContent = trim(curl_exec($c));
curl_close($c);
// Create SimpleXML object from XML Content
$xml = simplexml_load_string($xmlContent);
// Print out all of the XML Object
//print header("Content-type: text/plain");
//print_r($xml);
$resolution = $xml->result->geometry->location_type;
$status = $xml->status;
if (strcmp($status, "OK") == 0) {
// Successful geocode
$geocode_pending = false;
$lat = $xml->result->geometry->location->lat;
$lng = $xml->result->geometry->location->lng;
$latlng_array = array($lat, $lng);
return ($latlng_array);
} elseif (strcmp($status, "OVER_QUERY_LIMIT") == 0) {
// failure to geocode
$geocode_pending = false;
$status = "Address " . $address . " failed to geocode. ";
$status = $status . "Received status " . $status . "</br></br>\n";
return ($status);
} else {
// failure to geocode
$geocode_pending = false;
$status = "Address " . $address . " failed to geocode. ";
$status = $status . "Received status " . $status . "</br></br>\n";
return ($status);
}
}
}
$statecount = mysql_num_rows(mysql_query("SELECT * FROM gforum_Coaches WHERE coach_valid = 1"));
//Array of states for use in the form
$state_list = array('AL'=>"Alabama",
'AK'=>"Alaska",
'AB'=>'Alberta',
'AZ'=>"Arizona",
'AR'=>"Arkansas",
'BC'=>'British Columbia',
'CB'=>"Caribbean",
'CA'=>"California",
'CM'=>"Central America",
'CO'=>"Colorado",
'CT'=>"Connecticut",
'DE'=>"Delaware",
'DC'=>"District of Columbia",
'FL'=>"Florida",
'GA'=>"Georgia",
'HI'=>"Hawaii",
'ID'=>"Idaho",
'IL'=>"Illinois",
'IN'=>"Indiana",
'IA'=>"Iowa",
'KS'=>"Kansas",
'KY'=>"Kentucky",
'LA'=>"Louisiana",
'ME'=>"Maine",
'MB'=>'Manitoba',
'MD'=>"Maryland",
'MA'=>"Massachusetts",
'MX'=>"Mexico",
'MI'=>"Michigan",
'MN'=>"Minnesota",
'MS'=>"Mississippi",
'MO'=>"Missouri",
'MT'=>"Montana",
'NE'=>"Nebraska",
'NV'=>"Nevada",
'NB'=>'New Brunswick',
'NL'=>'Newfoundland',
'NH'=>"New Hampshire",
'NJ'=>"New Jersey",
'NM'=>"New Mexico",
'NY'=>"New York",
'NC'=>"North Carolina",
'ND'=>"North Dakota",
'NS'=>'Nova Scotia',
'OH'=>"Ohio",
'OK'=>"Oklahoma",
'ON'=>'Ontario',
'OR'=>"Oregon",
'PA'=>"Pennsylvania",
'PE'=>'Prince Edward Island',
'QC'=>'Quebec',
'RI'=>"Rhode Island",
'SK'=>'Saskatchewan',
'SC'=>"South Carolina",
'SD'=>"South Dakota",
'TN'=>"Tennessee",
'TX'=>"Texas",
'UT'=>"Utah",
'VT'=>"Vermont",
'VA'=>"Virginia",
'WA'=>"Washington",
'WV'=>"West Virginia",
'WI'=>"Wisconsin",
'WY'=>"Wyoming",
// New Foreign "States",
'OA'=>"Outside N. America");
?>

View File

@@ -0,0 +1,421 @@
<?PHP
include("config.php");
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
if(!is_logged_in($user)){
header('Location: '.$site_url);
exit();
}
$useruid = base64_decode($_SESSION['user_id']);
// set the page title
$pagetitle = "Create Advertiser Account";
// set meta tags
$meta_keywords = "create advertiser account";
$meta_description = "create advertiser account for slowtwitch advertising.";
/*
account_id
account_user_id_fk
account_advertiser
account_contact
account_phone
account_email
account_other
account_invoice
account_notes
*/
?>
<? include("include_common_head.php"); ?>
<?
if($_POST[add_account] == true){
include("create_X.php");
}
?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<?
if( $insert_success == true || $_GET[confirmed] == "yes" ) { ?>
<h1 class="content-title"><strong>Thank you</strong></h1>
<p class="cont">Thank you. The advertiser account information for <? echo ("$advertiser"); ?> has been entered. You will now be redirected to the IO Insertion Order Add page.</p>
<?
$jump_sql = "SELECT * FROM io_account WHERE account_id = \"".$advertiser."\" LIMIT 1";
$jump_fetch = mysql_fetch_array(mysql_query($jump_sql)) OR die(mysql_error());
$account_id = $jump_fetch[account_id];
?>
<? $meta_jump = "<META HTTP-EQUIV=Refresh CONTENT=\"4; URL=add.php?account_id=".$account_id."\"";
echo $meta_jump;
unset($insert_success);
unset($confirm_account);
?>
<? } else if( $confirm_account == true ) { ?>
<h1 class="content-title"><strong>Admin: Create Advertiser Account: Step 2 of 2</strong></h1>
<? }else if( ($confirm_account != true) || ($_POST[add_account] != true) ){ ?>
<h1 class="content-title"><strong>Admin: Create Advertiser Account: Step 1 of 2</strong></h1>
<? if (!$errmsg) { ?>
<p class="cont">In order to make advertisement insertion order requests, you need to create an advertiser account which will be tagged to your forum user profile. Simply fill out the form below. Be sure to fill out every field. After filling out each field, click submit. <span style="color: red;">You will then be prompted to confirm your information before the information is sent to us.</span></p>
<? } else { ?>
<p class="cont"><span style="color: red;"><? echo $errmsg; ?></span></p>
<? } ?>
<? }
// begin insert form
if( (($_POST[add_account] != true) || ($errmsg) || (($confirm_account != true) && ($_POST[insert_account] != true))) && $_GET[confirmed] != "yes") {
?>
<form enctype="multipart/form-data" action="create.php" method="post">
<div class="dtable form">
<div class="drow">
<div class="dcell name">Company/Advertiser Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes($_POST[advertiser]); ?>" type="text" name="advertiser" class="txt lngtext" maxlength="80">
</div>
</div>
<div class="drow">
<div class="dcell name">Contact Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes(htmlspecialchars($_POST[contact])); ?>" type="text" name="contact" class="txt lngtext">
</div>
</div>
<div class="drow">
<div class="dcell name">Forum User ID (<a href="http://forum.slowtwitch.com/cgi-bin/admin/db.cgi?db=User;do=search_form">Numerical</a>)</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes($_POST[forumid]); ?>" type="text" name="forumid" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">Address</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="text" name="address" value="<? echo stripslashes(htmlspecialchars($_POST[address])); ?>" class="txt lngtext" />
</div>
</div>
<div class="drow">
<div class="dcell name">Address 2</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="text" name="address_two" value="<? echo stripslashes(htmlspecialchars($_POST[address_two])); ?>" class="txt lngtext" />
</div>
</div>
<div class="drow">
<div class="dcell name">City</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="text" name="city" value="<? echo stripslashes(htmlspecialchars($_POST[city])); ?>" class="txt shotext" />
</div>
</div>
<div class="drow">
<div class="dcell name">State</div>
<div class="dcell divider"></div>
<div class="dcell value">
<select name="state">
<option value="0">Choose a State/Province</option>
<?
foreach($state_list as $key=>$value) {
if(strcmp($_POST[state], $value) == 0){
$str = " selected=\"selected\"";
}
echo "<option value=\"$value\"$str>$value</option>";
$str = "";
}
?>
</select>
</div>
</div>
<div class="drow">
<div class="dcell name">Zip/Postal Code</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="text" name="zip" value="<? echo stripslashes(htmlspecialchars($_POST[zip])); ?>" class="txt shotext" />
</div>
</div>
<div class="drow">
<div class="dcell name">Phone</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes(htmlspecialchars($_POST[phone])); ?>" type="text" name="phone" class="txt shotext">
</div>
</div>
<div class="drow">
<div class="dcell name">E-mail</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo stripslashes(htmlspecialchars($_POST[email])); ?>" type="text" name="email" class="txt midtext">
</div>
</div>
<div class="drow">
<div class="dcell name">Other Contacts</div>
<div class="dcell divider"></div>
<div class="dcell value">
<input value="<? echo $_POST[other]; ?>" type="text" name="other" class="txt lngtext">
</div>
</div>
<script language="JavaScript">
function toggle(source) {
checkboxes = document.getElementsByName('invoice[]');
for(var i=0, n=checkboxes.length;i<n;i++) {
checkboxes[i].checked = source.checked;
}
}
</script>
<div class="drow">
<div class="dcell name">Invoice Via</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? if(isset($_POST[invoice])) { $_POST[invoice] = explode(",", $_POST[invoice]); }?>
<input type="checkbox" name="invoice[]" value="0" <? if(in_array("0", $_POST[invoice])) {echo "checked";} ?>>Snail
<input type="checkbox" name="invoice[]" value="1" <? if(in_array("1", $_POST[invoice])) {echo "checked";} ?>>Email
<input type="checkbox" onClick="toggle(this)" <? if(in_array("0", $_POST[invoice]) && in_array("1", $_POST[invoice])) {echo "checked";} ?>>Both
<? /* need to insert checking in case of edit here on the value side */ ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Notes</div>
<div class="dcell divider"></div>
<div class="dcell value">
<textarea name="notes" rows="7" class="txt lngtext" placeholder="Any additional notes go here."><? if($_POST[notes]){ echo strip_tags(stripslashes($_POST[notes])); } ?></textarea>
</div>
</div>
<div class="drow actions">
<div class="dcell name"></div>
<div class="dcell divider"></div>
<div class="dcell value">
<input type="submit" value="Submit" class="btn">
<input type="hidden" name="add_account" value="true">
</div>
</div>
</div>
</form>
<? }
// end insert form
// begin confirmation form
if($confirm_account == true){
?>
Please confirm your information. If everything is correct, click the submit button. Otherwise, you may click the edit button to change your information before submitting.</div>
<br />
<div class="dtable form">
<div class="drow">
<div class="dcell name">Company/Advertiser Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes($_POST[advertiser]); ?>
</div>
</div>
<? // check the db for similar matches
$name_tag = strtolower(str_replace(" ","", $_POST['advertiser']));
$name_superstart = substr($name_tag, 0, 4);
$name_superend = substr($name_tag, -4, 4);
$name_supermid = substr($name_tag, ((strlen($name_tag))/2 - 2), 4);
//echo $name_supermid;
$match_sql = "SELECT * FROM io_account WHERE (account_advertiser LIKE '%".$name_superstart."%' OR account_advertiser LIKE '%".$name_superend."%' OR account_advertiser LIKE '%".$name_supermid."%')";
//echo $match_sql;
$match_fetch = mysql_query($match_sql) OR die(mysql_error());
$i = false;
while ($match_row = mysql_fetch_array($match_fetch)) {
similar_text($match_row['account_name'], $_POST['name'], $percent);
if ($percent >= 50) {
if ($i == false) {
echo ("<tr><td align=\"right\">Duplicate Alert:</td><td>");
}
if ($i == true) {echo ("<br />");}
echo ($match_row['account_name']."(Similarity: ".(round($percent, 0))."%)");
$i = true;
}
}
if ($i == true) { echo("</td></tr>"); }
?>
<div class="drow">
<div class="dcell name">Contact Name</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes(htmlspecialchars($_POST[contact])); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Forum ID</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes(htmlspecialchars($_POST[forumid])); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Address </div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[address])); ?></div>
</div>
<div class="drow">
<div class="dcell name">Address 2</div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[address_two])); ?></div>
</div>
<div class="drow">
<div class="dcell name">City</div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[city])); ?></div>
</div>
<div class="drow">
<div class="dcell name">State</div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[state])); ?></div>
</div>
<div class="drow">
<div class="dcell name">Zip</div>
<div class="dcell divider"></div>
<div class="dcell value"><? echo stripslashes(htmlspecialchars($_POST[zip])); ?></div>
</div>
<div class="drow">
<div class="dcell name">Phone</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes(htmlspecialchars($_POST[phone])); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Email</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo stripslashes(htmlspecialchars($_POST[email])); ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Other Contacts</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo $_POST[other]; ?>
</div>
</div>
<div class="drow">
<div class="dcell name">Invoice Via</div>
<div class="dcell divider"></div>
<div class="dcell value">
<?
$certification_list = "";
foreach($_POST[invoice] as $value) {
if ($value == "0") $certification_list = $certification_list."Snail, ";
if ($value == "1") $certification_list = $certification_list."Email";
};
$certification_list = rtrim($certification_list, ', ');
echo $certification_list;
?>
</div>
</div>
<div class="drow">
<div class="dcell name">General Info</div>
<div class="dcell divider"></div>
<div class="dcell value">
<? echo strip_tags(stripslashes($_POST[notes])) ?>
</div>
</div>
<div class="drow actions">
<div class="dcell name"></div>
<div class="dcell divider"></div>
<div class="dcell value">
<form action="create.php" method="post">
<input type="hidden" name="advertiser" value="<? echo stripslashes(htmlspecialchars($_POST[advertiser])); ?>">
<input type="hidden" name="contact" value="<? echo stripslashes(htmlspecialchars($_POST[contact])); ?>">
<input type="hidden" name="forumid" value="<? echo $_POST[forumid]; ?>">
<input type="hidden" name="address" value="<? echo stripslashes(htmlspecialchars($_POST[address])); ?>">
<input type="hidden" name="address_two" value="<? echo stripslashes(htmlspecialchars($_POST[address_two])); ?>">
<input type="hidden" name="city" value="<? echo stripslashes(htmlspecialchars($_POST[city])); ?>">
<input type="hidden" name="state" value="<? echo $_POST[state]; ?>">
<input type="hidden" name="zip" value="<? echo $_POST[zip]; ?>">
<input type="hidden" name="phone" value="<? echo $_POST[phone]; ?>">
<input type="hidden" name="email" value="<? echo $_POST[email]; ?>">
<input type="hidden" name="other" value="<? echo $_POST[other]; ?>">
<input type="hidden" name="invoice" value="<? echo(implode(',', $_POST[invoice])); ?>">
<input type="hidden" name="notes" value="<? echo stripslashes(htmlspecialchars($_POST[notes])); ?>">
<input type="hidden" name="add_account" value="true">
<input type="hidden" name="insert_account" value="true">
<input type="hidden" name="submitted_by" value="<? echo $useruid; ?>" >
<input type="submit" name="submit" value="Submit Info" class="btn float-left" style="margin-right: 5px;"/>
</form>
<form action="create.php" method="post">
<input type="hidden" name="advertiser" value="<? echo stripslashes(htmlspecialchars($_POST[advertiser])); ?>">
<input type="hidden" name="contact" value="<? echo stripslashes(htmlspecialchars($_POST[contact])); ?>">
<input type="hidden" name="forumid" value="<? echo $_POST[forumid]; ?>">
<input type="hidden" name="address" value="<? echo stripslashes(htmlspecialchars($_POST[address])); ?>">
<input type="hidden" name="address_two" value="<? echo stripslashes(htmlspecialchars($_POST[address_two])); ?>">
<input type="hidden" name="city" value="<? echo stripslashes(htmlspecialchars($_POST[city])); ?>">
<input type="hidden" name="state" value="<? echo $_POST[state]; ?>">
<input type="hidden" name="zip" value="<? echo $_POST[zip]; ?>">
<input type="hidden" name="phone" value="<? echo $_POST[phone]; ?>">
<input type="hidden" name="email" value="<? echo $_POST[email]; ?>">
<input type="hidden" name="other" value="<? echo $_POST[other]; ?>">
<input type="hidden" name="invoice" value="<? echo(implode(',', $_POST[invoice])); ?>">
<input type="hidden" name="notes" value="<? echo stripslashes(htmlspecialchars($_POST[notes])); ?>">
<input type="hidden" name="confirm_account" value="0">
<input type="submit" name="submit" value="Edit Information" class="btn float-left" />
</form>
</div>
</div>
</div>
<?
}
//end confirmation form
?>
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,77 @@
<?PHP
if (!$_POST){ header('Location: '.$site_url); }
/*
FIELD NAMES:
account_id
account_user_id_fk
account_advertiser
account_contact
account_phone
account_email
account_other
account_invoice
account_notes
*/
/* Need to ltrim and rtrim commas before insertion */
//Insert into database
//$pass = 'abc123';
$errmsg = NULL;
$insert_success = NULL;
//Check for blank fields
if ((!$_POST[advertiser])) $errmsg = $errmsg."Account Name, ";
if ((!$_POST[contact])) $errmsg = $errmsg."Primary Contact, ";
if ((!$_POST[forumid])) $errmsg = $errmsg."Forum ID #, ";
if (!$_POST[city]) $errmsg = $errmsg."City, ";
if (!$_POST[state]) $errmsg = $errmsg."State, ";
if (!$_POST[address]) $errmsg = $errmsg."Address, ";
if (!$_POST[phone]) $errmsg = $errmsg."Phone, ";
if (!$_POST[email]) $errmsg = $errmsg."Email, ";
if (!$_POST[invoice]) $errmsg = $errmsg."Invoice, ";
if (isset($errmsg)) {
$errmsg = "The following fields cannot be left blank: ".$errmsg."<br />";
$errmsg = rtrim($errmsg, ", ");
}
// begin error message check
if(!$errmsg){
$advertiser = trim($_POST[advertiser]);
$contact = trim($_POST[contact]);
$forumid = trim($_POST[forumid]);
$address = mysql_escape_string(trim($_POST[address]));
if (isset($_POST['address_two'])) { $address_two = mysql_escape_string(trim($_POST[address_two])); } else { $address_two = NULL; }
$city = mysql_escape_string(trim($_POST[city]));
$state = $_POST[state];
$state_tag = strtolower(str_replace(" ","", $state));
$zip = mysql_escape_string(trim($_POST[zip]));
$phone = trim($_POST[phone]);
$email = mysql_escape_string(trim($_POST[email]));
$other = mysql_escape_string(trim($_POST[other]));
$invoice = mysql_escape_string($_POST[invoice]);
$notes = mysql_escape_string(nl2br(substr(trim($_POST[notes]), 0, 4096)));
$submitted_by = $_POST[submitted_by];
// begin boolean check to see if we should insert the account into the dbase
if($_POST[insert_account] == true){
$sql = "INSERT INTO io_account (account_advertiser, account_user_id_fk, account_contact, account_address, account_address_two, account_city, account_state, account_zip, account_phone, account_email, account_other, account_invoice, account_notes) VALUES ('$advertiser', '$forumid', '$contact', '$address', '$address_two', '$city', '$state', '$zip', '$phone', '$email', '$other', ',$invoice,', '$notes')";
//echo("account entered!");
//echo($sql);
mysql_query($sql) OR die(mysql_error());
//exit();
$insert_success = true;
}else{
//echo("shop NOT entered.");
$confirm_account = true;
}
// end insert check
}
// end error message check
?>

View File

@@ -0,0 +1,23 @@
<?PHP
include("config.php");
if(!is_admin($user)){
header('Location:'.$site_url.'/');
}
if (!$_POST){ header('Location: '.$site_url); }
if (isset($_POST[account_id])) {
$sql = "DELETE FROM io_account WHERE account_id = '$_POST[account_id]'";
} elseif (isset($_POST[campaign_id])) {
$sql = "DELETE FROM io_campaign WHERE campaign_id = '$_POST[campaign_id]'";
}
//echo $sql;
//exit();
mysql_query($sql) or die(mysql_error());
header('Location: campaign.php');
?>

View File

@@ -0,0 +1,16 @@
<div class="list-block grid">
<div class="col-1-1 clearfix">
<h3 class="float-left"><? echo $ad_row[account_advertiser]; ?></h3>
<div class="float-right">
</div>
</div>
<div class="col-1-2">
<?
echo ("$ad_row[account_contact]");
?>
</div>
<div class="col-1-2">
Email: <? echo "<a href='mailto:$ad_row[account_email]'>$ad_row[account_email]</a>"; ?><br/>
<a href="<? echo "advertiser_account.php?account_id=$ad_row[account_id]"; ?>">More info &gt;</a>
</div>
</div>

View File

@@ -0,0 +1,4 @@
<div class="breadcrumb">
<a href="<? echo $main_site_url ?>">Home</a> &gt;
<a href="<? echo $main_site_url . "/adio/index.php" ?>">Advert IO</a> &gt;
</div>

View File

@@ -0,0 +1,83 @@
<?PHP
if(is_logged_in($user)){
//Get user's uid
//$testresults = mysql_query("SELECT user_id FROM ".$prefix."User WHERE user_username=\"$username\"") or die(mysql_error());
//$testrow = mysql_fetch_array($testresults);
//$useruid = $testrow[user_id];
$useruid = base64_decode($_SESSION['user_id']);
// is the current user the owner of the advertiser?
$advertiser_submitted_by = FALSE;
if($useruid == $row[account_user_id_fk]){
$advertiser_submitted_by = TRUE;
}
if (eregi("advertiser_account.php", $_SERVER['SCRIPT_NAME'])) {
?>
<div>
<? if(is_admin($user)){ ?>
<form method="post" action="<? echo "advertiser_edit.php?account_id=$row[account_id]"; ?>" style="display: inline;">
<input type="submit" value="Edit account" class="btn" />
</form>
<form method="post" action="delete_X.php" style="display: inline;">
<input type="hidden" name="account_id" value="<? echo($row[account_id]); ?>" />
<input type="submit" value="Delete this advertiser" class="btn" onclick="return confirm('Are you sure you want to DELETE this advertiser?');" />
</form>
<? } ?>
</div>
<? } elseif (eregi("campaign_detail.php", $_SERVER['SCRIPT_NAME'])) { ?>
<div>
<? if(is_admin($user)){ ?>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="invoice" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="Mark as invoiced" class="btn" onclick="return confirm('Are you sure you want to mark this campaign as INVOICED?');" />
</form>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="screenshot" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="Mark as screenshot" class="btn" onclick="return confirm('Are you sure you want to mark this campaign as SCREENSHOT?');" />
</form>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="deploy" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="Mark as deployed" class="btn" onclick="return confirm('Are you sure you want to mark this campaign as DEPLOYED?');" />
</form>
<br /><br />
<form method="post" action="<? echo "campaign_edit.php?campaign_id=$row[campaign_id]"; ?>" style="display: inline;">
<input type="submit" value="Edit campaign" class="btn" />
</form>
<form method="post" action="delete_X.php" style="display: inline;">
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="Delete this campaign" class="btn" onclick="return confirm('Are you sure you want to DELETE this campaign?');" />
</form>
<? if ($row[campaign_archive] == 1) { ?>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="unarchive" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="*UN*archive this campaign" class="btn" onclick="return confirm('Are you sure you want to *UN*ARCHIVE this campaign?');" />
</form>
<? } else { ?>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="archive" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="archive this campaign" class="btn" onclick="return confirm('Are you sure you want to ARCHIVE this campaign?');" />
</form>
<? } ?>
<? } ?>
</div>
<? } } ?>

View File

@@ -0,0 +1,17 @@
<div class="list-block grid">
<div class="col-1-1 clearfix">
<h3 class="float-left"><? echo $ad_row[campaign_name]; ?></h3>
<div class="float-right">
</div>
</div>
<div class="col-1-2">
<?
echo ("Start Date: ".date_format(date_create($ad_row[campaign_date]), 'Y-m-d')."<br />");
echo ("Repeat Date: ".date_format(date_create($ad_row[campaign_date_repeat]), 'Y-m-d')."<br />");
?>
</div>
<div class="col-1-2">
Advertiser: <? echo "<a href='advertiser_account.php?account_id=$ad_row[campaign_account_id_fk]'>$ad_row[campaign_advertiser]</a>"; ?><br/>
<a href="<? echo "campaign_detail.php?campaign_id=$ad_row[campaign_id]"; ?>">More info &gt;</a>
</div>
</div>

View File

@@ -0,0 +1,40 @@
<? $xmlURL = "http://www.slowtwitch.com/googlemaps/coaches_xml.php" ?>
<body id="home" <? if (eregi("index.php", $_SERVER['SCRIPT_NAME'])) { echo ("onload=\"initializeAllMap('$xmlURL')\""); } ?>>
<? include("/var/home/slowtwitch/slowtwitch.com/www/db_templates/fb_sdk.html"); ?>
<div id="accessibility"><a href="#content">Skip to Content</a></div>
<hr class="hide" />
<div id="wrapper">
<div id="header">
<div id="ad_728x90"><!-- BEGIN ADVERTPRO CODE BLOCK -->
<? include "../db_templates/ad_728x90.html"; ?>
<!-- END ADVERTPRO CODE BLOCK --></div>
<div id="logo"><h1><a href="http://www.slowtwitch.com">&lt;:: Welcome to Slowtwitch.com ::&gt;</a></h1></div>
</div>
<? include "../db_templates/common_nav.html"; ?>
<hr class="hide" />
<div id="ocwrapper" class="clear">
<div id="icwrapper" class="clear">
<div id="leftsidebar">
<?
include("include_status.php");
?>
<?
include("include_navigation.php");
?>
</div>
<div id="contentwrapper" class="shadowleft">
<div class="shadowtop"><div class="shadowtopleft"></div><div class="shadowtopright"></div></div>
<div class="shadowright">
<div id="content">
<div class="clear"></div>

View File

@@ -0,0 +1 @@
<?PHP include("../db_templates/include_common_footer.php"); ?>

View File

@@ -0,0 +1,19 @@
<?PHP
if (eregi("include", $_SERVER['SCRIPT_NAME'])) {
Header("Location: ".$site_url."/index.php"); die();
}
?>
<!DOCTYPE html >
<html lang="en">
<head>
<base href="<? echo $site_url ?>/" />
<title>Slowtwitch.com Advertisement Insertion Order: <? echo $pagetitle; ?></title>
<? include($common_path . "/templates/include_global_head.php"); ?>
<? include($common_path . "/templates/google_analytics.html"); ?>
<? include($common_path . "/templates/fb_sdk.html"); ?>
<!-- begin script to create random number for ads -->
<script language="Javascript">
<!--
sgi_ord=Math.random()*10000000000000000;
//-->
</script>

View File

@@ -0,0 +1,2 @@
<? include("include_status.php"); ?>
<div class="widget-divider"></div>

View File

@@ -0,0 +1,11 @@
<?PHP ?>
<?
if(is_admin()){
echo("<br /><br /><strong style=\"text-decoration: underline;\">Admin:</strong>");
echo("<br /><a href='advertiser.php'><strong>View Advertisers</strong></a>");
echo("<br /><a href='campaign.php'><strong>View Active Campaigns</strong></a>");
echo("<br /><a href='archive.php'><strong>View Archived Campaigns</strong></a>");
echo("<br /><a href='add.php'><strong>Add New Insertion Order</strong></a>");
echo("<br /><a href='create.php'><strong>Create New Advertiser Account</strong></a>");
}
?>

View File

@@ -0,0 +1,52 @@
<?PHP include("config.php");
// need to update code so that users are automatically taken to the page for their individual account here.
// set the page title
$pagetitle = "Advertisement Insertion Order";
// set meta tags
$meta_keywords = "advert io";
$meta_description = "tool for requesting an ad isertion";
?>
<? include("include_common_head.php"); ?>
<body class="listings">
<? include($common_path . "/ads/ad_wallpaper.html"); ?>
<div class="container">
<? include($common_path . "/templates/include_header.php"); ?>
<div class="main">
<div class="contentwrapper clearfix">
<? include("include_breadcrumb.php"); ?>
<section class="section listings section-has-widgets section-static remove-sidebar">
<div class="sidebar-b">
<? include("include_sidebar.php"); ?>
</div>
<div class="content content-has-widgets">
<div class="grid">
<div class="clearfix">
<h1 class="float-left">Advertisement Insertion Order Manager</h1>
<? /**if (is_logged_in($user)) { ?>
<a href="<? echo $site_url . '/add.php' ?>" class="btn btn-white float-right">Request IO</a>
<? }**/ ?>
<hr class="line" />
</div><!-- end col-2/3 -->
</div><!-- end grid -->
</div><!-- end content -->
</section>
</div><!-- end contentwrapper -->
</div> <!-- end main -->
<? include($common_path . "/templates/include_footer.php") ?>
</div> <!-- container -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>

View File

@@ -0,0 +1,123 @@
function validateEmail(emailAddress) {
var match = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/.test(emailAddress);
return match;
}
function CheckRegisterForm(RegisterForm)
{
if (RegisterForm.username.value == "" ) { alert( "Please choose a username!" );
RegisterForm.username.focus();
return false; }
if (RegisterForm.password.value == "" ) { alert( "Please choose a password!" );
RegisterForm.password.focus();
return false; }
if (RegisterForm.email.value == "" ) { alert( "Please enter your email address." );
RegisterForm.email.focus();
return false; }
checkEmail = RegisterForm.email.value
if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.')))
{alert("Your emails address is invalid!.");
RegisterForm.email.focus();
return false; }
// return true;
}
function CheckTellForm(tellform)
{
if (tellform.name.value == "" ) { alert( "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" );
tellform.name.focus();
return false; }
if (tellform.email.value == "" ) { alert( "<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" );
tellform.email.focus();
return false; }
checkEmail = tellform.email.value
if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.')))
{alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>!.");
tellform.email.focus();
return false; }
if (tellform.fname.value == "" ) { alert( "<22><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>" );
tellform.fname.focus();
return false; }
if (tellform.femail.value == "" ) { alert( "<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" );
tellform.femail.focus();
return false; }
checkEmail = tellform.femail.value
if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.')))
{alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>!.");
tellform.femail.focus();
return false; }
// return true;
}
var newwindow;
function pop(url)
{
newwindow=window.open(url,'poppage', 'toolbars=0, scrollbars=1, location=0, statusbars=1, menubars=0, resizable=0, width=500, height=400');
if (window.focus) {newwindow.focus()}
}
function popimg(url)
{
newwindow=window.open(url,'name','height=500,width=650,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
if (window.focus) {newwindow.focus()}
}
<!-- ;
var newwindow;
var wheight = 0, wwidth = 0;
function viewimg(url, title, iwidth, iheight, colour) {
var pwidth, pheight;
if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+30;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
wheight=iheight;
wwidth=iwidth;
}
if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+60;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}
newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
newwindow.document.writeln('<a titl="<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" href="javascript:window.close();"><img src=' + url + ' border=0></a>');
newwindow.document.writeln('<\/center> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}
// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy5()" in body tag
function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}

View File

@@ -0,0 +1,7 @@
<?PHP
include("config.php");
session_unset();
session_destroy();
$_SESSION = array();
header("Location: http://forum.slowtwitch.com/gforum.cgi?do=logout&from=coaches");
?>

View File

@@ -0,0 +1,339 @@
<?PHP
###########################################
#-----------Users login system------------#
###########################################
/*=========================================\
Author : Mohammed Ahmed(M@@king) \\
Version : 1.0 \\
Date Created: Aug 20 2005 \\
---------------------------- \\
Last Update: August 22 2005 \\
---------------------------- \\
Country : Palestine \\
City : Gaza \\
E-mail : m@maaking.com \\
MSN : m@maaking.com \\
AOL-IM : maa2pal \\
WWW : http://www.maaking.com \\
Mobile/SMS : 00972-599-622235 \\
\\
===========================================\
------------------------------------------*/
if (eregi("mysql.class.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php"); die();
}
//db class
if(!defined("SQL_LAYER"))
{
define("SQL_LAYER","mysql");
class sql_db
{
var $db_connect_id;
var $query_result;
var $row = array();
var $rowset = array();
var $num_queries = 0;
//
// Constructor
//
function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
{
$this->persistency = $persistency;
$this->user = $sqluser;
$this->password = $sqlpassword;
$this->server = $sqlserver;
$this->dbname = $database;
if($this->persistency)
{
$this->db_connect_id = @mysql_pconnect($this->server, $this->user, $this->password);
}
else
{
$this->db_connect_id = @mysql_connect($this->server, $this->user, $this->password);
}
if($this->db_connect_id)
{
if($database != "")
{
$this->dbname = $database;
$dbselect = @mysql_select_db($this->dbname);
if(!$dbselect)
{
@mysql_close($this->db_connect_id);
$this->db_connect_id = $dbselect;
}
}
return $this->db_connect_id;
}
else
{
return false;
}
}
//
// Other base methods
//
function sql_close()
{
if($this->db_connect_id)
{
if($this->query_result)
{
@mysql_free_result($this->query_result);
}
$result = @mysql_close($this->db_connect_id);
return $result;
}
else
{
return false;
}
}
//
// Base query method
//
function sql_query($query = "", $transaction = FALSE)
{
// Remove any pre-existing queries
unset($this->query_result);
if($query != "")
{
$this->query_result = @mysql_query($query, $this->db_connect_id);
}
if($this->query_result)
{
unset($this->row[$this->query_result]);
unset($this->rowset[$this->query_result]);
return $this->query_result;
}
else
{
return ( $transaction == END_TRANSACTION ) ? true : false;
}
}
//
// Other query methods
//
function sql_numrows($query_id = 0)
{
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
$result = @mysql_num_rows($query_id);
return $result;
}
else
{
return false;
}
}
function sql_affectedrows()
{
if($this->db_connect_id)
{
$result = @mysql_affected_rows($this->db_connect_id);
return $result;
}
else
{
return false;
}
}
function sql_numfields($query_id = 0)
{
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
$result = @mysql_num_fields($query_id);
return $result;
}
else
{
return false;
}
}
function sql_fieldname($offset, $query_id = 0)
{
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
$result = @mysql_field_name($query_id, $offset);
return $result;
}
else
{
return false;
}
}
function sql_fieldtype($offset, $query_id = 0)
{
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
$result = @mysql_field_type($query_id, $offset);
return $result;
}
else
{
return false;
}
}
function sql_fetchrow($query_id = 0)
{
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
$this->row[$query_id] = @mysql_fetch_array($query_id);
return $this->row[$query_id];
}
else
{
return false;
}
}
function sql_fetchrowset($query_id = 0)
{
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
unset($this->rowset[$query_id]);
unset($this->row[$query_id]);
while($this->rowset[$query_id] = @mysql_fetch_array($query_id))
{
$result[] = $this->rowset[$query_id];
}
return $result;
}
else
{
return false;
}
}
function sql_fetchfield($field, $rownum = -1, $query_id = 0)
{
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
if($rownum > -1)
{
$result = @mysql_result($query_id, $rownum, $field);
}
else
{
if(empty($this->row[$query_id]) && empty($this->rowset[$query_id]))
{
if($this->sql_fetchrow())
{
$result = $this->row[$query_id][$field];
}
}
else
{
if($this->rowset[$query_id])
{
$result = $this->rowset[$query_id][$field];
}
else if($this->row[$query_id])
{
$result = $this->row[$query_id][$field];
}
}
}
return $result;
}
else
{
return false;
}
}
function sql_rowseek($rownum, $query_id = 0){
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
$result = @mysql_data_seek($query_id, $rownum);
return $result;
}
else
{
return false;
}
}
function sql_nextid(){
if($this->db_connect_id)
{
$result = @mysql_insert_id($this->db_connect_id);
return $result;
}
else
{
return false;
}
}
function sql_freeresult($query_id = 0){
if(!$query_id)
{
$query_id = $this->query_result;
}
if ( $query_id )
{
unset($this->row[$query_id]);
unset($this->rowset[$query_id]);
@mysql_free_result($query_id);
return true;
}
else
{
return false;
}
}
function sql_error($query_id = 0)
{
$result["message"] = @mysql_error($this->db_connect_id);
$result["code"] = @mysql_errno($this->db_connect_id);
return $result;
}
} // class sql_db
} // if ... define
?>

View File

@@ -0,0 +1 @@
GT