/report/dailyugcentries.php
PHP | 759 lines | 554 code | 123 blank | 82 comment | 59 complexity | 9521de983f07b496264cf958bcd64fff MD5 | raw file
- <?php
- //$companyID = $_REQUEST['coID'];
- //$campaignID = $_REQUEST['cID']; // get
- require_once("timlib.php");
- // Connect to database
- require_once("db.php");
- $con = mysql_connect($dbhost, $dbuser, $dbpasswd); // connect to database
- if (!$con) { // error checking and handling
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db($dbname);
- $con_3tl = mysql_connect($dbhost_3tl, $dbuser_3tl, $dbpasswd_3tl); // connect to database
- if (!$con_3tl) { // error checking and handling
- die('Could not connect to 3TL: ' . mysql_error());
- }
- mysql_select_db($dbname_3tl);
- /* Load and clear sessions */
- session_start();
- if ( ! isset ( $_SESSION['companyid'] ) ) {
- header ( 'Location: http://platform.3tierlogic.com/tabbuilder/index1_3.php' );
- exit();
- } else {
- if (isset($_REQUEST['customerID'])) { ///**** This value is set when logged in as a superuser and selecting a company from the drop down to view
- $companyID = $_REQUEST['customerID'];
- } else {
- $companyID = $_SESSION['companyid'];
- }
- }
- $campaignID = $_REQUEST['cID'];
- $campaignDesc = "";
- $campaignSdate = "";
- $campaignEdate = "";
- $campaignReentryPic = "";
- $maxDefaultDates = 7;
- $recentStartDate = "";
- $recentEndDate = "";
- $fieldNames[$count_fields] = "";
- $fieldLabelNames[$count_fields] = "";
- // run a sql to get camp info for later html use.
- $sql_companyInfo = "SELECT cp_companyName FROM sp_company_info WHERE cp_companyID='".$companyID."'";
- $res_companyInfo = mysql_query($sql_companyInfo, $con);
- if (mysql_num_rows($res_companyInfo) == 1) {
- list($companyName) = mysql_fetch_array($res_companyInfo);
- }
- $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."'";
- $res0 = mysql_query($sql_campInfo, $con);
- if (mysql_num_rows($res0) == 1) {
- list($camp_id, $camp_name, $camp_desc, $camp_sdate, $camp_edate, $camp_reentry) = mysql_fetch_array($res0);
- $campaignName = $camp_name;
- $campaignDesc = $camp_desc;
- if (strlen($campaignDesc) <= 0) {
- $campaignDesc ="*** No description available ***";
- }
- $campaignSdate = $camp_sdate;
- $campaignEdate = $camp_edate;
- //$campaignReentry = $camp_reentry;
- if ($camp_reentry == 1) {
- $campaignReentryPic = "images/singleentry.png";
- } else {
- $campaignReentryPic = "images/multipleentries.png";
- }
- }
- else{
- echo "Err: could not pull out campaign info for cid: ".$campaignID."<br/>";
- }
- // import from getprizereport.php
- //$sqlEndDate = $_REQUEST['edate']; //post
- // to control if to show all dates or the specified period.
- $default_date = 1; // defaults tolast few days
- if ( (!isset($_REQUEST['edate'])) || ($_REQUEST['edate'] == "") || (!isset($_REQUEST['sdate'])) || ($_REQUEST['sdate'] == "") ){
- $default_date = 1;
- } else {
- $default_date = 0;
- }
- if ( (!isset($_REQUEST['edate'])) || ($_REQUEST['edate'] == "") ){
- $sqlEndDate = "2100-12-31";
- } else {
- $sqlEndDate = $_REQUEST['edate'];
- }
- if( (!isset($_REQUEST['sdate'])) || ($_REQUEST['sdate'] == "") ){
- //$_POST['sdate'] = "";
- $_POST['sdate'] = "2000-01-01";
- $sqlStartDate = "2000-01-01";
- }
- else{
- $_POST['sdate'] = $_REQUEST['sdate'];
- $sqlStartDate = $_REQUEST['sdate'];
- }
- $sqlStartDate = $sqlStartDate." 00:00:00";
- $sqlEndDate = $sqlEndDate." 23:59:59";
- //$x_axis = "";
- //$y_axis = "";
- $displaygender_div = 0;
- $displayemail_div=0;
- $displayagerange_div=0;
- $displayzipcode_div=0;
- $displaycarrier_div = 0;
- $countDyn = 0;
- $displaydyn_div[$countDyn]=0;
- $dynstr_data[$countDyn] = "";
- $labels[$countDyn] = "";
- $zipCodeCountry = "CA"; //by default Canada
- // end of import from getprizereport.php
- //echo "ID: ".$currentid;
- if (!isset($companyID)) {
- echo "<script language = 'javascript'> alert('Your session has expire. Please login again');</script>" ;
- echo "<script language = 'javascript'> window.location.href = 'index.php'; </script>" ;
- }
- //***** Daily Visit chart
- $x_axis = "";
- $y_axis = "";
- $y2_axis = ""; // for distinct entries.
- $x_axis_last5 = "";
- $y_axis_last5 = "";
- $y2_axis_last5 = ""; //** Distinct entries
- $total_entry_last5 = 0;
- $total_uniqueentry_last5 = 0;
- $sql = "SELECT date_format(ugc_upload_time,'%Y-%m-%d'), count(*) as num FROM sp_campaign_ugc where ugc_campaign_sid='".$campaignID."' AND ugc_upload_time BETWEEN '".$sqlStartDate."' AND '".$sqlEndDate."' AND ugc_approve_state != '-1' GROUP BY date_format(ugc_upload_time,'%Y-%m-%d') ORDER BY date_format(ugc_upload_time,'%Y-%m-%d') ASC";
- $res = mysql_query($sql, $con);
- $totalRecords = mysql_num_rows($res);
- //*** Calculate the height of the table. Keep up to 1000px
- $tableHeight = $totalRecords * 160;
- if ($tableHeight > 1000) {
- $tableHeight = 1100;
- }
- if ($totalRecords > 0) {
- //echo "total rows: ".$totalRecords."<br>";
-
- $index = 0;
- $total_entry = 0;
- $total_distinct_entry = 0;
- // get Y.
- while (list($currdate, $totalentries) = mysql_fetch_array($res)) {
- //echo "date:".$currdate."- entries: ".$totalentries."<br>";
- //$newcurrdate = date('m/d', strtotime($currdate));
- $newcurrdate = date('Y-m-d', strtotime($currdate));
- $x_axis = $x_axis . "'".$newcurrdate."',";
- $y_axis = $y_axis . $totalentries.",";
-
- //***** Get the last x days data defined by maxDefaultDates above
- if ((($totalRecords - $index) - $maxDefaultDates) <= 0) {
- $x_axis_last5 = $x_axis_last5 . "'".$newcurrdate."',";
- $y_axis_last5 = $y_axis_last5 . $totalentries.",";
- $total_entry_last5 += $totalentries;
- //** Capture the start date
- if ($recentStartDate == "") {
- $recentStartDate = $currdate;
- }
- //** Capture the end date
- if (($recentEndDate == "") && (($index+1) == $totalRecords)) {
- $recentEndDate = $currdate;
- }
- }
-
- // create array to store sql and sql2 results.
- $array_sql[$index][0] = $newcurrdate;
- $array_sql[$index][1] = $totalentries;
- $total_entry += $totalentries;
- $index++;
- }
- $array_sql[$index][0] = "Total";
- $array_sql[$index][1] = $total_entry;
-
- /*echo "<pre>";
- print_r($array_sql);
- echo "</pre>";*/
- //$index = 0;
- // get y2.
- /*while ( list($d, $dis) = mysql_fetch_array($res_incomplete)){
- $y2_axis = $y2_axis . $dis.",";
- //***** Get the last x days data defined by maxDefaultDates above
- if ((($totalRecords - $index) - $maxDefaultDates) <= 0) {
- $y2_axis_last5 = $y2_axis_last5 . $dis.",";
- $total_uniqueentry_last5 += $dis;
- }
-
- $array_sql[$index][2] = $dis;
- $total_distinct_entry += $dis;
- $index++;
- }
- $array_sql[$index][2] = $total_distinct_entry;*/
- $x_axis = substr($x_axis, 0, -1);
- $y_axis = substr($y_axis, 0, -1);
- //$y2_axis = substr($y2_axis, 0, -1);
- $x_axis_last5 = substr($x_axis_last5, 0, -1);
- $y_axis_last5 = substr($y_axis_last5, 0, -1);
- //$y2_axis_last5 = substr($y2_axis_last5, 0, -1);
-
- //** By default, if no dates are specified, display last x dates defined by maxDefaultDates
- if ($default_date == 1) {
- $x_axis = $x_axis_last5;
- $y_axis = $y_axis_last5;
- //$y2_axis = $y2_axis_last5;
- }
- //echo $recentStartDate.":".$recentEndDate."<br>";
- }
- /*echo "x = ".$x_axis."<br/>";
- echo "y1 = ".$y_axis."<br/>";
- echo "y2 = ".$y2_axis."<br/>";
- echo "x_last5 = ".$x_axis_last5."<br/>";
- echo "y_last5 = ".$y_axis_last5."<br/>";
- echo "y2_last5 = ".$y2_axis_last5."<br/>";*/
- /*echo "<pre>";
- print_r($array_sql);
- echo "</pre>";*/
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"><head profile="http://gmpg.org/xfn/11">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>3 Tier Logic - Tracker V1.0</title>
- <link href="style.css" rel="stylesheet" type="text/css" />
- <!--[if IE]>
- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- <!--[if IE 6]>
- <script src="js/belatedPNG.js"></script>
- <script>
- DD_belatedPNG.fix('*');
- </script>
- <![endif]-->
- <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>-->
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
- <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
- <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
- <!-- Charts JS library: START -->
- <script type="text/javascript" src="js/highcharts.js"></script>
- <script type="text/javascript" src="js/themes/gray.js"></script>
- <script type="text/javascript" src="js/modules/exporting.js"></script>
- <!-- Charts JS library: END -->
- <!-- date Picker start -->
- <!--<style type="text/css">@import "css/redmond.datepick.css";</style>
- <script src="js/CalendarControl/CalendarControl.js" language="javascript"></script>
- <script type="text/javascript" src="js/jquery.datepick.js"></script>-->
- <!-- date picker end-->
- <!-- documentation found at http://bxslider.com/options -->
- <!--<script src="http://bxslider.com/sites/default/files/jquery.bxSlider.min.js" type="text/javascript"></script>-->
- <script src="js/jquery.bxSlider.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $('#slider1').bxSlider({
- auto: true,
- pager: false,
- controls: false,
- pause: 5000
- });
- });
- </script>
- <script type="text/javascript">
- function viewEnties(td){
- var tord = td.substring(0,1);
- //alert(tord);
- var r = "r"+td.substring(1);
- var date = document.getElementById(r).innerHTML;
- //alert(date);
- var campid = "<?php echo $campaignID; ?>";
- //alert(campid);
- var detailPage = "detail.php";
-
- var sdate = <?php echo '\''.$_POST['sdate'].'\''; ?>;
- var edate = <?php echo '\''.$sqlEndDate.'\''; ?>;
- //var url = detailPage + "?campid=" + campid + "&date=" + date + "&tord=" + tord;
- var url = detailPage + "?campid=" + campid + "&date=" + date + "&tord=" + tord + "&sdate=" + sdate + "&edate=" + edate + "&coid=" + <?=$companyID?>;
- //alert(url);
-
- // window.open(url);
- window.location.href = url; // to try colorbox.
- }
-
- $(document).ready(function() {
- $('tr').hover(
- function () {
- $(this).addClass('hover');
- },
- function () {
- $(this).removeClass('hover');
- }
- );
- var chart;
- chart = new Highcharts.Chart({
- chart: {
- renderTo: 'containergraph',
- defaultSeriesType: 'line',
- marginRight: 130,
- marginBottom: 25,
- zoomType: 'x'
- },
- title: {
- text: '<?=$campaignName?>',
- x: -20 //center
- },
- subtitle: {
- text: 'Prepared for: <?=$companyName?>',
- x: -20
- },
- xAxis: {
- categories: [<?=$x_axis?>]
-
-
- },
- yAxis: {
- title: {
- text: 'Total submissions'
- },
- plotLines: [{
- value: 0,
- width: 1,
- color: '#808080'
- }]
- },
- tooltip: {
- formatter: function() {
- return '<b>'+ this.series.name +'</b><br/>'+
- this.x +': '+ this.y +' submissions';
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'top',
- x: -10,
- y: 100,
- borderWidth: 0
- },
- series: [
- {
- name: 'Total Submissions',
- data: [<?=$y_axis?>]
- }]
- });
-
-
-
-
- });
- </script>
- <script type="text/javascript">
- $(function() {
- $('#popupDatepicker_start').datepicker({dateFormat: 'yy-mm-dd'});
- $('#popupDatepicker_end').datepicker({dateFormat: 'yy-mm-dd'});
- });
- function showDate(state) {
- //alert(state);
- var sdate = "";
- var edate = "";
-
- switch(state) {
- case 0:
- sdate = document.getElementById('popupDatepicker_start').value;
- edate = document.getElementById('popupDatepicker_end').value;
- break;
- case 1:
- sdate = '2000-01-01';
- edate = '2100-12-31';
- break;
- case 2:
- sdate = '<?php echo $recentStartDate ?>';
- edate = '<?php echo $recentEndDate ?>';
- break;
- default:
- sdate = '2000-01-01';
- edate = '2100-12-31';
-
- }
-
- //alert('The date chosen is ' + sdate + " " + edate);
- // get every necessary param.
- var coid = "<?php echo $companyID; ?>";
- var cid = "<?php echo $campaignID; ?>";
- var caname = "<?php echo $camp_name; ?>";
- var coname = "<?php echo $companyName; ?>";
- var localdb = "<?php echo $localdb; ?>";
-
- // build url.
- var url = '';
- url += 'dailyugcentries.php';
- var params = '?cID='+cid+'&cName='+caname+'&coName='+coname+'&sdate='+sdate+'&edate='+edate+'&coID='+coid+'&ldb='+localdb;
- url += params;
- //alert(url);
- // go to self with new params.
- window.location.href = url;
- }
- </script>
- <!-- ****** Tables ************* -->
- <style type="text/css">
- @import "DTmedia/css/demo_page.css";
- @import "DTmedia/css/demo_table.css";
- </style>
- <!---<script type="text/javascript" language="javascript" src="DTmedia/js/jquery.js"></script>--->
- <!--<script class="jsbin" src="http://datatables.net/download/build/jquery.dataTables.nightly.js"></script>-->
- <!--<script type="text/javascript" language="javascript" src="DTmedia/js/jquery.js"></script>-->
- <script class="jsbin" src="DTmedia/js/jquery.dataTables.js"></script>
- <!--<script class="jsbin" src="http://datatables.net/download/build/jquery.dataTables.js"></script>-->
- <script type="text/javascript">
- $(document).ready(function(){
- $('#example').dataTable({
- "bJQueryUI": true,
- <!--"sPaginationType": "full_numbers",-->
- "bPaginate": false,
- "bFilter": false,
- "bLengthChange": false,
- "bScrollInfinite": true
- <!-- "bScrollCollapse": true,-->
- <!--"sScrollY": "<?php echo $tableHeight ?>px"-->
- });
-
- $(".panel").slideToggle("slow");
-
- $(".flip").click(function(){
- $(".panel").slideToggle("slow");
- });
-
- $(function () {
- var scroll_timer;
- var displayed = false;
- var $message = $('#message a');
- var $window = $(window);
- var top = $(document.body).children(0).position().top;
- $window.scroll(function () {
- window.clearTimeout(scroll_timer);
- scroll_timer = window.setTimeout(function () {
- if($window.scrollTop() <= top)
- {
- displayed = false;
- $message.fadeOut(500);
- }
- else if(displayed == false)
- {
- displayed = true;
- $message.stop(true, true).show().click(function () { $message.fadeOut(500); });
- }
- }, 100);
- });
- });
-
-
- });
- </script>
- <link rel="stylesheet" href="colorbox.css" />
- <script src="colorbox/jquery.colorbox.js"></script>
- <script>
- $(document).ready(function(){
- $(".picspopup").colorbox({iframe:true, width:"80%", height:"80%"});
- });
- </script>
- <style>
- div.panel{
- height:auto;
- display:none;
- }
- table#user-list tr.hover {
- color: #fff;
- background-color: #4c95e6;
- }
- #containergraph {
- float: left
- width: 33.3%;
- /* Min-height: */
- min-height: 400px;
- height: auto !important;
- height: 400px;
- }
- #message a
- {
- /* display: block before hiding */
- display: block;
- display: none;
-
- /* link is above all other elements */
- z-index: 999;
-
- /* link doesn't hide text behind it */
- opacity: .8;
-
- /* link stays at same place on page */
- position: fixed;
-
- /* link goes at the bottom of the page */
- top: 100%;
- margin-top: -80px; /* = height + preferred bottom margin */
-
- /* link is centered */
- left: 50%;
- margin-left: -160px; /* = half of width */
-
- /* round the corners (to your preference) */
- -moz-border-radius: 24px;
- -webkit-border-radius: 24px;
-
- /* make it big and easy to see (size, style to preferences) */
- width: 300px;
- line-height: 48px;
- height: 48px;
- padding: 10px;
- background-color: #000;
- font-size: 24px;
- text-align: center;
- color: #fff;
- }
- </style>
- </head>
- <body class="normalpage" id="top">
- <section id="page">
- <div id="bodywrap">
- <section id="top">
- <nav>
- <h1 id="sitename">
- <a href="#">3 Tier Logic Inc.</a></h1>
-
- <ul id="sitenav">
- <li class="current"><a href="#">UCG Entries Summary</a></li>
- <li><a href="main.php">Report Dashboard</a></li>
- <li><a href="../editor/dashboard.php">Back to Tab Editor</a></li>
- </ul>
-
- </nav>
- <header id="normalheader"></header>
- </section>
-
- <section id="contentwrap">
- <div id="contents">
- <div id="topcolumns">
- <div class="col">
- <!-- <img src="../images/design.png" width="61" height="60" alt="graph" class="imgright"> -->
- <h2>Campaign Info</h2>
- <p>
- <b>Company Name: </b> <?=$companyName?><br>
- <b>Campaign Name: </b> <?=$camp_name?><br>
- <b>Start date: </b> <?=$campaignSdate?><br>
- <b>End date: </b><?=$campaignEdate?><br>
- <b>Entry requirement: </b><img src="<?=$campaignReentryPic?>" /><br>
- <p class="flip"><b>Description: (Click to view/hide)</b></p><div class="panel"><?=$campaignDesc?></div><br>
- </p>
- </div>
- <div class="col">
- <h2>Filter by date</h2>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td><b>Start Date:</b> </td>
- <td><input name='startdate' type='text' id='popupDatepicker_start'></input></td>
- </tr>
- <tr>
- <td><b>End Date:</b> </td>
- <td><input name='enddate' type='text' id='popupDatepicker_end'></input></td>
- </tr>
- <tr>
- <td colspan="2" align="right"><br /><input type='button' value='submit' onclick='showDate(0)'></input></td>
- </tr>
- </table>
- </div>
- <div class="col">
- <h2>Quick Links</h2>
- <p>
- <ul>
- <li><img src="images/rightarrow.png" border="0" width="10" height="10" /> <a href="dailyentries.php?coID=<?=$companyID?>&cID=<?=$campaignID?>&ldb=<?=$localdb?>">View entries report</a></li><br/>
-
- <li><img src="images/rightarrow.png" border="0" width="10" height="10" /> <a href="#" onclick='showDate(1)'>View all submissions</a></li><br/>
-
- </p>
- </div>
- <div class="clear"></div>
- <!-- ****** Display Charts here **** -->
- <div id="containergraph" style="width: 900px; height: 400px; margin: auto;"></div>
-
-
- <br /><br />
- <?php
- echo "<div id='tableContainer'>";
- if($index > 0){
- echo "<h2>Campaign summary from ".$sqlStartDate." to ".$sqlEndDate." </h2>";
- echo "<table cellpadding='0' cellspacing='0' width='60%'>";
- echo "<tr>";
- //echo "<h4>total days: ".mysql_num_rows($res)."</h4>";
- if ($index <= 1) {
- echo "<td width='60%'><h4>Campaign duration: </h4></td><td width='40%'>".$index." day</td>";
- } else {
- echo "<td width='60%'><h4>Campaign duration: </h4></td><td width='40%'>".$index." days</td>";
- }
- echo "</tr><tr>";
- echo "<td width='60%'><h4>Total submissions: </h4></td><td width='40%'>".$total_entry."</td>";
- echo "</tr><tr>";
- echo "<td width='60%'><h4>Total submissions in the ".$maxDefaultDates." last days: </h4></td><td width='40%'>".$total_entry_last5."</td>";
- echo "</tr><table>";
- echo "<br><br>";
- echo "<table cellpadding='0' cellspacing='0' border='2' class='display' id='example'>"; //id='user-list'>";
- echo "<thead><tr><th>Day</th><th>Date</th><th>Total Submissions</th></tr></thead>";
- echo "<tbody>";
-
- $i = 0;
- while($i <= $index){
- if($i % 2 != 0){
- echo "<tr class='odd gradeX'>";
- }else{
- echo "<tr class='odd gradeA'>";
- }
-
- echo "<td class='center'>".($i+1)."</td>";
- echo "<td class='center'> ".$array_sql[$i][0]."</td>";
- if ($i==$index) { //*** the link to the total entries should display all entries
- echo '<td class="center"> <a id="t'.$i.'" href='.getUGCDetailURL("t".$i, $array_sql[$i][0], $campaignID, $_POST['sdate'], $sqlEndDate, $companyID, $localdb).'>'.$array_sql[$i][1].'</a></td>';
- } else { //*** the link to each daily entry should display that day's entries
- 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>';
- //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>';
- }
- echo "</tr>";
- $i++;
- }
- echo "</tbody>";
- echo "</table>";
- }
- echo "</div>";
-
- if ($displaygender_div == 1) {
- echo "<div id='container2' style='width: 900px; height: 400px; margin: 0 auto'></div>";
- }
- ?>
-
- <div class="clear"></div>
- </div>
- </div>
- </section>
- </div>
- <footer id="pagefooter">
- <div id="bottom">
- <div class="block1">
- <h2>Meet The Team</h2>
- <div class="teamimg">
- <? include("team.php")?>
- </div>
- </div>
- <div class="block2">
- <h2>Featured Projects</h2>
- <div class="projectthmb">
- <!--<a href="portfolio"><img src="images/latstproject.jpg" width="240" height="150" alt="project"></a>-->
- <?
- $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";
- $res = mysql_query($sql, $con_3tl);
- if (mysql_num_rows($res) > 0) {
- ?>
-
-
- <ul id="slider1">
- <?
- $picon = "";
- while(list($pid, $pdate, $pcontent, $ptitle) = mysql_fetch_array($res)) {
- $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";
- $res_icon = mysql_query($sql_icon, $con_3tl);
- if (mysql_num_rows($res_icon) > 0) {
- list($picon) = mysql_fetch_array($res_icon);
- }
- 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>";
- //echo "<li><a href='http://www5.3tierlogic.com/?p=".$pid."' target='_blank'>".$ptitle."</a></li>";
- }
- ?>
-
- </ul>
-
-
- <?
- } else {
- ?>
- <a href="portfolio"><img src="images/latstproject.jpg" width="240" height="150" alt="project"></a>
- <?
- }
- ?>
- </div>
- </div>
- <div class="block3">
- <h2>About</h2>
- <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>
- </div>
- <div class="clear"></div>
- </div>
- <div id="credits">
- <p>
- <span class="copyright">
- © 2012 | 3 Tier Logic Inc | All Rights Reserved </span></p>
- </div>
- </footer>
- </section>
- <div id="message"><a href="#top">Scroll to top</a></div>
- </body>
- </html>