Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('../header.php');/*
- if ($user_level != "Admin") {
- echo '<meta http-equiv="refresh" content="0; url=../">';
- exit;
- }*/
- ?>
- <meta charset="utf-8" />
- <title>- SCT-Checker -</title>
- <meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
- <link rel="stylesheet" href="../css/bootstrap.css" type="text/css" />
- <link rel="stylesheet" href="../css/animate.css" type="text/css" />
- <link rel="stylesheet" href="../css/font-awesome.min.css" type="text/css" />
- <link rel="stylesheet" href="../../css/icon.css" type="text/css" />
- <link rel="stylesheet" href="../css/font.css" type="text/css" />
- <link rel="stylesheet" href="../css/app.css" type="text/css" />
- <link rel="stylesheet" href="../js/calendar/bootstrap_calendar.css" type="text/css" />
- <!--[if lt IE 9]>
- <script src="../../js/ie/html5shiv.js"></script>
- <script src="../../js/ie/respond.min.js"></script>
- <script src="../../js/ie/excanvas.js"></script>
- <![endif]-->
- </head>
- <section id="content">
- <section class="hbox stretch">
- <section>
- <section class="vbox">
- <section class="scrollable padder">
- <section class="row m-b-md">
- <div class="col-sm-6">
- </div>
- <div class="col-sm-6 text-right text-left-xs m-t-md">
- </div>
- </section>
- </div>
- </div>
- </div>
- </div>
- <section class="page-content">
- <div class="page-content-inner">
- <title><?=$checker->name;?> | Admin Panel</title>
- <div class="col-lg-5">
- <!--earning graph start-->
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Add Member
- </h3>
- </div>
- <div class="panel-body">
- <?php
- if (isset($_POST['add_member'])) {
- $nama = $_POST['name'];
- $email = $_POST['email'];
- $password = $_POST['password'];
- $type = $_POST['type'];
- $ip = $_SERVER['REMOTE_ADDR'];
- $balance = $_POST['balance'];
- if ($nama == '' || $email == '' || $password == '' || $type == '') {
- echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
- } else {
- $date = date("Y-m-d"); // d F Y - g:i:s
- mysql_query("insert into user (`name`,`email`,`password`,`order`,`level`,`ip`,`balance`) values ('$nama','$email','$password','$date','$type','$ip','$balance')");
- echo '<div class="alert alert-success">Successfully add Member</div>';
- }
- }
- ?>
- <form action="" method="POST">
- <input type="text" name="name" placeholder="Name" class="form-control"><br>
- <input type="email" name="email" placeholder="Email" class="form-control"><br>
- <input type="password" name="password" placeholder="Password" class="form-control"><br>
- <select class="form-control" name="type">
- <option value="0">Member</optio>
- <option value="1">Paid Member</option>
- <option value="2">Admin</option>
- <option value="3">Reseller</option>
- </select><br>
- <input type="number" name="balance" placeholder="Balance" class="form-control"><br>
- <button type="submit" name="add_member" class="btn btn-secondary">Add Member</button>
- </form>
- </div>
- </section>
- </div>
- <!-- Main row -->
- <div class="row">
- <div class="col-lg-5">
- <!--earning graph start-->
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Add News
- </h3>
- </div>
- <div class="panel-body">
- <?php
- if (isset($_POST['add_news'])) {
- $isi = strip_tags($_POST['isi_text']);
- if ($isi == '') {
- echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
- } else {
- $date = date("d F Y - g:i:s");
- mysql_query("insert into news (`message`,`date`) values ('$isi','$date')");
- echo '<div class="alert alert-success">Successfully add news!</div>';
- }
- }
- ?>
- <form action="" method="POST">
- <textarea name="isi_text" placeholder="Add your news at here" class="form-control" rows="4"></textarea><br>
- <button type="submit" name="add_news" class="btn btn-secondary">Add News</button>
- </form>
- </div>
- </section>
- </div>
- <div class="col-md-7">
- <!--earning graph start-->
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Latest News
- </h3>
- </div>
- <div class="panel-body">
- <?php
- $db = mysqli_connect("localhost", "root", "", "user");
- if (@$_GET['cmd'] == 'delete-news' && @$_GET['id'] != null) {
- $id = SafeSql($_GET['id']);
- $query_delete_news = mysqli_query($db, "select * from news where id='$id'");
- if (mysqli_num_rows($query_delete_news) == 0) {
- echo '<div class="alert alert-danger">ID is invalid/not found!</div>';
- } else {
- mysqli_query($db, "delete from news where id='$id'");
- echo '<div class="alert alert-success">Successfully deleted ID '.$id.'</div>';
- }
- }
- ?>
- <table class="table table-hover">
- <thead>
- <tr>
- <th>Message</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $query_news = mysql_query("select * from news order by id desc limit 0,5");
- if (mysql_num_rows($query_news) == 0) {
- echo "
- <tr>
- <td colspan='2'>No info news!</td>
- </tr>";
- } else {
- while($row = mysql_fetch_assoc($query_news)) {
- echo "
- <tr>
- <td>".$row['message']."</td>
- <td><a href='?cmd=delete-news&id=".$row['id']."'>Delete</a></td>
- </tr>";
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- </section>
- </div>
- </div>
- <div class="row">
- <div class="col-md-6">
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Top Up Balance
- </h3>
- </div>
- <div class="panel-body table-responsive">
- <?php
- if (isset($_POST['topup'])) {
- $target = $_POST['email'];
- $balance = str_replace("$","",$_POST['balance']);
- $amount = $_POST['amount'];
- if ($target == '' || $balance == '' || checkAngka($balance) == false || $amount == '' || checkAngka($amount) == false) {
- echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
- } else if ($balance <= 0 || $amount < 0) {
- echo '<div class="alert alert-danger">Error! Unable to Top Up.</div>';
- } else if (CheckUser($target) == false) {
- echo '<div class="alert alert-danger">User Not Found!</div>';
- } else {
- $order_id = RandomKata(14);
- $date = date("d/m/y");
- mysql_query("insert into orders values ('$order_id','$target','pulsa','Buy $$balance Balance with Pulsa','$amount','$date')");
- mysql_query("update user set balance=balance+'$balance', `order`=`order`+1 where email='$target'") or die(mysql_error());
- echo '<div class="alert alert-success">Successfully topup '.$balance.' to '.$target.'!</div>';
- }
- }
- ?>
- <form action="" method="POST">
- <input type="text" name="email" placeholder="email@domain.com" class="form-control"><br>
- <input type="number" name="balance" placeholder="Total Balance" class="form-control"><br>
- <input type="number" name="amount" placeholder="Amount" class="form-control"><br>
- <button type="submit" name="topup" class="btn btn-secondary">Top Up</button>
- </form>
- </div>
- </section>
- </div><!--end col-6 -->
- <div class="col-md-6">
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Banned/UnBanned User
- </h3>
- </div>
- <div class="panel-body table-responsive">
- <?php
- if (isset($_POST['bann'])) {
- $target = $_POST['email'];
- $type = $_POST['type'];
- if ($target == '') {
- echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
- } else if (CheckUser($target) == false) {
- echo '<div class="alert alert-danger">User Not Found!</div>';
- } else {
- if ($type == 1) {
- mysql_query("update user set banned=1 where email='$target'");
- } else {
- mysql_query("update user set banned=0 where email='$target'");
- }
- $type = ($type == 1) ? "Banned" : "UnBanned";
- echo '<div class="alert alert-success">Successfully '.$type.' '.$target.'</div>';
- }
- }
- ?>
- <form action="" method="POST">
- <input type="text" name="email" placeholder="email@domain.com" class="form-control"><br>
- <select class="form-control" name="type">
- <option value="0">UnBanned</optio>
- <option value="1">Banned</option>
- </select><br>
- <button type="submit" name="bann" class="btn btn-secondary">Submit</button>
- </form>
- </div>
- </section>
- </div><!--end col-6 -->
- </div>
- <div class="row">
- <div class="col-md-6">
- <!--earning graph start-->
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Upgrade Level User
- </h3>
- </div>
- <div class="panel-body">
- <?php
- if (isset($_POST['update'])) {
- $target = $_POST['email'];
- $type = $_POST['type'];
- if ($target == '') {
- echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
- } else if (CheckUser($target) == false) {
- echo '<div class="alert alert-danger">User Not Found!</div>';
- } else {
- if ($type == 1) {
- mysql_query("update user set level=1 where email='$target'");
- echo '<div class="alert alert-success">Successfully update to Paid Member</div>';
- } else if ($type == 2) {
- mysql_query("update user set level=2 where email='$target'");
- echo '<div class="alert alert-success">Successfully update to Admin</div>';
- } else if ($type == 3) {
- mysql_query("update user set level=3 where email='$target'");
- echo '<div class="alert alert-success">Successfully update to Reseller</div>';
- } else {
- mysql_query("update user set level=0 where email='$target'");
- echo '<div class="alert alert-success">Successfully update to Member</div>';
- }
- }
- }
- ?>
- <form action="" method="POST">
- <input type="text" name="email" placeholder="email@domain.com" class="form-control"><br>
- <select class="form-control" name="type">
- <option value="0">Member</optio>
- <option value="1">Paid Member</option>
- <option value="2">Admin</option>
- <option value="3">Reseller</option>
- </select><br>
- <button type="submit" name="update" class="btn btn-secondary">Update</button>
- </form>
- </div>
- </section>
- </div>
- <div class="col-md-6">
- <!--earning graph start-->
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Create Gift Codes
- </h3>
- </div>
- <div class="panel-body">
- <b>* You can create gift code at here</b><br><br>
- <?php
- if (isset($_POST['create_code'])) {
- global $email;
- $code .= 'SCT-'.RandomKata(4).'-'.RandomKata(4).'-'.RandomKata(8);
- $balance = rand(1,10);
- $date = date("d/m/y g:i a");
- mysql_query("insert into giftcode values ('$code','$email','$balance','1','0','$date')");
- mysql_query("update user set balance=balance-$balance where email='$email'");
- echo '<div class="alert alert-success">Successfully! Your Code: '.$code.'</div>';
- }
- ?>
- <form action="" method="POST">
- <button type="submit" name="create_code" class="btn btn-secondary">Create!</button>
- </form>
- </div>
- </section>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <!--earning graph start-->
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Gift Codes
- <span class="pull-right"><a href="?cmd=delete-die" style="color:white"><button type="submit" name="deletet" class="btn btn-secondary">Delete GiftCode Die</botton></a><span>
- </h3>
- </div>
- <div class="panel-body">
- <?php
- $db = mysqli_connect("localhost", "root", "", "user");
- if (@$_GET['cmd'] == 'delete-die') {
- $query = mysqli_query($db, "select * from giftcode where author='$email'");
- if (mysqli_num_rows($query) == 0) {
- echo '<div class="alert alert-danger">No Gift Code!</div>';
- } else {
- mysqli_query($db, "delete from giftcode where registered=0");
- echo '<div class="alert alert-success">Successfully delete Gift Code die!</div>';
- }
- }
- ?>
- <?php
- if (@$_GET['cmd'] == 'delete-gc' && @$_GET['code'] != null) {
- $gc = SafeSql($_GET['code']);
- if (checkGC($gc) == false) {
- echo '<div class="alert alert-danger">Code is invalid/not found!</div>';
- } else {
- mysql_query("delete from giftcode where code='$gc'");
- echo '<div class="alert alert-success">Successfully deleted '.$gc.'</div>';
- }
- }
- ?>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>#</th>
- <th>Code</th>
- <th>Used By</th>
- <th>Date</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $db = mysqli_connect("localhost", "root", "", "user");
- $query_gc = mysql_query("select * from giftcode where author='$email'");
- if (mysql_num_rows($query_gc) == 0) {
- echo "
- <tr>
- <td colspan='5'>No Gift Code Found.</td>
- </tr>";
- } else {
- $no = 1;
- while($row = mysql_fetch_assoc($query_gc)) {
- if ($row['registered'] == 0) {
- $code = '<strike>'.$row['code'].'</strike';
- echo "
- <tr>
- <td>".$no."</td>
- <td>".$code."</td>
- <td>".$row['used_by']."</td>
- <td>".$row['date']."</td>
- <td><a href='?cmd=delete-gc&code=".$row['code']."'>Delete</a></td>
- </tr>";
- } else if ($row['registered'] == 1){
- echo "
- <tr>
- <td>".$no."</td>
- <td>".$row['code']."</td>
- <td>N/A</td>
- <td>".$row['date']."</td>
- <td><a href='?cmd=delete-gc&code=".$row['code']."'>Delete</a></td>
- </tr>";
- }
- $no++;
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- </section>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <!--earning graph start-->
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- Latest Order History (Total Order: <?=TotalOrder();?>)
- </h3>
- </div>
- <div class="panel-body">
- <table class="table table-hover">
- <thead>
- <tr>
- <th>#</th>
- <th>Order ID</th>
- <th>Email</th>
- <th>Type</th>
- <th>Description</th>
- <th>Amount</th>
- <th>Date</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $query_order = mysql_query("select * from orders order by date desc limit 0,5");
- if (mysql_num_rows($query_order) == 0) {
- echo "
- <tr>
- <td colspan='6'>No Order Found.</td>
- </tr>";
- } else {
- $no = 1;
- while($row = mysql_fetch_assoc($query_order)) {
- echo "
- <tr>
- <td>".$no."</td>
- <td>".$row['order_id']."</td>
- <td>".$row['author']."</td>
- <td>".strtoupper($row['type'])."</td>
- <td>".$row['description']."</td>
- <td>".$row['amount']."</td>
- <td>".$row['date']."</td>
- </tr>";
- $no++;
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- </section>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <!--earning graph start-->
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- All Reseller (Total User: <?=TotalReseller();?>)
- </h3>
- </div>
- <div class="panel-body">
- <table class="table table-hover">
- <thead>
- <tr>
- <th>#</th>
- <th>Email</th>
- <th>Level</th>
- <th>Status</th>
- <th>Balance</th>
- <th>Order</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $query_user = mysql_query("select * from user where level=3");
- if (mysql_num_rows($query_user) == 0) {
- echo "
- <tr>
- <td colspan='6'>No Reseller Found.</td>
- </tr>";
- } else {
- $no = 1;
- while($row = mysql_fetch_assoc($query_user)) {
- switch($row['banned']) {
- case 1: $banned = '<b style="color:red">BANNED</b>'; break;
- default: $banned = '<b style="color:green">NORMAL</b>'; break;
- }
- $level = TypeUser($row['level']);
- echo "
- <tr>
- <td>".$no."</td>
- <td>".$row['email']."</td>
- <td>".$level."</td>
- <td>".$banned."</td>
- <td>".$row['balance']."¢</td>
- <td>".$row['order']."</td>
- </tr>";
- $no++;
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- </section>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <section class="panel panel-with-borders">
- <div class="panel-heading">
- <h3>
- All User (Total User: <?=TotalUser();?>)
- </h3>
- </div>
- <div class="panel-body table-responsive">
- <?php
- $db = mysqli_connect("localhost", "root", "", "user");
- if (@$_GET['cmd'] == 'delete-user' && @$_GET['name'] != null) {
- $name = SafeSql($_GET['name']);
- $query_delete_news = mysqli_query($db, "select * from user where name='$name'");
- if (mysqli_num_rows($query_delete_news) == 0) {
- echo '<div class="alert alert-danger">User is invalid/not found!</div>';
- } else {
- mysqli_query($db, "delete from user where name='$name'");
- echo '<div class="alert alert-success">Successfully deleted User '.$name.'</div>';
- }
- }
- ?>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>#</th>
- <th>Email</th>
- <th>Psswrd</th>
- <th>Level</th>
- <th>Status</th>
- <th>Balance</th>
- <th>Order</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $query_user = mysql_query("select * from user");
- if (mysql_num_rows($query_user) == 0) {
- echo "
- <tr>
- <td colspan='6'>No User Found.</td>
- </tr>";
- } else {
- $no = 1;
- while($row = mysql_fetch_assoc($query_user)) {
- switch($row['banned']) {
- case 1: $banned = '<b style="color:red">BANNED</b>'; break;
- default: $banned = '<b style="color:green">NORMAL</b>'; break;
- }
- $level = TypeUser($row['level']);
- echo "
- <tr>
- <td>".$no."</td>
- <td>".$row['email']."</td>
- <td>".$row['password']."</td>
- <td>".$level."</td>
- <td>".$banned."</td>
- <td>".$row['balance']."¢</td>
- <td>".$row['order']."</td>
- <td><a href='?cmd=delete-user&name=".$row['name']."'>Delete</a></td>
- </tr>";
- $no++;
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- </section>
- </div><!--end col-6 -->
- </div>
- <!-- row end -->
- </section><!-- /.content -->
- </section>
- <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a>
- </section>
- </section>
- </section>
- </section>
- <script src="../js/jquery.min.js"></script>
- <!-- Bootstrap -->
- <script src="../js/bootstrap.js"></script>
- <!-- App -->
- <script src="../js/app.js"></script>
- <script src="../js/slimscroll/jquery.slimscroll.min.js"></script>
- <script src="../js/charts/easypiechart/jquery.easy-pie-chart.js"></script>
- <script src="../js/charts/sparkline/jquery.sparkline.min.js"></script>
- <script src="../js/charts/flot/jquery.flot.min.js"></script>
- <script src="../js/charts/flot/jquery.flot.tooltip.min.js"></script>
- <script src="../js/charts/flot/jquery.flot.spline.js"></script>
- <script src="../js/charts/flot/jquery.flot.pie.min.js"></script>
- <script src="../js/charts/flot/jquery.flot.resize.js"></script>
- <script src="../js/charts/flot/jquery.flot.grow.js"></script>
- <script src="../js/charts/flot/demo.js"></script>
- <script src="../js/calendar/bootstrap_calendar.js"></script>
- <script src="../js/calendar/demo.js"></script>
- <script src="../js/sortable/jquery.sortable.js"></script>
- <script src="../js/app.plugin.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement