SitePoint Sponsor

User Tag List

Page 4 of 6 FirstFirst 123456 LastLast
Results 76 to 100 of 126
  1. #76
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    OK so `id` IS NOT the user ID but an auto increment field for submitted forms. In That case, change that "header array" section to use a unique field like `username`.

    EDIT:
    IF you don't need a bunch of headers then just do one.
    PHP Code:
    <?php 
        $headrows
    =0;
        while (
    $row $result->fetch_assoc()){ 
            if(
    $headrows==0){ ?>
            <thead>
                <tr>
                    <th>User ID</th>
                    <th>Username</th>
                    <th>Email</th>
                    <th>First Name</th>
                    <th>Last Name</th>
                    <th>Skype</th>
                    <th>Rank</th>
                    <th>Edit User</th>
                    <th>Delete User</th>
                </tr>
            </thead>
            <tbody>
    <?php 
        $headrows
    ++;
            }

  2. #77
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    OK so `id` IS NOT the user ID but an auto increment field for submitted forms. In That case, change that "header array" section to use a unique field like `username`.
    Ok, it still is doing the same thing.

  3. #78
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Note EDIT above.

  4. #79
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    Note EDIT above.
    Alright, so I did that, now I still have all the rows problem.

  5. #80
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Not sure what data you have in your database... You might try wrapping the <tr> section in an IF statement saying if not empty.
    PHP Code:
        if(!empty($row['id'])){     
                
    $id $row['id'];
          echo 
    '<tr> 
                <td>'
    .$row['id'].'</td>
                <td>'
    .$row['username'].'</td> 
                <td><a href="'
    .$row['video_link'].'">'.$row['video_title'].'</a></td> 
                <td>'
    .$row['video_description'].'</td> 
                <td>'
    .$row['video_tags'].'</td> 
                <td>'
    .$row['music_sources'].'</td> 
                <td>'
    .$row['special_requests'].'</td> 
                <td>'
    .$row['status'].'</td>
                <td><a href="'
    .$pagename.'?id='.$row['id'].'"><button class="btn btn-sm btn-warning"><i class="icon-pencil"></i> </button></a></td>
                <td><a href="vdelete.php?id='
    .$row['id'].'"><button class="btn btn-sm btn-danger"><i class="icon-remove"></i> </button></a></td> 
                </tr>'
    ;
        } 

  6. #81
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    Not sure what data you have in your database... You might try wrapping the <tr> section in an IF statement saying if not empty.
    PHP Code:
        if(!empty($row['id'])){     
                
    $id $row['id'];
          echo 
    '<tr> 
                <td>'
    .$row['id'].'</td>
                <td>'
    .$row['username'].'</td> 
                <td><a href="'
    .$row['video_link'].'">'.$row['video_title'].'</a></td> 
                <td>'
    .$row['video_description'].'</td> 
                <td>'
    .$row['video_tags'].'</td> 
                <td>'
    .$row['music_sources'].'</td> 
                <td>'
    .$row['special_requests'].'</td> 
                <td>'
    .$row['status'].'</td>
                <td><a href="'
    .$pagename.'?id='.$row['id'].'"><button class="btn btn-sm btn-warning"><i class="icon-pencil"></i> </button></a></td>
                <td><a href="vdelete.php?id='
    .$row['id'].'"><button class="btn btn-sm btn-danger"><i class="icon-remove"></i> </button></a></td> 
                </tr>'
    ;
        } 
    Yes thank you! That pretty much worked!

  7. #82
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Before you go and commit to using that IF statement can you try changing your query, adding the unique user ID?

    PHP Code:
    $sql "SELECT
    `u`.`user_id`, 
    `sf`.`id`,
    `sf`.`username`,
    `sf`.`rank`,
    `sf`.`video_link`,
    `sf`.`video_title`,
    `sf`.`video_description`,
    `sf`.`video_tags`,
    `sf`.`music_sources`,
    `sf`.`special_requests`
    FROM `users` AS u 
    LEFT JOIN `submitted_forms1` AS sf
    ON sf.username = u.username
    $condition";
    $result $db->query($sql) or die(mysqli_error($db)); 
    Then comment out that IF statement and closing bracket for a test.

  8. #83
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    Before you go and commit to using that IF statement can you try changing your query, adding the unique user ID?

    PHP Code:
    $sql "SELECT
    `u`.`user_id`, 
    `sf`.`id`,
    `sf`.`username`,
    `sf`.`rank`,
    `sf`.`video_link`,
    `sf`.`video_title`,
    `sf`.`video_description`,
    `sf`.`video_tags`,
    `sf`.`music_sources`,
    `sf`.`special_requests`
    FROM `users` AS u 
    LEFT JOIN `submitted_forms1` AS sf
    ON sf.username = u.username
    $condition";
    $result $db->query($sql) or die(mysqli_error($db)); 
    Then comment out that IF statement and closing bracket for a test.
    Ok, i'll try that, but um now I want like it to be ordered so the very first submissions are at the top and the last ones are at the bottom, so the more recent ones are at the bottom. Right now its by username and its weird how it is.

    **UPDATE**
    I tried the query thing, it brought back the spaces so.

  9. #84
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Do you have records with empty `sf`.`id`?

    Not sure what the variable $condition says but you'll want to add ORDER BY `sf`.`id` ASC


    If it's not, that `sf`.`id` field should be auto-increment so it will always be unique and never empty. OR are you using another auto-increment field in that table?

  10. #85
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    Do you have records with empty `sf`.`id`?

    Not sure what the variable $condition says but you'll want to add ORDER BY `sf`.`id` ASC


    If it's not, that `sf`.`id` field should be auto-increment so it will always be unique and never empty. OR are you using another auto-increment field in that table?
    Ok, so I tried this and didn't really work, but its fine. Now, I want to try something else. I want to have like a box and have it have a number. I want to display 0 if every field is field in the table, if the field isn't filled then it shows how many rows don't have the field filled out. So for submissions, I have the status field, if that isn't filled out then I obviously haven't looked at it so I need to check submissions which means I want it to display like 1, 2, 3, etc how many of them aren't filled out, then i'll go filled them out. I don't really know how to do this. I also want to like just count how many users I have and display that as well, that part should be easy, just can't figure it out well enough.

    **UPDATE**
    Ok, I actually got the one to count how many users there are, thats easy, now I just need to figure out how to do the field thing.

  11. #86
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Is the page built dynamically or hard coded html? Maybe post a copy of what you have.

  12. #87
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    Is the page built dynamically or hard coded html? Maybe post a copy of what you have.
    Well, I don't know what page you're talking about? Its a bootstrap admin template. I'll give you my index page. I can easily do the box, I have the box already, just need the php part. Here you can see where I have the box at, the video submissions one says "coming soon"



    Code:
    <?php session_start();
    require '../core/config.php'; 
    
    if(isset($_SESSION['rank']) and $_SESSION['rank'] == "admin")
      {
      $_SESSION['username'];
    
      } else {
      header("location: ../index.php");
      } ?>
    <!DOCTYPE html>
    <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
    <!--[if IE 7]>    <html class="lt-ie9 lt-ie8"> <![endif]-->
    <!--[if IE 8]>    <html class="lt-ie9"> <![endif]-->
    <!--[if gt IE 8]><!--> <html> <!--<![endif]-->
    <head>
    	<title>Partner Dashboard</title>
    	
    	<!-- Meta -->
    	<meta charset="UTF-8" />
    	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
    	<meta name="apple-mobile-web-app-capable" content="yes" />
    	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
    	
    	<!-- Bootstrap -->
    	<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    	<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" />
    	
    	<!-- Bootstrap Extended -->
    	<link href="bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap.min.css" rel="stylesheet" />
    	<link href="bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap-responsive.min.css" rel="stylesheet" />
    	<link href="bootstrap/extend/bootstrap-wysihtml5/css/bootstrap-wysihtml5-0.0.2.css" rel="stylesheet" />
    	
    	<!-- JQueryUI v1.9.2 -->
    	<link rel="stylesheet" href="theme/scripts/jquery-ui-1.9.2.custom/css/smoothness/jquery-ui-1.9.2.custom.min.css" />
    	
    	<!-- Glyphicons -->
    	<link rel="stylesheet" href="theme/css/glyphicons.css" />
    	
    	<!-- Bootstrap Extended -->
    	<link rel="stylesheet" href="bootstrap/extend/bootstrap-select/bootstrap-select.css" />
    	<link rel="stylesheet" href="bootstrap/extend/bootstrap-toggle-buttons/static/stylesheets/bootstrap-toggle-buttons.css" />
    	
    	<!-- Uniform -->
    	<link rel="stylesheet" media="screen" href="theme/scripts/pixelmatrix-uniform/css/uniform.default.css" />
    
    	<!-- JQuery v1.8.2 -->
    	<script src="theme/scripts/jquery-1.8.2.min.js"></script>
    	
    	<!-- Modernizr -->
    	<script src="theme/scripts/modernizr.custom.76094.js"></script>
    	
    	<!-- MiniColors -->
    	<link rel="stylesheet" media="screen" href="theme/scripts/jquery-miniColors/jquery.miniColors.css" />
    	
    	<!-- Theme -->
    	<link rel="stylesheet/less" href="theme/less/style.less" />
    	
    	<!-- FireBug Lite -->
    	<!-- <script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script> -->
    	
    	
    	<!-- LESS 2 CSS -->
    	<script src="theme/scripts/less-1.3.3.min.js"></script>
    	
    	
    	<!--[if IE]><script type="text/javascript" src="theme/scripts/excanvas/excanvas.js"></script><![endif]-->
    	<!--[if lt IE 8]><script type="text/javascript" src="theme/scripts/json2.js"></script><![endif]-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
    <body>
    	
    	<!-- Start Content -->
    	<div class="container-fluid">
    		
    		<?php include "header.php" ?>
    		
    				<?php include "menu.php" ?>
    			</div>
    		</div>
    		<?php include "menu.php" ?>
    		<div id="content">
    		<ul class="breadcrumb">
    	<li><a href="index.php" class="glyphicons home"><i></i> EliteGamingNetwork</a></li>
    	<li class="divider"></li>
    	<li>Dashboard</li>
    </ul>
    <div class="separator"></div>
    
    <div class="heading-buttons">
    	<h3 class="glyphicons display"><i></i> Dashboard</h3>
    	
    	<div class="clearfix" style="clear: both;"></div>
    </div>
    <div class="separator"></div>
    <?php 
    $result = $db->query("SELECT COUNT(*) FROM `users`");
    $row = $result->fetch_row();
    $users = $row[0]; ?>
    
    
    <div class="innerLR">
    <div class="row-fluid">
    	<div class="span4">
    		<div class="widget widget-3">
    			<div class="widget-head">
    				<h4 class="heading"><span class="glyphicons coins"><i></i></span>New Video Submissions</h4>
    			</div>
    			<div class="widget-body large">
    				Coming Soon
    			</div>
    		</div>
    	</div>
    	<div class="span4">
    		<div class="widget widget-3">
    			<div class="widget-head">
    				<h4 class="heading"><span class="glyphicons user_add"><i></i></span>Users</h4>
    			</div>
    			<div class="widget-body large">
    				<?php echo $users ;?>
    			</div>
    		</div>
    	</div>
    </div>
    </div>
    <br/>		
    
    
    
    
    
    <div class="innerLR">
    	<div class="widget widget-gray widget-body-white">
    		<div class="widget-head">
    			<h4 class="heading">Users</h4>
    		</div>
    		<div class="widget-body" style="padding: 10px 0;">
    				<table class="dynamicTable table-striped table-bordered table-primary table-condensed">
    
      <thead>
        <tr>
        <th>User ID</th>
        <th>Username</th>
        <th>Email</th>
        <th>First Name</th>
        <th>Last Name</th>
        <th>Skype</th>
        <th>Rank</th>
        <th>Edit User</th>
        <th>Delete User</th>
      </tr>
    </thead>
    <tbody>
      <?php
        $query = $db->query("SELECT * FROM users");
        while($row = $query->fetch_assoc())
        { 
          
    
          $id = $row['Id'];
    echo "<tr>"; 
    echo "<td>" . $row['Id'] . "</td>"; 
    echo "<td>" . $row['Username'] . "</td>"; 
    echo "<td>" . $row['Email'] . "</td>"; 
    echo "<td>" . $row['FName'] . "</td>"; 
    echo "<td>" . $row['LName'] . "</td>";
    echo "<td>" . $row['SkypeID'] . "</td>";
    echo "<td>" . $row['Rank']  . "</td>";
    ?><td><a href="users.php?id=<?php echo $row['Id']?>"><button class="btn btn-sm btn-warning"><i class="icon-pencil"></i> </button></a></td>
      <td><a href="udelete.php?id=<?php echo $row['Id']?>"><button class="btn btn-sm btn-danger"><i class="icon-remove"></i> </button></a></td>
      <?php echo '</tr>'; 
             
        }
      ?>
    </tbody>
    </table>
    
     </div>
     <div class="clearfix"></div> 
    
                        </div>
                    </div>
    
    		
    				<!-- End Content -->
    		</div>
    		<!-- End Wrapper -->
    		</div>
    		
    		<!-- Sticky Footer -->
    		
    	
    	<!-- JQueryUI v1.9.2 -->
    	<script src="theme/scripts/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.min.js"></script>
    	
    	<!-- JQueryUI Touch Punch -->
    	<!-- small hack that enables the use of touch events on sites using the jQuery UI user interface library -->
    	<script src="theme/scripts/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js"></script>
    	
    	<!-- MiniColors -->
    	<script src="theme/scripts/jquery-miniColors/jquery.miniColors.js"></script>
    	
    	<!-- Themer -->
    	<script>
    	var themerPrimaryColor = '#DA4C4C';
    	</script>
    	<script src="theme/scripts/jquery.cookie.js"></script>
    	<script src="theme/scripts/themer.js"></script>
    	
    	
    	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    
    		<!-- Sparkline -->
    	<script src="theme/scripts/jquery.sparkline.min.js" type="text/javascript"></script>
    	<script type="text/javascript">
    	function genSparklines()
    	{
    		if ($('.sparkline').length)
    		{
    			$.each($('.sparkline'), function(k,v) 
    			{
    				var data = [[1, 3+charts.utility.randNum()], [2, 5+charts.utility.randNum()], [3, 8+charts.utility.randNum()], [4, 11+charts.utility.randNum()],[5, 14+charts.utility.randNum()],[6, 17+charts.utility.randNum()],[7, 20+charts.utility.randNum()], [8, 15+charts.utility.randNum()], [9, 18+charts.utility.randNum()], [10, 22+charts.utility.randNum()]];
    			 	$(v).sparkline(data, 
    				{ 
    					width: 100,
    					height: 28,
    					lineColor: themerPrimaryColor,
    					fillColor: '#fafafa',
    					spotColor: '#467e8c',
    					maxSpotColor: '#9FC569',
    					minSpotColor: '#ED7A53',
    					spotRadius: 3,
    					lineWidth: 2
    				});
    			});
    		}
    	}
    	$(function()
    	{
    		genSparklines();
    	});
    	</script>
    		
    	<!--  Flot (Charts) JS -->
    	<script src="theme/scripts/flot/jquery.flot.js" type="text/javascript"></script>
    	<script src="theme/scripts/flot/jquery.flot.pie.js" type="text/javascript"></script>
    	<script src="theme/scripts/flot/jquery.flot.tooltip.js" type="text/javascript"></script>
    	<script src="theme/scripts/flot/jquery.flot.selection.js"></script>
    	<script src="theme/scripts/flot/jquery.flot.resize.js" type="text/javascript"></script>
    	<script src="theme/scripts/flot/jquery.flot.orderBars.js" type="text/javascript"></script>
    	
    		
    	<script>
    	var charts = 
    	{
    		// init all charts
    		init: function()
    		{
    						// mark weekends on the website traffic main graph
    			this.website_traffic_graph.options.markings = this.utility.weekendAreas;
    
    			// init website traffic main graph
    			this.website_traffic_graph.init();
    
    			// init website traffic toolbar
    			this.utility.website_traffic_toolbar();
    
    			// init website traffic overview graph
    			this.website_traffic_overview.init();
    
    			// connect website traffic graphs
    			this.utility.website_traffic_connect();
    
    			// init traffic sources pie
    			this.traffic_sources_pie.init();
    											},
    
    		// utility class
    		utility:
    		{
    			chartColors: [ "#37a6cd", "#444", "#777", "#999", "#DDD", "#EEE" ],
    			chartBackgroundColors: ["#fff", "#fff"],
    
    			applyStyle: function(that)
    			{
    				that.options.colors = charts.utility.chartColors;
    				that.options.grid.backgroundColor = { colors: charts.utility.chartBackgroundColors };
    				that.options.grid.borderColor = charts.utility.chartColors[0];
    				that.options.grid.color = charts.utility.chartColors[0];
    			},
    			
    						// connect website_traffic_graph with website_traffic_overview
    			website_traffic_connect: function()
    			{
    				$("#placeholder").bind("plotselected", function (event, ranges) 
    				{
    			        // do the zooming // rewrite chart object
    			        charts.website_traffic_graph.plot = $.plot(
    						$("#placeholder"), 
    						[{ data: charts.website_traffic_graph.d1, label: "Visitors" }, { data: charts.website_traffic_graph.d2, label: "Conversions" }],
    						$.extend(true, {}, charts.website_traffic_graph.options, {
    			            	xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
    						})
    					);
    
    			        // don't fire event on the overview to prevent eternal loop
    			        charts.website_traffic_overview.plot.setSelection(ranges, true);
    
    			     	// enable website traffic clear selection button
    			    	$('#websiteTrafficClear').prop('disabled', false);
    			    });
    			    
    			    $("#overview").bind("plotselected", function (event, ranges) 
    				{
    					// set selection
    			    	charts.website_traffic_graph.plot.setSelection(ranges);
    
    			    	// enable website traffic clear selection button
    			    	$('#websiteTrafficClear').prop('disabled', false);
    			    });
    			},
    
    			website_traffic_toolbar: function()
    			{
    				// clear selection button
    				$("#websiteTrafficClear").click(function()
    				{
    					charts.utility.website_traffic_clear();
    				});
    
    				// last 24 hours button
    				$('#websiteTraffic24Hours').click(function()
    				{
    					charts.website_traffic_graph.plot.setSelection(
    					{
    						xaxis: 
    						{
    							from: 1361059200000,
    							to: 1361145600000						}
    					});
    				});
    
    				// last 7 days button
    				$('#websiteTraffic7Days').click(function()
    				{
    					charts.website_traffic_graph.plot.setSelection(
    					{
    						xaxis: 
    						{
    							from: 1360540800000,
    							to: 1361145600000						}
    					});
    				});
    
    				// last 14 days button
    				$('#websiteTraffic14Days').click(function()
    				{
    					charts.website_traffic_graph.plot.setSelection(
    					{
    						xaxis: 
    						{
    							from: 1359936000000,
    							to: 1361145600000						}
    					});
    				});
    			},
    			
    			// clear selection on website traffic charts
    			website_traffic_clear: function()
    			{
    				// disable clear button
    				$('#websiteTrafficClear').prop('disabled', true);
    				
    				// clear selection on website traffic main chart / rewrite chart object
    				charts.website_traffic_graph.plot = $.plot(
    					$("#placeholder"), 
    					[{ data: charts.website_traffic_graph.d1, label: "Visitors" }, { data: charts.website_traffic_graph.d2, label: "Conversions" }],
    					charts.website_traffic_graph.options
    				);
    
    				// clear selection on website traffic overview chart
    				charts.website_traffic_overview.plot.clearSelection();
    			},
    			
    			// helper for returning the weekends in a period
    			weekendAreas: function(axes)
    			{
    				var markings = [];
    		        var d = new Date(axes.xaxis.min);
    		        // go to the first Saturday
    		        d.setUTCDate(d.getUTCDate() - ((d.getUTCDay() + 1) % 7))
    		        d.setUTCSeconds(0);
    		        d.setUTCMinutes(0);
    		        d.setUTCHours(0);
    		        var i = d.getTime();
    		        do {
    		            // when we don't set yaxis, the rectangle automatically
    		            // extends to infinity upwards and downwards
    		            markings.push({ xaxis: { from: i, to: i + 2 * 24 * 60 * 60 * 1000 } });
    		            i += 7 * 24 * 60 * 60 * 1000;
    		        } while (i < axes.xaxis.max);
    		
    		        return markings;
    			},
    						
    			// generate random number for charts
    			randNum: function()
    			{
    				return (Math.floor( Math.random()* (1+40-20) ) ) + 20;
    			}
    		},
    
    				// main website traffic chart
    		website_traffic_graph:
    		{
    			// data
    			d1: [[1358640000000, 3162],[1358726400000, 3284],[1358812800000, 3008],[1358899200000, 3565],[1358985600000, 2105],[1359072000000, 3585],[1359158400000, 2923],[1359244800000, 3014],[1359331200000, 2279],[1359417600000, 2406],[1359504000000, 2704],[1359590400000, 2292],[1359676800000, 2740],[1359763200000, 3967],[1359849600000, 2595],[1359936000000, 3993],[1360022400000, 2319],[1360108800000, 3399],[1360195200000, 2889],[1360281600000, 2305],[1360368000000, 2943],[1360454400000, 2303],[1360540800000, 3099],[1360627200000, 2711],[1360713600000, 3238],[1360800000000, 3514],[1360886400000, 2334],[1360972800000, 3834],[1361059200000, 3991],[1361145600000, 3473]],
    			d2: [[1358640000000, 438],[1358726400000, 404],[1358812800000, 571],[1358899200000, 611],[1358985600000, 693],[1359072000000, 459],[1359158400000, 438],[1359244800000, 412],[1359331200000, 413],[1359417600000, 473],[1359504000000, 592],[1359590400000, 544],[1359676800000, 562],[1359763200000, 660],[1359849600000, 466],[1359936000000, 667],[1360022400000, 652],[1360108800000, 511],[1360195200000, 688],[1360281600000, 687],[1360368000000, 523],[1360454400000, 686],[1360540800000, 504],[1360627200000, 472],[1360713600000, 700],[1360800000000, 683],[1360886400000, 626],[1360972800000, 528],[1361059200000, 434],[1361145600000, 485]],
    
    			// will hold the chart object
    			plot: null,
    			
    			// chart options
    			options:
    			{
    		        xaxis: { mode: "time", tickLength: 5 },
    		        selection: { mode: "x" },
    		        grid: { 
    			        markingsColor: "rgba(0,0,0, 0.02)",
    			        backgroundColor : { },
    					borderColor : "#f1f1f1",
    					borderWidth: 0,
    					color : "#DA4C4C",
    					hoverable : true,
    					clickable: true
    			    },
    		        series : {
    					lines : {
    						show : true,
    						fill: true
    					},
    					points : {
    						show : true
    					}
    				},
    				colors: [],
    				tooltip: true,
    				tooltipOpts: {
    					content: "%x: <strong>%y %s</strong>",
    					dateFormat: "%y-%0m-%0d",
    					shifts: {
    						x: 10,
    						y: 20
    					},
    					defaultTheme: false
    				},
    				legend: {
    			        show: true,
    			        noColumns: 2
    			    }
    		    },
    
    		 	// initialize
    			init: function()
    			{
    				// apply styling
    				charts.utility.applyStyle(this);
    				
    				// first correct the timestamps - they are recorded as the daily
    			    // midnights in UTC+0100, but Flot always displays dates in UTC
    			    // so we have to add one hour to hit the midnights in the plot
    			    for (var i = 0; i < this.d1.length; ++i)
    			    {
    			    	this.d1[i][0] += 60 * 60 * 1000;
    			    	this.d2[i][0] += 60 * 60 * 1000;
    			    }
    
    				// create the chart object
    			    this.plot = $.plot(
    					$("#placeholder"), 
    					[{ data: this.d1, label: "Visitors" }, { data: this.d2, label: "Conversions" }], 
    					this.options
    				);
    			}
    		},
    
    		// website traffic overview chart
    		website_traffic_overview: 
    		{
    			// data
    			d1: [[1358640000000, 3162],[1358726400000, 3284],[1358812800000, 3008],[1358899200000, 3565],[1358985600000, 2105],[1359072000000, 3585],[1359158400000, 2923],[1359244800000, 3014],[1359331200000, 2279],[1359417600000, 2406],[1359504000000, 2704],[1359590400000, 2292],[1359676800000, 2740],[1359763200000, 3967],[1359849600000, 2595],[1359936000000, 3993],[1360022400000, 2319],[1360108800000, 3399],[1360195200000, 2889],[1360281600000, 2305],[1360368000000, 2943],[1360454400000, 2303],[1360540800000, 3099],[1360627200000, 2711],[1360713600000, 3238],[1360800000000, 3514],[1360886400000, 2334],[1360972800000, 3834],[1361059200000, 3991],[1361145600000, 3473]],
    			d2: [[1358640000000, 438],[1358726400000, 404],[1358812800000, 571],[1358899200000, 611],[1358985600000, 693],[1359072000000, 459],[1359158400000, 438],[1359244800000, 412],[1359331200000, 413],[1359417600000, 473],[1359504000000, 592],[1359590400000, 544],[1359676800000, 562],[1359763200000, 660],[1359849600000, 466],[1359936000000, 667],[1360022400000, 652],[1360108800000, 511],[1360195200000, 688],[1360281600000, 687],[1360368000000, 523],[1360454400000, 686],[1360540800000, 504],[1360627200000, 472],[1360713600000, 700],[1360800000000, 683],[1360886400000, 626],[1360972800000, 528],[1361059200000, 434],[1361145600000, 485]],
    
    			// will hold the chart object
    			plot: null,
    
    			// chart options
    			options: 
    			{
    		        series: {
    			        /*
    		            bars: {
    						show: true,
    	                    lineWidth: 35,
    	                    align: "left"
    					},
    					*/
    					lines: { show: true, lineWidth: 1, fill: true },
    	                shadowSize: 0
    		        },
    		        xaxis: { ticks: [], mode: "time" },
    		        yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
    		        selection: { mode: "x" },
    		        grid: {
    		        	borderColor : "#DA4C4C",
    		        	borderWidth: 0,
    		        	minBorderMargin: 0,
    		        	axisMargin: 0,
    		        	labelMargin: 0,
    		        	margin: 0,
    		        	backgroundColor : {}
    			    },
    			    colors: [],
    			    legend: {
    			        show: false
    			    }
    		    },
    
    			// initialize
    			init: function()
    			{
    				// apply styling
    				charts.utility.applyStyle(this);
    				
    				// first correct the timestamps - they are recorded as the daily
    			    // midnights in UTC+0100, but Flot always displays dates in UTC
    			    // so we have to add one hour to hit the midnights in the plot
    			    for (var i = 0; i < this.d1.length; ++i)
    			    {
    			    	this.d1[i][0] += 60 * 60 * 1000;
    			    	this.d2[i][0] += 60 * 60 * 1000;
    			    }
    
    			    // create chart object
    			    this.plot = $.plot(
    					$("#overview"), 
    					[{ data: this.d1, label: "Visitors" }, { data: this.d2, label: "Conversions" }], 
    					this.options
    				);
    			}
    		},
    
    		traffic_sources_pie: 
    		{
    			// data
    			data: [
    				{ label: "organic",  data: 60 },
    				{ label: "direct",  data: 22.1 },
    				{ label: "referral",  data: 16.9 },
    				{ label: "cpc",  data: 1 }
    			],
    			
    			// chart object
    			plot: null,
    			
    			// chart options
    			options: {
    				series: {
    		            pie: {
    		                show: true,
    		                redraw: true,
    		                radius: 1,
    		                tilt: 0.6,
    		                label: {
    		                    show: true,
    		                    radius: 1,
    		                    formatter: function(label, series){
    		                        return '<div style="font-size:8pt;text-align:center;padding:5px;color:#fff;">'+Math.round(series.percent)+'%</div>';
    		                    },
    		                    background: { opacity: 0.8 }
    		                }
    		            }
    		        },
    		        legend: {
    		            show: true
    		        },
    		        colors: [],
    		        grid: { hoverable: true },
    		        tooltip: true,
    				tooltipOpts: {
    					content: "<strong>%y% %s</strong>",
    					dateFormat: "%y-%0m-%0d",
    					shifts: {
    						x: 10,
    						y: 20
    					},
    					defaultTheme: false
    				}
    			},
    			
    			// initialize
    			init: function()
    			{
    				// apply styling
    				charts.utility.applyStyle(this);
    				
    				this.plot = $.plot($("#pie"), this.data, this.options);
    			}
    		},
    
    		// traffic sources dataTables
    		// we are now using Google Charts instead of Flot
    		traffic_sources_dataTables:
    		{
    			// tables data
    			data: 
    			{
    				tableSources:  
    				{
    					data: null,
    					init: function()
    					{
    						var data = new google.visualization.DataTable();
    				        data.addColumn('string', 'Source');
    				        data.addColumn('string', 'Medium');
    				        data.addColumn('number', 'Visits');
    				        data.addColumn('number', 'Pg.Views');
    				        data.addColumn('string', 'avg.time');
    
    				        data.addRows(7);
    				        data.setCell(0, 0, 'google', null, {'style': 'text-align: center;'});
    				        data.setCell(0, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(0, 2, 89, null, {'style': 'text-align: center;'});
    				        data.setCell(0, 3, 299, null, {'style': 'text-align: center;'});
    				        data.setCell(0, 4, '00:01:48', null, {'style': 'text-align: center;'});
    				        data.setCell(1, 0, '(direct)', null, {'style': 'text-align: center;'});
    				        data.setCell(1, 1, '(none)', null, {'style': 'text-align: center;'});
    				        data.setCell(1, 2, 14, null, {'style': 'text-align: center;'});
    				        data.setCell(1, 3, 34, null, {'style': 'text-align: center;'});
    				        data.setCell(1, 4, '00:03:15', null, {'style': 'text-align: center;'});
    				        data.setCell(2, 0, 'yahoo', null, {'style': 'text-align: center;'});
    				        data.setCell(2, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(2, 2, 3, null, {'style': 'text-align: center;'});
    				        data.setCell(2, 3, 3, null, {'style': 'text-align: center;'});
    				        data.setCell(2, 4, '00:00:00', null, {'style': 'text-align: center;'});
    				        data.setCell(3, 0, 'ask', null, {'style': 'text-align: center;'});
    				        data.setCell(3, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(3, 2, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(3, 3, 3, null, {'style': 'text-align: center;'});
    				        data.setCell(3, 4, '00:01:34', null, {'style': 'text-align: center;'});
    				        data.setCell(4, 0, 'bing', null, {'style': 'text-align: center;'});
    				        data.setCell(4, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(4, 2, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(4, 3, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(4, 4, '00:00:00', null, {'style': 'text-align: center;'});
    				        data.setCell(5, 0, 'conduit', null, {'style': 'text-align: center;'});
    				        data.setCell(5, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(5, 2, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(5, 3, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(5, 4, '00:00:00', null, {'style': 'text-align: center;'});
    				        data.setCell(6, 0, 'google', null, {'style': 'text-align: center;'});
    				        data.setCell(6, 1, 'cpc', null, {'style': 'text-align: center;'});
    				        data.setCell(6, 2, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(6, 3, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(6, 4, '00:00:00', null, {'style': 'text-align: center;'});
    
    				        this.data = data;
    				        return data;
    					}
    				},
    				tableReffering:
    				{
    					data: null,
    					init: function()
    					{
    						var data = new google.visualization.DataTable();
    						data.addColumn('string', 'Source');
    				        data.addColumn('number', 'Pg.Views');
    				        data.addColumn('string', 'avg.time');
    				        data.addColumn('string', 'Exits');
    				        
    						data.addRows(6);
    						data.setCell(0, 0, 'google.ro');
    						data.setCell(0, 1, 14, null, {'style': 'text-align: center;'});
    						data.setCell(0, 2, '00:05:51', null, {'style': 'text-align: center;'});
    						data.setCell(0, 3, '3', null, {'style': 'text-align: center;'});
    						data.setCell(1, 0, 'search.sweetim.com');
    						data.setCell(1, 1, 5, null, {'style': 'text-align: center;'});
    						data.setCell(1, 2, '00:03:29', null, {'style': 'text-align: center;'});
    						data.setCell(1, 3, '1', null, {'style': 'text-align: center;'});
    						data.setCell(2, 0, 'start.funmoods.com');
    						data.setCell(2, 1, 5, null, {'style': 'text-align: center;'});
    						data.setCell(2, 2, '00:01:02', null, {'style': 'text-align: center;'});
    						data.setCell(2, 3, '1', null, {'style': 'text-align: center;'});
    						data.setCell(3, 0, 'google.md');
    						data.setCell(3, 1, 2, null, {'style': 'text-align: center;'});
    						data.setCell(3, 2, '00:03:56', null, {'style': 'text-align: center;'});
    						data.setCell(3, 3, '1', null, {'style': 'text-align: center;'});
    						data.setCell(4, 0, 'searchmobileonline.com');
    						data.setCell(4, 1, 2, null, {'style': 'text-align: center;'});
    						data.setCell(4, 2, '00:02:21', null, {'style': 'text-align: center;'});
    						data.setCell(4, 3, '1', null, {'style': 'text-align: center;'});
    						data.setCell(5, 0, 'google.com');
    						data.setCell(5, 1, 1, null, {'style': 'text-align: center;'});
    						data.setCell(5, 2, '00:00:00', null, {'style': 'text-align: center;'});
    						data.setCell(5, 3, '1', null, {'style': 'text-align: center;'});
    						
    						this.data = data;
    						return data;
    					}
    				}
    			},
    			
    			// chart
    			chart: 
    			{
    				tableSources: null,
    				tableReffering: null
    			},
    			
    			// options
    			options: 
    			{
    				tableSources: 
    				{
    					page: 'enable',
    					pageSize: 6,
    					allowHtml: true,
    					cssClassNames: {
    						headerRow: 'tableHeaderRow',
    						tableRow: 'tableRow',
    						selectedTableRow: 'selectedTableRow',
    						hoverTableRow: 'hoverTableRow'
    					},
    					width: '100%',
    					alternatingRowStyle: false,
    					pagingSymbols: { prev: '<span class="btn btn-inverse">prev</btn>', next: '<span class="btn btn-inverse">next</span>' }
    				},
    				
    				tableReffering:
    				{
    					page: 'enable',
    					pageSize: 6,
    					allowHtml: true,
    					cssClassNames: {
    						headerRow: 'tableHeaderRow',
    						tableRow: 'tableRow',
    						selectedTableRow: 'selectedTableRow',
    						hoverTableRow: 'hoverTableRow'
    					},
    					width: '100%',
    					alternatingRowStyle: false,
    					pagingSymbols: { prev: '<span class="btn btn-inverse">prev</btn>', next: '<span class="btn btn-inverse">next</span>' }
    				}
    			},
    			
    			// initialize
    			init: function()
    			{
    				// data
    				charts.traffic_sources_dataTables.data.tableSources.init();
    				charts.traffic_sources_dataTables.data.tableReffering.init();
    				
    				// charts
    				charts.traffic_sources_dataTables.drawTableSources();
    				charts.traffic_sources_dataTables.drawTableReffering();
    			},
    
    			// draw Traffic Sources Table
    			drawTableSources: function()
    			{
    				this.chart.tableSources = new google.visualization.Table(document.getElementById('dataTableSources'));
    				this.chart.tableSources.draw(this.data.tableSources.data, this.options.tableSources);
    			},
    
    			// draw Refferals Table
    			drawTableReffering: function()
    			{
    				this.chart.tableReffering = new google.visualization.Table(document.getElementById('dataTableReffering'));
    				this.chart.tableReffering.draw(this.data.tableReffering.data, this.options.tableReffering);
    			}
    		}
    							};
    
    	$(function()
    	{
    		// initialize charts
    		charts.init();
    	});
    	</script>
    	
    	
    	<!-- Resize Script -->
    	<script src="theme/scripts/jquery.ba-resize.js"></script>
    	
    	<!-- Uniform -->
    	<script src="theme/scripts/pixelmatrix-uniform/jquery.uniform.min.js"></script>
    	
    	<!-- Bootstrap Script -->
    	<script src="bootstrap/js/bootstrap.min.js"></script>
    	
    	<!-- Bootstrap Extended -->
    	<script src="bootstrap/extend/bootstrap-select/bootstrap-select.js"></script>
    	<script src="bootstrap/extend/bootstrap-toggle-buttons/static/js/jquery.toggle.buttons.js"></script>
    	<script src="bootstrap/extend/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js"></script>
    	<script src="bootstrap/extend/jasny-bootstrap/js/jasny-bootstrap.min.js" type="text/javascript"></script>
    	<script src="bootstrap/extend/jasny-bootstrap/js/bootstrap-fileupload.js" type="text/javascript"></script>
    	<script src="bootstrap/extend/bootbox.js" type="text/javascript"></script>
    	<script src="bootstrap/extend/bootstrap-wysihtml5/js/wysihtml5-0.3.0_rc2.min.js" type="text/javascript"></script>
    	<script src="bootstrap/extend/bootstrap-wysihtml5/js/bootstrap-wysihtml5-0.0.2.js" type="text/javascript"></script>
    	
    	<!-- Custom Onload Script -->
    	<script src="theme/scripts/load.js"></script>
    	
    	<script>
    	//Load the Visualization API and the piechart package.
    	google.load('visualization', '1.0', {'packages':['table', 'corechart']});
    	
    	// Set a callback to run when the Google Visualization API is loaded.
    	google.setOnLoadCallback(charts.traffic_sources_dataTables.init);
    	</script>
    
    </body>
    </html>

  13. #88
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Well, I don't know what page you're talking about?
    I want to have like a box and have it have a number. I want to display 0 if every field is field in the table, if the field isn't filled then it shows how many rows don't have the field filled out. So for submissions, I have the status field, if that isn't filled out then I obviously haven't looked at it so I need to check submissions which means I want it to display like 1, 2, 3, etc how many of them aren't filled out, then i'll go filled them out.
    Is the page built dynamically or hard coded html? Maybe post a copy of what you have.
    I really don't care about "the box" or where you are putting it. My question was regarding what code you have related to the task of your comment above, e.g. I want to display 0 if every field is field in the table... I have the status field etc. Where are you attempting to make these counts? Where is the query and display section regarding this.

  14. #89
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    I really don't care about "the box" or where you are putting it. My question was regarding what code you have related to the task of your comment above, e.g. I want to display 0 if every field is field in the table... I have the status field etc. Where are you attempting to make these counts? Where is the query and display section regarding this.
    Well, i'm referring to the video submissions in my database. You helped me with that a little awhile ago where I can display there own submissions to them, etc. Now this is just the admin side where I can get like a little notification of how many I need to check, etc. I thought we could check the status field because if its empty then I have most likely not checked it so I think it would be easier for that.

    Heres the "table" I have displayed for all the submissions, but the box will be on the index page, not this page, but heres the page with the table.



    Code:
    <?php session_start();
    require '../core/config.php'; 
    
    if(isset($_SESSION['rank']) and $_SESSION['rank'] == "admin")
      {
      $_SESSION['username'];
    
      } else {
      header("location: ../index.php");
      exit;
      } 
    $pagename = "vedit.php";
      //Show all or single id 
    if(isset($_GET['id'])){
        $id = mysqli_real_escape_string ($db, $_GET['id']);
        $condition = "ORDER BY `sf`.`id` ASC";
    }else{ 
        $condition = "ORDER BY username ASC";
    }
    $sql = "SELECT 
    `sf`.`id`,
    `sf`.`username`,
    `sf`.`rank`,
    `sf`.`video_link`,
    `sf`.`video_title`,
    `sf`.`video_description`,
    `sf`.`video_tags`,
    `sf`.`music_sources`,
    `sf`.`special_requests`,
    `sf`.`status`
    
    FROM `users` AS u 
    LEFT JOIN `submitted_forms1` AS sf
    ON sf.username = u.username
    $condition";
    $result = $db->query($sql) or die(mysqli_error($db)); 
    ?>
    <!DOCTYPE html>
    <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
    <!--[if IE 7]>    <html class="lt-ie9 lt-ie8"> <![endif]-->
    <!--[if IE 8]>    <html class="lt-ie9"> <![endif]-->
    <!--[if gt IE 8]><!--> <html> <!--<![endif]-->
    <head>
    	<title>Partner Dashboard</title>
    	
    	<!-- Meta -->
    	<meta charset="UTF-8" />
    	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
    	<meta name="apple-mobile-web-app-capable" content="yes" />
    	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
    	
    	<!-- Bootstrap -->
    	<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    	<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" />
    	
    	<!-- Bootstrap Extended -->
    	<link href="bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap.min.css" rel="stylesheet" />
    	<link href="bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap-responsive.min.css" rel="stylesheet" />
    	<link href="bootstrap/extend/bootstrap-wysihtml5/css/bootstrap-wysihtml5-0.0.2.css" rel="stylesheet" />
    	
    	<!-- JQueryUI v1.9.2 -->
    	<link rel="stylesheet" href="theme/scripts/jquery-ui-1.9.2.custom/css/smoothness/jquery-ui-1.9.2.custom.min.css" />
    	
    	<!-- Glyphicons -->
    	<link rel="stylesheet" href="theme/css/glyphicons.css" />
    	
    	<!-- Bootstrap Extended -->
    	<link rel="stylesheet" href="bootstrap/extend/bootstrap-select/bootstrap-select.css" />
    	<link rel="stylesheet" href="bootstrap/extend/bootstrap-toggle-buttons/static/stylesheets/bootstrap-toggle-buttons.css" />
    	
    	<!-- Uniform -->
    	<link rel="stylesheet" media="screen" href="theme/scripts/pixelmatrix-uniform/css/uniform.default.css" />
    
    	<!-- JQuery v1.8.2 -->
    	<script src="theme/scripts/jquery-1.8.2.min.js"></script>
    	
    	<!-- Modernizr -->
    	<script src="theme/scripts/modernizr.custom.76094.js"></script>
    	
    	<!-- MiniColors -->
    	<link rel="stylesheet" media="screen" href="theme/scripts/jquery-miniColors/jquery.miniColors.css" />
    	
    	<!-- Theme -->
    	<link rel="stylesheet/less" href="theme/less/style.less" />
    	
    	<!-- FireBug Lite -->
    	<!-- <script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script> -->
    	
    	
    	<!-- LESS 2 CSS -->
    	<script src="theme/scripts/less-1.3.3.min.js"></script>
    	
    	
    	<!--[if IE]><script type="text/javascript" src="theme/scripts/excanvas/excanvas.js"></script><![endif]-->
    	<!--[if lt IE 8]><script type="text/javascript" src="theme/scripts/json2.js"></script><![endif]-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
    <body>
    	
    	<!-- Start Content -->
    	<div class="container-fluid">
    		
    		<?php include "header.php" ?>
    		
    				<?php include "menu.php" ?>
    			</div>
    		</div>
    		<?php include "menu.php" ?>
    		<div id="content">
    		<ul class="breadcrumb">
    	<li><a href="index.php" class="glyphicons home"><i></i> EliteGamingNetwork</a></li>
    	<li class="divider"></li>
    	<li>Dashboard</li>
    </ul>
    <div class="separator"></div>
    
    <div class="heading-buttons">
    	<h3 class="glyphicons display"><i></i> Video Submissions</h3>
    	
    	<div class="clearfix" style="clear: both;"></div>
    </div>
    <div class="separator"></div>
    
    
    	<div class="widget widget-gray widget-body-white">
    		<div class="widget-head">
    			<h4 class="heading">Video Submissions</h4>
    		</div>
    		<div class="widget-body" style="padding: 10px 0;">
    			<table class="table table-striped table-bordered table-primary">
    
    				<?php 
        $headrows = 0;
        while ($row = $result->fetch_assoc()){ 
            if($headrows==0){ ?>
      <thead>
        <tr>
        <th>ID</th>
        <th>Channel Name</th>
        <th>Video</th>
        <th>Description</th>
        <th>Video Tags</th>
        <th>Music Sources</th>
        <th>Status</th>
        <th>Edit User</th>
      </tr>
    </thead>
    <tbody>
    	<?php 
        $headrows++;
            }
            
                $id = $row['id'];
                if(!empty($row['id'])){   
          echo '<tr>  
                <td>'.$row['id'].'</td> 
                <td>'.$row['username'].'</td>  
                <td><a href="'.$row['video_link'].'">'.$row['video_title'].'</a></td>  
                <td>'.$row['video_description'].'</td>  
                <td>'.$row['video_tags'].'</td>  
                <td>'.$row['music_sources'].'</td>    
                <td>'.$row['status'].'</td> 
                <td><a href="'.$pagename.'?id='.$row['id'].'"><button class="btn btn-sm btn-warning"><i class="icon-pencil"></i> </button></a></td> 
                <td><a href="vdelete.php?id='.$row['id'].'"><button class="btn btn-sm btn-danger"><i class="icon-remove"></i> </button></a></td>  
                </tr>'; 
        }  
    }
    ?> 
    </table>
    </div>
     </div>
     <div class="clearfix"></div> 
    
                        </div>
                    </div>
                  </div>
    
    		
    				<!-- End Content -->
    		</div>
    		<!-- End Wrapper -->
    		</div>
    		
    		<!-- Sticky Footer -->
    		
    	
    	<!-- JQueryUI v1.9.2 -->
    	<script src="theme/scripts/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.min.js"></script>
    	
    	<!-- JQueryUI Touch Punch -->
    	<!-- small hack that enables the use of touch events on sites using the jQuery UI user interface library -->
    	<script src="theme/scripts/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js"></script>
    	
    	<!-- MiniColors -->
    	<script src="theme/scripts/jquery-miniColors/jquery.miniColors.js"></script>
    	
    	<!-- Themer -->
    	<script>
    	var themerPrimaryColor = '#DA4C4C';
    	</script>
    	<script src="theme/scripts/jquery.cookie.js"></script>
    	<script src="theme/scripts/themer.js"></script>
    	
    	
    	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    
    		<!-- Sparkline -->
    	<script src="theme/scripts/jquery.sparkline.min.js" type="text/javascript"></script>
    	<script type="text/javascript">
    	function genSparklines()
    	{
    		if ($('.sparkline').length)
    		{
    			$.each($('.sparkline'), function(k,v) 
    			{
    				var data = [[1, 3+charts.utility.randNum()], [2, 5+charts.utility.randNum()], [3, 8+charts.utility.randNum()], [4, 11+charts.utility.randNum()],[5, 14+charts.utility.randNum()],[6, 17+charts.utility.randNum()],[7, 20+charts.utility.randNum()], [8, 15+charts.utility.randNum()], [9, 18+charts.utility.randNum()], [10, 22+charts.utility.randNum()]];
    			 	$(v).sparkline(data, 
    				{ 
    					width: 100,
    					height: 28,
    					lineColor: themerPrimaryColor,
    					fillColor: '#fafafa',
    					spotColor: '#467e8c',
    					maxSpotColor: '#9FC569',
    					minSpotColor: '#ED7A53',
    					spotRadius: 3,
    					lineWidth: 2
    				});
    			});
    		}
    	}
    	$(function()
    	{
    		genSparklines();
    	});
    	</script>
    		
    	<!--  Flot (Charts) JS -->
    	<script src="theme/scripts/flot/jquery.flot.js" type="text/javascript"></script>
    	<script src="theme/scripts/flot/jquery.flot.pie.js" type="text/javascript"></script>
    	<script src="theme/scripts/flot/jquery.flot.tooltip.js" type="text/javascript"></script>
    	<script src="theme/scripts/flot/jquery.flot.selection.js"></script>
    	<script src="theme/scripts/flot/jquery.flot.resize.js" type="text/javascript"></script>
    	<script src="theme/scripts/flot/jquery.flot.orderBars.js" type="text/javascript"></script>
    	
    		
    	<script>
    	var charts = 
    	{
    		// init all charts
    		init: function()
    		{
    						// mark weekends on the website traffic main graph
    			this.website_traffic_graph.options.markings = this.utility.weekendAreas;
    
    			// init website traffic main graph
    			this.website_traffic_graph.init();
    
    			// init website traffic toolbar
    			this.utility.website_traffic_toolbar();
    
    			// init website traffic overview graph
    			this.website_traffic_overview.init();
    
    			// connect website traffic graphs
    			this.utility.website_traffic_connect();
    
    			// init traffic sources pie
    			this.traffic_sources_pie.init();
    											},
    
    		// utility class
    		utility:
    		{
    			chartColors: [ "#37a6cd", "#444", "#777", "#999", "#DDD", "#EEE" ],
    			chartBackgroundColors: ["#fff", "#fff"],
    
    			applyStyle: function(that)
    			{
    				that.options.colors = charts.utility.chartColors;
    				that.options.grid.backgroundColor = { colors: charts.utility.chartBackgroundColors };
    				that.options.grid.borderColor = charts.utility.chartColors[0];
    				that.options.grid.color = charts.utility.chartColors[0];
    			},
    			
    						// connect website_traffic_graph with website_traffic_overview
    			website_traffic_connect: function()
    			{
    				$("#placeholder").bind("plotselected", function (event, ranges) 
    				{
    			        // do the zooming // rewrite chart object
    			        charts.website_traffic_graph.plot = $.plot(
    						$("#placeholder"), 
    						[{ data: charts.website_traffic_graph.d1, label: "Visitors" }, { data: charts.website_traffic_graph.d2, label: "Conversions" }],
    						$.extend(true, {}, charts.website_traffic_graph.options, {
    			            	xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
    						})
    					);
    
    			        // don't fire event on the overview to prevent eternal loop
    			        charts.website_traffic_overview.plot.setSelection(ranges, true);
    
    			     	// enable website traffic clear selection button
    			    	$('#websiteTrafficClear').prop('disabled', false);
    			    });
    			    
    			    $("#overview").bind("plotselected", function (event, ranges) 
    				{
    					// set selection
    			    	charts.website_traffic_graph.plot.setSelection(ranges);
    
    			    	// enable website traffic clear selection button
    			    	$('#websiteTrafficClear').prop('disabled', false);
    			    });
    			},
    
    			website_traffic_toolbar: function()
    			{
    				// clear selection button
    				$("#websiteTrafficClear").click(function()
    				{
    					charts.utility.website_traffic_clear();
    				});
    
    				// last 24 hours button
    				$('#websiteTraffic24Hours').click(function()
    				{
    					charts.website_traffic_graph.plot.setSelection(
    					{
    						xaxis: 
    						{
    							from: 1361059200000,
    							to: 1361145600000						}
    					});
    				});
    
    				// last 7 days button
    				$('#websiteTraffic7Days').click(function()
    				{
    					charts.website_traffic_graph.plot.setSelection(
    					{
    						xaxis: 
    						{
    							from: 1360540800000,
    							to: 1361145600000						}
    					});
    				});
    
    				// last 14 days button
    				$('#websiteTraffic14Days').click(function()
    				{
    					charts.website_traffic_graph.plot.setSelection(
    					{
    						xaxis: 
    						{
    							from: 1359936000000,
    							to: 1361145600000						}
    					});
    				});
    			},
    			
    			// clear selection on website traffic charts
    			website_traffic_clear: function()
    			{
    				// disable clear button
    				$('#websiteTrafficClear').prop('disabled', true);
    				
    				// clear selection on website traffic main chart / rewrite chart object
    				charts.website_traffic_graph.plot = $.plot(
    					$("#placeholder"), 
    					[{ data: charts.website_traffic_graph.d1, label: "Visitors" }, { data: charts.website_traffic_graph.d2, label: "Conversions" }],
    					charts.website_traffic_graph.options
    				);
    
    				// clear selection on website traffic overview chart
    				charts.website_traffic_overview.plot.clearSelection();
    			},
    			
    			// helper for returning the weekends in a period
    			weekendAreas: function(axes)
    			{
    				var markings = [];
    		        var d = new Date(axes.xaxis.min);
    		        // go to the first Saturday
    		        d.setUTCDate(d.getUTCDate() - ((d.getUTCDay() + 1) % 7))
    		        d.setUTCSeconds(0);
    		        d.setUTCMinutes(0);
    		        d.setUTCHours(0);
    		        var i = d.getTime();
    		        do {
    		            // when we don't set yaxis, the rectangle automatically
    		            // extends to infinity upwards and downwards
    		            markings.push({ xaxis: { from: i, to: i + 2 * 24 * 60 * 60 * 1000 } });
    		            i += 7 * 24 * 60 * 60 * 1000;
    		        } while (i < axes.xaxis.max);
    		
    		        return markings;
    			},
    						
    			// generate random number for charts
    			randNum: function()
    			{
    				return (Math.floor( Math.random()* (1+40-20) ) ) + 20;
    			}
    		},
    
    				// main website traffic chart
    		website_traffic_graph:
    		{
    			// data
    			d1: [[1358640000000, 3162],[1358726400000, 3284],[1358812800000, 3008],[1358899200000, 3565],[1358985600000, 2105],[1359072000000, 3585],[1359158400000, 2923],[1359244800000, 3014],[1359331200000, 2279],[1359417600000, 2406],[1359504000000, 2704],[1359590400000, 2292],[1359676800000, 2740],[1359763200000, 3967],[1359849600000, 2595],[1359936000000, 3993],[1360022400000, 2319],[1360108800000, 3399],[1360195200000, 2889],[1360281600000, 2305],[1360368000000, 2943],[1360454400000, 2303],[1360540800000, 3099],[1360627200000, 2711],[1360713600000, 3238],[1360800000000, 3514],[1360886400000, 2334],[1360972800000, 3834],[1361059200000, 3991],[1361145600000, 3473]],
    			d2: [[1358640000000, 438],[1358726400000, 404],[1358812800000, 571],[1358899200000, 611],[1358985600000, 693],[1359072000000, 459],[1359158400000, 438],[1359244800000, 412],[1359331200000, 413],[1359417600000, 473],[1359504000000, 592],[1359590400000, 544],[1359676800000, 562],[1359763200000, 660],[1359849600000, 466],[1359936000000, 667],[1360022400000, 652],[1360108800000, 511],[1360195200000, 688],[1360281600000, 687],[1360368000000, 523],[1360454400000, 686],[1360540800000, 504],[1360627200000, 472],[1360713600000, 700],[1360800000000, 683],[1360886400000, 626],[1360972800000, 528],[1361059200000, 434],[1361145600000, 485]],
    
    			// will hold the chart object
    			plot: null,
    			
    			// chart options
    			options:
    			{
    		        xaxis: { mode: "time", tickLength: 5 },
    		        selection: { mode: "x" },
    		        grid: { 
    			        markingsColor: "rgba(0,0,0, 0.02)",
    			        backgroundColor : { },
    					borderColor : "#f1f1f1",
    					borderWidth: 0,
    					color : "#DA4C4C",
    					hoverable : true,
    					clickable: true
    			    },
    		        series : {
    					lines : {
    						show : true,
    						fill: true
    					},
    					points : {
    						show : true
    					}
    				},
    				colors: [],
    				tooltip: true,
    				tooltipOpts: {
    					content: "%x: <strong>%y %s</strong>",
    					dateFormat: "%y-%0m-%0d",
    					shifts: {
    						x: 10,
    						y: 20
    					},
    					defaultTheme: false
    				},
    				legend: {
    			        show: true,
    			        noColumns: 2
    			    }
    		    },
    
    		 	// initialize
    			init: function()
    			{
    				// apply styling
    				charts.utility.applyStyle(this);
    				
    				// first correct the timestamps - they are recorded as the daily
    			    // midnights in UTC+0100, but Flot always displays dates in UTC
    			    // so we have to add one hour to hit the midnights in the plot
    			    for (var i = 0; i < this.d1.length; ++i)
    			    {
    			    	this.d1[i][0] += 60 * 60 * 1000;
    			    	this.d2[i][0] += 60 * 60 * 1000;
    			    }
    
    				// create the chart object
    			    this.plot = $.plot(
    					$("#placeholder"), 
    					[{ data: this.d1, label: "Visitors" }, { data: this.d2, label: "Conversions" }], 
    					this.options
    				);
    			}
    		},
    
    		// website traffic overview chart
    		website_traffic_overview: 
    		{
    			// data
    			d1: [[1358640000000, 3162],[1358726400000, 3284],[1358812800000, 3008],[1358899200000, 3565],[1358985600000, 2105],[1359072000000, 3585],[1359158400000, 2923],[1359244800000, 3014],[1359331200000, 2279],[1359417600000, 2406],[1359504000000, 2704],[1359590400000, 2292],[1359676800000, 2740],[1359763200000, 3967],[1359849600000, 2595],[1359936000000, 3993],[1360022400000, 2319],[1360108800000, 3399],[1360195200000, 2889],[1360281600000, 2305],[1360368000000, 2943],[1360454400000, 2303],[1360540800000, 3099],[1360627200000, 2711],[1360713600000, 3238],[1360800000000, 3514],[1360886400000, 2334],[1360972800000, 3834],[1361059200000, 3991],[1361145600000, 3473]],
    			d2: [[1358640000000, 438],[1358726400000, 404],[1358812800000, 571],[1358899200000, 611],[1358985600000, 693],[1359072000000, 459],[1359158400000, 438],[1359244800000, 412],[1359331200000, 413],[1359417600000, 473],[1359504000000, 592],[1359590400000, 544],[1359676800000, 562],[1359763200000, 660],[1359849600000, 466],[1359936000000, 667],[1360022400000, 652],[1360108800000, 511],[1360195200000, 688],[1360281600000, 687],[1360368000000, 523],[1360454400000, 686],[1360540800000, 504],[1360627200000, 472],[1360713600000, 700],[1360800000000, 683],[1360886400000, 626],[1360972800000, 528],[1361059200000, 434],[1361145600000, 485]],
    
    			// will hold the chart object
    			plot: null,
    
    			// chart options
    			options: 
    			{
    		        series: {
    			        /*
    		            bars: {
    						show: true,
    	                    lineWidth: 35,
    	                    align: "left"
    					},
    					*/
    					lines: { show: true, lineWidth: 1, fill: true },
    	                shadowSize: 0
    		        },
    		        xaxis: { ticks: [], mode: "time" },
    		        yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
    		        selection: { mode: "x" },
    		        grid: {
    		        	borderColor : "#DA4C4C",
    		        	borderWidth: 0,
    		        	minBorderMargin: 0,
    		        	axisMargin: 0,
    		        	labelMargin: 0,
    		        	margin: 0,
    		        	backgroundColor : {}
    			    },
    			    colors: [],
    			    legend: {
    			        show: false
    			    }
    		    },
    
    			// initialize
    			init: function()
    			{
    				// apply styling
    				charts.utility.applyStyle(this);
    				
    				// first correct the timestamps - they are recorded as the daily
    			    // midnights in UTC+0100, but Flot always displays dates in UTC
    			    // so we have to add one hour to hit the midnights in the plot
    			    for (var i = 0; i < this.d1.length; ++i)
    			    {
    			    	this.d1[i][0] += 60 * 60 * 1000;
    			    	this.d2[i][0] += 60 * 60 * 1000;
    			    }
    
    			    // create chart object
    			    this.plot = $.plot(
    					$("#overview"), 
    					[{ data: this.d1, label: "Visitors" }, { data: this.d2, label: "Conversions" }], 
    					this.options
    				);
    			}
    		},
    
    		traffic_sources_pie: 
    		{
    			// data
    			data: [
    				{ label: "organic",  data: 60 },
    				{ label: "direct",  data: 22.1 },
    				{ label: "referral",  data: 16.9 },
    				{ label: "cpc",  data: 1 }
    			],
    			
    			// chart object
    			plot: null,
    			
    			// chart options
    			options: {
    				series: {
    		            pie: {
    		                show: true,
    		                redraw: true,
    		                radius: 1,
    		                tilt: 0.6,
    		                label: {
    		                    show: true,
    		                    radius: 1,
    		                    formatter: function(label, series){
    		                        return '<div style="font-size:8pt;text-align:center;padding:5px;color:#fff;">'+Math.round(series.percent)+'%</div>';
    		                    },
    		                    background: { opacity: 0.8 }
    		                }
    		            }
    		        },
    		        legend: {
    		            show: true
    		        },
    		        colors: [],
    		        grid: { hoverable: true },
    		        tooltip: true,
    				tooltipOpts: {
    					content: "<strong>%y% %s</strong>",
    					dateFormat: "%y-%0m-%0d",
    					shifts: {
    						x: 10,
    						y: 20
    					},
    					defaultTheme: false
    				}
    			},
    			
    			// initialize
    			init: function()
    			{
    				// apply styling
    				charts.utility.applyStyle(this);
    				
    				this.plot = $.plot($("#pie"), this.data, this.options);
    			}
    		},
    
    		// traffic sources dataTables
    		// we are now using Google Charts instead of Flot
    		traffic_sources_dataTables:
    		{
    			// tables data
    			data: 
    			{
    				tableSources:  
    				{
    					data: null,
    					init: function()
    					{
    						var data = new google.visualization.DataTable();
    				        data.addColumn('string', 'Source');
    				        data.addColumn('string', 'Medium');
    				        data.addColumn('number', 'Visits');
    				        data.addColumn('number', 'Pg.Views');
    				        data.addColumn('string', 'avg.time');
    
    				        data.addRows(7);
    				        data.setCell(0, 0, 'google', null, {'style': 'text-align: center;'});
    				        data.setCell(0, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(0, 2, 89, null, {'style': 'text-align: center;'});
    				        data.setCell(0, 3, 299, null, {'style': 'text-align: center;'});
    				        data.setCell(0, 4, '00:01:48', null, {'style': 'text-align: center;'});
    				        data.setCell(1, 0, '(direct)', null, {'style': 'text-align: center;'});
    				        data.setCell(1, 1, '(none)', null, {'style': 'text-align: center;'});
    				        data.setCell(1, 2, 14, null, {'style': 'text-align: center;'});
    				        data.setCell(1, 3, 34, null, {'style': 'text-align: center;'});
    				        data.setCell(1, 4, '00:03:15', null, {'style': 'text-align: center;'});
    				        data.setCell(2, 0, 'yahoo', null, {'style': 'text-align: center;'});
    				        data.setCell(2, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(2, 2, 3, null, {'style': 'text-align: center;'});
    				        data.setCell(2, 3, 3, null, {'style': 'text-align: center;'});
    				        data.setCell(2, 4, '00:00:00', null, {'style': 'text-align: center;'});
    				        data.setCell(3, 0, 'ask', null, {'style': 'text-align: center;'});
    				        data.setCell(3, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(3, 2, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(3, 3, 3, null, {'style': 'text-align: center;'});
    				        data.setCell(3, 4, '00:01:34', null, {'style': 'text-align: center;'});
    				        data.setCell(4, 0, 'bing', null, {'style': 'text-align: center;'});
    				        data.setCell(4, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(4, 2, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(4, 3, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(4, 4, '00:00:00', null, {'style': 'text-align: center;'});
    				        data.setCell(5, 0, 'conduit', null, {'style': 'text-align: center;'});
    				        data.setCell(5, 1, 'organic', null, {'style': 'text-align: center;'});
    				        data.setCell(5, 2, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(5, 3, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(5, 4, '00:00:00', null, {'style': 'text-align: center;'});
    				        data.setCell(6, 0, 'google', null, {'style': 'text-align: center;'});
    				        data.setCell(6, 1, 'cpc', null, {'style': 'text-align: center;'});
    				        data.setCell(6, 2, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(6, 3, 1, null, {'style': 'text-align: center;'});
    				        data.setCell(6, 4, '00:00:00', null, {'style': 'text-align: center;'});
    
    				        this.data = data;
    				        return data;
    					}
    				},
    				tableReffering:
    				{
    					data: null,
    					init: function()
    					{
    						var data = new google.visualization.DataTable();
    						data.addColumn('string', 'Source');
    				        data.addColumn('number', 'Pg.Views');
    				        data.addColumn('string', 'avg.time');
    				        data.addColumn('string', 'Exits');
    				        
    						data.addRows(6);
    						data.setCell(0, 0, 'google.ro');
    						data.setCell(0, 1, 14, null, {'style': 'text-align: center;'});
    						data.setCell(0, 2, '00:05:51', null, {'style': 'text-align: center;'});
    						data.setCell(0, 3, '3', null, {'style': 'text-align: center;'});
    						data.setCell(1, 0, 'search.sweetim.com');
    						data.setCell(1, 1, 5, null, {'style': 'text-align: center;'});
    						data.setCell(1, 2, '00:03:29', null, {'style': 'text-align: center;'});
    						data.setCell(1, 3, '1', null, {'style': 'text-align: center;'});
    						data.setCell(2, 0, 'start.funmoods.com');
    						data.setCell(2, 1, 5, null, {'style': 'text-align: center;'});
    						data.setCell(2, 2, '00:01:02', null, {'style': 'text-align: center;'});
    						data.setCell(2, 3, '1', null, {'style': 'text-align: center;'});
    						data.setCell(3, 0, 'google.md');
    						data.setCell(3, 1, 2, null, {'style': 'text-align: center;'});
    						data.setCell(3, 2, '00:03:56', null, {'style': 'text-align: center;'});
    						data.setCell(3, 3, '1', null, {'style': 'text-align: center;'});
    						data.setCell(4, 0, 'searchmobileonline.com');
    						data.setCell(4, 1, 2, null, {'style': 'text-align: center;'});
    						data.setCell(4, 2, '00:02:21', null, {'style': 'text-align: center;'});
    						data.setCell(4, 3, '1', null, {'style': 'text-align: center;'});
    						data.setCell(5, 0, 'google.com');
    						data.setCell(5, 1, 1, null, {'style': 'text-align: center;'});
    						data.setCell(5, 2, '00:00:00', null, {'style': 'text-align: center;'});
    						data.setCell(5, 3, '1', null, {'style': 'text-align: center;'});
    						
    						this.data = data;
    						return data;
    					}
    				}
    			},
    			
    			// chart
    			chart: 
    			{
    				tableSources: null,
    				tableReffering: null
    			},
    			
    			// options
    			options: 
    			{
    				tableSources: 
    				{
    					page: 'enable',
    					pageSize: 6,
    					allowHtml: true,
    					cssClassNames: {
    						headerRow: 'tableHeaderRow',
    						tableRow: 'tableRow',
    						selectedTableRow: 'selectedTableRow',
    						hoverTableRow: 'hoverTableRow'
    					},
    					width: '100%',
    					alternatingRowStyle: false,
    					pagingSymbols: { prev: '<span class="btn btn-inverse">prev</btn>', next: '<span class="btn btn-inverse">next</span>' }
    				},
    				
    				tableReffering:
    				{
    					page: 'enable',
    					pageSize: 6,
    					allowHtml: true,
    					cssClassNames: {
    						headerRow: 'tableHeaderRow',
    						tableRow: 'tableRow',
    						selectedTableRow: 'selectedTableRow',
    						hoverTableRow: 'hoverTableRow'
    					},
    					width: '100%',
    					alternatingRowStyle: false,
    					pagingSymbols: { prev: '<span class="btn btn-inverse">prev</btn>', next: '<span class="btn btn-inverse">next</span>' }
    				}
    			},
    			
    			// initialize
    			init: function()
    			{
    				// data
    				charts.traffic_sources_dataTables.data.tableSources.init();
    				charts.traffic_sources_dataTables.data.tableReffering.init();
    				
    				// charts
    				charts.traffic_sources_dataTables.drawTableSources();
    				charts.traffic_sources_dataTables.drawTableReffering();
    			},
    
    			// draw Traffic Sources Table
    			drawTableSources: function()
    			{
    				this.chart.tableSources = new google.visualization.Table(document.getElementById('dataTableSources'));
    				this.chart.tableSources.draw(this.data.tableSources.data, this.options.tableSources);
    			},
    
    			// draw Refferals Table
    			drawTableReffering: function()
    			{
    				this.chart.tableReffering = new google.visualization.Table(document.getElementById('dataTableReffering'));
    				this.chart.tableReffering.draw(this.data.tableReffering.data, this.options.tableReffering);
    			}
    		}
    							};
    
    	$(function()
    	{
    		// initialize charts
    		charts.init();
    	});
    	</script>
    	
    	
    	<!-- Resize Script -->
    	<script src="theme/scripts/jquery.ba-resize.js"></script>
    	
    	<!-- Uniform -->
    	<script src="theme/scripts/pixelmatrix-uniform/jquery.uniform.min.js"></script>
    	
    	<!-- Bootstrap Script -->
    	<script src="bootstrap/js/bootstrap.min.js"></script>
    	
    	<!-- Bootstrap Extended -->
    	<script src="bootstrap/extend/bootstrap-select/bootstrap-select.js"></script>
    	<script src="bootstrap/extend/bootstrap-toggle-buttons/static/js/jquery.toggle.buttons.js"></script>
    	<script src="bootstrap/extend/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js"></script>
    	<script src="bootstrap/extend/jasny-bootstrap/js/jasny-bootstrap.min.js" type="text/javascript"></script>
    	<script src="bootstrap/extend/jasny-bootstrap/js/bootstrap-fileupload.js" type="text/javascript"></script>
    	<script src="bootstrap/extend/bootbox.js" type="text/javascript"></script>
    	<script src="bootstrap/extend/bootstrap-wysihtml5/js/wysihtml5-0.3.0_rc2.min.js" type="text/javascript"></script>
    	<script src="bootstrap/extend/bootstrap-wysihtml5/js/bootstrap-wysihtml5-0.0.2.js" type="text/javascript"></script>
    	
    	<!-- Custom Onload Script -->
    	<script src="theme/scripts/load.js"></script>
    	
    	<script>
    	//Load the Visualization API and the piechart package.
    	google.load('visualization', '1.0', {'packages':['table', 'corechart']});
    	
    	// Set a callback to run when the Google Visualization API is loaded.
    	google.setOnLoadCallback(charts.traffic_sources_dataTables.init);
    	</script>
    
    </body>
    </html>

  15. #90
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Looks like you just wish to count if status is empty or at a default setting of 0.
    PHP Code:
    <?php
    $sql 
    "SELECT COUNT(*) as cnt
    FROM `submitted_forms` 
    WHERE status IS NULL or status = '0'"
    ;
    $result $db->query($sql); 
    $row $result->fetch_assoc();
    print_r($row['cnt']);
    ?>

  16. #91
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    Looks like you just wish to count if status is empty or at a default setting of 0.
    PHP Code:
    <?php
    $sql 
    "SELECT COUNT(*) as cnt
    FROM `submitted_forms` 
    WHERE status IS NULL or status = '0'"
    ;
    $result $db->query($sql); 
    $row $result->fetch_assoc();
    print_r($row['cnt']);
    ?>
    Well, I want to display a number. So like count how many rows have nothing in the status field. If they don't have anything, then display the number as 0. If they have something then count how many rows don't have it and display it. That didn't work. So, it displays a number, but when a new form is submitted and the field status has nothing in it, it keeps it at 0 instead of saying one. And whats the cnt for, not really sure what that is?

  17. #92
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    So it would be the opposite I'm assuming.
    PHP Code:
    <?php
    $sql 
    "SELECT COUNT(*) as cnt
    FROM `submitted_forms` 
    WHERE status IS NOT NULL or status != '0'"
    ;
    $result $db->query($sql); 
    $row $result->fetch_assoc();
    print_r($row['cnt']);
    ?>

  18. #93
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    So it would be the opposite I'm assuming.
    PHP Code:
    <?php
    $sql 
    "SELECT COUNT(*) as cnt
    FROM `submitted_forms` 
    WHERE status IS NOT NULL or status != '0'"
    ;
    $result $db->query($sql); 
    $row $result->fetch_assoc();
    print_r($row['cnt']);
    ?>
    I think thats wrong too, this is very weird and confusing. Its counting 3 with that, but the status row is filled out on only 2 so it should display one instead of 3. So i'm trying to count rows that aren't filled in, that way I know theres submissions I need to check and I can fill in the status. Thats just counting all the rows that are in there, I need it to just count the rows that don't have the status field filled in.

  19. #94
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    So like count how many rows have nothing in the status field.
    That's what the first example does.
    If they don't have anything, then display the number as 0.
    This would be more like the second example.
    If they have something then count how many rows don't have it and display it.
    This would be more like the first example.
    when a new form is submitted and the field status has nothing in it, it keeps it at 0 instead of saying one.
    Very confusing. Second example again.

  20. #95
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    That's what the first example does.

    This would be more like the second example.

    This would be more like the first example.

    Very confusing. Second example again.
    Ok, let me try to explain this again. The first example doesn't count if the fields empty for some reason, but the second one does if I remove the "!", but it doesn't count it right, it counts if the field is filled and if it is it displays it. The first example is what I want, but for some reason its not display right. Its displaying as 0 even though its supposed to count if its empty and they're two empty. If I add the "!" point, it counts all rows no matter what. This is very odd and cannot figure out the problem.

  21. #96
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    So you are using 0 as default. Is that correct?

    If so, then let's get rid of the NULL condition.

    Note:
    POPUP on this site (from footer) is blocking your post. very annoying.

  22. #97
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    So you are using 0 as default. Is that correct?

    If so, then let's get rid of the NULL condition.

    Note:
    POPUP on this site (from footer) is blocking your post. very annoying.
    No no no, default is not 0. The status field has NOTHING in it. I want to display the number zero if every status field is filled. So go back to NULL. I want it to count all the rows that don't have the status field filled in.

  23. #98
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    It's really the first example. If the status is empty, then it's going to say "1 record needs attention". But it will only be zero after all status fields have been set.

  24. #99
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    It's really the first example. If the status is empty, then it's going to say "1 record needs attention". But it will only be zero after all status fields have been set.
    Yes I know, but for some reason its not echoing if the status field is empty or not, thats the problem

  25. #100
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    773
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Hey sorry for the delay.
    As I understand it, the status might be marked as 0 but is marked so get rid of that condition.
    PHP Code:
    <?php
    $sql 
    "SELECT COUNT(*) as cnt
    FROM `submitted_forms` 
    WHERE status IS NULL"
    ;
    $result $db->query($sql); 
    $row $result->fetch_assoc();
    print_r($row['cnt']);
    ?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •