PageRenderTime 48ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/report/dailyvotesdetails.php

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