Your IP : 18.118.126.51
<?php
session_start();
include("lib/connect.inc.php");
include("lib/index.php");
$uid = $covis->Uid();
readMessage(1);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="treant/examples/tree/basic-example2.css">
<!-- Neptune CSS -->
<link rel="stylesheet" href="css/core.css">
<title>Admin Message</title>
<link rel="shortcut icon" href="img/fav.png" />
<link rel="stylesheet" href="treant/Treant.css">
<link rel="stylesheet" href="treant/examples/tree/basic-example2.css">
<!-- Neptune CSS -->
<link rel="stylesheet" href="css/core.css">
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Vendor CSS -->
<link rel="stylesheet" href="../vendor/bootstrap4/css/bootstrap.min.css">
<link rel="stylesheet" href="../vendor/themify-icons/themify-icons.css">
<link rel="stylesheet" href="../vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../vendor/animate.css/animate.min.css">
<link rel="stylesheet" href="../vendor/jscrollpane/jquery.jscrollpane.css">
<link rel="stylesheet" href="../vendor/waves/waves.min.css">
<link rel="stylesheet" href="../vendor/switchery/dist/switchery.min.css">
<link rel="stylesheet" href="../vendor/morris/morris.css">
<link rel="stylesheet" href="../vendor/jvectormap/jquery-jvectormap-2.0.3.css">
<!-- Font Awesome -->
<?php include('head.php'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">
<?php include('nav.php'); ?>
<!-- Content Header (Page header) -->
<!-- Content Header (Page header) -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Admin Messages</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item active">Admin messages</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Content Header (Page header) -->
<div class="content-area py-1">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="card ">
<div class="card-header text-white bg-dark">
<h5>Messages</h5>
</div>
<!-- <div class="content-area py-1">
<div class="container-fluid"> -->
<div class="box bg-white messenger">
<div class="row no-gutter">
<div class="col-xs-4">
<div class="m-contacts">
<div class="m-title">Contacts</div>
<br/>
<div class="form-group">
<form class="mf-search" method="post">
<div class="col-xs-10">
<input class="form-control" type="text" name="username" placeholder="Search User...">
</div>
<div class="col-xs-2" style="margin-left: -30px;">
<button class="btn btn-secondary btn-rounded" name="SearchUserMessage" type="submit">
<i class="ti-search"></i></button>
</div>
</form>
</div>
<br/><br/>
<?php
$sql11 = $db->query("SELECT * FROM msg WHERE receiverid='0' ORDER BY ctime DESC");
$count = $sql11->num_rows;
$row11 = $sql11->fetch_assoc();
?>
<div class="mc-item">
<a class="text-black" href="?ugh=0">
<div class="media">
<div class="media-left">
<div class="avatar box-48">
</div>
</div>
<div class="media-body">
<div class="clearfix">
<h6 class="media-heading float-xs-left">
Everyone<span class="tag tag-danger"><?php echo $count ?></span>
</h6>
</div>
<span class="text-muted"><?php echo substr($row11['msg'],0,20) ?>...</span>
</div>
</div>
</a>
</div>
<?php $sql = $db->query("SELECT *, COUNT(*) AS count FROM msg WHERE receiverid='1' GROUP BY senderid ORDER BY ctime DESC");
while($row = $sql->fetch_assoc()){
?>
<div class='table-responsive'>
<div class="mc-item">
<a class="text-black" href="?ugh=<?php echo $row['senderid'] ?>">
<div class="media">
<div class="media-left">
<div class="avatar box-48">
<img class="b-a-radius-circle" src="images/<?php echo userName($row['senderid'],'photo') ?>" alt="">
<span class="status bg-success top right"></span>
</div>
</div>
<div class="media-body">
<div class="clearfix">
<h6 class="media-heading float-xs-left">
<?php echo userName($row['senderid'],'user') ?><span class="tag tag-danger"><?php echo $row['count'] ?></span>
</h6>
<span class="font-90 text-muted float-xs-right"><?php echo date("jS M, Y H:i A",strtotime($row['created'])) ?></span>
</div>
<span class="text-muted"><?php //echo substr($row['msg'],0,20) ?>...</span>
</div>
</div>
</a>
</div>
</div>
<?php } ?>
</div>
</div>
<?php if(isset($_GET['ugh'])){
$idd = $_GET['ugh'];
if($_GET['ugh'] == '0' ){
$sql1 = $db->query("SELECT * FROM msg WHERE receiverid='0' ORDER BY sn DESC LIMIT 1");
} else{
$sql1 = $db->query("SELECT * FROM msg WHERE senderid='$idd' ORDER BY sn DESC LIMIT 1");}
$row1 = $sql1->fetch_assoc();
$time = $row1['ctime'];
?>
<div class="col-xs-8">
<div class="m-chat">
<div class="m-header">
<div class="media">
<div class="media-body">
<h6 class="media-heading mb-0"><?php echo userName($idd,'user') ?></h6>
<span class="font-90 text-muted">Last Message
<?php if($sql1->num_rows < 1){echo ' ';}else {echo get_time_ago($time);} ?></span>
</div>
<div class="media-right">
<div class="mh-links">
<a class="text-grey" href="#"><i class="fa fa-phone"></i></a>
<a class="text-grey" href="#"><i class="fa fa-video-camera"></i></a>
</div>
</div>
</div>
</div>
<?php
$sql2 = $db->query("SELECT * FROM msg WHERE senderid='$idd' OR receiverid='$idd' ORDER BY ctime DESC LIMIT 20");
while($row2 = $sql2->fetch_assoc()){
if($row2['senderid'] == $idd){ ?>
<div class="mc-item left clearfix" style="margin-top: -10px">
<div class="avatar box-48">
<img class="b-a-radius-circle" src="images/<?php echo userName($row2['senderid'],'photo') ?>" alt="">
</div>
<div class="mc-content">
<?php echo $row2['msg'] ?>
<div class="font-90 text-xs-right text-muted"><?php echo date("Y-m-d H:i",$row2['ctime']) ?></div>
</div>
</div>
<?php }elseif($row2['senderid']==1) { ?>
<div class="mc-item right clearfix" style="margin-top: -10px">
<div class="avatar box-48">
<img class="b-a-radius-circle" src="images/<?php echo userName($row2['senderid'],'photo') ?>" alt="">
</div>
<div class="mc-content">
<?php echo $row2['msg'] ?>
<div class="font-90 text-xs-right text-muted"><?php echo date("Y-m-d H:i",$row2['ctime']) ?></div>
</div>
</div>
<?php } } ?>
</div>
</div>
<div class="m-form">
<div class="row">
<div class="col-md-8 offset-md-2">
<form class="mf-compose" method="post">
<input type="hidden" name="id" value="<?php echo $idd ?>"/>
<input class="form-control" type="text" name="message" placeholder="Type a message..." required>
<button type="submit" name="MessageAdminSubmit" class="btn btn-success btn-rounded">Send</button>
</form>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<!-- /.card-body -->
<!-- /.card -->
<!-- right col -->
</div>
<!-- /.row (main row) -->
</div><!-- /.container-fluid -->
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php include('foot.php'); ?>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- jQuery -->
<script src="../plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="../plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
$.widget.bridge('uibutton', $.ui.button)
</script>
<!-- Bootstrap 4 -->
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- ChartJS -->
<script src="../plugins/chart.js/Chart.min.js"></script>
<!-- Sparkline -->
<script src="../plugins/sparklines/sparkline.js"></script>
<!-- JQVMap -->
<script src="../plugins/jqvmap/jquery.vmap.min.js"></script>
<script src="../plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
<!-- jQuery Knob Chart -->
<script src="../plugins/jquery-knob/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="../plugins/moment/moment.min.js"></script>
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Summernote -->
<script src="../plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<script src="../plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="../dist/js/adminlte.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="../dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script>
<!-- DataTables -->
<script src="../plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="../plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script type="text/javascript" src="../vendor/chartist/chartist.min.js"></script>
<!-- Vendor JS -->
<script type="text/javascript" src="../vendor/jquery/jquery-1.12.3.min.js"></script>
<script type="text/javascript" src="../vendor/tether/js/tether.min.js"></script>
<script type="text/javascript" src="../vendor/bootstrap4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../vendor/detectmobilebrowser/detectmobilebrowser.js"></script>
<script type="text/javascript" src="../vendor/jscrollpane/jquery.mousewheel.js"></script>
<script type="text/javascript" src="../vendor/jscrollpane/mwheelIntent.js"></script>
<script type="text/javascript" src="../vendor/jscrollpane/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="../vendor/jquery-fullscreen-plugin/jquery.fullscreen-min.js"></script>
<script type="text/javascript" src="../vendor/waves/waves.min.js"></script>
<script type="text/javascript" src="../vendor/switchery/dist/switchery.min.js"></script>
<script type="text/javascript" src="../vendor/flot/jquery.flot.min.js"></script>
<script type="text/javascript" src="../vendor/flot/jquery.flot.resize.min.js"></script>
<script type="text/javascript" src="../vendor/flot.tooltip/js/jquery.flot.tooltip.min.js"></script>
<script type="text/javascript" src="../vendor/CurvedLines/curvedLines.js"></script>
<script type="text/javascript" src="../vendor/TinyColor/tinycolor.js"></script>
<script type="text/javascript" src="../vendor/sparkline/jquery.sparkline.min.js"></script>
<script type="text/javascript" src="../vendor/raphael/raphael.min.js"></script>
<script type="text/javascript" src="../vendor/morris/morris.min.js"></script>
<script type="text/javascript" src="../vendor/jvectormap/jquery-jvectormap-2.0.3.min.js"></script>
<script type="text/javascript" src="../vendor/jvectormap/jquery-jvectormap-world-mill.js"></script>
<script type="text/javascript" src="../vendor/peity/jquery.peity.js"></script>
<script type="text/javascript" src="../vendor/chartist/chartist.min.js"></script>
<!-- Neptune JS -->
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/demo.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<!-- page script -->
<script type="text/javascript">
<?php
// if($covis->globeStage($uidy)==1 ){
if($stages==1 ){
echo $covis->covisTreeGlobe($uid);
}else{
echo $covis->covisTree4Globe($uid);
}
?>
</script>
<script src="treant/vendor/raphael.js"></script>
<script src="treant/Treant.js"></script>
<script>
new Treant( chart_config );
</script>
</body>
</html>