One Hat Cyber Team
Your IP :
216.73.216.240
Server IP :
162.240.106.28
Server :
Linux server.ganesand.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64
Server Software :
Apache
PHP Version :
7.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
thoa
/
public_html
/
admin
/
Edit File:
mg_available.php
<? error_reporting(0); session_start(); include 'config.php'; $_POST['username']=$_SESSION['username']; $_POST['password']=$_SESSION['password']; $sql=mysql_query("select * from admin where USERNAME='".$_POST['username']."' and PASSWORD='".$_POST['password']."'"); if(mysql_num_rows($sql)==1) { include('config.php'); $avai = mysql_query("select * from available"); $row = mysql_fetch_array($avai); /* $con = mysql_connect('localhost', 'root', ''); mysql_select_db("ecomm", $con); */ $A_ID = $_GET['A_ID']; $view = mysql_query("select * from available where A_ID = '".$A_ID."'"); // for editing $data = mysql_fetch_array($view); if($_GET['SAI']){ $STS = $_GET['A_STS']; if($STS == 0){ $upd_sts = mysql_query("UPDATE available SET A_STS ='0' WHERE A_ID ='".$_GET['SAI']."'"); //for changing status } else{ $upd_sts = mysql_query("UPDATE available SET A_STS ='1' WHERE A_ID ='".$_GET['SAI']."'"); } } if($_GET['del_id']){ ?> <?php $del = mysql_query("delete from available where A_ID='".$_GET['del_id']."'"); //for deleting status if($del){?> <script> alert("Register detail deleted sucessfully"); window.location= "mg_available.php"; </script> <?php } if(!$del){?> <script> alert("Register detail Not deleted sucessfully"); window.location= "mg_available.php"; </script> <?php } } if($_POST['submit']){ $apsel = mysql_real_escape_string($_POST['apsel']); $subcat = mysql_real_escape_string($_POST['subcat']); /* $clas = mysql_real_escape_string($_POST['clas']); */ $aseat = mysql_real_escape_string($_POST['aseat']); if($_GET['A_ID']==""){ $querytot=mysql_query("select * from available where A_SPACK ='".$subcat."' and A_PACK ='".$apsel."'"); if($rowtot=mysql_fetch_array($querytot)) { ?> <script type="text/javascript"> alert("Package already available"); location.href = 'mg_available.php';</script> <? } else{ $ins = mysql_query("insert into available (A_PACK,A_SPACK,A_SEAT) values ('$apsel','$subcat','$aseat')"); ?><script>alert("Inserted sucessfully"); </script><? } } if($_GET['A_ID']!=""){ { $upd = mysql_query("update available set A_PACK='$apsel',A_SPACK='$subcat',A_SEAT='$aseat' WHERE A_ID ='".$A_ID."'"); } if($upd){?> <script>alert("updated sucessfully"); window.location ="mg_available.php" </script> <?php } if(!$upd){?> <script>alert("Not updated sucessfully"); window.location ="mg_available.php" </script> <?php } } } ?> <script> function del(id){ var del = confirm("Are you sure Want to delete"); if(del){ window.location.href = "mg_available.php?del_id="+id+"&del=1"; } else{ window.location.href = "mg_available.php"; } } </script> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Admin Panel</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/datepicker3.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <link href="css/bootstrap-table.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <script src="js/respond.min.js"></script> <![endif]--> <script> function showUser(str) { $.ajax({ type: "GET", url: "getsub.php?q="+str, success: function(result){ $("#subcat").html(result); } }); } </script> </head> <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "textarea", themes: "modern", plugins: [ "advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste" ], toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" }); </script> <script> function getstate(cid){ $.ajax({ type: "GET", url: "../get_state.php?cid="+cid, success: function(result){ $("#state").html(result); } }); } function getcity(sid){ alert $.ajax({ type: "GET", url: "../get_city.php?sid="+sid, success: function(result){ $("#city").html(result); } }); } </script> <script> $(document).ready(function() { $("#pyes").hide(); $("#pno").hide(); $("#cno").hide(); $("#cyes").hide(); $("#scard").hide(); }); function extra(val){ if(val == 'yes'){ $("#pno").hide(); $("#pyes").show(); } else if(val == 'no'){ $("#pyes").hide(); $("#pno").show(); } } function cextra(val){ if(val == 'yes'){ $("#cno").hide(); $("#cyes").show(); } else if(val == 'no'){ $("#cyes").hide(); $("#cno").show(); } } function sextra(val){ if(val == 'tak'){ $("#scard").show(); } else if(val == 'ord'){ $("#scard").show(); } else if(val == 'not'){ $("#scard").hide(); } } </script> <body> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse"> <a href="#"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> </button> <a class="navbar-brand" href="#">Admin</a> <ul class="user-menu"> <li class="dropdown pull-right"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> User <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#"><span class="glyphicon glyphicon-user"></span> Profile</a></li> <li><a href="#"><span class="glyphicon glyphicon-cog"></span> Settings</a></li> <li><a href="logou.php"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li> </ul> </li> </ul> </div> </div><!-- /.container-fluid --> </nav> <div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar"> <form role="search"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> </form> <? include('header.php');?> </div><!--/.sidebar--> <div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main"> <div class="row"> <ol class="breadcrumb"> <li><a href="dash.php"><span class="glyphicon glyphicon-home"></span></a></li> <li class="active">Manage Available Seats</li> </ol> </div><!--/.row--> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">Add Available Details</h2> </div> </div><!--/.row--> <section class="content"> <div class="row"> <!-- left column --> <div class="col-xs-12"> <!-- general form elements --> <div class="box box-primary"> <!-- form start --> <div class="container"> <form role="form" method="post" action="" enctype="multipart/form-data"> <div class="form-group col-sm-11"> <label for="sel1">Select Package:</label> <? if($A_ID) {?> <select id="apsel" name="apsel" class="form-control" onchange="showUser(this.value)"> <?php $query1=mysql_query("select * from available where A_ID = '".$A_ID."'"); while($row1=mysql_fetch_array($query1)) {?> <option value="<?php echo $row1['A_PACK'];?>"><?php echo $row1['A_PACK'];?></option> <?php }?> </select> <?}else{?> <select class="form-control" id="apsel" name="apsel" onchange="showUser(this.value)"> <?php $query1=mysql_query("select * from package"); while($row1=mysql_fetch_array($query1)) {?> <option value="<?php echo $row1['P_NAME'];?>"><?php echo $row1['P_NAME'];?></option> <?php }?> </select> <? }?> </div> <div class="form-group col-sm-11"> <label for="sel1">Select Subpackage:</label> <? if($A_ID) {?> <select id="subcat" name="subcat" class="form-control"> <?php $query1=mysql_query("select * from available where A_ID = '".$A_ID."'"); while($row1=mysql_fetch_array($query1)) {?> <option value="<?php echo $row1['A_SPACK'];?>"><?php echo $row1['A_SPACK'];?></option> <?php }?> </select> <?}else{?> <select id="subcat" name="subcat" class="form-control"> <?php $query1=mysql_query("select * from subpackage"); while($row1=mysql_fetch_array($query1)) {?> <option value="<?php echo $row1['SP_NAME'];?>"><?php echo $row1['SP_NAME'];?></option> <?php }?> </select> <? }?> </div> <!-- <div class="form-group col-sm-11"> <label for="sel1">Select Class:</label> <? // if($A_ID && $data['A_CLS']!="") {?> <select id="clas" name="clas" class="form-control"> <?php // $queryc=mysql_query("select * from class where C_NAME='".$data['A_CLS']."'"); // while($rowc=mysql_fetch_array($queryc)) {?> <option value="<?php //echo $rowc['C_NAME'];?>"><?php //echo $rowc['C_NAME'];?></option> <?php// }?> </select> <?//}else{?> <select id="clas" name="clas" class="form-control"> <?php // $queryc=mysql_query("select * from class"); // while($rowc=mysql_fetch_array($queryc)) {?> <option value="<?php// echo $rowc['C_NAME'];?>"><?ph//p echo $rowc['C_NAME'];?></option> <?php //}?> </select> <? //}?> </div>--> <div class="form-group col-sm-11"> <label for="exampleInputEmail1">Avaiable Seats:</label> <input type="text" class="form-control" id="aseat" name="aseat" value="<?php echo $data['A_SEAT']; ?>"> </div> <!-- <div class="form-group col-sm-11"> <label for="sel1">No. of Seats Currently Avaiable</label> <button id="button12" type="button" class ="button-click"><blink><?//echo $row['A_NOS']?></blink></button> </div> <div class="checkbox col-sm-11"> <label><input type="checkbox" value="">I hereby accept to the Terms & Conditions.<a href="images/terms.pdf" target="_blank">click here</a></label> </div>--> <div class="box-footer col-sm-11"> <button type="submit" name="submit" value="submit" class="btn btn-primary">Submit</button> <button type="reset" class="btn btn-primary">Reset</button> </div> </form> </div> </div> </div> </div> </section> <hr> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="box box-primary"> <div class="container"> <div class="form-group col-sm-11"> <label for="exampleInputEmail1">Total Available Seats:</label> <?php $query2=mysql_query("select SUM(A_SEAT) AS T_SEAT from available"); while($row2=mysql_fetch_assoc($query2)) {?> <button id="button12" type="button" class ="button-click"><blink><?php echo $row2['T_SEAT']; ?></blink></button> <? } ?> </div> </div> </div> </div> </div> </section> <div class="row" style="position: absolute;width:100%;"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading">Available Data Table</div> <div class="panel-body bottom"> <table data-toggle="table" data-show-refresh="true" data-show-toggle="true" data-show-columns="true" data-search="true" data-select-item-name="toolbar1" data-pagination="true" data-sort-name="name" data-sort-order="desc"> <thead> <tr> <th data-field="state" data-checkbox="true" >Item ID</th> <th data-field="id" data-sortable="false">Item ID</th> <th data-field="sname" data-sortable="true">Package</th> <th data-field="clas" data-sortable="true">SubPakage</th> <th data-field="sstatus" data-sortable="true">Status</th> <th data-field="saction" data-sortable="true">Action</th> </tr> </thead> <tbody> <?php $table = mysql_query("select * from available"); $A_ID=1; while($row=mysql_fetch_array($table)) { ?> <tr> <td></td> <td><?php echo $A_ID;?></td> <td><?php echo $row['A_PACK'];?></td> <td><?php echo $row['A_SPACK'];?></td> <td><a href= "mg_available.php?A_ID=<?php echo $row['A_ID'];?>">Edit</a>/<a href="#" onclick="del(<?php echo $row['A_ID'];?>)">Delete</a></td> <td><?php if($row['A_STS']==1) {?> <a href = "mg_available.php?A_STS=0&SAI=<?php echo $row['A_ID'];?>">Active</a> <?php } else {?> <a href = "mg_available.php?A_STS=1&SAI=<?php echo $row['A_ID'];?>">InActive </a> <?php } ?></td> </tr> <?php $A_ID++; }?> </tbody> </table> </div> </div> </div> </div> </div> <!--/.main--> <script src="js/jquery-1.11.1.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/chart.min.js"></script> <script src="js/chart-data.js"></script> <script src="js/easypiechart.js"></script> <script src="js/easypiechart-data.js"></script> <script src="js/bootstrap-datepicker.js"></script> <script src="js/bootstrap-table.js"></script> <script> $(document).ready(function() { $('ul.subcat').hide(); $('li').click(function(event) { event.stopPropagation(); $('> ul', this).toggle(); }); }); </script> <script> $('.top').on('click', function() { $parent_box = $(this).closest('.box'); $parent_box.siblings().find('.bottom').hide(); $parent_box.find('.bottom').toggle(); }); </script> <style> .container .box { width:auto; max-width:900px; } .container .box .top { padding: 12px; background-color: blue; color: white; cursor: pointer; } .container .box .bottom { display: none; } </style> </body> </html> <? } else { $queryu=mysql_query("select * from admin where ID='1'"); $rowu=mysql_fetch_array($queryu); if($rowu) { $rowu['A_LOG']; $log = $rowu['A_LOG'] - 1; $upd_sts = mysql_query("UPDATE admin SET A_LOG ='$log' where ID='1'"); } header("Location: home.php"); } ?>
Simpan