BLACKSITE
:
18.222.161.187
:
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/auto.php
<?php include "auth.php"; ?> <?php include '../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="assets/js/Lightweight-Chart/cssCharts.css"> <link rel="shortcut icon" href="../images/favicon.png"> <script> function validateForm() { var x = document.forms["myForm"]["name"].value; if (x == "") { alert("Name must be filled out"); return false; } var x = document.forms["myForm"]["address"].value; if (x == "") { alert("Address must be filled out"); return false; } var x = document.forms["myForm"]["file"].value; if (x == "") { alert("please select a file or photo"); return false; } } </script> </head> <body> <div id="wrapper"> <nav class="navbar navbar-default top-navbar" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" 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"></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> </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"> <center> <img src="../images/logo.png"width="140px"height="60px"> </center> <div class="row"> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="dashboard.php">Dashboard</a> </li> <li class="breadcrumb-item active"> <a href="Serviceus.php">Services</a> </li> <!-- <li class="breadcrumb-item active"> <a href="hordinng.php">Hordings</a> </li> <li class="breadcrumb-item active"> <a href="bus.php">Bus-Que-Shelter</a> </li> <li class="breadcrumb-item active"> <a href="trafficbooth.php">Traffic-Booth</a> </li> <li class="breadcrumb-item active"> <a href="pool.php">Pool-kiosk</a> </li> <li class="breadcrumb-item active"> <a href="socialmedia.php">Social-Media</a> </li> <li class="breadcrumb-item active"> <a href="ledscreen.php">Led-Screen</a> </li> <li class="breadcrumb-item active"> <a href="Serviceus.php">Van-Activation</a> </li> <li class="breadcrumb-item active"> <a href="auto.php">Auto-Add</a> </li> --> </ol> <h3 align="center"><font color="#30cc7b"><!-- <div class="card-action"> --> AUTO-ADD <!-- </div> --></font></h3> </div> <h5 align="left"><font color="#30cc7b"><strong> <?php echo "Today Date : " . date("Y/m/d") . "<br>";?></font></strong></h5> <div class="card-content"> <div class="row"> <div class="input-field col s4"> <form name="myForm" action=" " onsubmit="return validateForm()" method="post" enctype="multipart/form-data"> <input id="" type="text" class="validate"name="name" placeholder="Name"> <label for=""><font size="2px"></font></label> </div> <div class="input-field col s4"> <textarea id="address" name="address" class="form-control" placeholder="Address"></textarea> <label for=""><font size="2px"></font></label> </div> <div class="input-field col s4"> <input type="file" name="file" id="file" class="form-control"> <!-- <label for=""><font size="2px">Email</font></label> --> </div> </div> <center> <input type="submit"name="submit"value="submit" class="btn btn-sm btn-primary"> </center> </form> </div> </div> <?php if(isset($_POST['submit'])){ $file = $_FILES['file']['name']; $temp_name = $_FILES['file']['tmp_name']; if(isset($file)){ if(!empty($file)){ $location = '../upload/'; if(move_uploaded_file($temp_name, $location.$file)){ echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('File Uploaded Successfully!!!') window.location.href='auto.php'; </SCRIPT>"); } } } else { echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('you should select a file to upload!!!') window.location.href='auto.php'; </SCRIPT>"); } } ?> <?php if(isset($_POST['submit'])) { $name = mysqli_real_escape_string($conn,$_POST['name']); $file = mysqli_real_escape_string($conn,$_FILES['file']['name']); $address = mysqli_real_escape_string($conn,$_POST['address']); $sql = "INSERT INTO `autoad`(`name`,`file`,`address`,`date`) VALUES ('$name','$file','$address',now())"; $result=mysqli_query($conn,$sql); if($result) { echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('thank you for contact us we will revert you soon!!!') window.location.href='auto.php'; </SCRIPT>"); } else { echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('Please Try Again') window.location.href='auto.php'; </SCRIPT>"); } } ?> <div class="container-fluid"> <div class="card"> <div class="card-header"> hfdkjghsfjkd <div class="card-body"> <table class="table table-striped table-bordered table-hover"> <thead class="thead-dark"> <tr> <th class="text-center">ID</th> <th class="text-center">FILE</th> <th class="text-center">NAME</th> <th class="text-center">ADDRESS</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 `autoad`"); $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 `autoad` LIMIT $offset, $total_records_per_page"); while($row = mysqli_fetch_array($result)){ echo "<tr> <td class='text-center'>".$row['id']."</td> <td class='text-center'><a href='../upload/".$row['file']."'><img src='pdf.jpg' width='30' height='20'></a></td> <td class='text-center'>".$row['name']."</td> <td class='text-center'>".$row['address']."</td> <td class='text-center'><a href='delete9.php?id=".$row['id']."'><button class='btn btn-sm btn-danger'>Delete</button></a> </td> </tr>"; } 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> <?php include 'footer.php';?> </div> </body> </html>