PageRenderTime 50ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/report/dailyvotes.php

https://bitbucket.org/3tierlogic/3tl.tabbuilder
PHP | 728 lines | 546 code | 125 blank | 57 comment | 54 complexity | b5a3a22a44a0f00e326034974cb8bb13 MD5 | raw file
  1. <?php
  2. /*$companyID = $_REQUEST['coID'];
  3. $campaignID = $_REQUEST['cID']; // get
  4. $localdb = $_REQUEST['ldb'];*/
  5. require_once("timlib.php");
  6. // Connect to database
  7. require_once("db.php");
  8. $con = mysql_connect($dbhost, $dbuser, $dbpasswd); // connect to database
  9. if (!$con) { // error checking and handling
  10. die('Could not connect: ' . mysql_error());
  11. }
  12. mysql_select_db($dbname);
  13. $con_3tl = mysql_connect($dbhost_3tl, $dbuser_3tl, $dbpasswd_3tl); // connect to database
  14. if (!$con_3tl) { // error checking and handling
  15. die('Could not connect to 3TL: ' . mysql_error());
  16. }
  17. mysql_select_db($dbname_3tl);
  18. /* Load and clear sessions */
  19. session_start();
  20. $companyID = $_SESSION['companyid'];
  21. $campaignID = $_REQUEST['cID'];
  22. /*$companyID = $_SESSION['id'];
  23. $sweepstake_baseURL = "http://www2.3tierlogic.com/";
  24. $_SESSION['companyID'] = $_REQUEST['coID'];*/
  25. $campaignDesc = "";
  26. $campaignSdate = "";
  27. $campaignEdate = "";
  28. $campaignReentryPic = "";
  29. $maxDefaultDates = 7;
  30. $recentStartDate = "";
  31. $recentEndDate = "";
  32. $fieldNames[$count_fields] = "";
  33. $fieldLabelNames[$count_fields] = "";
  34. // run a sql to get camp info for later html use.
  35. $sql_companyInfo = "SELECT cp_companyName FROM sp_company_info WHERE cp_companyID='".$companyID."'";
  36. $res_companyInfo = mysql_query($sql_companyInfo, $con);
  37. if (mysql_num_rows($res_companyInfo) == 1) {
  38. list($companyName) = mysql_fetch_array($res_companyInfo);
  39. }
  40. $sql_campInfo = "SELECT campaign_sid as cid, campaign_name as cname, campaign_description as cdesc, campaign_start_time as sdate, campaign_end_time as edate, campaign_is_check_reentry as creentry FROM sp_campaign_info s where campaign_sid ='".$campaignID."'";
  41. $res0 = mysql_query($sql_campInfo, $con);
  42. if (mysql_num_rows($res0) == 1) {
  43. list($camp_id, $camp_name, $camp_desc, $camp_sdate, $camp_edate, $camp_reentry) = mysql_fetch_array($res0);
  44. $campaignName = $camp_name;
  45. $campaignDesc = $camp_desc;
  46. if (strlen($campaignDesc) <= 0) {
  47. $campaignDesc ="*** No description available ***";
  48. }
  49. $campaignSdate = $camp_sdate;
  50. $campaignEdate = $camp_edate;
  51. //$campaignReentry = $camp_reentry;
  52. if ($camp_reentry == 1) {
  53. $campaignReentryPic = "images/singleentry.png";
  54. } else {
  55. $campaignReentryPic = "images/multipleentries.png";
  56. }
  57. }
  58. else{
  59. echo "Err: could not pull out campaign info for cid: ".$campaignID."<br/>";
  60. }
  61. $default_date = 1; // defaults tolast few days
  62. if ( (!isset($_REQUEST['edate'])) || ($_REQUEST['edate'] == "") || (!isset($_REQUEST['sdate'])) || ($_REQUEST['sdate'] == "") ){
  63. $default_date = 1;
  64. } else {
  65. $default_date = 0;
  66. }
  67. if ( (!isset($_REQUEST['edate'])) || ($_REQUEST['edate'] == "") ){
  68. $sqlEndDate = "2100-12-31";
  69. } else {
  70. $sqlEndDate = $_REQUEST['edate'];
  71. }
  72. if( (!isset($_REQUEST['sdate'])) || ($_REQUEST['sdate'] == "") ){
  73. //$_POST['sdate'] = "";
  74. $_POST['sdate'] = "2000-01-01";
  75. $sqlStartDate = "2000-01-01";
  76. }
  77. else{
  78. $_POST['sdate'] = $_REQUEST['sdate'];
  79. $sqlStartDate = $_REQUEST['sdate'];
  80. }
  81. $sqlStartDate = $sqlStartDate." 00:00:00";
  82. $sqlEndDate = $sqlEndDate." 23:59:59";
  83. //$x_axis = "";
  84. //$y_axis = "";
  85. $displaygender_div = 0;
  86. $displayemail_div=0;
  87. $displayagerange_div=0;
  88. $displayzipcode_div=0;
  89. $displaycarrier_div = 0;
  90. $countDyn = 0;
  91. $displaydyn_div[$countDyn]=0;
  92. $dynstr_data[$countDyn] = "";
  93. $labels[$countDyn] = "";
  94. $zipCodeCountry = "CA"; //by default Canada
  95. // end of import from getprizereport.php
  96. //echo "ID: ".$companyID;
  97. if (!isset($companyID)) {
  98. header ( 'Location: http://platform.3tierlogic.com/tabbuilder/index1_3.php' );
  99. exit();
  100. }
  101. //***** Daily Visit chart
  102. $x_axis = "";
  103. $y_axis = "";
  104. $y2_axis = ""; // for distinct entries.
  105. $x_axis_last5 = "";
  106. $y_axis_last5 = "";
  107. $y2_axis_last5 = ""; //** Distinct entries
  108. $total_entry_last5 = 0;
  109. $total_uniqueentry_last5 = 0;
  110. $sql = "SELECT date_format(vc_votetime,'%Y-%m-%d'), count(*) as num FROM sp_campaign_ugc_vote WHERE vc_campaign_sid='".$campaignID."' AND vc_voteTime BETWEEN '".$sqlStartDate."' AND '".$sqlEndDate."' GROUP BY date_format(vc_voteTime,'%Y-%m-%d') ORDER BY date_format(vc_voteTime,'%Y-%m-%d') ASC";
  111. //echo $sql."<br>";
  112. //*** Need to think whether we include this search. Different date issues, do we want to share this info? etc etc
  113. //$sql_incomplete = "SELECT date_format(ep_uploadtime,'%Y-%m-%d'), count(*) as num FROM eim_tb_ugc_".$companyID." where ep_activityid='".$campaignID."' AND ep_uploadtime BETWEEN '".$_POST['sdate']."' AND '".$sqlEndDate."' AND ep_approvestate = '-1' GROUP BY date_format(ep_uploadtime,'%Y-%m-%d') ORDER BY date_format(ep_uploadtime,'%Y-%m-%d') ASC";
  114. $res = mysql_query($sql, $con);
  115. //$res_incomplete = mysql_query($sql_incomplete, $con);
  116. $totalRecords = mysql_num_rows($res);
  117. //*** Calculate the height of the table. Keep up to 1000px
  118. $tableHeight = $totalRecords * 160;
  119. if ($tableHeight > 1000) {
  120. $tableHeight = 1100;
  121. }
  122. if ($totalRecords > 0) {
  123. //echo "total rows: ".$totalRecords."<br>";
  124. $index = 0;
  125. $total_entry = 0;
  126. $total_distinct_entry = 0;
  127. // get Y.
  128. while (list($currdate, $totalentries) = mysql_fetch_array($res)) {
  129. //echo "date:".$currdate."- entries: ".$totalentries."<br>";
  130. //$newcurrdate = date('m/d', strtotime($currdate));
  131. $newcurrdate = date('Y-m-d', strtotime($currdate));
  132. $x_axis = $x_axis . "'".$newcurrdate."',";
  133. $y_axis = $y_axis . $totalentries.",";
  134. //***** Get the last x days data defined by maxDefaultDates above
  135. if ((($totalRecords - $index) - $maxDefaultDates) <= 0) {
  136. $x_axis_last5 = $x_axis_last5 . "'".$newcurrdate."',";
  137. $y_axis_last5 = $y_axis_last5 . $totalentries.",";
  138. $total_entry_last5 += $totalentries;
  139. //** Capture the start date
  140. if ($recentStartDate == "") {
  141. $recentStartDate = $currdate;
  142. }
  143. //** Capture the end date
  144. if (($recentEndDate == "") && (($index+1) == $totalRecords)) {
  145. $recentEndDate = $currdate;
  146. }
  147. }
  148. // create array to store sql and sql2 results.
  149. $array_sql[$index][0] = $newcurrdate;
  150. $array_sql[$index][1] = $totalentries;
  151. $total_entry += $totalentries;
  152. $index++;
  153. }
  154. $array_sql[$index][0] = "Total";
  155. $array_sql[$index][1] = $total_entry;
  156. $x_axis = substr($x_axis, 0, -1);
  157. $y_axis = substr($y_axis, 0, -1);
  158. $x_axis_last5 = substr($x_axis_last5, 0, -1);
  159. $y_axis_last5 = substr($y_axis_last5, 0, -1);
  160. //** By default, if no dates are specified, display last x dates defined by maxDefaultDates
  161. if ($default_date == 1) {
  162. $x_axis = $x_axis_last5;
  163. $y_axis = $y_axis_last5;
  164. }
  165. }
  166. ?>
  167. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  168. <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"><head profile="http://gmpg.org/xfn/11">
  169. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  170. <title>3 Tier Logic - Sweepstakes Tracker V1.0</title>
  171. <link href="style.css" rel="stylesheet" type="text/css" />
  172. <!--[if IE]>
  173. <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  174. <![endif]-->
  175. <!--[if IE 6]>
  176. <script src="js/belatedPNG.js"></script>
  177. <script>
  178. DD_belatedPNG.fix('*');
  179. </script>
  180. <![endif]-->
  181. <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>-->
  182. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
  183. <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
  184. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
  185. <!-- Charts JS library: START -->
  186. <script type="text/javascript" src="js/highcharts.js"></script>
  187. <script type="text/javascript" src="js/themes/gray.js"></script>
  188. <script type="text/javascript" src="js/modules/exporting.js"></script>
  189. <!-- Charts JS library: END -->
  190. <!-- date Picker start -->
  191. <!--<style type="text/css">@import "css/redmond.datepick.css";</style>
  192. <script src="js/CalendarControl/CalendarControl.js" language="javascript"></script>
  193. <script type="text/javascript" src="js/jquery.datepick.js"></script>-->
  194. <!-- date picker end-->
  195. <!-- documentation found at http://bxslider.com/options -->
  196. <!--<script src="http://bxslider.com/sites/default/files/jquery.bxSlider.min.js" type="text/javascript"></script>-->
  197. <script src="js/jquery.bxSlider.min.js" type="text/javascript"></script>
  198. <script type="text/javascript">
  199. $(document).ready(function(){
  200. $('#slider1').bxSlider({
  201. auto: true,
  202. pager: false,
  203. controls: false,
  204. pause: 5000
  205. });
  206. });
  207. </script>
  208. <script type="text/javascript">
  209. function viewEnties(td){
  210. var tord = td.substring(0,1);
  211. //alert(tord);
  212. var r = "r"+td.substring(1);
  213. var date = document.getElementById(r).innerHTML;
  214. //alert(date);
  215. var campid = "<?php echo $campaignID; ?>";
  216. //alert(campid);
  217. var detailPage = "detail.php";
  218. var sdate = <?php echo '\''.$_POST['sdate'].'\''; ?>;
  219. var edate = <?php echo '\''.$sqlEndDate.'\''; ?>;
  220. //var url = detailPage + "?campid=" + campid + "&date=" + date + "&tord=" + tord;
  221. var url = detailPage + "?campid=" + campid + "&date=" + date + "&tord=" + tord + "&sdate=" + sdate + "&edate=" + edate + "&coid=" + <?=$companyID?>;
  222. //alert(url);
  223. // window.open(url);
  224. window.location.href = url; // to try colorbox.
  225. }
  226. var chart;
  227. var chart_gender;
  228. $(document).ready(function() {
  229. $('tr').hover(
  230. function () {
  231. $(this).addClass('hover');
  232. },
  233. function () {
  234. $(this).removeClass('hover');
  235. }
  236. );
  237. chart = new Highcharts.Chart({
  238. chart: {
  239. renderTo: 'containergraph',
  240. defaultSeriesType: 'line',
  241. marginRight: 130,
  242. marginBottom: 25,
  243. zoomType: 'x'
  244. },
  245. title: {
  246. text: '<?=$campaignName?>',
  247. x: -20 //center
  248. },
  249. subtitle: {
  250. text: 'Prepared for: <?=$companyName?>',
  251. x: -20
  252. },
  253. xAxis: {
  254. //categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  255. categories: [<?=$x_axis?>],
  256. },
  257. yAxis: {
  258. title: {
  259. text: 'Total votes'
  260. },
  261. plotLines: [{
  262. value: 0,
  263. width: 1,
  264. color: '#808080'
  265. }]
  266. },
  267. tooltip: {
  268. formatter: function() {
  269. return '<b>'+ this.series.name +'</b><br/>'+
  270. this.x +': '+ this.y +' votes';
  271. }
  272. },
  273. legend: {
  274. layout: 'vertical',
  275. align: 'right',
  276. verticalAlign: 'top',
  277. x: -10,
  278. y: 100,
  279. borderWidth: 0
  280. },
  281. series: [
  282. {
  283. name: 'Total Votes',
  284. data: [<?=$y_axis?>]
  285. }]
  286. });
  287. });
  288. </script>
  289. <script type="text/javascript">
  290. $(function() {
  291. $('#popupDatepicker_start').datepicker({dateFormat: 'yy-mm-dd'});
  292. $('#popupDatepicker_end').datepicker({dateFormat: 'yy-mm-dd'});
  293. });
  294. function showDate(state) {
  295. //alert(state);
  296. var sdate = "";
  297. var edate = "";
  298. switch(state) {
  299. case 0:
  300. sdate = document.getElementById('popupDatepicker_start').value;
  301. edate = document.getElementById('popupDatepicker_end').value;
  302. break;
  303. case 1:
  304. sdate = '2000-01-01';
  305. edate = '2100-12-31';
  306. break;
  307. case 2:
  308. sdate = '<?php echo $recentStartDate ?>';
  309. edate = '<?php echo $recentEndDate ?>';
  310. break;
  311. default:
  312. sdate = '2000-01-01';
  313. edate = '2100-12-31';
  314. }
  315. //alert('The date chosen is ' + sdate + " " + edate);
  316. // get every necessary param.
  317. var coid = "<?php echo $companyID; ?>";
  318. var cid = "<?php echo $campaignID; ?>";
  319. var caname = "<?php echo $camp_name; ?>";
  320. var coname = "<?php echo $companyName; ?>";
  321. var localdb = "<?php echo $localdb; ?>";
  322. // build url.
  323. var url = '';
  324. url += 'dailyvotes.php';
  325. var params = '?cID='+cid+'&cName='+caname+'&coName='+coname+'&sdate='+sdate+'&edate='+edate+'&coID='+coid+'&ldb='+localdb;
  326. url += params;
  327. //alert(url);
  328. // go to self with new params.
  329. window.location.href = url;
  330. }
  331. </script>
  332. <!-- ****** Tables ************* -->
  333. <style type="text/css">
  334. @import "DTmedia/css/demo_page.css";
  335. @import "DTmedia/css/demo_table.css";
  336. </style>
  337. <!---<script type="text/javascript" language="javascript" src="DTmedia/js/jquery.js"></script>--->
  338. <!--<script class="jsbin" src="http://datatables.net/download/build/jquery.dataTables.nightly.js"></script>-->
  339. <!--<script type="text/javascript" language="javascript" src="DTmedia/js/jquery.js"></script>-->
  340. <script class="jsbin" src="DTmedia/js/jquery.dataTables.js"></script>
  341. <!--<script class="jsbin" src="http://datatables.net/download/build/jquery.dataTables.js"></script>-->
  342. <script type="text/javascript">
  343. $(document).ready(function(){
  344. $('#example').dataTable({
  345. "bJQueryUI": true,
  346. <!--"sPaginationType": "full_numbers",-->
  347. "bPaginate": false,
  348. "bFilter": false,
  349. "bLengthChange": false,
  350. "bScrollInfinite": true
  351. <!-- "bScrollCollapse": true,-->
  352. <!--"sScrollY": "<?php echo $tableHeight ?>px"-->
  353. });
  354. $(".panel").slideToggle("slow");
  355. $(".flip").click(function(){
  356. $(".panel").slideToggle("slow");
  357. });
  358. $(function () {
  359. var scroll_timer;
  360. var displayed = false;
  361. var $message = $('#message a');
  362. var $window = $(window);
  363. var top = $(document.body).children(0).position().top;
  364. $window.scroll(function () {
  365. window.clearTimeout(scroll_timer);
  366. scroll_timer = window.setTimeout(function () {
  367. if($window.scrollTop() <= top)
  368. {
  369. displayed = false;
  370. $message.fadeOut(500);
  371. }
  372. else if(displayed == false)
  373. {
  374. displayed = true;
  375. $message.stop(true, true).show().click(function () { $message.fadeOut(500); });
  376. }
  377. }, 100);
  378. });
  379. });
  380. });
  381. </script>
  382. <link rel="stylesheet" href="colorbox.css" />
  383. <script src="colorbox/jquery.colorbox.js"></script>
  384. <script>
  385. $(document).ready(function(){
  386. $(".picspopup").colorbox({iframe:true, width:"80%", height:"80%"});
  387. });
  388. </script>
  389. <style>
  390. div.panel{
  391. height:auto;
  392. display:none;
  393. }
  394. table#user-list tr.hover {
  395. color: #fff;
  396. background-color: #4c95e6;
  397. }
  398. #containergraph {
  399. float: left
  400. width: 33.3%;
  401. /* Min-height: */
  402. min-height: 400px;
  403. height: auto !important;
  404. height: 400px;
  405. }
  406. #message a
  407. {
  408. /* display: block before hiding */
  409. display: block;
  410. display: none;
  411. /* link is above all other elements */
  412. z-index: 999;
  413. /* link doesn't hide text behind it */
  414. opacity: .8;
  415. /* link stays at same place on page */
  416. position: fixed;
  417. /* link goes at the bottom of the page */
  418. top: 100%;
  419. margin-top: -80px; /* = height + preferred bottom margin */
  420. /* link is centered */
  421. left: 50%;
  422. margin-left: -160px; /* = half of width */
  423. /* round the corners (to your preference) */
  424. -moz-border-radius: 24px;
  425. -webkit-border-radius: 24px;
  426. /* make it big and easy to see (size, style to preferences) */
  427. width: 300px;
  428. line-height: 48px;
  429. height: 48px;
  430. padding: 10px;
  431. background-color: #000;
  432. font-size: 24px;
  433. text-align: center;
  434. color: #fff;
  435. }
  436. </style>
  437. </head>
  438. <body class="normalpage" id="top">
  439. <section id="page">
  440. <div id="bodywrap">
  441. <section id="top">
  442. <nav>
  443. <h1 id="sitename">
  444. <a href="#">3 Tier Logic Inc.</a></h1>
  445. <ul id="sitenav">
  446. <li class="current"><a href="#">UCG Votes Summary</a></li>
  447. <li><a href="main.php">Report Dashboard</a></li>
  448. <li><a href="../editor/dashboard.php">Back to Tab Editor</a></li>
  449. </ul>
  450. </nav>
  451. <header id="normalheader"></header>
  452. </section>
  453. <section id="contentwrap">
  454. <div id="contents">
  455. <div id="topcolumns">
  456. <div class="col">
  457. <!-- <img src="../images/design.png" width="61" height="60" alt="graph" class="imgright"> -->
  458. <h2>Campaign Info</h2>
  459. <p>
  460. <b>Company Name: </b> <?=$companyName?><br>
  461. <b>Campaign Name: </b> <?=$camp_name?><br>
  462. <b>Start date: </b> <?=$campaignSdate?><br>
  463. <b>End date: </b><?=$campaignEdate?><br>
  464. <b>Entry requirement: </b><img src="<?=$campaignReentryPic?>" /><br>
  465. <p class="flip"><b>Description: (Click to view/hide)</b></p><div class="panel"><?=$campaignDesc?></div><br>
  466. </p>
  467. </div>
  468. <div class="col">
  469. <h2>Filter by date</h2>
  470. <table cellpadding="0" cellspacing="0">
  471. <tr>
  472. <td><b>Start Date:</b>&nbsp;</td>
  473. <td><input name='startdate' type='text' id='popupDatepicker_start'></input></td>
  474. </tr>
  475. <tr>
  476. <td><b>End Date:</b>&nbsp;</td>
  477. <td><input name='enddate' type='text' id='popupDatepicker_end'></input></td>
  478. </tr>
  479. <tr>
  480. <td colspan="2" align="right"><br /><input type='button' value='submit' onclick='showDate(0)'></input></td>
  481. </tr>
  482. </table>
  483. </div>
  484. <div class="col">
  485. <h2>Quick Links</h2>
  486. <p>
  487. <ul>
  488. <li><img src="images/rightarrow.png" border="0" width="10" height="10" />&nbsp;&nbsp;<a href="dailyentries.php?coID=<?=$companyID?>&cID=<?=$campaignID?>">View entries report</a></li><br/>
  489. <li><img src="images/rightarrow.png" border="0" width="10" height="10" />&nbsp;&nbsp;<a href="#" onclick='showDate(1)'>View all votes</a></li><br/>
  490. </p>
  491. </div>
  492. <div class="clear"></div>
  493. <!-- ****** Display Charts here **** -->
  494. <div id="containergraph" style="width: 900px; height: 400px; margin: auto;"></div>
  495. <br /><br />
  496. <?php
  497. echo "<div id='tableContainer'>";
  498. if($index > 0){
  499. echo "<h2>Campaign summary from ".$sqlStartDate." to ".$sqlEndDate." </h2>";
  500. echo "<table cellpadding='0' cellspacing='0' width='60%'>";
  501. echo "<tr>";
  502. //echo "<h4>total days: ".mysql_num_rows($res)."</h4>";
  503. if ($index <= 1) {
  504. echo "<td width='60%'><h4>Campaign duration: </h4></td><td width='40%'>".$index." day</td>";
  505. } else {
  506. echo "<td width='60%'><h4>Campaign duration: </h4></td><td width='40%'>".$index." days</td>";
  507. }
  508. echo "</tr><tr>";
  509. echo "<td width='60%'><h4>Total Votes: </h4></td><td width='40%'>".$total_entry."</td>";
  510. echo "</tr><tr>";
  511. echo "<td width='60%'><h4>Total Votes in the ".$maxDefaultDates." last days: </h4></td><td width='40%'>".$total_entry_last5."</td>";
  512. echo "</tr><table>";
  513. echo "<br><br>";
  514. echo "<table cellpadding='0' cellspacing='0' border='2' class='display' id='example'>"; //id='user-list'>";
  515. echo "<thead><tr><th>Day</th><th>Date</th><th>Total Votes</th></tr></thead>";
  516. echo "<tbody>";
  517. $i = 0;
  518. while($i <= $index){
  519. if($i % 2 != 0){
  520. echo "<tr class='odd gradeX'>";
  521. }else{
  522. echo "<tr class='odd gradeA'>";
  523. }
  524. echo "<td class='center'>".($i+1)."</td>";
  525. echo "<td class='center'> ".$array_sql[$i][0]."</td>";
  526. if ($i==$index) { //*** the link to the total entries should display all entries
  527. echo '<td class="center"> <a id="t'.$i.'" href='.getVoteDetailURL("t".$i, $array_sql[$i][0], $campaignID, $_POST['sdate'], $sqlEndDate, $companyID, $localdb).'>'.$array_sql[$i][1].'</a></td>';
  528. } else { //*** the link to each daily entry should display that day's entries
  529. echo '<td class="center"> <a id="t'.$i.'" href='.getVoteDetailURL("t".$i, $array_sql[$i][0], $campaignID, $array_sql[$i][0], $array_sql[$i][0], $companyID, $localdb).'>'.$array_sql[$i][1].'</a></td>';
  530. //echo '<td class="center"> <a class="picspopup" id="t'.$i.'" href='.getDetailURL("d".$i, $array_sql[$i][0], $campaignID, $_POST['sdate'], $sqlEndDate,$companyID ).'>'.$array_sql[$i][2].'</a></td>';
  531. }
  532. echo "</tr>";
  533. $i++;
  534. }
  535. echo "</tbody>";
  536. echo "</table>";
  537. }
  538. echo "</div>";
  539. if ($displaygender_div == 1) {
  540. echo "<div id='container2' style='width: 900px; height: 400px; margin: 0 auto'></div>";
  541. }
  542. ?>
  543. <div class="clear"></div>
  544. </div>
  545. </div>
  546. </section>
  547. </div>
  548. <footer id="pagefooter">
  549. <div id="bottom">
  550. <div class="block1">
  551. <h2>Meet The Team</h2>
  552. <div class="teamimg">
  553. <? include("team.php")?>
  554. </div>
  555. </div>
  556. <div class="block2">
  557. <h2>Featured Projects</h2>
  558. <div class="projectthmb">
  559. <!--<a href="portfolio"><img src="images/latstproject.jpg" width="240" height="150" alt="project"></a>-->
  560. <?
  561. $sql = "SELECT ID, post_date, post_content, post_title FROM 3tierweb.tier_posts WHERE post_type='post' and post_parent='0' and post_status='publish' order by post_date desc Limit 4";
  562. $res = mysql_query($sql, $con_3tl);
  563. if (mysql_num_rows($res) > 0) {
  564. ?>
  565. <ul id="slider1">
  566. <?
  567. $picon = "";
  568. while(list($pid, $pdate, $pcontent, $ptitle) = mysql_fetch_array($res)) {
  569. $sql_icon = "SELECT guid FROM 3tierweb.tier_posts where post_type='attachment' and (post_mime_type='image/jpeg' or post_mime_type='image/png') and post_parent='".$pid."' order by post_date desc";
  570. $res_icon = mysql_query($sql_icon, $con_3tl);
  571. if (mysql_num_rows($res_icon) > 0) {
  572. list($picon) = mysql_fetch_array($res_icon);
  573. }
  574. echo "<li><a href='http://www5.3tierlogic.com/?p=".$pid."' target='_blank'><img src='".$picon."' width='240' height='150' /></a><p style='font:Verdana, Geneva, sans-serif; color:#FFF; font-size:10px '>".$ptitle."</p></li>";
  575. //echo "<li><a href='http://www5.3tierlogic.com/?p=".$pid."' target='_blank'>".$ptitle."</a></li>";
  576. }
  577. ?>
  578. </ul>
  579. <?
  580. } else {
  581. ?>
  582. <a href="portfolio"><img src="images/latstproject.jpg" width="240" height="150" alt="project"></a>
  583. <?
  584. }
  585. ?>
  586. </div>
  587. </div>
  588. <div class="block3">
  589. <h2>About</h2>
  590. <p>3 Tier Logic is a full service digital marketing and technology services company that enables organizations to grow their customer and prospect communities through anywhere-anytime communications. </p>
  591. </div>
  592. <div class="clear"></div>
  593. </div>
  594. <div id="credits">
  595. <p>
  596. <span class="copyright">
  597. &copy; 2012 | 3 Tier Logic Inc | All Rights Reserved </span></p>
  598. </div>
  599. </footer>
  600. </section>
  601. <div id="message"><a href="#top">Scroll to top</a></div>
  602. </body>
  603. </html>