Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.5.0.0
- * @ Author : DeZender
- * @ Release on : 22.06.2018
- * @ Official site : http://DeZender.Net
- *
- */
- defined('BASEPATH') or exit('No direct script access allowed');
- class Plan_model extends CI_Model
- {
- public function __construct()
- {
- parent::__construct();
- $this->common_model->__session();
- }
- public function create_leg()
- {
- $leg = config_item('leg');
- if ($leg == '1') {
- return array('A' => 'Left');
- }
- if ($leg == '2') {
- return array('A' => 'Left', 'B' => 'Right');
- }
- if ($leg == '3') {
- return array('A' => 'A', 'B' => 'B', 'C' => 'C');
- }
- if ($leg == '4') {
- return array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D');
- }
- if ($leg == '5') {
- return array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E');
- }
- if ($leg == '6') {
- return array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E', 'F' => 'F');
- }
- }
- public function find_extreme_position($id, $leg)
- {
- $this->db->select($leg)->from('member')->where(array('id' => $id));
- $result = $this->db->get()->row();
- if ($result->$leg == 0) {
- return $id;
- }
- return $this->find_extreme_position($result->$leg, $leg);
- }
- public function check_position($position, $leg)
- {
- $this->db->select($leg)->from('member')->where('id', $position);
- $result = $this->db->get()->row();
- if ($result->$leg == 0) {
- return $position;
- }
- return false;
- }
- public function find_autopool_field($sponsor = '')
- {
- if (config_item('leg') == '1') {
- $this->db->select('id,A')->from('member')->where('A', 0)->order_by('secret', 'ASC')->limit(1);
- $result = $this->db->get()->row();
- $id = $result->id;
- if (trim($result->A) == '0') {
- $position = 'A';
- }
- }
- if (config_item('leg') == '2') {
- $this->db->select('id,A,B')->from('member')->where('A', 0)->or_where('B', 0)->order_by('secret', 'ASC')->limit(1);
- $result = $this->db->get()->row();
- $id = $result->id;
- if (trim($result->A) == '0') {
- $position = 'A';
- } else {
- $position = 'B';
- }
- }
- if (config_item('leg') == '3') {
- $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);
- $result = $this->db->get()->row();
- $id = $result->id;
- if (trim($result->A) == '0') {
- $position = 'A';
- } else {
- if (trim($result->B) == '0') {
- $position = 'B';
- } else {
- $position = 'C';
- }
- }
- }
- if (config_item('leg') == '4') {
- $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);
- $result = $this->db->get()->row();
- $id = $result->id;
- if (trim($result->A) == '0') {
- $position = 'A';
- } else {
- if (trim($result->B) == '0') {
- ...................................................................
- ...............................................
- ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement