PageRenderTime 617ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 1ms

/report/ugcentries.php

https://bitbucket.org/3tierlogic/3tl.tabbuilder
PHP | 1354 lines | 909 code | 304 blank | 141 comment | 92 complexity | 1e384453ac799dbb20b6074564dcb799 MD5 | raw file
  1. <?php
  2. /*$companyID = $_REQUEST['coID'];
  3. $activityID = $_REQUEST['aID']; // get
  4. $localdb = $_REQUEST['ldb'];
  5. $campaignID = $activityID;*/
  6. require_once("timlib.php");
  7. require_once("badwords.php");
  8. // Connect to database
  9. require_once("db.php");
  10. $con = mysql_connect($dbhost, $dbuser, $dbpasswd); // connect to database
  11. if (!$con) { // error checking and handling
  12. die('Could not connect: ' . mysql_error());
  13. }
  14. mysql_select_db($dbname);
  15. $con_3tl = mysql_connect($dbhost_3tl, $dbuser_3tl, $dbpasswd_3tl); // connect to database
  16. if (!$con_3tl) { // error checking and handling
  17. die('Could not connect to 3TL: ' . mysql_error());
  18. }
  19. mysql_select_db($dbname_3tl);
  20. session_start();
  21. if ( ! isset ( $_SESSION['companyid'] ) ) {
  22. header ( 'Location: http://platform.3tierlogic.com/tabbuilder/index1_3.php' );
  23. exit();
  24. } else {
  25. if (isset($_REQUEST['customerID'])) { ///**** This value is set when logged in as a superuser and selecting a company from the drop down to view
  26. $companyID = $_REQUEST['customerID'];
  27. } else {
  28. $companyID = $_SESSION['companyid'];
  29. }
  30. }
  31. $campaignID = $activityID = $_REQUEST['cID'];
  32. // run a sql to get camp info for later html use.
  33. $sql_companyInfo = "SELECT cp_companyName FROM sp_company_info WHERE cp_companyID='".$companyID."'";
  34. $res_companyInfo = mysql_query($sql_companyInfo, $con);
  35. if (mysql_num_rows($res_companyInfo) == 1) {
  36. list($companyName) = mysql_fetch_array($res_companyInfo);
  37. }
  38. $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."'";
  39. $res0 = mysql_query($sql_campInfo, $con);
  40. if (mysql_num_rows($res0) == 1) {
  41. list($camp_id, $camp_name, $camp_desc, $camp_sdate, $camp_edate, $camp_reentry) = mysql_fetch_array($res0);
  42. $campaignName = $camp_name;
  43. $campaignDesc = $camp_desc;
  44. if (strlen($campaignDesc) <= 0) {
  45. $campaignDesc ="*** No description available ***";
  46. }
  47. $campaignSdate = $camp_sdate;
  48. $campaignEdate = $camp_edate;
  49. //$campaignReentry = $camp_reentry;
  50. if ($camp_reentry == 1) {
  51. $campaignReentryPic = "images/singleentry.png";
  52. } else {
  53. $campaignReentryPic = "images/multipleentries.png";
  54. }
  55. }
  56. else{
  57. echo "Err: could not pull out campaign info for cid: ".$campaignID."<br/>";
  58. }
  59. //*** Get the current URL of this script to add to the links
  60. $domain = $_SERVER['HTTP_HOST'];
  61. $path = $_SERVER['SCRIPT_NAME'];
  62. $queryString = $_SERVER['QUERY_STRING'];
  63. $currenturl = "http://" . $domain . $path;
  64. //*****
  65. /*$companyID = $_REQUEST["coID"];
  66. $activityID = $_REQUEST["aID"];*/
  67. if (!isset($_GET['d'])) {
  68. if (isset($_GET['sdate'])) {
  69. $startDate = $_GET['sdate'];
  70. } else {
  71. $startDate = "";
  72. }
  73. if (isset($_GET['edate'])) {
  74. $endDate = $_GET['edate'];
  75. } else {
  76. $endDate = "";
  77. }
  78. } else {
  79. $endDate = date("Y-m-d");
  80. $startDate = date("Y-m-d", mktime(0, 0, 0, date("m") , date("d") - $_GET['d'], date("Y")));
  81. }
  82. if (isset($_GET['s'])) {
  83. $state = $_GET['s'];
  84. } else {
  85. $state = "0"; //**** By default - New entries
  86. }
  87. $imageBaseURL = "http://platform.3tierlogic.com/tabbuilder1_3/editor/uploads/";
  88. $imageBaseURL_thumb = "http://platform.3tierlogic.com/tabbuilder1_3/editor/uploads/";
  89. /*$menuPath = "http://www2.3tierlogic.com/stlouisrams/brandyourpassion/submission/admin/tabmenu.php?s=$state&u=$currenturl";*/
  90. if($startDate == "" and $endDate=="") {
  91. $sql = "SELECT ugc_sid, ugc_photo_name, ugc_upload_time, ugc_user_id, ugc_video_id, ugc_type, ugc_title, ugc_description, ugc_admin_comments FROM sp_campaign_ugc WHERE ugc_approve_state = '".$state."' AND ugc_campaign_sid='".$activityID."'";
  92. $newentry_link = $_SERVER['PHP_SELF']."?s=0&aID=".$activityID;
  93. $approvedentry_link = $_SERVER['PHP_SELF']."?s=1&cID=".$activityID;
  94. $rejectedentry_link = $_SERVER['PHP_SELF']."?s=2&cID=".$activityID;
  95. $reviewlaterentry_link = $_SERVER['PHP_SELF']."?s=3&cID=".$activityID;
  96. } else {
  97. $newentry_link = $_SERVER['PHP_SELF']."?s=0&sdate=".$startDate."&edate=".$endDate."&cID=".$activityID;
  98. $approvedentry_link = $_SERVER['PHP_SELF']."?s=1&sdate=".$startDate."&edate=".$endDate."&cID=".$activityID."&coID=".$companyID;
  99. $rejectedentry_link = $_SERVER['PHP_SELF']."?s=2&sdate=".$startDate."&edate=".$endDate."&cID=".$activityID."&coID=".$companyID;
  100. $reviewlaterentry_link = $_SERVER['PHP_SELF']."?s=3&sdate=".$startDate."&edate=".$endDate."&cID=".$activityID."&coID=".$companyID;
  101. //*** Format date with time for accuracy
  102. $startDate=$startDate." 00:00:00";
  103. $endDate=$endDate." 23:59:59:";
  104. $sql = "SELECT ugc_sid, ugc_photo_name, ugc_upload_time, ugc_user_id, ugc_video_id, ugc_type, ugc_title, ugc_description, ugc_admin_comments FROM sp_campaign_ugc WHERE ugc_approve_state = '".$state."' and ugc_upload_time >= '".$startDate."' AND ugc_upload_time <= '".$endDate."' AND ugc_campaign_sid='".$activityID."'";
  105. }
  106. $res = mysql_query($sql, $con);
  107. //*** Check if we have pictures to display
  108. if (mysql_num_rows($res) > 0) {
  109. $emptyAlbum=1;
  110. } else {
  111. $emptyAlbum=0;
  112. }
  113. switch ($state) {
  114. case 0:
  115. $sectionName = "New Entries";
  116. break;
  117. case 1:
  118. $sectionName = "Approved Entries";
  119. break;
  120. case 2:
  121. $sectionName = "Rejected Entries";
  122. break;
  123. case 3:
  124. $sectionName = "Entries for Review";
  125. break;
  126. case 5:
  127. $sectionName = "Quarantined Entries";
  128. break;
  129. }
  130. function isBadWord($text, $badwords) {
  131. //First we list the bad words in array
  132. /* $badwords = array(
  133. 'fuck',
  134. 'suck',
  135. 'com',
  136. 'net',
  137. 'org',
  138. 'info'
  139. );*/
  140. //Then we perform the bad word check
  141. foreach($badwords as $badwords) {
  142. if(stristr($text,$badwords)) {
  143. return true;
  144. }
  145. }
  146. return false;
  147. }
  148. ?>
  149. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  150. <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"><head profile="http://gmpg.org/xfn/11">
  151. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  152. <title>3 Tier Logic - Tracker V1.0</title>
  153. <link href="style.css" rel="stylesheet" type="text/css" />
  154. <!--[if IE]>
  155. <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  156. <![endif]-->
  157. <!--[if IE 6]>
  158. <script src="js/belatedPNG.js"></script>
  159. <script>
  160. DD_belatedPNG.fix('*');
  161. </script>
  162. <![endif]-->
  163. <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>-->
  164. <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>-->
  165. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
  166. <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
  167. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
  168. <!-- Charts JS library: START -->
  169. <script type="text/javascript" src="js/highcharts.js"></script>
  170. <script type="text/javascript" src="js/themes/gray.js"></script>
  171. <script type="text/javascript" src="js/modules/exporting.js"></script>
  172. <!-- Charts JS library: END -->
  173. <!-- date Picker start -->
  174. <!--<style type="text/css">@import "css/redmond.datepick.css";</style>
  175. <script src="js/CalendarControl/CalendarControl.js" language="javascript"></script>
  176. <script type="text/javascript" src="js/jquery.datepick.js"></script>-->
  177. <!-- date picker end-->
  178. <!-- documentation found at http://bxslider.com/options -->
  179. <!--<script src="http://bxslider.com/sites/default/files/jquery.bxSlider.min.js" type="text/javascript"></script>-->
  180. <script src="js/jquery.bxSlider.min.js" type="text/javascript"></script>
  181. <script type="text/javascript">
  182. $(document).ready(function(){
  183. $('#slider1').bxSlider({
  184. auto: true,
  185. pager: false,
  186. controls: false,
  187. pause: 5000
  188. });
  189. });
  190. </script>
  191. <script type="text/javascript">
  192. var starttime = new Date();
  193. var timelastactivity = new Date();
  194. var refreshTimerId = null;
  195. var refreshTimerRunning = false;
  196. var logoutTimerId = null;
  197. var logoutTimerRunning = false;
  198. $(function() {
  199. $('#popupDatepicker_start').datepicker({dateFormat: 'yy-mm-dd'});
  200. $('#popupDatepicker_end').datepicker({dateFormat: 'yy-mm-dd'});
  201. });
  202. function showDate(state) {
  203. //alert(state);
  204. var sdate = "";
  205. var edate = "";
  206. switch(state) {
  207. case 0:
  208. sdate = document.getElementById('popupDatepicker_start').value;
  209. edate = document.getElementById('popupDatepicker_end').value;
  210. break;
  211. case 1:
  212. sdate = '2000-01-01';
  213. edate = '2100-12-31';
  214. break;
  215. case 2:
  216. sdate = '<?php echo $recentStartDate ?>';
  217. edate = '<?php echo $recentEndDate ?>';
  218. break;
  219. default:
  220. sdate = '2000-01-01';
  221. edate = '2100-12-31';
  222. }
  223. //alert('The date chosen is ' + sdate + " " + edate);
  224. // get every necessary param.
  225. var coid = "<?php echo $companyID; ?>";
  226. var cid = "<?php echo $activityID; ?>";
  227. //var localdb = "<?php echo $localdb; ?>";
  228. // build url.
  229. var url = '';
  230. url += 'ugcentries.php';
  231. //var params = '?aID='+cid+'&sdate='+sdate+'&edate='+edate+'&coID='+coid+'&ldb='+localdb;
  232. var params = '?aID='+cid+'&sdate='+sdate+'&edate='+edate+'&coID='+coid;
  233. url += params;
  234. //alert(url);
  235. // go to self with new params.
  236. window.location.href = url;
  237. }
  238. //**** Update entry function ::: START
  239. function updateentry(cid) {
  240. var selectedoption = "0";
  241. var notifyuser = "0";
  242. var notifylanguage = document.getElementById('lang_'+cid).value;
  243. var selectedoption = document.querySelector('.status'+cid+':checked').value;
  244. //alert(cid+":lan "+document.getElementById('lang_'+cid).value);
  245. //var radiooptions = document.getElementsByName('status'+cid);
  246. // for(var rad in radiooptions) {
  247. // if (radiooptions[rad].checked) {
  248. // var selectedoption = radiooptions[rad].value;
  249. // }
  250. // }
  251. if (document.getElementById('notify'+cid).checked) {
  252. notifyuser = "1";
  253. }
  254. var data = "c="+document.getElementById('admincomment'+cid).value;
  255. data = data + "&s="+selectedoption;
  256. data = data + "&id=" + cid;
  257. data = data + "&coid=" + <?=$companyID?>;
  258. data = data + "&aid=" + <?=$activityID?>;
  259. data = data + "&n=" + notifyuser;
  260. data = data + "&cid=" + document.getElementById('cid_'+cid).value;
  261. //data = data + "&ldb=" + <?=$localdb?>;
  262. data = data + "&l=" + notifylanguage;
  263. //alert(data);
  264. //start the ajax
  265. $.ajax({
  266. //this is the php file that processes the data and send mail
  267. url: "updateentry.php",
  268. //GET method is used
  269. type: "POST",
  270. //pass the data
  271. data: data,
  272. //Do not cache the page
  273. cache: false,
  274. //success
  275. success: function (returnval) {
  276. alert("Entry updated");
  277. //alert(returnval);
  278. }
  279. });
  280. //cancel the submit button default behaviours
  281. return false;
  282. }
  283. //**** Update entry function ::: END
  284. //*** Timer function
  285. function dateDiff(date1, date2) {
  286. return date1.getTime() - date2.getTime();
  287. }
  288. function checkSessionExpiry() {
  289. var timenow=new Date();
  290. var timebetween = dateDiff(timenow, timelastactivity)/60000;
  291. var data = "";
  292. data = data+"&cid="+"<?=$companyID?>";
  293. data = data+"&sid="+"<?=session_id()?>";
  294. data = data+"&uid="+"<?=$_SESSION['userID']?>";
  295. data = data+"&action=timeout";
  296. //Logout after 15 minutes
  297. if (timebetween > 15) {
  298. //start the ajax
  299. $.ajax({
  300. //this is the php file that processes the data and send mail
  301. url: "updatetimer.php",
  302. //POST method is used
  303. type: "POST",
  304. //pass the data
  305. data: data,
  306. //Do not cache the page
  307. cache: false,
  308. //success
  309. success: function (returnval) {
  310. //alert(returnval);
  311. }
  312. });
  313. alert("Your session has timed out, please login again to continue.");
  314. window.location.href = 'loginreview.php';
  315. }
  316. }
  317. function updateTime() {
  318. var timenow=new Date();
  319. var data = "d="+timenow;
  320. data = data+"&cid="+"<?=$companyID?>";
  321. data = data+"&sid="+"<?=session_id()?>";
  322. data = data+"&uid="+"<?=$_SESSION['userID']?>";
  323. data = data+"&action=update";
  324. //start the ajax
  325. $.ajax({
  326. //this is the php file that processes the data and send mail
  327. url: "updatetimer.php",
  328. //POST method is used
  329. type: "POST",
  330. //pass the data
  331. data: data,
  332. //Do not cache the page
  333. cache: false,
  334. //success
  335. success: function (returnval) {
  336. //alert(returnval);
  337. }
  338. });
  339. }
  340. function startTimer() {
  341. //alert("Timer starts now..."+starttime);
  342. // Check every 10 minutes (600,000 milliseconds)
  343. if (refreshTimerRunning) {
  344. clearInterval(refreshTimerId);
  345. }
  346. refreshTimerRunning = true;
  347. refreshTimerId = setInterval(function() {
  348. updateTime();
  349. }, 60000);
  350. // Check every 15 minutes (900,000 milliseconds) to see whether session has expired
  351. if (logoutTimerRunning) {
  352. clearInterval(logoutTimerId);
  353. }
  354. logoutTimerRunning = true;
  355. var logoutTimerId = setInterval(function() {
  356. checkSessionExpiry();
  357. }, 120000);
  358. }
  359. function reset_interval() {
  360. //resets the timer. The timer is reset on each of the below events:<br />
  361. // 1. mousemove 2. mouseclick 3. key press 4. scroliing<br />
  362. //first step: clear the existing timer<br />
  363. timelastactivity = new Date();
  364. }
  365. function Toggle(id) {
  366. if (document.getElementById(id).style.display == "none" || document.getElementById(id).style.display == "") {
  367. document.getElementById(id).style.display = "block";
  368. } else if (document.getElementById(id).style.display == "block") {
  369. document.getElementById(id).style.display = "none";
  370. } else {
  371. document.getElementById(id).style.display = "none";
  372. }
  373. }
  374. </script>
  375. <script type="text/javascript">
  376. $(document).ready(function(){
  377. <!-- ***** SCROLL TOP SCRIPT ::: START -->
  378. $(function () {
  379. var scroll_timer;
  380. var displayed = false;
  381. var $message = $('#message a');
  382. var $window = $(window);
  383. var top = $(document.body).children(0).position().top;
  384. $window.scroll(function () {
  385. window.clearTimeout(scroll_timer);
  386. scroll_timer = window.setTimeout(function () {
  387. if($window.scrollTop() <= top)
  388. {
  389. displayed = false;
  390. $message.fadeOut(500);
  391. }
  392. else if(displayed == false)
  393. {
  394. displayed = true;
  395. $message.stop(true, true).show().click(function () { $message.fadeOut(500); });
  396. }
  397. }, 100);
  398. });
  399. });
  400. <!-- ***** SCROLL TOP SCRIPT ::: END -->
  401. <!-- ***** FANCYBOX SCRIPT ::: START -->
  402. /*
  403. Simple image gallery. Uses default settings
  404. */
  405. $('.fancybox').fancybox();
  406. /*
  407. Different effects
  408. */
  409. // Change title type, overlay opening speed and opacity
  410. $(".fancybox-effects-a").fancybox({
  411. helpers: {
  412. title : {
  413. type : 'outside'
  414. },
  415. overlay : {
  416. speedIn : 500,
  417. opacity : 0.95
  418. }
  419. }
  420. });
  421. // Disable opening and closing animations, change title type
  422. $(".fancybox-effects-b").fancybox({
  423. openEffect : 'none',
  424. closeEffect : 'none',
  425. helpers : {
  426. title : {
  427. type : 'over'
  428. }
  429. }
  430. });
  431. // Set custom style, close if clicked, change title type and overlay color
  432. $(".fancybox-effects-c").fancybox({
  433. wrapCSS : 'fancybox-custom',
  434. closeClick : true,
  435. helpers : {
  436. title : {
  437. type : 'inside'
  438. },
  439. overlay : {
  440. css : {
  441. 'background-color' : '#eee'
  442. }
  443. }
  444. }
  445. });
  446. // Remove padding, set opening and closing animations, close if clicked and disable overlay
  447. $(".fancybox-effects-d").fancybox({
  448. padding: 0,
  449. openEffect : 'elastic',
  450. openSpeed : 150,
  451. closeEffect : 'elastic',
  452. closeSpeed : 150,
  453. closeClick : true,
  454. helpers : {
  455. overlay : null
  456. }
  457. });
  458. /*
  459. Button helper. Disable animations, hide close button, change title type and content
  460. */
  461. $('.fancybox-buttons').fancybox({
  462. openEffect : 'none',
  463. closeEffect : 'none',
  464. prevEffect : 'none',
  465. nextEffect : 'none',
  466. closeBtn : false,
  467. helpers : {
  468. title : {
  469. type : 'inside'
  470. },
  471. buttons : {}
  472. },
  473. afterLoad : function() {
  474. this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
  475. }
  476. });
  477. /*
  478. Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
  479. */
  480. $('.fancybox-thumbs').fancybox({
  481. prevEffect : 'none',
  482. nextEffect : 'none',
  483. closeBtn : false,
  484. arrows : false,
  485. nextClick : true,
  486. helpers : {
  487. thumbs : {
  488. width : 50,
  489. height : 50
  490. }
  491. }
  492. });
  493. /*
  494. Open manually
  495. */
  496. $("#fancybox-manual-a").click(function() {
  497. $.fancybox.open('1_b.jpg');
  498. });
  499. $("#fancybox-manual-b").click(function() {
  500. $.fancybox.open({
  501. href : 'iframe.html',
  502. type : 'iframe',
  503. padding : 5
  504. });
  505. });
  506. $("#fancybox-manual-c").click(function() {
  507. $.fancybox.open([
  508. {
  509. href : '1_b.jpg',
  510. title : 'My title'
  511. }, {
  512. href : '2_b.jpg',
  513. title : '2nd title'
  514. }, {
  515. href : '3_b.jpg'
  516. }
  517. ], {
  518. helpers : {
  519. thumbs : {
  520. width: 75,
  521. height: 50
  522. }
  523. }
  524. });
  525. });
  526. <!-- ***** FANCYBOX SCRIPT ::: START -->
  527. });
  528. </script>
  529. <!-- ***** GALLERIFIC STUFF ::: START -->
  530. <!--<link rel="stylesheet" href="css/basic.css" type="text/css" />-->
  531. <link rel="stylesheet" href="css/galleriffic-5.css" type="text/css" />
  532. <!--<link rel="stylesheet" href="css/buttons.css" type="text/css" />-->
  533. <!-- <link rel="stylesheet" href="css/white.css" type="text/css" /> -->
  534. <!--<link rel="stylesheet" href="css/black.css" type="text/css" />-->
  535. <!--/*<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>*/-->
  536. <!--<script type="text/javascript" src="js/jquery-1.3.2.js"></script>-->
  537. <script type="text/javascript" src="js/jquery.history.js"></script>
  538. <script type="text/javascript" src="js/jquery.galleriffic.js"></script>
  539. <script type="text/javascript" src="js/jquery.opacityrollover.js"></script>
  540. <!-- We only want the thunbnails to display when javascript is disabled -->
  541. <script type="text/javascript">
  542. document.write('<style>.noscript { display: none; }</style>');
  543. </script>
  544. <!-- ***** GALLERIFIC STUFF ::: END -->
  545. <!-- ***** FACNY BOX STUFF ::: START -->
  546. <!-- Add mousewheel plugin (this is optional) -->
  547. <script type="text/javascript" src="lib/jquery.mousewheel-3.0.6.pack.js"></script>
  548. <!-- Add fancyBox main JS and CSS files -->
  549. <script type="text/javascript" src="source/jquery.fancybox.js"></script>
  550. <link rel="stylesheet" type="text/css" href="source/jquery.fancybox.css" media="screen" />
  551. <!-- Add Button helper (this is optional) -->
  552. <link rel="stylesheet" type="text/css" href="source/helpers/jquery.fancybox-buttons.css?v=2.0.4" />
  553. <script type="text/javascript" src="source/helpers/jquery.fancybox-buttons.js?v=2.0.4"></script>
  554. <!-- Add Thumbnail helper (this is optional) -->
  555. <link rel="stylesheet" type="text/css" href="source/helpers/jquery.fancybox-thumbs.css?v=2.0.4" />
  556. <script type="text/javascript" src="source/helpers/jquery.fancybox-thumbs.js?v=2.0.4"></script>
  557. <style type="text/css">
  558. .fancybox-custom .fancybox-outer {
  559. box-shadow: 0 0 50px #222;
  560. }
  561. </style>
  562. <!-- ***** FACNY BOX STUFF ::: END -->
  563. <style>
  564. #emailtext { width:600px; padding:1px; display:none; }
  565. div.panel{
  566. height:auto;
  567. display:none;
  568. }
  569. table#user-list tr.hover {
  570. color: #fff;
  571. background-color: #4c95e6;
  572. }
  573. #containergraph {
  574. float: left
  575. width: 33.3%;
  576. /* Min-height: */
  577. min-height: 400px;
  578. height: auto !important;
  579. height: 400px;
  580. }
  581. #message a {
  582. /* display: block before hiding */
  583. display: block;
  584. display: none;
  585. /* link is above all other elements */
  586. z-index: 999;
  587. /* link doesn't hide text behind it */
  588. opacity: .8;
  589. /* link stays at same place on page */
  590. position: fixed;
  591. /* link goes at the bottom of the page */
  592. top: 100%;
  593. margin-top: -80px; /* = height + preferred bottom margin */
  594. /* link is centered */
  595. left: 50%;
  596. margin-left: -160px; /* = half of width */
  597. /* round the corners (to your preference) */
  598. -moz-border-radius: 24px;
  599. -webkit-border-radius: 24px;
  600. /* make it big and easy to see (size, style to preferences) */
  601. width: 300px;
  602. line-height: 48px;
  603. height: 48px;
  604. padding: 10px;
  605. background-color: #000;
  606. font-size: 24px;
  607. text-align: center;
  608. color: #fff;
  609. }
  610. #flashContent { width:100%; height:100%; }
  611. </style>
  612. </head>
  613. <body class="normalpage" id="top">
  614. <!--<body class="normalpage" id="top" onload="startTimer()" onmousemove="reset_interval()" onclick="reset_interval()" onkeypress="reset_interval()" onscroll="reset_interval()">-->
  615. <!--<body class="normalpage" id="top" onmousemove="reset_interval()" onclick="reset_interval()" onkeypress="reset_interval()" onscroll="reset_interval()">-->
  616. <section id="page">
  617. <div id="bodywrap">
  618. <section id="top">
  619. <nav>
  620. <h1 id="sitename">
  621. <a href="#">3 Tier Logic Inc.</a></h1>
  622. <ul id="sitenav">
  623. <li class="current"><a href="#">UCG Entries Summary</a></li>
  624. <li><a href="main.php">Report Dashboard</a></li>
  625. <li><a href="../editor/dashboard.php">Back to Tab Editor</a></li>
  626. </ul>
  627. </nav>
  628. <header id="normalheader"></header>
  629. </section>
  630. <section id="contentwrap">
  631. <div id="contents">
  632. <div id="topcolumns">
  633. <!-- ***** Column 1 ::: START -->
  634. <div class="col">
  635. <h2>Campaign Info</h2>
  636. <p>
  637. <b>Company Name: </b> <?=$companyName?><br>
  638. <b>Campaign Name: </b> <?=$camp_name?><br>
  639. <b>Start date: </b> <?=$campaignSdate?><br>
  640. <b>End date: </b><?=$campaignEdate?><br>
  641. <b>Entry requirement: </b><img src="<?=$campaignReentryPic?>" /><br>
  642. <b>Rules and regulations: </b><a href="<?=$campaignRulesLink?>" target="_blank">Click here</a><br>
  643. <p class="flip">
  644. <b>Description: (Click to view/hide)</b></p><div class="panel"><?=$campaignDesc?></div><br>
  645. </p>
  646. </div>
  647. <!-- ***** Column 2 ::: START -->
  648. <div class="col">
  649. <h2>Filter by date</h2>
  650. <table cellpadding="0" cellspacing="0">
  651. <tr>
  652. <td><b>Start Date:</b>&nbsp;</td>
  653. <td><input name='startdate' type='text' id='popupDatepicker_start'></input></td>
  654. </tr>
  655. <tr>
  656. <td><b>End Date:</b>&nbsp;</td>
  657. <td><input name='enddate' type='text' id='popupDatepicker_end'></input></td>
  658. </tr>
  659. <tr>
  660. <td colspan="2" align="right"><br /><input type='button' value='submit' onclick='showDate(0)'></input></td>
  661. </tr>
  662. </table>
  663. </div>
  664. <!-- ***** Column 3 ::: START -->
  665. <div class="col">
  666. <h2>Quick Links</h2>
  667. <p>
  668. <ul>
  669. <li><img src="images/rightarrow.png" border="0" width="10" height="10" />&nbsp;&nbsp;<a href="<?=$newentry_link?>" target="_top">View New Entries</a></li><br/>
  670. <li><img src="images/rightarrow.png" border="0" width="10" height="10" />&nbsp;&nbsp;<a href="<?=$approvedentry_link?>" target="_top">View Approved Entries</a></li><br/>
  671. <li><img src="images/rightarrow.png" border="0" width="10" height="10" />&nbsp;&nbsp;<a href="<?=$rejectedentry_link?>" target="_top">View Rejected Entries</a></li><br/>
  672. <li><img src="images/rightarrow.png" border="0" width="10" height="10" />&nbsp;&nbsp;<a href="<?=$reviewlaterentry_link?>" target="_top">View Entries for Review</a></li><br/>
  673. </ul>
  674. </p>
  675. </div>
  676. <div class="clear"></div>
  677. <!-- ****** Display Charts here **** -->
  678. <!--<div id="containergraph" style="width: 900px; height: 400px; margin: auto;"></div><br /><br />-->
  679. <h1><?=$sectionName?></h1>
  680. <!-- End Gallery Html Containers ::: START -->
  681. <div class="navigation-container">
  682. <div id="thumbs" class="navigation">
  683. <a class="pageLink prev" style="visibility: hidden;" href="#" title="Previous Page"></a>
  684. <?
  685. if ($emptyAlbum !=0 ){
  686. $imageCount=0;
  687. echo "<ul class='thumbs noscript'>";
  688. while(list($pid,$photoname, $uploadtime, $cid, $videoid, $entrytype, $entrytitle, $entrycomments, $adminnotes, $language) = mysql_fetch_array($res)) {
  689. $imageCount++;
  690. $submitid="submit".$imageCount;
  691. $responsearea="responseMsg".$imageCount;
  692. $imageName="photo".$imageCount;
  693. $formName="contact".$imageCount;
  694. //$entrycomments = "nothing bad here";
  695. $containbadwords = isBadWord($entrycomments, $badwordsarray);
  696. if ($containbadwords) {
  697. $flagstatustext = "<font color='#FF0000'>(Warning: Some inappropriate language detected)</font><br><br>";
  698. } else {
  699. $flagstatustext = "";
  700. }
  701. //$photoname=$photoname;
  702. if (!isset($language) || $language=="") $language="en";
  703. if (!isset($entrytype) || $entrytype=="") $entrytype="photo";
  704. if (strtolower($entrytype)=="photo") {
  705. //$thumbName=$photoname;
  706. $imageAddress= $imageBaseURL_thumb.$photoname;
  707. $fullImageAddress = $imageBaseURL.$photoname;
  708. } else if (strtolower($entrytype)=="youtube") {
  709. $imageAddress= "http://img.youtube.com/vi/".$videoid."/2.jpg";
  710. $fullImageAddress = $imageAddress;
  711. } else if (strtolower($entrytype)=="record") {
  712. if ($campaignUGCType == "photovideo") {
  713. $imageAddress= $imageBaseURL_thumb.$photoname;
  714. } else {
  715. $imageAddress= "images/webcam.jpg";
  716. }
  717. $fullImageAddress = $imageAddress;
  718. } else { //*** Assume YouTube for now to keep compatability with older campaigns
  719. $imageAddress= "http://img.youtube.com/vi/".$videoid."/2.jpg";
  720. $fullImageAddress = $imageAddress;
  721. }
  722. $fullImageAddress = str_replace(" ", "%20", $fullImageAddress); // issue with images with spaces
  723. echo "<li>";
  724. echo "<a class=\"thumb\" href=\"".$fullImageAddress."\" title=\"".$displayname."\">";
  725. echo "<img src=\"".$imageAddress."\" width=\"75\" width=\"75\" alt=\"".$displayname."\" />";
  726. echo "</a>";
  727. echo "<div style=\"background-color: #ccc;\" class=\"caption\">";
  728. echo "<div class=\"image-title\">".$displayName."</div>";
  729. echo "<div class=\"image-desc\">".$photoName."</div>";
  730. ?>
  731. <div style="word-wrap:break-word;"> <h1><?=$entrytitle?></h1><br /><br /></div>
  732. <div style="position:absolute; top:90px; left:10px; width:640px; height:500px; background-color:#999">
  733. <? if ($campaignUGCType == "") {
  734. if (strtolower($entrytype)=="photo") {
  735. //$size = getimagesize($fullImageAddress);
  736. list($originalWidth, $originalHeight) = getimagesize($fullImageAddress);
  737. //echo $originalWidth.":".$originalHeight.":";
  738. $ratio = $originalWidth / $originalHeight;
  739. //echo $ratio."<br>";
  740. $targetWidth = $targetHeight = min(390, max($originalWidth, $originalHeight));
  741. if ($ratio < 1) {
  742. $targetWidth = $targetHeight * $ratio;
  743. } else {
  744. $targetHeight = $targetWidth / $ratio;
  745. }
  746. //echo $targetWidth.":".$targetHeight;
  747. ?>
  748. <img src="<?=$fullImageAddress?>" border=0 width="<?=$targetWidth?>" height="<?=$targetHeight?>" /><br /><br />
  749. <? } else { ?>
  750. <iframe width="640" height="390" src="https://www.youtube.com/embed/<?=$videoid?>" frameborder="0" allowfullscreen></iframe>
  751. <? }
  752. } else {
  753. //echo "Campaign type:".$campaignUGCType."<br>";
  754. //**** Images are always included by default in this type of campaign
  755. list($originalWidth, $originalHeight) = getimagesize($fullImageAddress);
  756. $ratio = $originalWidth / $originalHeight;
  757. $targetWidth = $targetHeight = min(500, max($originalWidth, $originalHeight));
  758. if ($ratio < 1) {
  759. $targetWidth = $targetHeight * $ratio;
  760. } else {
  761. $targetHeight = $targetWidth / $ratio;
  762. }
  763. ?>
  764. <img src="<?=$fullImageAddress?>" border=0 width="<?=$targetWidth?>" height="<?=$targetHeight?>" /><br /><br />
  765. <?
  766. if (strtolower($entrytype)=="youtube") {
  767. ?>
  768. <iframe width="640" height="390" src="https://www.youtube.com/embed/<?=$videoid?>" frameborder="0" allowfullscreen></iframe>
  769. <? } else if (strtolower($entrytype)=="record") {
  770. //echo "Recorded video";
  771. ?>
  772. <div id="flashContent">
  773. <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="475" height="265" id="videopreviewplayer" align="middle">
  774. <param name="movie" value="videopreviewplayer.swf" />
  775. <param name="FlashVars" value="s=<?=$videoid?>&c=bestbuy">
  776. <param name="quality" value="high" />
  777. <param name="bgcolor" value="#ffffff" />
  778. <param name="play" value="true" />
  779. <param name="loop" value="true" />
  780. <param name="wmode" value="transparent" />
  781. <param name="scale" value="showall" />
  782. <param name="menu" value="true" />
  783. <param name="devicefont" value="false" />
  784. <param name="salign" value="" />
  785. <param name="allowScriptAccess" value="sameDomain" />
  786. <!--[if !IE]>-->
  787. <object type="application/x-shockwave-flash" data="videopreviewplayer.swf" width="475" height="265">
  788. <param name="movie" value="videopreviewplayer.swf" />
  789. <param name="FlashVars" value="s=<?=$videoid?>&c=bestbuy">
  790. <param name="quality" value="high" />
  791. <param name="bgcolor" value="#ffffff" />
  792. <param name="play" value="true" />
  793. <param name="loop" value="true" />
  794. <param name="wmode" value="transparent" />
  795. <param name="scale" value="showall" />
  796. <param name="menu" value="true" />
  797. <param name="devicefont" value="false" />
  798. <param name="salign" value="" />
  799. <param name="allowScriptAccess" value="sameDomain" />
  800. <!--<![endif]-->
  801. <a href="http://www.adobe.com/go/getflash">
  802. <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
  803. </a>
  804. <!--[if !IE]>-->
  805. </object>
  806. <!--<![endif]-->
  807. </object>
  808. </div>
  809. <?
  810. }
  811. }
  812. ?>
  813. </div>
  814. <div style="position:absolute; top:90px; left:660px; width:280px; height:400px; background-color:#999">
  815. <?
  816. $sql_info = "SELECT cpresult_first_name, cpresult_last_name, cpresult_birthday, cpresult_city, cpresult_states, cpresult_email FROM sp_campaign_result WHERE cpresult_sid = '".$cid."' AND campaign_sid='".$activityID."'";
  817. //echo $sql_info;
  818. $res_info = mysql_query($sql_info, $con);
  819. if (mysql_num_rows($res_info) > 0) {
  820. list($first, $last, $agerange, $city, $prov, $email) = mysql_fetch_array($res_info);
  821. if ($agerange == "0000-00-00 00:00:00") $agerange = "N/A";
  822. } else {
  823. $first = $last = $agerange = $prov = $city = $email = "N/A";
  824. }
  825. ?>
  826. <h1>Name:</h1>
  827. <div style="word-wrap:break-word;"> <?=$first." ".$last?><br /><br /></div>
  828. <h1>Age range:</h1>
  829. <?=$agerange?><br /><br />
  830. <h1>From:</h1>
  831. <?=$city." ".$prov?><br /><br />
  832. <h1>Email:</h1>
  833. <?=$email?><br /><br />
  834. <h1>Description:</h1>
  835. <?=$flagstatustext?>
  836. <div style="word-wrap:break-word;"> <?=$entrycomments?><br /><br /></div>
  837. </div>
  838. <div style="position:absolute; top:600px; left:10px; width:930px; height:300px; background-color:#999">
  839. <font color="#000000">Date Submitted: <?=$uploadtime?></font><br><br />
  840. <h1>Notes:</h1>
  841. <textarea rows="5" cols="80" name="admincomment<?=$pid?>" id="admincomment<?=$pid?>" style="width: 640px; height: 50px; border: 3px solid #cccccc; padding: 5px; font-family: Tahoma, sans-serif; font-size:12px" /><?=$adminnotes?></textarea><br /><br />
  842. <h1>Current Status:</h1>
  843. <input type="radio" name="status<?=$pid?>" id="status<?=$pid?>" class="status<?=$pid?>" value="1" /> Approve<br />
  844. <input type="radio" name="status<?=$pid?>" id="status<?=$pid?>" class="status<?=$pid?>" value="2" /> Reject<br />
  845. <input type="radio" name="status<?=$pid?>" id="status<?=$pid?>" class="status<?=$pid?>" value="3" /> Review later<br /><br />
  846. <?
  847. if ($campaignUGCNotify == "1") {
  848. ?>
  849. <h1>Notify user:</h1>
  850. <input type="checkbox" name="notify<?=$pid?>" id="notify<?=$pid?>" value="Y" onclick="Toggle('emailtext')" /> Check to notify user (only approved entries will receive an email notification)<br /><br />
  851. <div id="emailtext">
  852. <input type="radio" name="emailtemplate_<?=$pid?>" id="emailtemplate_<?=$pid?>" value="0" checked="true" />Default template<br /><br /><br />
  853. </div>
  854. <?
  855. }
  856. ?>
  857. <input type="hidden" name="lang_<?=$pid?>" id="lang_<?=$pid?>" value="<?=$language?>" />
  858. <input type="hidden" name="notify<?=$pid?>" id="notify<?=$pid?>" value="Y" />
  859. <input type="hidden" name="cid_<?=$pid?>" id="cid_<?=$pid?>" value="<?=$cid?>" />
  860. <button onclick="updateentry(<?=$pid?>)" >Save</button>
  861. </div>
  862. <?
  863. echo "</div>";
  864. echo "</li>";
  865. }
  866. echo "</ul>";
  867. } else {
  868. echo "<h2>No entries found...</h2>";
  869. }
  870. ?>
  871. <a class="pageLink next" style="visibility: hidden;" href="#" title="Next Page"></a>
  872. </div>
  873. </div>
  874. <!--<div class="content">
  875. <div class="slideshow-container">-->
  876. <!--//<div id="controls" class="controls"></div>-->
  877. <!--<div id="loading" class="loader"></div>
  878. <div id="slideshow" class="slideshow"></div> //<!--*** This is where the big image goes *** -->
  879. <!--</div>
  880. <div id="caption" class="caption-container">
  881. <div class="photo-index"></div>
  882. </div>
  883. </div>-->
  884. <div class="content">
  885. <div id="caption" class="caption-container"></div>
  886. </div>
  887. <!-- End Gallery Html Containers ::: END-->
  888. <div class="clear"></div>
  889. </div>
  890. </div>
  891. </section>
  892. </div>
  893. <footer id="pagefooter">
  894. <div id="bottom">
  895. <div class="block1">
  896. <h2>Meet The Team</h2>
  897. <div class="teamimg">
  898. <? include("team.php")?>
  899. </div>
  900. </div>
  901. <div class="block2">
  902. <h2>Featured Projects</h2>
  903. <div class="projectthmb">
  904. <!--<a href="portfolio"><img src="images/latstproject.jpg" width="240" height="150" alt="project"></a>-->
  905. <?
  906. $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";
  907. $res = mysql_query($sql, $con_3tl);
  908. if (mysql_num_rows($res) > 0) {
  909. ?>
  910. <ul id="slider1">
  911. <?
  912. $picon = "";
  913. while(list($pid, $pdate, $pcontent, $ptitle) = mysql_fetch_array($res)) {
  914. $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";
  915. $res_icon = mysql_query($sql_icon, $con_3tl);
  916. if (mysql_num_rows($res_icon) > 0) {
  917. list($picon) = mysql_fetch_array($res_icon);
  918. }
  919. 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>";
  920. //echo "<li><a href='http://www5.3tierlogic.com/?p=".$pid."' target='_blank'>".$ptitle."</a></li>";
  921. }
  922. ?>
  923. </ul>
  924. <?
  925. } else {
  926. ?>
  927. <a href="portfolio"><img src="images/latstproject.jpg" width="240" height="150" alt="project"></a>
  928. <?
  929. }
  930. ?>
  931. </div>
  932. </div>
  933. <div class="block3">
  934. <h2>About</h2>
  935. <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>
  936. </div>
  937. <div class="clear"></div>
  938. </div>
  939. <div id="credits">
  940. <p>
  941. <span class="copyright">
  942. &copy; 2012 | 3 Tier Logic Inc | All Rights Reserved </span></p>
  943. </div>
  944. </footer>
  945. </section>
  946. <script type="text/javascript">
  947. jQuery(document).ready(function($) {
  948. // We only want these styles applied when javascript is enabled
  949. $('div.content').css('display', 'block');
  950. // Initially set opacity on thumbs and add
  951. // additional styling for hover effect on thumbs
  952. var onMouseOutOpacity = 0.67;
  953. $('#thumbs ul.thumbs li, div.navigation a.pageLink').opacityrollover({
  954. mouseOutOpacity: onMouseOutOpacity,
  955. mouseOverOpacity: 1.0,
  956. fadeSpeed: 'fast',
  957. exemptionSelector: '.selected'
  958. });
  959. // Initialize Advanced Galleriffic Gallery
  960. var gallery = $('#thumbs').galleriffic({
  961. delay: 2500,
  962. numThumbs: 10,
  963. preloadAhead: 10,
  964. enableTopPager: false,
  965. enableBottomPager: false,
  966. imageContainerSel: '#slideshow',
  967. controlsContainerSel: '#controls',
  968. captionContainerSel: '#caption',
  969. loadingContainerSel: '#loading',
  970. renderSSControls: true,
  971. renderNavControls: true,
  972. playLinkText: 'Play Slideshow',
  973. pauseLinkText: 'Pause Slideshow',
  974. prevLinkText: '&lsaquo; Previous Photo',
  975. nextLinkText: 'Next Photo &rsaquo;',
  976. nextPageLinkText: 'Next &rsaquo;',
  977. prevPageLinkText: '&lsaquo; Prev',
  978. enableHistory: true,
  979. autoStart: false,
  980. syncTransitions: true,
  981. defaultTransitionDuration: 900,
  982. onSlideChange: function(prevIndex, nextIndex) {
  983. // 'this' refers to the gallery, which is an extension of $('#thumbs')
  984. this.find('ul.thumbs').children()
  985. .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
  986. .eq(nextIndex).fadeTo('fast', 1.0);
  987. // Update the photo index display
  988. this.$captionContainer.find('div.photo-index')
  989. .html('Photo '+ (nextIndex+1) +' of '+ this.data.length);
  990. },
  991. onPageTransitionOut: function(callback) {
  992. this.fadeTo('fast', 0.0, callback);
  993. },
  994. onPageTransitionIn: function() {
  995. var prevPageLink = this.find('a.prev').css('visibility', 'hidden');
  996. var nextPageLink = this.find('a.next').css('visibility', 'hidden');
  997. // Show appropriate next / prev page links
  998. if (this.displayedPage > 0)
  999. prevPageLink.css('visibility', 'visible');
  1000. var lastPage = this.getNumPages() - 1;
  1001. if (this.displayedPage < lastPage)
  1002. nextPageLink.css('visibility', 'visible');
  1003. this.fadeTo('fast', 1.0);
  1004. }
  1005. });
  1006. /**************** Event handlers for custom next / prev page links **********************/
  1007. gallery.find('a.prev').click(function(e) {
  1008. gallery.previousPage();
  1009. e.preventDefault();
  1010. });
  1011. gallery.find('a.next').click(function(e) {
  1012. gallery.nextPage();
  1013. e.preventDefault();
  1014. });
  1015. /****************************************************************************************/
  1016. /**** Functions to support integration of galleriffic with the jquery.history plugin ****/
  1017. // PageLoad function
  1018. // This function is called when:
  1019. // 1. after calling $.historyInit();
  1020. // 2. after calling $.historyLoad();
  1021. // 3. after pushing "Go Back" button of a browser
  1022. function pageload(hash) {
  1023. // alert("pageload: " + hash);
  1024. // hash doesn't contain the first # character.
  1025. if(hash) {
  1026. $.galleriffic.gotoImage(hash);
  1027. } else {
  1028. gallery.gotoIndex(0);
  1029. }
  1030. }
  1031. // Initialize history plugin.
  1032. // The callback is called at once by present location.hash.
  1033. $.historyInit(pageload, "advanced.html");
  1034. // set onlick event for buttons using the jQuery 1.3 live method
  1035. $("a[rel='history']").live('click', function(e) {
  1036. if (e.button != 0) return true;
  1037. var hash = this.href;
  1038. hash = hash.replace(/^.*#/, '');
  1039. // moves to a new page.
  1040. // pageload is called at once.
  1041. // hash don't contain "#", "?"
  1042. $.historyLoad(hash);
  1043. return false;
  1044. });
  1045. /****************************************************************************************/
  1046. });
  1047. </script>
  1048. <div id="message"><a href="#top">Scroll to top</a></div>
  1049. </body>
  1050. </html>