Advertisement
Guest User

Untitled

a guest
Oct 5th, 2018
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. <?php
  2. /*
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.5.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.06.2018
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. defined('BASEPATH') or exit('No direct script access allowed');
  15.  
  16. class Plan_model extends CI_Model
  17. {
  18. public function __construct()
  19. {
  20. parent::__construct();
  21. $this->common_model->__session();
  22. }
  23.  
  24. public function create_leg()
  25. {
  26. $leg = config_item('leg');
  27.  
  28. if ($leg == '1') {
  29. return array('A' => 'Left');
  30. }
  31.  
  32. if ($leg == '2') {
  33. return array('A' => 'Left', 'B' => 'Right');
  34. }
  35.  
  36. if ($leg == '3') {
  37. return array('A' => 'A', 'B' => 'B', 'C' => 'C');
  38. }
  39.  
  40. if ($leg == '4') {
  41. return array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D');
  42. }
  43.  
  44. if ($leg == '5') {
  45. return array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E');
  46. }
  47.  
  48. if ($leg == '6') {
  49. return array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E', 'F' => 'F');
  50. }
  51. }
  52.  
  53. public function find_extreme_position($id, $leg)
  54. {
  55. $this->db->select($leg)->from('member')->where(array('id' => $id));
  56. $result = $this->db->get()->row();
  57.  
  58. if ($result->$leg == 0) {
  59. return $id;
  60. }
  61.  
  62. return $this->find_extreme_position($result->$leg, $leg);
  63. }
  64.  
  65. public function check_position($position, $leg)
  66. {
  67. $this->db->select($leg)->from('member')->where('id', $position);
  68. $result = $this->db->get()->row();
  69.  
  70. if ($result->$leg == 0) {
  71. return $position;
  72. }
  73.  
  74. return false;
  75. }
  76.  
  77. public function find_autopool_field($sponsor = '')
  78. {
  79. if (config_item('leg') == '1') {
  80. $this->db->select('id,A')->from('member')->where('A', 0)->order_by('secret', 'ASC')->limit(1);
  81. $result = $this->db->get()->row();
  82. $id = $result->id;
  83.  
  84. if (trim($result->A) == '0') {
  85. $position = 'A';
  86. }
  87. }
  88.  
  89. if (config_item('leg') == '2') {
  90. $this->db->select('id,A,B')->from('member')->where('A', 0)->or_where('B', 0)->order_by('secret', 'ASC')->limit(1);
  91. $result = $this->db->get()->row();
  92. $id = $result->id;
  93.  
  94. if (trim($result->A) == '0') {
  95. $position = 'A';
  96. } else {
  97. $position = 'B';
  98. }
  99. }
  100.  
  101. if (config_item('leg') == '3') {
  102. $this->db->select('id,A,B,C')->from('member')->where('A', 0)->or_where('B', 0)->or_where('C', 0)->order_by('secret', 'ASC')->limit(1);
  103. $result = $this->db->get()->row();
  104. $id = $result->id;
  105.  
  106. if (trim($result->A) == '0') {
  107. $position = 'A';
  108. } else {
  109. if (trim($result->B) == '0') {
  110. $position = 'B';
  111. } else {
  112. $position = 'C';
  113. }
  114. }
  115. }
  116.  
  117. if (config_item('leg') == '4') {
  118. $this->db->select('id,A,B,C,D')->from('member')->where('A', 0)->or_where('B', 0)->or_where('C', 0)->or_where('D', 0)->order_by('secret', 'ASC')->limit(1);
  119. $result = $this->db->get()->row();
  120. $id = $result->id;
  121.  
  122. if (trim($result->A) == '0') {
  123. $position = 'A';
  124. } else {
  125. if (trim($result->B) == '0') {
  126. ...................................................................
  127. ...............................................
  128. ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement