View file iblog/admin/index.php

File size: 6.7Kb
<?php 
	include "../lib/functions_class.php"; 
	include "inc/check_session.php"; 
	
	function status($stat){
		if($stat == 1){
			$val = "<font color='green'>Approved</font>";
		}else{
			$val =  "<font color='red'>Pending</font>";
		}
		return $val;
	}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>iBlog | Dashboard</title>

	<!-- FAVICONS -->
    <link rel="shortcut icon" href="../uploads/favicon/<?php echo $DB->get_settingdata('favicon');?>" type="image/x-icon">
	
    <!-- Bootstrap -->
    <link href="plugins/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="plugins/iCheck/skins/flat/green.css" rel="stylesheet">
    <!-- bootstrap-progressbar -->
    <link href="plugins/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
    <!-- jVectorMap -->
    <link href="css/maps/jquery-jvectormap-2.0.3.css" rel="stylesheet"/>

    <!-- Custom Theme Style -->
    <link href="css/custom.css" rel="stylesheet">
  </head>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        
            <?php include "inc/header.php";?>


        <?php include "inc/top_nav.php";?>
		
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
           
            <div class="clearfix"></div>

            <div class="row">

              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="" style="height:600px;">

                  <div class="x_content">
                    <div class="row">
						
						<!---- Start Top Box ----->
                        <div class="col-md-4 col-sm-12 col-xs-12">
							<div class="servive-block servive-block-purple">
								<i class="icon-3x color-light fa fa-file-powerpoint-o"></i>
								<span class="heading-md total-value"><?php echo $DB->get_total(BLOG_PAGES);?> Pages</span>
								<p class="box-note">Total pages publish</p>  
							</div>
						</div>

                       <div class="col-md-4 col-sm-12 col-xs-12">
							<div class="servive-block servive-block-yellow">
								<i class="icon-3x color-light fa fa-th-list"></i>
								<span class="heading-md total-value"><?php echo $DB->get_total(BLOG_POST);?> Topics</span>
								<p class="box-note">Total blog topics publish</p>  
							</div>
						</div>

                        <div class="col-md-4 col-sm-12 col-xs-12">
							<div class="servive-block servive-block-blue">
								<i class="icon-3x color-light fa fa-commenting"></i>
								<span class="heading-md total-value"><?php echo $DB->get_total(BLOG_COMMENTS);?> 
								Comments</span>
								<p class="box-note">Total comments on blog post</p>  
							</div>
						</div>
						<!---- End Top Box ----->
					  
						<!---- Start Comments----->
						<div class="col-md-6 col-sm-6 col-xs-12">
						  <div class="x_panel">
							<div class="x_title">
							  <h2>Latest Comments</h2>
							  <ul class="nav navbar-right panel_toolbox">
								<li><a href="comments.php"><small>View All</small></a></li>
							  </ul>
							  <div class="clearfix"></div>
							</div>
							<div class="x_content">
							  <ul class="list-unstyled msg_list">
								<?php 
								$fetch = $DB->latest_comments();
								$count = count($fetch);
								if($count != 0){
								foreach($fetch as $rows){?>
								<li>
								  <a>
									<span class="image">
									  <img src="images/user.png" alt="img">
									</span>
									<span>
									  <span><?php echo $rows['name'];?> - (<?php echo status($rows['status']);?>)</span>
									  <span class="time"><?php echo date("h:i:s a",strtotime($rows['date']));?></span>
									</span>
									<span class="message">
									  <?php echo $rows['comments'];?>
									</span>
								  </a>
								</li>
								<?php } } else { ?>
								<li>
									<span>
									  <h2><span class="fa fa-exclamation-triangle"> No Comments</span></h2>
									</span>
								</li>
								<?php } ?>
							  </ul>
							</div>
						  </div>
						</div>
						<!---- End Comments----->
						
						<!---- Start Visitors ----->
						<div class="col-md-6 col-sm-6 col-xs-12">
						  <div class="x_panel">
							<div class="x_title">
							  <h2>Latest Visitors</h2>
							  <div class="clearfix"></div>
							</div>
							<div class="x_content">
							  <ul class="list-unstyled timeline">
							  <?php 
								$fetch = $DB->latest_visitors();
								$count = count($fetch);
								if($count != 0){
								foreach($fetch as $rows){
								$details = json_decode(file_get_contents("http://ip-api.com/json/".$rows['ip_adress']));
									?>
								<li>
								  <div class="block">
									<div class="tags">
									  <a href="" class="tag">
										<span><?php echo $rows['ip_adress'];?></span>
									  </a>
									</div>
									<div class="block_content">
									  <h2 class="title">
											<a><?php echo $details->country;?></a>
									  </h2>
									  <div class="byline">
										<span><?php echo date("d M Y",strtotime($rows['date']));?></span></a>
									  </div>
									  <p class="excerpt">State / Region: <?php echo $details->regionName;?></a>
									  <p class="excerpt">City: <?php echo $details->city;?></a>
									  <p class="excerpt">Time Zone: <?php echo $details->timezone;?></a>
									  <p class="excerpt">ISP: <?php echo $details->isp;?></a>
									  </p>
									</div>
								  </div>
								</li>
								<?php } } else { ?>
								<li>
									<span>
									  <h2><span class="fa fa-exclamation-triangle"> No Comments</span></h2>
									</span>
								</li>
								<?php } ?>
							  </ul>
							</div>
						  </div>
						</div>
						<!---- End Visitors ----->
					  
					  
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->

		<?php include "inc/footer.php";?>
		
      </div>
    </div>

    <!-- jQuery -->
    <script src="plugins/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="plugins/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="plugins/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="plugins/nprogress/nprogress.js"></script>
    
    <!-- Custom Theme Scripts -->
    <script src="js/custom.js"></script>
  </body>
</html>