Server IP : 162.214.80.37 / Your IP : 216.73.216.83 Web Server : Apache System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : imyrqtmy ( 2189) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/imyrqtmy/public_html/localapp/vendor/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); // require "inc/config.php"; // error_reporting(E_ERROR | E_PARSE); error_reporting(E_ERROR | E_PARSE); $se = $_SESSION["id"]; if (!isset($_SESSION['id'])) { // header("Location: login.php"); } include("inc/config.php"); ?> <!DOCTYPE html> <html lang="en"> <?php require "inc/head.php"; ?> <body> <!-- header--> <?php require "inc/header.php"; ?> <!-- Header End --> <!-- End header--> <!-- Main-content Top bar--> <!-- <div class="redial-relative mt-80"> <div class="container-fluid"> <div class="row"> <div class="col-12 col-md-2 align-self-center my-3 my-lg-0"> <h6 class="text-uppercase redial-font-weight-700 redial-light mb-0 pl-2">Dashboard</h6> </div> <div class="col-12 col-md-4 align-self-center"> <div class="float-sm-left float-none mb-4 mb-sm-0"> <ol class="breadcrumb mb-0 bg-transparent redial-light"> <li class="breadcrumb-item"><a href="#" class="redial-light">Home</a></li> <li class="breadcrumb-item active">User Profile </li> </ol> </div> </div> <div class="col-12 col-md-6"> <div class="clearfix d-none d-md-inline"> <div class="float-sm-right float-none"> <ul class="list-inline mb-0"> <li class="list-inline-item h4 mb-0 redial-brd-right py-3 px-3 mr-0"><a href="#" class="redial-dark"><span class="lnr lnr-move"></span></a></li> <li class="list-inline-item h4 mb-0 redial-brd-right py-3 px-3 mr-0"><a href="#" class="redial-dark"><span class="lnr lnr-sync"></span></a></li> <li class="list-inline-item px-3 mr-0"><small class="font-weight-bold">Language : </small></li> <li class="list-inline-item mr-0 bg-transparent"> <select class="form-control"> <option>English</option> <option>French</option> <option>Russian</option> </select> </li> </ul> </div> </div> </div> </div> </div> </div> --> <!-- End Main-content Top bar--> <!-- main-content--> <div class="wrapper"> <?php require "inc/sidebar.php"; ?> <div id="content"> <?php if (isset($_SESSION['id'])) { // User is logged in, fetch user information $se = $_SESSION['id']; $query = "SELECT * FROM `vendor` WHERE id='$se'"; $query_run = mysqli_query($conn, $query); if ($query_run && mysqli_num_rows($query_run) > 0) { $row = mysqli_fetch_assoc($query_run); ?> <div class="row"> <div class="col-sm-12"> <div class="redial-relative redial-grediant grediant-tb profile-header"> <div class="background-image-maker py-5"></div> <div class="holder-image"> <!-- <img src="dist/images/profile-cover.jpg" alt="" class="img-fluid d-none"> --> </div> <div class="redial-relative pl-md-3 pt-5"> <div class="media d-md-flex d-block"> <!-- <a href="#"><img src="dist/images/profile3.jpg" width="250" alt="" class="d-md-flex img-fluid rounded border redial-border-width-8 border-white redial-relative profile-avatar ml-md-0 ml-4 mb-md-0 mb-3" /></a> --> <div class="media-body align-self-end pt-4"> <div class="pl-4"> <h1 class="display-4 text-uppercase text-white mb-0 redial-font-weight-900"><?php echo $row['name'] ?></h1> <!-- <h6 class="text-uppercase text-white mb-0 redial-font-weight-700">Founder / CEO</h6> --> </div> <div class="profile-menu mt-4 bg-white border border-left-0 border-right-0 redial-border-light"> <div class="clearfix"> <div class="float-xl-left float-none"> <ul class="nav nav-pills flex-column flex-sm-row redial-font-weight-700" id="myTab" role="tablist"> <li class="nav-item ml-0"> <a class="nav-link redial-dark py-2 px-3 px-lg-4 redial-relative active" data-toggle="tab" href="#timeline" role="tab" aria-controls="timeline" aria-expanded="true"> Phone : <?php echo $row['phone'] ?></a> </li> <li class="nav-item ml-0"> <a class="nav-link redial-dark py-2 px-4 px-lg-4 redial-relative" data-toggle="tab" href="#about" role="tab" aria-controls="about"> Email: <?php echo $row['username'] ?></a> </li> <li class="nav-item ml-0"> <a class="nav-link redial-dark py-2 px-4 px-lg-4 redial-relative" data-toggle="tab" href="#activities" role="tab" aria-controls="activities"></a> </li> </ul> </div> </div> </div> </div> </div> </div> </div> </div> </div> <?php }} ?> <?php if (isset($_SESSION['id'])) { $se = $_SESSION['id']; $query = "SELECT * FROM `vendor` WHERE id='$se'"; $query_run = mysqli_query($conn, $query); if ($query_run && mysqli_num_rows($query_run) > 0) { $row = mysqli_fetch_assoc($query_run); $reporter_id = $row['id']; // Assuming this is the correct field // Fetch total news count $total_news_query = "SELECT COUNT(*) AS total FROM `news` WHERE reporter_id='$reporter_id'"; $total_news_result = mysqli_query($conn, $total_news_query); $total_news = mysqli_fetch_assoc($total_news_result)['total']; // Fetch approved news count $approved_news_query = "SELECT COUNT(*) AS approved FROM `news` WHERE reporter_id='$reporter_id' AND status='approved'"; $approved_news_result = mysqli_query($conn, $approved_news_query); $approved_news = mysqli_fetch_assoc($approved_news_result)['approved']; // Fetch pending news count $pending_news_query = "SELECT COUNT(*) AS pending FROM `news` WHERE reporter_id='$reporter_id' AND status='pending'"; $pending_news_result = mysqli_query($conn, $pending_news_query); $pending_news = mysqli_fetch_assoc($pending_news_result)['pending']; ?> <div class="row profile-bottom"> <div class="col-12 col-md-9 ml-auto mt-2"> <ul class="list-inline mb-0 float-xl-right float-none text-xl-center text-left mr-xl-3 mr-0"> <li class="list-inline-item redial-brd-right pr-sm-3 pr-0 mr-0 d-sm-inline-block d-block mb-3 mb-sm-0"> <a href="#" class="redial-light"> <p class="mb-0 text-uppercase redial-font-weight-700 counter_number"><?php echo $total_news; ?></p> Total News </a> </li> <li class="list-inline-item redial-brd-right px-sm-3 px-0 mr-0 d-sm-inline-block d-block mb-3 mb-sm-0"> <a href="#" class="redial-light"> <p class="mb-0 text-uppercase redial-font-weight-700 counter_number"><?php echo $approved_news; ?></p> Approved News </a> </li> <li class="list-inline-item pl-sm-3 pl-0 mr-0 d-sm-inline-block d-block mb-3 mb-sm-0"> <a href="#" class="redial-light"> <p class="mb-0 text-uppercase redial-font-weight-700 counter_number"><?php echo $pending_news; ?></p> Pending News </a> </li> </ul> </div> </div> <?php } } ?> <div class="row mt-4 mb-4"> <div class="col-xl-9"> <div class="tab-content" id="myTabContent"> <div class="tab-pane fade active show" id="timeline" role="tabpanel" aria-labelledby="timeline" aria-expanded="true"> <div class="card redial-border-light redial-shadow"> <div class="card-body"> <div class="row mt-4 portfolio-box"> <?php $se = $_SESSION["id"]; // Get the logged-in reporter's ID $query = "SELECT news.id, news.news_title, news.photo, news.state, news.status,news.district, news.created_at, vendor.name AS reporter_name, categories.cat_name FROM news LEFT JOIN vendor ON news.reporter_id = vendor.id LEFT JOIN categories ON news.category_id = categories.id WHERE news.reporter_id = '$se'"; // Filter news by session ID $query_run = mysqli_query($conn, $query); if (mysqli_num_rows($query_run) > 0) { foreach ($query_run as $row) { ?> <div class="col-md-6 post mb-4"> <div class="border redial-border-light redial-line-height-1_5"> <div class="card-body pb-0"> <h5><?php echo $row['news_title']; ?></h5> <div id="demo" class="collapse show"> <img src="<?php echo "news/" . $row['photo']; ?>"alt="" class="img-fluid"> <div class="clearfix my-2"> <div class="float-sm-left float-none"> <small><a href="#" class="redial-light redial-font-weight-700 mr-2"><i class="fa fa-user pr-1"></i><?php echo $row['reporter_name']; ?></a></small> <small><a href="#" class="redial-light redial-font-weight-700"><i class="fa fa-clock-o"></i><?php echo date("d F Y", strtotime($row['created_at'])); ?></a></small> <small><a href="#" class="redial-light redial-font-weight-700"><i class="fa fa-check pr-1"></i> <?php echo $row['status']; ?></a></small> </div> <div class="float-sm-right float-none"> <!-- <small><?php echo $row['short_description']; ?></small> --> </div> </div> </div> </div> </div> </div> <?php }} ?> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- End main-content--> <!-- Top To Bottom--> <a href="#" class="scrollup text-center redial-bg-primary redial-rounded-circle-50"> <h4 class="text-white mb-0"><i class="icofont icofont-long-arrow-up"></i></h4> </a> <!-- End Top To Bottom--> <!-- jQuery --> <script src="dist/js/plugins.min.js"></script> <script src="dist/js/common.js"></script> </body> </html>