Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.86 KB | None | 0 0
  1. <?php
  2. include('../header.php');/*
  3. if ($user_level != "Admin") {
  4. echo '<meta http-equiv="refresh" content="0; url=../">';
  5. exit;
  6. }*/
  7. ?>
  8. <meta charset="utf-8" />
  9. <title>- SCT-Checker -</title>
  10. <meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
  11. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  12. <link rel="stylesheet" href="../css/bootstrap.css" type="text/css" />
  13. <link rel="stylesheet" href="../css/animate.css" type="text/css" />
  14. <link rel="stylesheet" href="../css/font-awesome.min.css" type="text/css" />
  15. <link rel="stylesheet" href="../../css/icon.css" type="text/css" />
  16. <link rel="stylesheet" href="../css/font.css" type="text/css" />
  17. <link rel="stylesheet" href="../css/app.css" type="text/css" />
  18. <link rel="stylesheet" href="../js/calendar/bootstrap_calendar.css" type="text/css" />
  19. <!--[if lt IE 9]>
  20. <script src="../../js/ie/html5shiv.js"></script>
  21. <script src="../../js/ie/respond.min.js"></script>
  22. <script src="../../js/ie/excanvas.js"></script>
  23. <![endif]-->
  24. </head>
  25. <section id="content">
  26. <section class="hbox stretch">
  27. <section>
  28. <section class="vbox">
  29. <section class="scrollable padder">
  30. <section class="row m-b-md">
  31. <div class="col-sm-6">
  32.  
  33.  
  34. </div>
  35. <div class="col-sm-6 text-right text-left-xs m-t-md">
  36.  
  37.  
  38. </div>
  39. </section>
  40.  
  41.  
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46.  
  47. <section class="page-content">
  48. <div class="page-content-inner">
  49.  
  50. <title><?=$checker->name;?> | Admin Panel</title>
  51.  
  52.  
  53. <div class="col-lg-5">
  54. <!--earning graph start-->
  55. <section class="panel panel-with-borders">
  56. <div class="panel-heading">
  57. <h3>
  58. Add Member
  59. </h3>
  60. </div>
  61. <div class="panel-body">
  62. <?php
  63. if (isset($_POST['add_member'])) {
  64. $nama = $_POST['name'];
  65. $email = $_POST['email'];
  66. $password = $_POST['password'];
  67. $type = $_POST['type'];
  68. $ip = $_SERVER['REMOTE_ADDR'];
  69. $balance = $_POST['balance'];
  70. if ($nama == '' || $email == '' || $password == '' || $type == '') {
  71. echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
  72. } else {
  73. $date = date("Y-m-d"); // d F Y - g:i:s
  74. mysql_query("insert into user (`name`,`email`,`password`,`order`,`level`,`ip`,`balance`) values ('$nama','$email','$password','$date','$type','$ip','$balance')");
  75. echo '<div class="alert alert-success">Successfully add Member</div>';
  76. }
  77. }
  78. ?>
  79. <form action="" method="POST">
  80. <input type="text" name="name" placeholder="Name" class="form-control"><br>
  81. <input type="email" name="email" placeholder="Email" class="form-control"><br>
  82. <input type="password" name="password" placeholder="Password" class="form-control"><br>
  83. <select class="form-control" name="type">
  84. <option value="0">Member</optio>
  85. <option value="1">Paid Member</option>
  86. <option value="2">Admin</option>
  87. <option value="3">Reseller</option>
  88. </select><br>
  89. <input type="number" name="balance" placeholder="Balance" class="form-control"><br>
  90. <button type="submit" name="add_member" class="btn btn-secondary">Add Member</button>
  91. </form>
  92. </div>
  93. </section>
  94. </div>
  95.  
  96.  
  97. <!-- Main row -->
  98. <div class="row">
  99. <div class="col-lg-5">
  100. <!--earning graph start-->
  101. <section class="panel panel-with-borders">
  102. <div class="panel-heading">
  103. <h3>
  104. Add News
  105. </h3>
  106. </div>
  107. <div class="panel-body">
  108. <?php
  109. if (isset($_POST['add_news'])) {
  110. $isi = strip_tags($_POST['isi_text']);
  111. if ($isi == '') {
  112. echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
  113. } else {
  114. $date = date("d F Y - g:i:s");
  115. mysql_query("insert into news (`message`,`date`) values ('$isi','$date')");
  116. echo '<div class="alert alert-success">Successfully add news!</div>';
  117. }
  118. }
  119. ?>
  120. <form action="" method="POST">
  121. <textarea name="isi_text" placeholder="Add your news at here" class="form-control" rows="4"></textarea><br>
  122. <button type="submit" name="add_news" class="btn btn-secondary">Add News</button>
  123. </form>
  124. </div>
  125. </section>
  126. </div>
  127. <div class="col-md-7">
  128. <!--earning graph start-->
  129. <section class="panel panel-with-borders">
  130. <div class="panel-heading">
  131. <h3>
  132. Latest News
  133. </h3>
  134. </div>
  135. <div class="panel-body">
  136. <?php
  137. $db = mysqli_connect("localhost", "root", "", "user");
  138. if (@$_GET['cmd'] == 'delete-news' && @$_GET['id'] != null) {
  139. $id = SafeSql($_GET['id']);
  140. $query_delete_news = mysqli_query($db, "select * from news where id='$id'");
  141. if (mysqli_num_rows($query_delete_news) == 0) {
  142. echo '<div class="alert alert-danger">ID is invalid/not found!</div>';
  143. } else {
  144. mysqli_query($db, "delete from news where id='$id'");
  145. echo '<div class="alert alert-success">Successfully deleted ID '.$id.'</div>';
  146. }
  147. }
  148. ?>
  149. <table class="table table-hover">
  150. <thead>
  151. <tr>
  152. <th>Message</th>
  153. <th>Action</th>
  154. </tr>
  155. </thead>
  156. <tbody>
  157. <?php
  158. $query_news = mysql_query("select * from news order by id desc limit 0,5");
  159. if (mysql_num_rows($query_news) == 0) {
  160. echo "
  161. <tr>
  162. <td colspan='2'>No info news!</td>
  163. </tr>";
  164.  
  165. } else {
  166. while($row = mysql_fetch_assoc($query_news)) {
  167. echo "
  168. <tr>
  169. <td>".$row['message']."</td>
  170. <td><a href='?cmd=delete-news&id=".$row['id']."'>Delete</a></td>
  171. </tr>";
  172.  
  173. }
  174. }
  175. ?>
  176. </tbody>
  177. </table>
  178. </div>
  179. </section>
  180. </div>
  181. </div>
  182.  
  183. <div class="row">
  184. <div class="col-md-6">
  185. <section class="panel panel-with-borders">
  186. <div class="panel-heading">
  187. <h3>
  188. Top Up Balance
  189. </h3>
  190. </div>
  191. <div class="panel-body table-responsive">
  192. <?php
  193. if (isset($_POST['topup'])) {
  194. $target = $_POST['email'];
  195. $balance = str_replace("$","",$_POST['balance']);
  196. $amount = $_POST['amount'];
  197. if ($target == '' || $balance == '' || checkAngka($balance) == false || $amount == '' || checkAngka($amount) == false) {
  198. echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
  199. } else if ($balance <= 0 || $amount < 0) {
  200. echo '<div class="alert alert-danger">Error! Unable to Top Up.</div>';
  201. } else if (CheckUser($target) == false) {
  202. echo '<div class="alert alert-danger">User Not Found!</div>';
  203. } else {
  204. $order_id = RandomKata(14);
  205. $date = date("d/m/y");
  206. mysql_query("insert into orders values ('$order_id','$target','pulsa','Buy $$balance Balance with Pulsa','$amount','$date')");
  207. mysql_query("update user set balance=balance+'$balance', `order`=`order`+1 where email='$target'") or die(mysql_error());
  208. echo '<div class="alert alert-success">Successfully topup '.$balance.' to '.$target.'!</div>';
  209. }
  210. }
  211. ?>
  212. <form action="" method="POST">
  213. <input type="text" name="email" placeholder="email@domain.com" class="form-control"><br>
  214. <input type="number" name="balance" placeholder="Total Balance" class="form-control"><br>
  215. <input type="number" name="amount" placeholder="Amount" class="form-control"><br>
  216. <button type="submit" name="topup" class="btn btn-secondary">Top Up</button>
  217. </form>
  218. </div>
  219. </section>
  220. </div><!--end col-6 -->
  221.  
  222. <div class="col-md-6">
  223. <section class="panel panel-with-borders">
  224. <div class="panel-heading">
  225. <h3>
  226. Banned/UnBanned User
  227. </h3>
  228. </div>
  229. <div class="panel-body table-responsive">
  230. <?php
  231. if (isset($_POST['bann'])) {
  232. $target = $_POST['email'];
  233. $type = $_POST['type'];
  234. if ($target == '') {
  235. echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
  236. } else if (CheckUser($target) == false) {
  237. echo '<div class="alert alert-danger">User Not Found!</div>';
  238. } else {
  239. if ($type == 1) {
  240. mysql_query("update user set banned=1 where email='$target'");
  241. } else {
  242. mysql_query("update user set banned=0 where email='$target'");
  243. }
  244. $type = ($type == 1) ? "Banned" : "UnBanned";
  245. echo '<div class="alert alert-success">Successfully '.$type.' '.$target.'</div>';
  246. }
  247. }
  248. ?>
  249. <form action="" method="POST">
  250. <input type="text" name="email" placeholder="email@domain.com" class="form-control"><br>
  251. <select class="form-control" name="type">
  252. <option value="0">UnBanned</optio>
  253. <option value="1">Banned</option>
  254. </select><br>
  255. <button type="submit" name="bann" class="btn btn-secondary">Submit</button>
  256. </form>
  257. </div>
  258. </section>
  259. </div><!--end col-6 -->
  260. </div>
  261.  
  262. <div class="row">
  263. <div class="col-md-6">
  264. <!--earning graph start-->
  265. <section class="panel panel-with-borders">
  266. <div class="panel-heading">
  267. <h3>
  268. Upgrade Level User
  269. </h3>
  270. </div>
  271. <div class="panel-body">
  272. <?php
  273. if (isset($_POST['update'])) {
  274. $target = $_POST['email'];
  275. $type = $_POST['type'];
  276. if ($target == '') {
  277. echo '<div class="alert alert-danger">Please fill out the form correctly.</div>';
  278. } else if (CheckUser($target) == false) {
  279. echo '<div class="alert alert-danger">User Not Found!</div>';
  280. } else {
  281. if ($type == 1) {
  282. mysql_query("update user set level=1 where email='$target'");
  283. echo '<div class="alert alert-success">Successfully update to Paid Member</div>';
  284. } else if ($type == 2) {
  285. mysql_query("update user set level=2 where email='$target'");
  286. echo '<div class="alert alert-success">Successfully update to Admin</div>';
  287. } else if ($type == 3) {
  288. mysql_query("update user set level=3 where email='$target'");
  289. echo '<div class="alert alert-success">Successfully update to Reseller</div>';
  290. } else {
  291. mysql_query("update user set level=0 where email='$target'");
  292. echo '<div class="alert alert-success">Successfully update to Member</div>';
  293. }
  294. }
  295. }
  296. ?>
  297. <form action="" method="POST">
  298. <input type="text" name="email" placeholder="email@domain.com" class="form-control"><br>
  299. <select class="form-control" name="type">
  300. <option value="0">Member</optio>
  301. <option value="1">Paid Member</option>
  302. <option value="2">Admin</option>
  303. <option value="3">Reseller</option>
  304. </select><br>
  305. <button type="submit" name="update" class="btn btn-secondary">Update</button>
  306. </form>
  307. </div>
  308. </section>
  309. </div>
  310. <div class="col-md-6">
  311. <!--earning graph start-->
  312. <section class="panel panel-with-borders">
  313. <div class="panel-heading">
  314. <h3>
  315. Create Gift Codes
  316. </h3>
  317. </div>
  318. <div class="panel-body">
  319. <b>* You can create gift code at here</b><br><br>
  320. <?php
  321. if (isset($_POST['create_code'])) {
  322. global $email;
  323. $code .= 'SCT-'.RandomKata(4).'-'.RandomKata(4).'-'.RandomKata(8);
  324. $balance = rand(1,10);
  325. $date = date("d/m/y g:i a");
  326. mysql_query("insert into giftcode values ('$code','$email','$balance','1','0','$date')");
  327. mysql_query("update user set balance=balance-$balance where email='$email'");
  328. echo '<div class="alert alert-success">Successfully! Your Code: '.$code.'</div>';
  329. }
  330. ?>
  331. <form action="" method="POST">
  332. <button type="submit" name="create_code" class="btn btn-secondary">Create!</button>
  333. </form>
  334. </div>
  335. </section>
  336. </div>
  337. </div>
  338.  
  339. <div class="row">
  340. <div class="col-md-12">
  341. <!--earning graph start-->
  342. <section class="panel panel-with-borders">
  343. <div class="panel-heading">
  344. <h3>
  345. Gift Codes
  346. <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>
  347. </h3>
  348. </div>
  349. <div class="panel-body">
  350. <?php
  351. $db = mysqli_connect("localhost", "root", "", "user");
  352. if (@$_GET['cmd'] == 'delete-die') {
  353. $query = mysqli_query($db, "select * from giftcode where author='$email'");
  354. if (mysqli_num_rows($query) == 0) {
  355. echo '<div class="alert alert-danger">No Gift Code!</div>';
  356. } else {
  357. mysqli_query($db, "delete from giftcode where registered=0");
  358. echo '<div class="alert alert-success">Successfully delete Gift Code die!</div>';
  359. }
  360. }
  361. ?>
  362. <?php
  363. if (@$_GET['cmd'] == 'delete-gc' && @$_GET['code'] != null) {
  364. $gc = SafeSql($_GET['code']);
  365. if (checkGC($gc) == false) {
  366. echo '<div class="alert alert-danger">Code is invalid/not found!</div>';
  367. } else {
  368. mysql_query("delete from giftcode where code='$gc'");
  369. echo '<div class="alert alert-success">Successfully deleted '.$gc.'</div>';
  370. }
  371. }
  372. ?>
  373. <table class="table table-striped">
  374. <thead>
  375. <tr>
  376. <th>#</th>
  377. <th>Code</th>
  378. <th>Used By</th>
  379. <th>Date</th>
  380. <th>Action</th>
  381. </tr>
  382. </thead>
  383. <tbody>
  384. <?php
  385. $db = mysqli_connect("localhost", "root", "", "user");
  386. $query_gc = mysql_query("select * from giftcode where author='$email'");
  387. if (mysql_num_rows($query_gc) == 0) {
  388. echo "
  389. <tr>
  390. <td colspan='5'>No Gift Code Found.</td>
  391. </tr>";
  392.  
  393. } else {
  394. $no = 1;
  395. while($row = mysql_fetch_assoc($query_gc)) {
  396. if ($row['registered'] == 0) {
  397. $code = '<strike>'.$row['code'].'</strike';
  398. echo "
  399. <tr>
  400. <td>".$no."</td>
  401. <td>".$code."</td>
  402. <td>".$row['used_by']."</td>
  403. <td>".$row['date']."</td>
  404. <td><a href='?cmd=delete-gc&code=".$row['code']."'>Delete</a></td>
  405. </tr>";
  406.  
  407. } else if ($row['registered'] == 1){
  408. echo "
  409. <tr>
  410. <td>".$no."</td>
  411. <td>".$row['code']."</td>
  412. <td>N/A</td>
  413. <td>".$row['date']."</td>
  414. <td><a href='?cmd=delete-gc&code=".$row['code']."'>Delete</a></td>
  415. </tr>";
  416.  
  417. }
  418. $no++;
  419. }
  420. }
  421. ?>
  422. </tbody>
  423. </table>
  424. </div>
  425. </section>
  426. </div>
  427. </div>
  428.  
  429. <div class="row">
  430. <div class="col-md-12">
  431. <!--earning graph start-->
  432. <section class="panel panel-with-borders">
  433. <div class="panel-heading">
  434. <h3>
  435. Latest Order History (Total Order: <?=TotalOrder();?>)
  436. </h3>
  437. </div>
  438. <div class="panel-body">
  439. <table class="table table-hover">
  440. <thead>
  441. <tr>
  442. <th>#</th>
  443. <th>Order ID</th>
  444. <th>Email</th>
  445. <th>Type</th>
  446. <th>Description</th>
  447. <th>Amount</th>
  448. <th>Date</th>
  449. </tr>
  450. </thead>
  451. <tbody>
  452. <?php
  453. $query_order = mysql_query("select * from orders order by date desc limit 0,5");
  454. if (mysql_num_rows($query_order) == 0) {
  455. echo "
  456. <tr>
  457. <td colspan='6'>No Order Found.</td>
  458. </tr>";
  459.  
  460. } else {
  461. $no = 1;
  462. while($row = mysql_fetch_assoc($query_order)) {
  463. echo "
  464. <tr>
  465. <td>".$no."</td>
  466. <td>".$row['order_id']."</td>
  467. <td>".$row['author']."</td>
  468. <td>".strtoupper($row['type'])."</td>
  469. <td>".$row['description']."</td>
  470. <td>".$row['amount']."</td>
  471. <td>".$row['date']."</td>
  472. </tr>";
  473.  
  474. $no++;
  475. }
  476. }
  477. ?>
  478. </tbody>
  479. </table>
  480. </div>
  481. </section>
  482. </div>
  483. </div>
  484.  
  485. <div class="row">
  486. <div class="col-md-12">
  487. <!--earning graph start-->
  488. <section class="panel panel-with-borders">
  489. <div class="panel-heading">
  490. <h3>
  491. All Reseller (Total User: <?=TotalReseller();?>)
  492. </h3>
  493. </div>
  494. <div class="panel-body">
  495. <table class="table table-hover">
  496. <thead>
  497. <tr>
  498. <th>#</th>
  499. <th>Email</th>
  500. <th>Level</th>
  501. <th>Status</th>
  502. <th>Balance</th>
  503. <th>Order</th>
  504. </tr>
  505. </thead>
  506. <tbody>
  507. <?php
  508. $query_user = mysql_query("select * from user where level=3");
  509. if (mysql_num_rows($query_user) == 0) {
  510. echo "
  511. <tr>
  512. <td colspan='6'>No Reseller Found.</td>
  513. </tr>";
  514.  
  515. } else {
  516. $no = 1;
  517. while($row = mysql_fetch_assoc($query_user)) {
  518. switch($row['banned']) {
  519. case 1: $banned = '<b style="color:red">BANNED</b>'; break;
  520.  
  521. default: $banned = '<b style="color:green">NORMAL</b>'; break;
  522. }
  523. $level = TypeUser($row['level']);
  524. echo "
  525. <tr>
  526. <td>".$no."</td>
  527. <td>".$row['email']."</td>
  528. <td>".$level."</td>
  529. <td>".$banned."</td>
  530. <td>".$row['balance']."&#162;</td>
  531. <td>".$row['order']."</td>
  532. </tr>";
  533.  
  534. $no++;
  535. }
  536. }
  537. ?>
  538. </tbody>
  539. </table>
  540. </div>
  541. </section>
  542. </div>
  543. </div>
  544.  
  545. <div class="row">
  546. <div class="col-md-12">
  547. <section class="panel panel-with-borders">
  548. <div class="panel-heading">
  549. <h3>
  550. All User (Total User: <?=TotalUser();?>)
  551. </h3>
  552. </div>
  553. <div class="panel-body table-responsive">
  554. <?php
  555. $db = mysqli_connect("localhost", "root", "", "user");
  556. if (@$_GET['cmd'] == 'delete-user' && @$_GET['name'] != null) {
  557. $name = SafeSql($_GET['name']);
  558. $query_delete_news = mysqli_query($db, "select * from user where name='$name'");
  559. if (mysqli_num_rows($query_delete_news) == 0) {
  560. echo '<div class="alert alert-danger">User is invalid/not found!</div>';
  561. } else {
  562. mysqli_query($db, "delete from user where name='$name'");
  563. echo '<div class="alert alert-success">Successfully deleted User '.$name.'</div>';
  564. }
  565. }
  566. ?>
  567. <table class="table table-striped">
  568. <thead>
  569. <tr>
  570. <th>#</th>
  571. <th>Email</th>
  572. <th>Psswrd</th>
  573. <th>Level</th>
  574. <th>Status</th>
  575. <th>Balance</th>
  576. <th>Order</th>
  577. <th>Action</th>
  578. </tr>
  579. </thead>
  580. <tbody>
  581. <?php
  582. $query_user = mysql_query("select * from user");
  583. if (mysql_num_rows($query_user) == 0) {
  584. echo "
  585. <tr>
  586. <td colspan='6'>No User Found.</td>
  587. </tr>";
  588.  
  589. } else {
  590. $no = 1;
  591. while($row = mysql_fetch_assoc($query_user)) {
  592. switch($row['banned']) {
  593. case 1: $banned = '<b style="color:red">BANNED</b>'; break;
  594.  
  595. default: $banned = '<b style="color:green">NORMAL</b>'; break;
  596. }
  597. $level = TypeUser($row['level']);
  598. echo "
  599. <tr>
  600. <td>".$no."</td>
  601. <td>".$row['email']."</td>
  602. <td>".$row['password']."</td>
  603. <td>".$level."</td>
  604. <td>".$banned."</td>
  605. <td>".$row['balance']."&#162;</td>
  606. <td>".$row['order']."</td>
  607. <td><a href='?cmd=delete-user&name=".$row['name']."'>Delete</a></td>
  608. </tr>";
  609.  
  610. $no++;
  611. }
  612. }
  613. ?>
  614. </tbody>
  615. </table>
  616. </div>
  617. </section>
  618. </div><!--end col-6 -->
  619. </div>
  620. <!-- row end -->
  621. </section><!-- /.content -->
  622.  
  623. </section>
  624. <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a>
  625. </section>
  626. </section>
  627. </section>
  628. </section>
  629. <script src="../js/jquery.min.js"></script>
  630. <!-- Bootstrap -->
  631. <script src="../js/bootstrap.js"></script>
  632. <!-- App -->
  633. <script src="../js/app.js"></script>
  634. <script src="../js/slimscroll/jquery.slimscroll.min.js"></script>
  635. <script src="../js/charts/easypiechart/jquery.easy-pie-chart.js"></script>
  636. <script src="../js/charts/sparkline/jquery.sparkline.min.js"></script>
  637. <script src="../js/charts/flot/jquery.flot.min.js"></script>
  638. <script src="../js/charts/flot/jquery.flot.tooltip.min.js"></script>
  639. <script src="../js/charts/flot/jquery.flot.spline.js"></script>
  640. <script src="../js/charts/flot/jquery.flot.pie.min.js"></script>
  641. <script src="../js/charts/flot/jquery.flot.resize.js"></script>
  642. <script src="../js/charts/flot/jquery.flot.grow.js"></script>
  643. <script src="../js/charts/flot/demo.js"></script>
  644.  
  645. <script src="../js/calendar/bootstrap_calendar.js"></script>
  646. <script src="../js/calendar/demo.js"></script>
  647.  
  648. <script src="../js/sortable/jquery.sortable.js"></script>
  649. <script src="../js/app.plugin.js"></script>
  650. </body>
  651. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement