BLACKSITE
:
18.191.222.5
:
103.154.184.216 / www.astitvaad.com
:
Linux vps.readyhost.in 4.18.0-553.6.1.el8.x86_64 #1 SMP Thu May 30 04:13:58 UTC 2024 x86_64
:
/
home
/
astitvaad
/
public_html
/
admin
/
Upload File:
files >> /home/astitvaad/public_html/admin/tv.php
<?php include "auth.php"; ?> <?php include_once '../connection.php'; ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>ASTITVAA</title> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link rel="stylesheet" href="assets/materialize/css/materialize.min.css" media="screen,projection" /> <link href="assets/css/bootstrap.css" rel="stylesheet" /> <link href="assets/css/font-awesome.css" rel="stylesheet" /> <link href="assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" /> <link href="assets/css/custom-styles.css" rel="stylesheet" /> <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="assets/js/Lightweight-Chart/cssCharts.css"> <link rel="shortcut icon" href="../images/favicon.png"> </head> <body> <div id="wrapper"> <nav class="navbar navbar-default top-navbar" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle waves-effect waves-dark" data-toggle="collapse" data-target=".sidebar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand waves-effect waves-dark" href="dashboard.php"><i class="large material-icons">insert_chart</i><img src="../images/logo.png"width="140px"height="60px"></a> <div id="sideNav" href=""><i class="material-icons dp48">toc</i></div> </div> <a href="logout.php" class="pull-right"><img src="exit.jpg" width="50" class="pull-right"> <a href="changepassword.php" class="pull-right"><img src="changepass.jpg" width="50" class="pull-right"> </nav> <?php include 'header.php';?> <div id="page-wrapper" > <div class="header"> </div> <div id="page-inner"> <div class="row"> <div class="col-lg-12"> <div class="card"> <img src="../images/logo.png"width="140px"height="60px"> <h3 align="center"><font color="#30cc7b"> <div class="card-action"> Tv Service View Page </div></font></h3> <h5 align="left"><font color="#30cc7b"><strong> <?php echo "Today Date : " . date("Y/m/d") . "<br>";?></font></strong></h5> <div class="card-content"> <form id="contact" method="post" action=""> <div class="row"> <div class="col-lg-4 col-xs-4 col-md-4"> <input type="text" name="name" id="name" class="form-control" placeholder="Name"> </div> <div class="col-lg-4 col-xs-4 col-md-4"> <input type="text" name="channel_genre" id="channel_genre" class="form-control" placeholder="channel_genre"> </div> <div class="col-lg-4 col-xs-4 col-md-4"> <input type="text" name="language" id="language" class="form-control" placeholder="language"> </div> </div> <div class="row"> <div class="col-lg-6 col-xs-6 col-md-6"> <input type="text" name="rate" id="rate" class="form-control" placeholder="rate"> </div> <div class="col-lg-6 col-xs-6 col-md-6"> <input type="text" name="viewers" id="viewers" class="form-control" placeholder="viewers"> </div> </div> <center> <button type="submit" name="submit" id="submit" class="btn btn-sm btn-primary">Submit</button> </center> </form> <p id="msg10"></p> </div> </div> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-lg-12"> <table class="table table-striped table-bordered table-hover"> <thead class="thead-dark"> <tr> <th class="text-center">Sno</th> <th class="text-center">NAME</th> <th class="text-center">CHANNEL GENRE</th> <th class="text-center">LANGUAGE</th> <th class="text-center">RATE</th> <th class="text-center">VIEWER</th> <th class="text-center">ACTION</th> </tr> </thead> <tbody> <?php if (isset($_GET['page_no']) && $_GET['page_no']!="") { $page_no = $_GET['page_no']; } else { $page_no = 1; } $total_records_per_page = 10; $offset = ($page_no-1) * $total_records_per_page; $previous_page = $page_no - 1; $next_page = $page_no + 1; $adjacents = "2"; $result_count = mysqli_query($conn,"SELECT COUNT(*) As total_records FROM `tv`"); $total_records = mysqli_fetch_array($result_count); $total_records = $total_records['total_records']; $total_no_of_pages = ceil($total_records / $total_records_per_page); $second_last = $total_no_of_pages - 1; // total page minus 1 $result = mysqli_query($conn,"SELECT * FROM `tv` ORDER BY id DESC LIMIT $offset, $total_records_per_page"); $sno= 1; while($row = mysqli_fetch_array($result)){ echo "<tr> <td class='text-center'>".$sno."</td> <td class='text-center'>".$row['name']."</td> <td class='text-center'>".$row['channel_genre']."</td> <td class='text-center'>".$row['language']."</td> <td class='text-center'>".$row['rate']."</td> <td class='text-center'>".$row['viewers']."</td> <td class='text-center'><a href='del_tv.php?id=".$row['id']."'><button class='btn btn-sm btn-danger'>Delete</button></a> <a href='edit_tv.php?id=".$row['id']."'><button class='btn btn-sm btn-warning'>Edit</button></a> </td> </tr>"; $sno++; } mysqli_close($conn); ?> </tbody> </table> <div style='padding: 10px 20px 0px; border-top: dotted 1px #CCC;'> <strong>Page <?php echo $page_no." of ".$total_no_of_pages; ?></strong> </div> <ul class="pagination"> <?php // if($page_no > 1){ echo "<li><a href='?page_no=1'>First Page</a></li>"; } ?> <li <?php if($page_no <= 1){ echo "class='disabled'"; } ?>> <a <?php if($page_no > 1){ echo "href='?page_no=$previous_page'"; } ?>>Previous</a> </li> <?php if ($total_no_of_pages <= 10){ for ($counter = 1; $counter <= $total_no_of_pages; $counter++){ if ($counter == $page_no) { echo "<li class='active'><a>$counter</a></li>"; }else{ echo "<li><a href='?page_no=$counter'>$counter</a></li>"; } } } elseif($total_no_of_pages > 10){ if($page_no <= 4) { for ($counter = 1; $counter < 8; $counter++){ if ($counter == $page_no) { echo "<li class='active'><a>$counter</a></li>"; }else{ echo "<li><a href='?page_no=$counter'>$counter</a></li>"; } } echo "<li><a>...</a></li>"; echo "<li><a href='?page_no=$second_last'>$second_last</a></li>"; echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>"; } elseif($page_no > 4 && $page_no < $total_no_of_pages - 4) { echo "<li><a href='?page_no=1'>1</a></li>"; echo "<li><a href='?page_no=2'>2</a></li>"; echo "<li><a>...</a></li>"; for ($counter = $page_no - $adjacents; $counter <= $page_no + $adjacents; $counter++) { if ($counter == $page_no) { echo "<li class='active'><a>$counter</a></li>"; }else{ echo "<li><a href='?page_no=$counter'>$counter</a></li>"; } } echo "<li><a>...</a></li>"; echo "<li><a href='?page_no=$second_last'>$second_last</a></li>"; echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>"; } else { echo "<li><a href='?page_no=1'>1</a></li>"; echo "<li><a href='?page_no=2'>2</a></li>"; echo "<li><a>...</a></li>"; for ($counter = $total_no_of_pages - 6; $counter <= $total_no_of_pages; $counter++) { if ($counter == $page_no) { echo "<li class='active'><a>$counter</a></li>"; }else{ echo "<li><a href='?page_no=$counter'>$counter</a></li>"; } } } } ?> <li <?php if($page_no >= $total_no_of_pages){ echo "class='disabled'"; } ?>> <a <?php if($page_no < $total_no_of_pages) { echo "href='?page_no=$next_page'"; } ?>>Next</a> </li> <?php if($page_no < $total_no_of_pages){ echo "<li><a href='?page_no=$total_no_of_pages'>Last ››</a></li>"; } ?> </ul> </div> </div> </div> </div> <?php include 'footer.php';?> </div> </div> </div> <?php include 'script.php';?> <script src="js/validate.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#contact").validate({ rules: { name: { required: true }, channel_genre: { required: true }, language: { required: true }, viewers: { required: true }, rate: { required: true } }, messages: { name: { required: "Please enter your name" }, channel_genre: { required: "Please enter channel" }, language: { required: "Please enter your language" }, viewers: { required: "Please enter viewers" }, rate: { required: "Please mention rate" } }, errorPlacement: function(label, element) { label.addClass('mt2 text-danger'); label.insertAfter(element); }, highlight: function(element, errorClass) { $(element).parent().addClass('has-danger') $(element).addClass('form-control-danger') }, submitHandler:function(){ $.ajax({ url:"ajax/tv.php", method:"POST", dataType: 'json', data: $("#contact").serialize(), success:function(data){ if (data.success=='ok') { $("#msg10").removeClass('text-danger').addClass('text-success').text('Successfully Added!!!').slideDown().delay(5000).slideUp(); $("#contact").trigger('reset'); } else{ $("#msg10").removeClass('text-success').addClass('text-danger').text('Some Error Occured, Try Again.').slideDown().delay(5000).slideUp(); } $('#datable_1').load(location.href+" #datable_1>*",""); }, error:function(){ alert('Fail to Insert'); } }) return false; } }); }) </script> </body> </html>