ok
Direktori : /home/ngwcolle/public_html/admin/ |
Current File : /home/ngwcolle/public_html/admin/queryplus.php |
<?php session_start(); //DB conncetion include_once('includes/config.php'); //validating Session if (strlen($_SESSION['aid']==0)) { header('location:logout.php'); } else{ ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title> QPlus-Admin</title> <!-- Custom fonts for this template--> <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin-2.min.css" rel="stylesheet"> <style type="text/css"> label{ font-size:16px; font-weight:bold; color:#000; } </style> </head> <body id="page-top"> <!-- Page Wrapper --> <div id="wrapper"> <?php include_once('includes/sidebar.php');?> <!-- Content Wrapper --> <div id="content-wrapper" class="d-flex flex-column"> <!-- Main Content --> <div id="content"> <!-- Topbar --> <?php include_once('includes/topbar.php');?> <!-- End of Topbar --> <!-- Begin Page Content --> <div class="container-fluid"> <!-- Page Heading --> <h1 class="h3 mb-4 text-gray-800">QPlus Admin</h1> <form method="post" name="adminprofile" > <div class="row"> <div class="col-lg-12 col-sm-12 col-md-12"> <!-- Basic Card Example --> <div class="card shadow mb-4"> <div class="card-body"> <!-- form starts --> <div class="container py-2"> <div class="row"> <div class="col-md-12 mx-auto"> <div class="form-group row"> <div class="col-sm-6"> <label for="inputFirstname">Enter Password</label> <input type="password" class="form-control" id="inputFirstname" name="pname" placeholder="Enter Password"> </div> </div> <button type="button" class="btn btn-info px-4" id="show">Edit/Update</button> <button type="button" class="btn btn-secondary px-4" id="select">Select</button> <a href="queryplus.php" class="btn btn-danger px-4" >Reload</a> </div> </div> <!--query area!--> <div class="row pt-3" style="display:none" id="qplus"> <div class="col-md-12 mx-auto"> <div class="form-group row"> <div class="col-sm-12"> <label for="inputFirstname2">SQL Statements</label> <textarea class="form-control" id="inputFirstname2" name="pname" placeholder="Enter SQL Statements"></textarea> </div> </div> <button type="submit" class="btn btn-success px-4 float-right" name="submit">Execute</button> </div> <!--end qplus!--> </div> <!--query area!--> <div class="row pt-3" style="display:none" id="selqplus"> <div class="col-md-12 mx-auto"> <div class="form-group row"> <div class="col-sm-12"> <label for="inputFirstname1">SQL Select Statements</label> <textarea class="form-control" id="inputFirstname1" name="selname" placeholder="Enter Select SQL Statements"></textarea> </div> </div> <button type="submit" class="btn btn-success px-4 float-right" name="selsubmit">View Data</button> </div> <!--end qplus!--> </div> <!-- form ends --> <?php if(isset($_POST['selsubmit'])) { $sql=$_POST['selname']; echo "statementis:"; $query=mysqli_query($con, $sql); if ($query) { $emparray = array(); while($row =mysqli_fetch_assoc($query)) { $emparray[] = $row; } $json_pretty =json_encode($emparray, JSON_PRETTY_PRINT); echo "<pre>" . $json_pretty . "<pre/>"; mysqli_close($con); // echo '<script>alert("Post Created Successfully.")</script>'; // echo "<script>window.location.href ='manage-posts.php'</script>"; }else{ //echo '<script>alert("Something Went Wrong. Please try again.")</script>'; } } if(isset($_POST['submit'])) { $sql=$_POST['pname']; $query=mysqli_query($con, $sql); if ($query) { // $emparray = array(); // while($row =mysqli_fetch_assoc($query)) // { // $emparray[] = $row; // } // echo json_encode($emparray); echo '<script>alert("Date Upadted Successfully.")</script>'; mysqli_close($con); // // echo "<script>window.location.href ='manage-posts.php'</script>"; }else{ echo '<script>alert("Something Went Wrong. Please try again.")</script>'; } } ?> </div> </div> </div> </div> </form> </div> <!-- /.container-fluid --> </div> <!-- End of Main Content --> <?php include_once('includes/footer.php');?> </div> <!-- End of Content Wrapper --> </div> <!-- End of Page Wrapper --> <!-- Scroll to Top Button--> <?php include_once('includes/footer2.php');?> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin-2.min.js"></script> <script type="text/javascript"> $(document).ready(function () { // $("#selqplus").hide(); $('#select').click(function () { if(document.getElementById("inputFirstname").value == "123") { $('#selqplus').show(); $('#qplus').hide(); } else{ alert("Not a valid password"); $('#selqplus').hide(); } }); }); </script> <script type="text/javascript"> $(document).ready(function () { $("#qplus").hide(); $('#show').click(function () { checkHidden(); }); }); </script> <script> function checkHidden() { if(document.getElementById("inputFirstname").value == "123") { $('#qplus').show(); $('#selqplus').hide(); } else{ alert("Not a valid password"); $('#qplus').hide(); } } </script> <script> function refreshPage(){ alert("aa"); // window.location.href = "dashboard.php"; } </script> </body> </html> <?php } ?>