Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Z57 PPC Builder</title>
- <?php
- include_once("arrays.php");
- include("class_lib.php");
- ?>
- </head>
- <body>
- <script language="javascript" type="text/javascript">
- <!--
- function ajaxFunction(){
- var ajaxRequest;
- try{
- ajaxRequest = new XMLHttpRequest();
- } catch (e){
- try{
- ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try{
- ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e){
- alert("Your browser broke!");
- return false;
- }
- }
- }
- ajaxRequest.onreadystatechange = function(){
- if(ajaxRequest.readyState == 4){
- var ajaxDisplay = document.getElementById('ajaxSpan');
- ajaxDisplay.innerHTML = ajaxRequest.responseText;
- }
- }
- var state = document.getElementById('state').value;
- var queryString = "?state=" + state;
- ajaxRequest.open("GET", "webService.php" + queryString, true);
- ajaxRequest.send(null);
- }
- //-->
- </script>
- <script>
- </script>
- <h2>Z57 PPC Builder</h2>
- <form name="ppcForm" method="POST" action="z57.php">
- City 1:<input type="text" id="city1" name="city1"/><br />
- City 2:<input type="text" id="city2" name="city2"/><br />
- City 3:<input type="text" id="city3" name="city3"/><br />
- City 4:<input type="text" id="city4" name="city4"/><br />
- City 5:<input type="text" id="city5" name="city5"/><br />
- City 6:<input type="text" id="city6" name="city6"/><br />
- City 7:<input type="text" id="city7" name="city7"/><br />
- Zip 1:<input type="text" id="zip1" name="zip1"/><br />
- Zip 2:<input type="text" id="zip2" name="zip2"/><br />
- Zip 3:<input type="text" id="zip3" name="zip3"/><br />
- County 1:<input type="text" id="county1" name="county1"/><br />
- County 2:<input type="text" id="county2" name="county2"/><br />
- State:<select id="state" name="state" onChange="ajaxFunction();">
- <?php
- foreach($state_list as $abbrev => $name)
- {
- echo "<option value=" . $abbrev . ">" . $name. "</option>\n";
- }
- ?>
- </select>
- <br />
- StateABV: <span id='ajaxSpan'></span><br />
- Domain:<input type="text" id="domain" name="domain"/><br />
- SEM Page:<input type="text" id="semPage" name="semPage"/><br />
- Project ID:<input type="text" id="projectID" name="projectID"/><br />
- CPC:<input type="text" id="costPerClick" name="costPerClick"/><br />
- Specialties:<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="singleFamily" checked/> Single Family<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="multipleFamily" checked/> Multi-Family<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="condo" checked/> Condo<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="foreclosures" checked/> Forclosures<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="vacationHomes" checked/> Vacation Homes<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="commercial" checked/> Commercial<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="land" /> Land<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="farmRanch" /> Farm/Ranch<br />
- <input type="checkbox" id="specialties" name="specialties[]" value="manufactured" /> Manufactured<br />
- <p><input type="submit"> <input type="reset"></p>
- </form>
- <?php
- if(isset($_POST['city1'])) {
- $cityArr = "";
- if(trim($_POST['city1']) != "") {
- $cityArr[] .= $_POST['city1'];
- }
- if(trim($_POST['city2']) != "") {
- $cityArr[] .= $_POST['city2'];
- }
- if(trim($_POST['city3']) != "") {
- $cityArr[] .= $_POST['city3'];
- }
- if(trim($_POST['city4']) != "") {
- $cityArr[] .= $_POST['city4'];
- }
- if(trim($_POST['city5']) != "") {
- $cityArr[] .= $_POST['city5'];
- }
- if(trim($_POST['city6']) != "") {
- $cityArr[] .= $_POST['city6'];
- }
- if(trim($_POST['city7']) != "") {
- $cityArr[] .= $_POST['city7'];
- }
- //print_r ($cityArr);
- $zipArr = "";
- if(trim($_POST['zip1']) != "") {
- $zipArr[] .= $_POST['zip1'];
- }
- if(trim($_POST['zip2']) != "") {
- $zipArr[] .= $_POST['zip2'];
- }
- if(trim($_POST['zip3']) != "") {
- $zipArr[] .= $_POST['zip3'];
- }
- //print_r ($zipArr);
- $countyArr = "";
- if(trim($_POST['county1']) != "") {
- $countyArr[] .= $_POST['county1'];
- }
- if(trim($_POST['county2']) != "") {
- $countyArr[] .= $_POST['county2'];
- }
- //print_r ($countyArr);
- $stateAbv = $_POST['state'];
- $domain = $_POST['domain'];
- $semPage = $_POST['semPage'];
- $projectID = $_POST['projectID'];
- $cpc = $_POST['costPerClick'];
- $specialties = $_POST['specialties'];
- if($_POST['state'] == 'AL') {
- $state = "Alabama";
- } elseif($_POST['state'] == 'AK') {
- $state = 'Alaska';
- } elseif($_POST['state'] == 'AZ') {
- $state = 'Arizona';
- } elseif($_POST['state'] == 'AR') {
- $state = 'Arkansas';
- } elseif($_POST['state'] == 'CA') {
- $state = 'California';
- } elseif($_POST['state'] == 'CO') {
- $state = 'Colorado';
- } elseif($_POST['state'] == 'CT') {
- $state = 'Connecticut';
- } elseif($_POST['state'] == 'DE') {
- $state = 'Delaware';
- } elseif($_POST['state'] == 'DC') {
- $state = 'District of Columbia';
- } elseif($_POST['state'] == 'FL') {
- $state = 'Florida';
- } elseif($_POST['state'] == 'GA') {
- $state = 'Georgia';
- } elseif($_POST['state'] == 'HI') {
- $state = 'Hawaii';
- } elseif($_POST['state'] == 'ID') {
- $state = 'Idaho';
- } elseif($_POST['state'] == 'IL') {
- $state = 'Illinois';
- } elseif($_POST['state'] == 'IN') {
- $state = 'Indiana';
- } elseif($_POST['state'] == 'IA') {
- $state = 'Iowa';
- } elseif($_POST['state'] == 'KS') {
- $state = 'Kansas';
- } elseif($_POST['state'] == 'KY') {
- $state = 'Kentucky';
- } elseif($_POST['state'] == 'LA') {
- $state = 'Louisiana';
- } elseif($_POST['state'] == 'ME') {
- $state = 'Maine';
- } elseif($_POST['state'] == 'MD') {
- $state = 'Maryland';
- } elseif($_POST['state'] == 'MA') {
- $state = 'Massachusetts';
- } elseif($_POST['state'] == 'MI') {
- $state = 'Michigan';
- } elseif($_POST['state'] == 'MN') {
- $state = 'Minnesota';
- } elseif($_POST['state'] == 'MS') {
- $state = 'Mississippi';
- } elseif($_POST['state'] == 'MO') {
- $state = 'Missouri';
- } elseif($_POST['state'] == 'MT') {
- $state = 'Montana';
- } elseif($_POST['state'] == 'NE') {
- $state = 'Nebraska';
- } elseif($_POST['state'] == 'NV') {
- $state = 'Nevada';
- } elseif($_POST['state'] == 'NH') {
- $state = 'New Hampshire';
- } elseif($_POST['state'] == 'NJ') {
- $state = 'New Jersey';
- } elseif($_POST['state'] == 'NM') {
- $state = 'New Mexico';
- } elseif($_POST['state'] == 'NY') {
- $state = 'New York';
- } elseif($_POST['state'] == 'NC') {
- $state = 'North Carolina';
- } elseif($_POST['state'] == 'ND') {
- $state = 'North Dakota';
- } elseif($_POST['state'] == 'OH') {
- $state = 'Ohio';
- } elseif($_POST['state'] == 'OK') {
- $state = 'Oklahoma';
- } elseif($_POST['state'] == 'OR') {
- $state = 'Oregon';
- } elseif($_POST['state'] == 'PA') {
- $state = 'Pennsylvania';
- } elseif($_POST['state'] == 'RI') {
- $state = 'Rhode Island';
- } elseif($_POST['state'] == 'SC') {
- $state = 'South Carolina';
- } elseif($_POST['state'] == 'SD') {
- $state = 'South Dakota';
- } elseif($_POST['state'] == 'TN') {
- $state = 'Tennessee';
- } elseif($_POST['state'] == 'TX') {
- $state = 'Texas';
- } elseif($_POST['state'] == 'UT') {
- $state = 'Utah';
- } elseif($_POST['state'] == 'VT') {
- $state = 'Vermont';
- } elseif($_POST['state'] == 'VA') {
- $state = 'Virginia';
- } elseif($_POST['state'] == 'WA') {
- $state = 'Washington';
- } elseif($_POST['state'] == 'WV') {
- $state = 'West Virginia';
- } elseif($_POST['state'] == 'WI') {
- $state = 'Wisconsin';
- } elseif($_POST['state'] == 'WY') {
- $state = 'Wyoming';
- } else {
- echo "HERPDURPDURPDURP";
- }
- /*
- foreach ($specialties as $specialty) {
- if ($specialty == "singleFamily") {
- $singleFamilyArr = "";
- foreach ($cityArr as $city) {
- foreach ($singleFamilyKeywords as $keyword) {
- $singleFamilyArr[] .= $city . " " . $keyword;
- }
- }
- }
- }
- print_r($singleFamilyArr);
- */
- echo "<table><tr><th>Campaign</th><th>Ad Group</th><th>Keyword</th><th>Max CPC</th><th>Status</th></tr>";
- $active = "Active";
- $paused = "Paused";
- $campaign = new campaign();
- $campaign->set_campaign($domain,$projectID);
- foreach ($specialties as $specialty) {
- $cityKeywords = new cityKeywords();
- $cityKeywords->set_keywordArr($specialty,$cityArr);
- foreach($cityKeywords->keywordArr as $cityKeyword) {
- echo "<tr><td>" . $campaign->campaign . "</td><td>" . $cityKeywords->adGroup . "</td><td>" . $cityKeyword . "</td><td>" . $cpc . "</td><td>" . $active . "</td></tr>";
- }
- $zipKeywords = new zipKeywords();
- $zipKeywords->set_keywordArr($specialty,$zipArr);
- foreach($zipKeywords->keywordArr as $zipKeyword) {
- echo "<tr><td>" . $campaign->campaign . "</td><td>" . $zipKeywords->adGroup . "</td><td>" . $zipKeyword . "</td><td>" . $cpc . "</td><td>" . $active . "</td></tr>";
- }
- $countyKeywords = new countyKeywords();
- $countyKeywords->set_keywordArr($specialty,$countyArr);
- foreach($countyKeywords->keywordArr as $countyKeyword) {
- echo "<tr><td>" . $campaign->campaign . "</td><td>" . $countyKeywords->adGroup . "</td><td>" . $countyKeyword . "</td><td>" . $cpc . "</td><td>" . $active . "</td></tr>";
- }
- $stateKeywords = new stateKeywords();
- $stateKeywords->set_keywordArr($specialty,$state);
- foreach($stateKeywords->keywordArr as $stateKeyword) {
- echo "<tr><td>" . $campaign->campaign . "</td><td>" . $stateKeywords->adGroup . "</td><td>" . $stateKeyword . "</td><td>.30</td><td>" . $paused . "</td></tr>";
- }
- $stateAbvKeywords = new stateKeywords();
- $stateAbvKeywords->set_keywordArr($specialty,$stateAbv);
- foreach($stateAbvKeywords->keywordArr as $stateAbvKeyword) {
- echo "<tr><td>" . $campaign->campaign . "</td><td>" . $stateAbvKeywords->adGroup . "</td><td>" . $stateAbvKeyword . "</td><td>.30</td><td>" . $paused . "</td></tr>";
- }
- //print_r($keywords);
- //echo $keywords->adGroup;
- }
- echo "</table";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement