Update balance statement view

This commit is contained in:
Djery-Tom 2021-06-25 09:46:48 +01:00
parent ed8ee1c477
commit d6285afcea
6 changed files with 373 additions and 344 deletions

View File

@ -1,5 +1,7 @@
RewriteEngine On <IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\.php|assets/|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L] RewriteCond $1 !^(index\.php|assets/|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

View File

@ -1024,12 +1024,12 @@ class Gestion extends CI_Controller
$max = 999999; $max = 999999;
$data['paliers'] = $this->user_model->getPaliers(); $data['paliers'] = $this->user_model->getPaliers();
$data['pays'] = $this->user_model->getAllGameCountries(); $data['pays'] = $this->user_model->getAllGameCountries();
$data['list'] = $this->user_model->getMembers($pays);
$data['game_pays'] = $this->user_model->getGameCountry(); $data['game_pays'] = $this->user_model->getGameCountry();
$data['q1'] = $this->user_model->getQuota(1); $data['q1'] = $this->user_model->getQuota(1);
$data['q2'] = $this->user_model->getQuota(2); $data['q2'] = $this->user_model->getQuota(2);
$data['q3'] = $this->user_model->getQuota(3); $data['q3'] = $this->user_model->getQuota(3);
$data['q4'] = $this->user_model->getQuota(4); $data['q4'] = $this->user_model->getQuota(4);
$data['list'] = $this->user_model->getMembers($pays,$data['q1']);
$data['quota1'] = $this->user_model->getCoutForQuota($pays, $data['q1'], $data['q2']); $data['quota1'] = $this->user_model->getCoutForQuota($pays, $data['q1'], $data['q2']);
$data['quota2'] = $this->user_model->getCoutForQuota($pays, $data['q2'], $data['q3']); $data['quota2'] = $this->user_model->getCoutForQuota($pays, $data['q2'], $data['q3']);
$data['quota3'] = $this->user_model->getCoutForQuota($pays, $data['q3'], $data['q4']); $data['quota3'] = $this->user_model->getCoutForQuota($pays, $data['q3'], $data['q4']);

View File

@ -1694,24 +1694,42 @@ class User_model extends CI_Model
return ($query->num_rows() > 0) ? $query : false; return ($query->num_rows() > 0) ? $query : false;
} }
public function getCoutForQuota($pays,$quota_inf,$quota_sup){ // public function getCoutForQuota($pays,$quota_inf,$quota_sup){
//
// $query = $this->db->query("SELECT COUNT(*) AS c FROM (SELECT * FROM game WHERE `id_pays`=".$pays." GROUP BY `id_parrain` HAVING COUNT(*) >= ".$quota_inf." AND COUNT(*) < ".$quota_sup." ) AS t");
//
// if($query->num_rows()>0){
// return $query->row()->c;
// }else{
// return false;
// }
// }
//
// public function getMembers($pays,$minQuota){
// $query = $this->db->query("SELECT t.lastname,t.phone,t.email,t.total
// FROM (SELECT users.lastname,users.phone,users.email,COUNT(*) AS total FROM game
// INNER JOIN users ON game.id_parrain=users.id
// WHERE `id_pays`=".$pays." GROUP BY `id_parrain` HAVING COUNT(*) >= $minQuota) AS t");
// return ($query->num_rows() > 0) ? $query : false;
// }
$query = $this->db->query("SELECT COUNT(*) AS c FROM (SELECT * FROM game WHERE `id_pays`=".$pays." GROUP BY `id_parrain` HAVING COUNT(*) >= ".$quota_inf." AND COUNT(*) < ".$quota_sup." ) AS t"); public function getCoutForQuota($pays,$quota_inf,$quota_sup){
if($query->num_rows()>0){ $query = $this->db->query("SELECT COUNT(*) AS c FROM (SELECT * FROM agents_game WHERE `id_pays`=".$pays." GROUP BY `id_parrain` HAVING COUNT(*) >= ".$quota_inf." AND COUNT(*) < ".$quota_sup." ) AS t");
return $query->row()->c;
}else{
return false;
}
}
public function getMembers($pays){ if($query->num_rows()>0){
$query = $this->db->query("SELECT t.lastname,t.phone,t.email,t.total return $query->row()->c;
FROM (SELECT users.lastname,users.phone,users.email,COUNT(*) AS total FROM game }else{
INNER JOIN users ON game.id_parrain=users.id return false;
WHERE `id_pays`=".$pays." GROUP BY `id_parrain` HAVING COUNT(*) >= 20) AS t"); }
}
public function getMembers($pays,$minQuota){
$query = $this->db->query("SELECT t.lastname,t.phone,t.email,t.total
FROM (SELECT ag.lastname, ag.phone, ag.email,COUNT(*) AS total FROM agents_game g
INNER JOIN agent_plus ag ON g.id_parrain = ag.id
WHERE `id_pays`=".$pays." GROUP BY `id_parrain` HAVING COUNT(*) >= $minQuota) AS t");
return ($query->num_rows() > 0) ? $query : false; return ($query->num_rows() > 0) ? $query : false;
} }
public function test($pays,$hyper,$ville){ public function test($pays,$hyper,$ville){

View File

@ -107,6 +107,7 @@
<th><?= $this->lang->line('Telephone') ?></th> <th><?= $this->lang->line('Telephone') ?></th>
<th><?= $this->lang->line('code membre') ?></th> <th><?= $this->lang->line('code membre') ?></th>
<th>Agent</th> <th>Agent</th>
<th>Parrain</th>
<?php if ($this->session->userdata('category') != 'super') { ?> <?php if ($this->session->userdata('category') != 'super') { ?>
<th align='center'>Action</th> <th align='center'>Action</th>
<?php } ?> <?php } ?>
@ -116,6 +117,12 @@
<?php <?php
foreach ($wallets->result() as $row) { foreach ($wallets->result() as $row) {
$parrain = $row->parrain;
if($row->codeMembre == $row->codeParrain)
$parrain ='';
else if($row->codeParrain == $this->session->userdata('member_code'))
$parrain = $this->lang->line('Vous');
$num++; $num++;
echo "<tr> echo "<tr>
<td align='center' >$num</td> <td align='center' >$num</td>
@ -123,7 +130,8 @@
<td>" . Money::of(round($row->balance_com, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td> <td>" . Money::of(round($row->balance_com, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
<td>" . $row->transactionNumber . "</td> <td>" . $row->transactionNumber . "</td>
<td>" . $row->codeMembre . "</td> <td>" . $row->codeMembre . "</td>
<td>" . $row->lastname . "</td>"; <td>" . $row->lastname . "</td>
<td>" . $parrain . "</td>";
?> ?>
<?php if ($this->session->userdata('category') != 'super') { ?> <?php if ($this->session->userdata('category') != 'super') { ?>
<td> <td>

View File

@ -88,6 +88,7 @@
<label><?php echo $row->libelle; ?>:</label> <label><?php echo $row->libelle; ?>:</label>
<div class="input-group"> <div class="input-group">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-flag-checkered"></i>
</div> </div>
<input type="number" id="palier<?php echo $i; ?>" value="<?php echo $row->valeur; ?>" class="form-control"> <input type="number" id="palier<?php echo $i; ?>" value="<?php echo $row->valeur; ?>" class="form-control">
</div> </div>

View File

@ -15,7 +15,7 @@
<section class="content-header"> <section class="content-header">
<h1> <h1>
<?php echo $this->lang->line('Géolocalisation'); ?> <?php echo $this->lang->line('Campagne'); ?>
</h1> </h1>
<?php <?php
$site_url = base_url(); $site_url = base_url();