Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.06 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.0.8.2
  8. * @ Author : DeZender
  9. * @ Release on : 02.01.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. $action = $_POST['action'];
  15. $languages = $conn->prepare('SELECT * FROM languages WHERE language_type=:type');
  16. $languages->execute(['type' => 2]);
  17. $languages = $languages->fetchAll(PDO::FETCH_ASSOC);
  18.  
  19. if ($action == 'providers_list') {
  20. $smmapi = new SMMApi();
  21. $provider = $_POST['provider'];
  22. $api = $conn->prepare('SELECT * FROM service_api WHERE id=:id');
  23. $api->execute(['id' => $provider]);
  24. $api = $api->fetch(PDO::FETCH_ASSOC);
  25.  
  26. if ($api['api_type'] == 3) {
  27. echo '<div class="service-mode__block">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Servis</label>' . "\r\n" . ' <input class="form-control" name="service" placeholder="Servis ID giriniz">' . "\r\n" . ' </div>' . "\r\n" . ' </div>';
  28. }
  29. else if ($api['api_type'] == 1) {
  30. $services = $smmapi->action(['key' => $api['api_key'], 'action' => 'services'], $api['api_url']);
  31. echo '<div class="service-mode__block">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Servis</label>' . "\r\n" . ' <select class="form-control" name="service">';
  32.  
  33. foreach ($services as $service) {
  34. echo '<option value="' . $service->service . '"';
  35.  
  36. if ($_SESSION['data']['service'] == $service->service) {
  37. echo 'selected';
  38. }
  39.  
  40. echo '>' . $service->service . ' - ' . $service->name . ' - ' . priceFormat($service->rate) . '</option>';
  41. }
  42.  
  43. echo '</select>' . "\r\n" . ' </div>' . "\r\n" . ' </div>';
  44. }
  45.  
  46. unset($_SESSION['data']);
  47. }
  48. else if ($action == 'paymentmethod-sortable') {
  49. $list = $_POST['methods'];
  50.  
  51. foreach ($list as $method) {
  52. $update = $conn->prepare('UPDATE payment_methods SET method_line=:line WHERE id=:id ');
  53. $update->execute(['id' => $method['id'], 'line' => $method['line']]);
  54. }
  55. }
  56. else if ($action == 'service-sortable') {
  57. $list = $_POST['services'];
  58.  
  59. foreach ($list as $service) {
  60. $id = explode('-', $service['id']);
  61. $update = $conn->prepare('UPDATE services SET service_line=:line WHERE service_id=:id ');
  62. $update->execute(['id' => $id[1], 'line' => $service['line']]);
  63. }
  64. }
  65. else if ($action == 'category-sortable') {
  66. $list = $_POST['categories'];
  67.  
  68. foreach ($list as $category) {
  69. $update = $conn->prepare('UPDATE categories SET category_line=:line WHERE category_id=:id ');
  70. $update->execute(['id' => $category['id'], 'line' => $category['line']]);
  71. }
  72. }
  73. else if ($action == 'secret_user') {
  74. $id = $_POST['id'];
  75. $services = $conn->prepare('SELECT * FROM services RIGHT JOIN categories ON categories.category_id=services.category_id WHERE services.service_secret=\'1\' || categories.category_secret=\'1\' ');
  76. $services->execute(['id' => $id]);
  77. $services = $services->fetchAll(PDO::FETCH_ASSOC);
  78. $grouped = array_group_by($services, 'category_id');
  79. $return = '<form class="form" action="' . site_url('admin/clients/export') . '" method="post" data-xhr="true">' . "\r\n" . ' <div class="modal-body">' . "\r\n\r\n" . ' <div class="services-import__body">' . "\r\n" . ' <div>' . "\r\n" . ' <div class="services-import__list-wrap services-import__list-active">' . "\r\n" . ' <div class="services-import__scroll-wrap">';
  80.  
  81. foreach ($grouped as $category) {
  82. $row = [
  83. 'table' => 'clients_category',
  84. 'where' => ['client_id' => $id, 'category_id' => $category[0]['category_id']]
  85. ];
  86. $return .= '<span>' . "\r\n" . ' <div class="services-import__category">' . "\r\n" . ' <div class="services-import__category-title">' . "\r\n" . ' <label> ';
  87.  
  88. if ($category[0]['category_secret'] == 1) {
  89. $return .= '<small><i class="fa fa-lock"></i></small> <input type="checkbox"';
  90.  
  91. if (countRow($row)) {
  92. $return .= 'checked';
  93. }
  94.  
  95. $return .= ' class="tiny-toggle" data-tt-palette="blue" data-url="' . site_url('admin/clients/secret_category/' . $id) . '" data-id="' . $category[0]['category_id'] . '"> ';
  96. }
  97.  
  98. $return .= $category[0]['category_name'] . ' </label>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n" . ' <div class="services-import__packages">' . "\r\n" . ' <ul>';
  99.  
  100. for ($i = 0; $i < count($category); $i++) {
  101. $row = [
  102. 'table' => 'clients_service',
  103. 'where' => ['client_id' => $id, 'service_id' => $category[$i]['service_id']]
  104. ];
  105. $return .= '<li id="service-' . $category[$i]['service_id'] . '">' . "\r\n" . ' <label>';
  106.  
  107. if ($category[$i]['service_secret'] == 1) {
  108. $return .= '<small><i class="fa fa-lock"></i></small> ';
  109. }
  110.  
  111. $return .= $category[$i]['service_id'] . ' - ' . $category[$i]['service_name'] . "\r\n" . ' <span class="services-import__packages-price-edit" >';
  112.  
  113. if ($category[$i]['service_secret'] == 1) {
  114. $return .= '<input type="checkbox"';
  115.  
  116. if (countRow($row)) {
  117. $return .= 'checked';
  118. }
  119.  
  120. $return .= ' class="tiny-toggle" data-tt-palette="blue" data-url="' . site_url('admin/clients/secret_service/' . $id) . '" data-id="' . $category[$i]['service_id'] . '">';
  121. }
  122.  
  123. $return .= '</span>' . "\r\n" . ' </label>' . "\r\n" . ' </li>';
  124. }
  125.  
  126. $return .= '</ul>' . "\r\n" . ' </div>' . "\r\n" . ' </span>';
  127. }
  128.  
  129. $return .= '</div>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n" . ' <script src="' . site_url('public/admin/') . 'jquery.tinytoggle.min.js"></script>' . "\r\n" . ' <link rel="stylesheet" type="text/css" href="' . site_url('public/admin/') . 'tinytoggle.min.css" rel="stylesheet">' . "\r\n" . ' <script>' . "\r\n" . ' $(".tiny-toggle").tinyToggle({' . "\r\n" . ' onCheck: function() {' . "\r\n" . ' var id = $(this).attr("data-id");' . "\r\n" . ' var action = $(this).attr("data-url")+"?type=on&id="+id;' . "\r\n" . ' $.ajax({' . "\r\n" . ' url: action,' . "\r\n" . ' type: \'GET\',' . "\r\n" . ' dataType: \'json\',' . "\r\n" . ' cache: false,' . "\r\n" . ' contentType: false,' . "\r\n" . ' processData: false' . "\r\n" . ' }).done(function(result){' . "\r\n" . ' if( result == 1 ){' . "\r\n" . ' $.toast({' . "\r\n" . ' heading: "Başarılı",' . "\r\n" . ' text: "İşlem başarılı",' . "\r\n" . ' icon: "success",' . "\r\n" . ' loader: true,' . "\r\n" . ' loaderBg: "#9EC600"' . "\r\n" . ' });' . "\r\n" . ' }else{' . "\r\n" . ' $.toast({' . "\r\n" . ' heading: "Başarısız",' . "\r\n" . ' text: "İşlem başarısız",' . "\r\n" . ' icon: "error",' . "\r\n" . ' loader: true,' . "\r\n" . ' loaderBg: "#9EC600"' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n" . ' })' . "\r\n" . ' .fail(function(){' . "\r\n" . ' $.toast({' . "\r\n" . ' heading: "Başarısız",' . "\r\n" . ' text: "İşlem başarısız",' . "\r\n" . ' icon: "error",' . "\r\n" . ' loader: true,' . "\r\n" . ' loaderBg: "#9EC600"' . "\r\n" . ' });' . "\r\n" . ' });' . "\r\n" . ' },' . "\r\n" . ' onUncheck: function() {' . "\r\n" . ' var id = $(this).attr("data-id");' . "\r\n" . ' var action = $(this).attr("data-url")+"?type=off&id="+id;' . "\r\n" . ' $.ajax({' . "\r\n" . ' url: action,' . "\r\n" . ' type: \'GET\',' . "\r\n" . ' dataType: \'json\',' . "\r\n" . ' cache: false,' . "\r\n" . ' contentType: false,' . "\r\n" . ' processData: false' . "\r\n" . ' }).done(function(result){' . "\r\n" . ' if( result == 1 ){' . "\r\n" . ' $.toast({' . "\r\n" . ' heading: "Başarılı",' . "\r\n" . ' text: "İşlem başarılı",' . "\r\n" . ' icon: "success",' . "\r\n" . ' loader: true,' . "\r\n" . ' loaderBg: "#9EC600"' . "\r\n" . ' });' . "\r\n" . ' }else{' . "\r\n" . ' $.toast({' . "\r\n" . ' heading: "Başarısız",' . "\r\n" . ' text: "İşlem başarısız",' . "\r\n" . ' icon: "error",' . "\r\n" . ' loader: true,' . "\r\n" . ' loaderBg: "#9EC600"' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n" . ' })' . "\r\n" . ' .fail(function(){' . "\r\n" . ' $.toast({' . "\r\n" . ' heading: "Başarısız",' . "\r\n" . ' text: "İşlem başarısız",' . "\r\n" . ' icon: "error",' . "\r\n" . ' loader: true,' . "\r\n" . ' loaderBg: "#9EC600"' . "\r\n" . ' });' . "\r\n" . ' });' . "\r\n" . ' },' . "\r\n" . ' });' . "\r\n\r\n" . ' </script>' . "\r\n\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="modal-footer">' . "\r\n" . ' <button type="button" class="btn btn-default" data-dismiss="modal">Vazgeç</button>' . "\r\n" . ' </div>' . "\r\n" . ' </form>';
  130. echo json_encode(['content' => $return, 'title' => 'Kullanıcıya özel servisler']);
  131. }
  132. else if ($action == 'new_user') {
  133. $return = '<form class="form" action="' . site_url('admin/clients/new') . '" method="post" data-xhr="true">' . "\r\n" . ' <div class="modal-body">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label class="form-group__service-name">Üye adı</label>' . "\r\n" . ' <input type="text" class="form-control" name="name" value="">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Üye E-mail</label>' . "\r\n" . ' <input type="text" name="email" value="" class="form-control">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Kullanıcı adı</label>' . "\r\n" . ' <input type="text" name="username" class="form-control" value="">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Üye Parolası</label>' . "\r\n" . ' <div class="input-group">' . "\r\n" . ' <input type="text" class="form-control" name="password" value="" id="user_password">' . "\r\n" . ' <span class="input-group-btn">' . "\r\n" . ' <button class="btn btn-default" onclick="UserPassword()" type="button">' . "\r\n" . ' <span class="fa fa-random" data-toggle="tooltip" data-placement="bottom" title="" aria-hidden="true" data-original-title="Parola oluştur"></span></button>' . "\r\n" . ' </span>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Üye telefon</label>' . "\r\n" . ' <input type="text" name="telephone" class="form-control" value="">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="service-mode__block">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Borç durumu</label>' . "\r\n" . ' <select class="form-control" id="debit" name="balance_type">' . "\r\n" . ' <option value="2">Borç yapamasın</option>' . "\r\n" . ' <option value="1">Borç yapabilsin</option>' . "\r\n" . ' </select>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="form-group" id="debit_limit">' . "\r\n" . ' <label>Ne kadar borç yapabilsin</label>' . "\r\n" . ' <input type="text" name="debit_limit" class="form-control" value="">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="service-mode__block">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>SMS Onayı</label>' . "\r\n" . ' <select class="form-control" name="tel_type">' . "\r\n" . ' <option value="1">Onaysız</option>' . "\r\n" . ' <option value="2">Onaylı</option>' . "\r\n" . ' </select>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="service-mode__block">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>E-mail Onayı</label>' . "\r\n" . ' <select class="form-control" name="email_type">' . "\r\n" . ' <option value="1">Onaysız</option>' . "\r\n" . ' <option value="2">Onaylı</option>' . "\r\n" . ' </select>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="service-mode__block">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Yönetici Hesabı</label>' . "\r\n" . ' <select class="form-control" name="access[admin_access]">' . "\r\n" . ' <option value="0">Hayır</option>' . "\r\n" . ' <option value="1">Evet</option>' . "\r\n" . ' </select>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="service-mode__block">' . "\r\n" . ' <div class="form-group row">' . "\r\n" . ' <label>Yönetici Yetkileri</label>' . "\r\n" . ' <div class="form-group col-md-12">' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[users]" checked value="1"> Kullanıcılar' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[orders]" checked value="1"> Siparişler' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[subscriptions]" checked value="1"> Abonelikler' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[dripfeed]" checked value="1"> Drip-feed' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[services]" checked value="1"> Servisler' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[payments]" checked value="1"> Ödemeler' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[tickets]" checked value="1"> Destek sistemi' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[reports]" checked value="1"> İstatistikler' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[general_settings]" checked value="1"> Genel ayarlar' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[pages]" checked value="1"> Sayfalar' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[payments_settings]" checked value="1"> Ödeme ayarları' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[bank_accounts]" checked value="1"> Banka Hesapları' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[payments_bonus]" checked value="1"> Ödeme bonusları' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[alert_settings]" checked value="1"> Bildirim ayarları' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[providers]" checked value="1"> Servis sağlayıcıları' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[themes]" checked value="1"> Tema düzenleyicisi' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[language]" checked value="1"> Dil düzenleyicisi' . "\r\n" . ' </label>' . "\r\n" . ' <label class="checkbox-inline col-md-3">' . "\r\n" . ' <input type="checkbox" class="access" name="access[admins]" checked value="1"> Yönetici yetkileri' . "\r\n" . ' </label>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n" . ' </div>' . "\r\n\r\n\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="modal-footer">' . "\r\n" . ' <button type="submit" class="btn btn-primary">Kullanıcıyı kayıt et</button>' . "\r\n" . ' <button type="button" class="btn btn-default" data-dismiss="modal">Vazgeç</button>' . "\r\n" . ' </div>' . "\r\n" . ' </form>' . "\r\n" . ' <script>' . "\r\n" . ' var type = $("#debit").val();' . "\r\n" . ' if( type == 2 ){' . "\r\n" . ' $("#debit_limit").hide();' . "\r\n" . ' } else{' . "\r\n" . ' $("#debit_limit").show();' . "\r\n" . ' }' . "\r\n" . ' $("#debit").change(function(){' . "\r\n" . ' var type = $(this).val();' . "\r\n" . ' if( type == 2 ){' . "\r\n" . ' $("#debit_limit").hide();' . "\r\n" . ' } else{' . "\r\n" . ' $("#debit_limit").show();' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' </script>';
  134. echo json_encode(['content' => $return, 'title' => 'Yeni kullanıcı kaydı']);
  135. }
  136. else if ($action == 'edit_user') {
  137. $id = $_POST['id'];
  138. $user = $conn->prepare('SELECT * FROM clients WHERE client_id=:id ');
  139. $user->execute(['id' => $id]);
  140. $user = $user->fetch(PDO::FETCH_ASSOC);
  141. $access = json_decode($user['access'], true);
  142. $return = '<form class="form" action="' . site_url('admin/clients/edit/' . $user['username']) . '" method="post" data-xhr="true">' . "\r\n" . ' <div class="modal-body">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label class="form-group__service-name">Üye adı</label>' . "\r\n" . ' <input type="text" class="form-control" name="name" value="' . $user['name'] . '">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Üye E-mail</label>' . "\r\n" . ' <input type="text" name="email" value="' . $user['email'] . '" class="form-control">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Kullanıcı adı</label>' . "\r\n" . ' <input type="text" name="username" class="form-control" readonly value="' . $user['username'] . '">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Üye telefon</label>' . "\r\n" . ' <input type="text" name="telephone" class="form-control" value="' . $user['telephone'] . '">' . "\r\n" . ' </div>' . "\r\n\r\n" . ' <div class="service-mode__block">' . "\r\n" . ' <div class="form-group">' . "\r\n" . ' <label>Borç durumu</label>' . "\r\n" . ' <select class="form-control" id="debit" name="balance_type">' . "\r\n" . ' <option value="2"';
  143.  
  144. if ($user['balance_type'] == 2) {
  145. $return .= 'selected';
  146. ............................................................................
  147. .................................................
  148. ...................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement