Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 10.03 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <title>Z57 PPC Builder</title>
  6.     <?php
  7.    include_once("arrays.php");
  8.    include("class_lib.php");
  9.    ?>
  10.   </head>
  11.   <body>
  12.     <script language="javascript" type="text/javascript">
  13.     <!--
  14.     function ajaxFunction(){
  15.         var ajaxRequest;
  16.         try{
  17.             ajaxRequest = new XMLHttpRequest();
  18.         } catch (e){
  19.             try{
  20.                 ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
  21.             } catch (e) {
  22.                 try{
  23.                     ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
  24.                 } catch (e){
  25.                     alert("Your browser broke!");
  26.                     return false;
  27.                 }
  28.             }
  29.         }
  30.         ajaxRequest.onreadystatechange = function(){
  31.         if(ajaxRequest.readyState == 4){
  32.             var ajaxDisplay = document.getElementById('ajaxSpan');
  33.             ajaxDisplay.innerHTML = ajaxRequest.responseText;
  34.         }
  35.         }
  36.         var state = document.getElementById('state').value;
  37.         var queryString = "?state=" + state;
  38.         ajaxRequest.open("GET", "webService.php" + queryString, true);
  39.         ajaxRequest.send(null);
  40.     }
  41.     //-->
  42.     </script>
  43.     <script>
  44.      
  45.     </script>
  46.  
  47. <h2>Z57 PPC Builder</h2>
  48. <form name="ppcForm" method="POST" action="z57.php">
  49. City 1:<input type="text" id="city1" name="city1"/><br />
  50. City 2:<input type="text" id="city2" name="city2"/><br />
  51. City 3:<input type="text" id="city3" name="city3"/><br />
  52. City 4:<input type="text" id="city4" name="city4"/><br />
  53. City 5:<input type="text" id="city5" name="city5"/><br />
  54. City 6:<input type="text" id="city6" name="city6"/><br />
  55. City 7:<input type="text" id="city7" name="city7"/><br />
  56. Zip 1:<input type="text" id="zip1" name="zip1"/><br />
  57. Zip 2:<input type="text" id="zip2" name="zip2"/><br />
  58. Zip 3:<input type="text" id="zip3" name="zip3"/><br />
  59. County 1:<input type="text" id="county1" name="county1"/><br />
  60. County 2:<input type="text" id="county2" name="county2"/><br />
  61. State:<select id="state" name="state" onChange="ajaxFunction();">
  62. <?php
  63.  
  64. foreach($state_list as $abbrev => $name)
  65. {
  66.     echo "<option value=" . $abbrev . ">" . $name. "</option>\n";
  67. }
  68.  
  69. ?>
  70. </select>
  71. <br />
  72. StateABV: <span id='ajaxSpan'></span><br />
  73. Domain:<input type="text" id="domain" name="domain"/><br />
  74. SEM Page:<input type="text" id="semPage" name="semPage"/><br />
  75. Project ID:<input type="text" id="projectID" name="projectID"/><br />
  76. CPC:<input type="text" id="costPerClick" name="costPerClick"/><br />
  77. Specialties:<br />
  78. <input type="checkbox" id="specialties" name="specialties[]" value="singleFamily" checked/> Single Family<br />
  79. <input type="checkbox" id="specialties" name="specialties[]" value="multipleFamily" checked/> Multi-Family<br />
  80. <input type="checkbox" id="specialties" name="specialties[]" value="condo" checked/> Condo<br />
  81. <input type="checkbox" id="specialties" name="specialties[]" value="foreclosures" checked/> Forclosures<br />
  82. <input type="checkbox" id="specialties" name="specialties[]" value="vacationHomes" checked/> Vacation Homes<br />
  83. <input type="checkbox" id="specialties" name="specialties[]" value="commercial" checked/> Commercial<br />
  84. <input type="checkbox" id="specialties" name="specialties[]" value="land" /> Land<br />
  85. <input type="checkbox" id="specialties" name="specialties[]" value="farmRanch" /> Farm/Ranch<br />
  86. <input type="checkbox" id="specialties" name="specialties[]" value="manufactured" /> Manufactured<br />
  87.  
  88. <p><input type="submit"> <input type="reset"></p>
  89. </form>
  90. <?php
  91.  
  92. if(isset($_POST['city1'])) {
  93. $cityArr = "";
  94. if(trim($_POST['city1']) != "") {
  95.     $cityArr[] .= $_POST['city1'];
  96. }
  97. if(trim($_POST['city2']) != "") {
  98.     $cityArr[] .= $_POST['city2'];
  99. }
  100. if(trim($_POST['city3']) != "") {
  101.     $cityArr[] .= $_POST['city3'];
  102. }
  103. if(trim($_POST['city4']) != "") {
  104.     $cityArr[] .= $_POST['city4'];
  105. }
  106. if(trim($_POST['city5']) != "") {
  107.     $cityArr[] .= $_POST['city5'];
  108. }
  109. if(trim($_POST['city6']) != "") {
  110.     $cityArr[] .= $_POST['city6'];
  111. }
  112. if(trim($_POST['city7']) != "") {
  113.     $cityArr[] .= $_POST['city7'];
  114. }
  115. //print_r ($cityArr);
  116.  
  117. $zipArr = "";
  118. if(trim($_POST['zip1']) != "") {
  119.     $zipArr[] .= $_POST['zip1'];
  120. }  
  121. if(trim($_POST['zip2']) != "") {
  122.     $zipArr[] .= $_POST['zip2'];
  123. }
  124. if(trim($_POST['zip3']) != "") {
  125.     $zipArr[] .= $_POST['zip3'];
  126. }
  127. //print_r ($zipArr);
  128.  
  129. $countyArr = "";
  130. if(trim($_POST['county1']) != "") {
  131.     $countyArr[] .= $_POST['county1'];
  132. }
  133. if(trim($_POST['county2']) != "") {
  134.     $countyArr[] .= $_POST['county2'];
  135. }
  136. //print_r ($countyArr);
  137. $stateAbv = $_POST['state'];
  138. $domain = $_POST['domain'];
  139. $semPage = $_POST['semPage'];
  140. $projectID = $_POST['projectID'];
  141. $cpc = $_POST['costPerClick'];
  142. $specialties = $_POST['specialties'];
  143.  
  144.  
  145. if($_POST['state'] == 'AL') {
  146.         $state = "Alabama";
  147.     } elseif($_POST['state'] == 'AK') {
  148.         $state = 'Alaska';
  149.     } elseif($_POST['state'] == 'AZ') {
  150.         $state = 'Arizona';
  151.     } elseif($_POST['state'] == 'AR') {
  152.         $state = 'Arkansas';
  153.     } elseif($_POST['state'] == 'CA') {
  154.         $state = 'California';
  155.     } elseif($_POST['state'] == 'CO') {
  156.         $state = 'Colorado';
  157.     } elseif($_POST['state'] == 'CT') {
  158.         $state = 'Connecticut';
  159.     } elseif($_POST['state'] == 'DE') {
  160.         $state = 'Delaware';
  161.     } elseif($_POST['state'] == 'DC') {
  162.         $state = 'District of Columbia';
  163.     } elseif($_POST['state'] == 'FL') {
  164.         $state = 'Florida';
  165.     } elseif($_POST['state'] == 'GA') {
  166.         $state = 'Georgia';
  167.     } elseif($_POST['state'] == 'HI') {
  168.         $state = 'Hawaii';
  169.     } elseif($_POST['state'] == 'ID') {
  170.         $state = 'Idaho';
  171.     } elseif($_POST['state'] == 'IL') {
  172.         $state = 'Illinois';
  173.     } elseif($_POST['state'] == 'IN') {
  174.         $state = 'Indiana';
  175.     } elseif($_POST['state'] == 'IA') {
  176.         $state = 'Iowa';
  177.     } elseif($_POST['state'] == 'KS') {
  178.         $state = 'Kansas';
  179.     } elseif($_POST['state'] == 'KY') {
  180.         $state = 'Kentucky';
  181.     } elseif($_POST['state'] == 'LA') {
  182.         $state = 'Louisiana';
  183.     } elseif($_POST['state'] == 'ME') {
  184.         $state = 'Maine';
  185.     } elseif($_POST['state'] == 'MD') {
  186.         $state = 'Maryland';
  187.     } elseif($_POST['state'] == 'MA') {
  188.         $state = 'Massachusetts';
  189.     } elseif($_POST['state'] == 'MI') {
  190.         $state = 'Michigan';
  191.     } elseif($_POST['state'] == 'MN') {
  192.         $state = 'Minnesota';
  193.     } elseif($_POST['state'] == 'MS') {
  194.         $state = 'Mississippi';
  195.     } elseif($_POST['state'] == 'MO') {
  196.         $state = 'Missouri';
  197.     } elseif($_POST['state'] == 'MT') {
  198.         $state = 'Montana';
  199.     } elseif($_POST['state'] == 'NE') {
  200.         $state = 'Nebraska';
  201.     } elseif($_POST['state'] == 'NV') {
  202.         $state = 'Nevada';
  203.     } elseif($_POST['state'] == 'NH') {
  204.         $state = 'New Hampshire';
  205.     } elseif($_POST['state'] == 'NJ') {
  206.         $state = 'New Jersey';
  207.     } elseif($_POST['state'] == 'NM') {
  208.         $state = 'New Mexico';
  209.     } elseif($_POST['state'] == 'NY') {
  210.         $state = 'New York';
  211.     } elseif($_POST['state'] == 'NC') {
  212.         $state = 'North Carolina';
  213.     } elseif($_POST['state'] == 'ND') {
  214.         $state = 'North Dakota';
  215.     } elseif($_POST['state'] == 'OH') {
  216.         $state = 'Ohio';
  217.     } elseif($_POST['state'] == 'OK') {
  218.         $state = 'Oklahoma';
  219.     } elseif($_POST['state'] == 'OR') {
  220.         $state = 'Oregon';
  221.     } elseif($_POST['state'] == 'PA') {
  222.         $state = 'Pennsylvania';
  223.     } elseif($_POST['state'] == 'RI') {
  224.         $state = 'Rhode Island';
  225.     } elseif($_POST['state'] == 'SC') {
  226.         $state = 'South Carolina';
  227.     } elseif($_POST['state'] == 'SD') {
  228.         $state = 'South Dakota';
  229.     } elseif($_POST['state'] == 'TN') {
  230.         $state = 'Tennessee';
  231.     } elseif($_POST['state'] == 'TX') {
  232.         $state = 'Texas';
  233.     } elseif($_POST['state'] == 'UT') {
  234.         $state = 'Utah';
  235.     } elseif($_POST['state'] == 'VT') {
  236.         $state = 'Vermont';
  237.     } elseif($_POST['state'] == 'VA') {
  238.         $state = 'Virginia';
  239.     } elseif($_POST['state'] == 'WA') {
  240.         $state = 'Washington';
  241.     } elseif($_POST['state'] == 'WV') {
  242.         $state = 'West Virginia';
  243.     } elseif($_POST['state'] == 'WI') {
  244.         $state = 'Wisconsin';
  245.     } elseif($_POST['state'] == 'WY') {
  246.         $state = 'Wyoming';
  247.     } else {
  248.         echo "HERPDURPDURPDURP";
  249.     }
  250. /*
  251. foreach ($specialties as $specialty) {
  252.     if ($specialty == "singleFamily") {
  253.         $singleFamilyArr = "";
  254.         foreach ($cityArr as $city) {
  255.             foreach ($singleFamilyKeywords as $keyword) {
  256.                 $singleFamilyArr[] .= $city . " " . $keyword;
  257.             }
  258.            
  259.         }
  260.            
  261.     }
  262. }
  263.  
  264. print_r($singleFamilyArr);
  265. */
  266. echo "<table><tr><th>Campaign</th><th>Ad Group</th><th>Keyword</th><th>Max CPC</th><th>Status</th></tr>";
  267. $active = "Active";
  268. $paused = "Paused";
  269. $campaign = new campaign();
  270. $campaign->set_campaign($domain,$projectID);
  271. foreach ($specialties as $specialty) {
  272. $cityKeywords = new cityKeywords();
  273. $cityKeywords->set_keywordArr($specialty,$cityArr);
  274.     foreach($cityKeywords->keywordArr as $cityKeyword) {
  275.         echo "<tr><td>" . $campaign->campaign . "</td><td>" . $cityKeywords->adGroup . "</td><td>" . $cityKeyword . "</td><td>" . $cpc . "</td><td>" . $active . "</td></tr>";     
  276.     }
  277.    
  278. $zipKeywords = new zipKeywords();
  279. $zipKeywords->set_keywordArr($specialty,$zipArr);
  280.     foreach($zipKeywords->keywordArr as $zipKeyword) {
  281.         echo "<tr><td>" . $campaign->campaign . "</td><td>" . $zipKeywords->adGroup . "</td><td>" . $zipKeyword . "</td><td>" . $cpc . "</td><td>" . $active . "</td></tr>";       
  282.     }
  283.  
  284. $countyKeywords = new countyKeywords();
  285. $countyKeywords->set_keywordArr($specialty,$countyArr);
  286.     foreach($countyKeywords->keywordArr as $countyKeyword) {
  287.         echo "<tr><td>" . $campaign->campaign . "</td><td>" . $countyKeywords->adGroup . "</td><td>" . $countyKeyword . "</td><td>" . $cpc . "</td><td>" . $active . "</td></tr>";     
  288.     }
  289.  
  290. $stateKeywords = new stateKeywords();
  291. $stateKeywords->set_keywordArr($specialty,$state);
  292.     foreach($stateKeywords->keywordArr as $stateKeyword) {
  293.         echo "<tr><td>" . $campaign->campaign . "</td><td>" . $stateKeywords->adGroup . "</td><td>" . $stateKeyword . "</td><td>.30</td><td>" . $paused . "</td></tr>";    
  294.     }
  295.    
  296. $stateAbvKeywords = new stateKeywords();
  297. $stateAbvKeywords->set_keywordArr($specialty,$stateAbv);
  298.     foreach($stateAbvKeywords->keywordArr as $stateAbvKeyword) {
  299.         echo "<tr><td>" . $campaign->campaign . "</td><td>" . $stateAbvKeywords->adGroup . "</td><td>" . $stateAbvKeyword . "</td><td>.30</td><td>" . $paused . "</td></tr>";      
  300.     }
  301.  
  302. //print_r($keywords);
  303. //echo $keywords->adGroup;
  304. }
  305. echo "</table";
  306. }
  307. ?>
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.   </body>
  316. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement