Advertisement
Guest User

Untitled

a guest
Mar 20th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 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.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function CreateApiKey($data)
  15. {
  16. global $conn;
  17. $data = md5($data['email'] . $data['username'] . rand(9999, 2324332));
  18. $row = $conn->prepare('SELECT * FROM clients WHERE apikey=:key ');
  19. $row->execute(['key' => $data]);
  20.  
  21. if ($row->rowCount()) {
  22. CreateApiKey();
  23. }
  24. else {
  25. return $data;
  26. }
  27. }
  28.  
  29. function guardDeleteAllRoles()
  30. {
  31. $update = $conn->prepare('UPDATE clients SET access=:access WHERE client_id=:c_id ');
  32. $update->execute(['c_id' => $user['client_id'], 'access' => '{"admin_access":"0"}']);
  33. header('Location:' . site_url(''));
  34. }
  35.  
  36. function guardLogout()
  37. {
  38. unset($_SESSION['neira_userid']);
  39. unset($_SESSION['neira_userpass']);
  40. unset($_SESSION['neira_userlogin']);
  41. setcookie('u_id', $user['client_id'], time() - 604800, '/', NULL, NULL, true);
  42. setcookie('u_password', $user['password'], time() - 604800, '/', NULL, NULL, true);
  43. setcookie('u_login', 'ok', time() - 604800, '/', NULL, NULL, true);
  44. setcookie('a_login', 'ok', time() - 604800, '/', NULL, NULL, true);
  45. session_destroy();
  46. header('Location:' . site_url(''));
  47. }
  48.  
  49. function replace_tr($text)
  50. {
  51. $text = trim($text);
  52. $search = ['Ç', 'ç', 'Ğ', 'ğ', 'ı', 'İ', 'Ö', 'ö', 'Ş', 'ş', 'Ü', 'ü', ' ', '.', ',', '<', '>', '!'];
  53. $replace = ['c', 'c', 'g', 'g', 'i', 'i', 'o', 'o', 's', 's', 'u', 'u', '-', '', '', '', '', ''];
  54. $new_text = str_replace($search, $replace, $text);
  55. return $new_text;
  56. }
  57.  
  58. function convertSecToStr($secs)
  59. {
  60. $output = '';
  61.  
  62. if (86400 <= $secs) {
  63. $days = floor($secs / 86400);
  64. $secs = $secs % 86400;
  65. $output = $days . ' Gün';
  66.  
  67. if ($days != 1) {
  68. $output .= '';
  69. }
  70.  
  71. if (0 < $secs) {
  72. $output .= ', ';
  73. }
  74. }
  75.  
  76. if (3600 <= $secs) {
  77. $hours = floor($secs / 3600);
  78. $secs = $secs % 3600;
  79. $output .= $hours . ' Saat';
  80.  
  81. if ($hours != 1) {
  82. $output .= '';
  83. }
  84.  
  85. if (0 < $secs) {
  86. $output .= ', ';
  87. }
  88. }
  89.  
  90. if (60 <= $secs) {
  91. $minutes = floor($secs / 60);
  92. $secs = $secs % 60;
  93. $output .= $minutes . ' Dakika';
  94.  
  95. if ($minutes != 1) {
  96. $output .= '';
  97. }
  98.  
  99. if (0 < $secs) {
  100. $output .= ' ';
  101. }
  102. }
  103.  
  104. return $output;
  105. }
  106.  
  107. function ortalama($array)
  108. {
  109. $toplam = 0;
  110. $sayi = count($array);
  111.  
  112. foreach ($array as $ort) {
  113. if (is_numeric($ort)) {
  114. $toplam += $ort;
  115. }
  116. else {
  117. $sayi--;
  118. }
  119. }
  120.  
  121. if ($sayi) {
  122. $islem = $toplam / $sayi;
  123. return $islem;
  124. }
  125. else {
  126. return 'NaN';
  127. }
  128. }
  129.  
  130. function createReferral()
  131. {
  132. $karakterler = '1234567890abcdefghijKLMNOPQRSTuvwxyzABCDEFGHIJklmnopqrstUVWXYZ0987654321';
  133. $sifre = '';
  134. ................................................................
  135. .............................................
  136. ........................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement