GIF89a;
Direktori : /home/serb/public_html/ |
Current File : /home/serb/public_html/ad_report_chart1.php |
<? session_start(); include("lib/globals.php"); include("lib/common.php"); include("lib/functions.php"); $page="my_account"; ?> <!doctype html> <html> <head> <title>Ad Visits Bar Chart</title> <script type="text/javascript" src="ad_report_chart_files/jquery-1.11.0.min.js"></script> <!-- styles specific to demo site --> <!--<link type="text/css" href="jScroll_script_style/demo.css" rel="stylesheet" media="all" />--> <!-- styles needed by jScrollPane - include in your own sites --> <link type="text/css" href="jScroll_script_style/jquery.jscrollpane.css" rel="stylesheet" media="all" /> <style type="text/css" id="page-css"> /* Styles specific to this particular page */ body { background: #f7c4d5; overflow: auto; height: 100%; } #content { } </style> <!-- latest jQuery direct from google's CDN --> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>--> <!-- the mousewheel plugin --> <script type="text/javascript" src="jScroll_script_style/jquery.mousewheel.js"></script> <!-- the jScrollPane script --> <script type="text/javascript" src="jScroll_script_style/jquery.jscrollpane.min.js"></script> <!-- scripts specific to this demo site --> <!--<script type="text/javascript" src="jScroll_script_style/demo.js"></script>--> <script type="text/javascript" src="ad_report_chart_files/TableBarChart.js"></script> <link rel="stylesheet" href="ad_report_chart_files/TableBarChart.css" /> </head> <body> <div style="float:left;width:auto;" id="content"> <!------- chart script ------------> <?php $day_td = "<th></th>"; $visit_td = "<th>Visits</th>"; $impression_td = "<th>Impressions</th>"; for($day = 0; $day < 30; $day++) { $fulldate = date('Y-m-d',strtotime("-".$day." days")); $date_day = date('d-m',strtotime("-".$day." days")); $report_query = "SELECT COUNT(id) AS TOTAL_VISITS FROM `USER_AD_REPORT` WHERE add_date LIKE '".$fulldate."%' AND user_id = '".$_SESSION['userid']."'"; $report_result = execute_query($report_query); $report_row = mysql_fetch_array($report_result); $day_td .= "<th>".$date_day."</th>"; $visit_td .= "<td>".($report_row['TOTAL_VISITS'])."</td>"; $report_query = "SELECT COUNT(id) AS TOTAL_IMPRESSIONS FROM `USER_IMPRESSION_REPORT` WHERE add_date LIKE '".$fulldate."%' AND user_id = '".$_SESSION['userid']."'"; $report_result = execute_query($report_query); $report_row = mysql_fetch_array($report_result); $impression_td .= "<td>".($report_row['TOTAL_IMPRESSIONS'])."</td>"; } ?> <table id="source" style="display:none;"> <thead> <tr><?php echo $day_td;?></tr> </thead> <tbody> <tr><?php echo $visit_td;?></tr> <tr><?php echo $impression_td;?></tr> </tbody> </table> <div id="target"> </div> <!---------------------------------> <script type="text/javascript"> $(function() { $('#source').tableBarChart('#target', '', false); }); </script> <script type="text/javascript" id="sourcecode"> $(function() { var win = $(window); // Full body scroll var isResizing = false; win.bind( 'resize', function() { if (!isResizing) { isResizing = true; var container = $('#content'); // Temporarily make the container tiny so it doesn't influence the // calculation of the size of the document container.css( { 'width': 1, 'height': 1 } ); // Now make it the size of the window... container.css( { 'width': win.width(), 'height': win.height() } ); isResizing = false; container.jScrollPane( { 'showArrows': true } ); } } ).trigger('resize'); // Workaround for known Opera issue which breaks demo (see // http://jscrollpane.kelvinluck.com/known_issues.html#opera-scrollbar ) $('body').css('overflow', 'hidden'); // IE calculates the width incorrectly first time round (it // doesn't count the space used by the native scrollbar) so // we re-trigger if necessary. if ($('#full-page-container').width() != win.width()) { win.trigger('resize'); } }); </script> </div> </body> </html>