]> gitweb.erp-flowers.ru Git - yii-erp24/.git/commitdiff
add bonus/users during moving from pure php to yii
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 21 Dec 2023 10:48:11 +0000 (13:48 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 21 Dec 2023 10:48:11 +0000 (13:48 +0300)
erp24/actions/bonus/AjaxBonusHistoryAction.php [new file with mode: 0644]
erp24/actions/bonus/AjaxBonusRemoveAction.php [new file with mode: 0644]
erp24/actions/bonus/AjaxUserAddStopListAction.php [new file with mode: 0644]
erp24/actions/bonus/AjaxUserRemoveStopListAction.php [new file with mode: 0644]
erp24/actions/bonus/UsersAction.php [new file with mode: 0644]
erp24/controllers/BonusController.php
erp24/views/bonus/ajax-bonus-history.php [new file with mode: 0644]
erp24/views/bonus/ajax-bonus-remove.php [new file with mode: 0644]
erp24/views/bonus/ajax-user-add-stop-list.php [new file with mode: 0644]
erp24/views/bonus/ajax-user-remove-stop-list.php [new file with mode: 0644]
erp24/views/bonus/users.php [new file with mode: 0644]

diff --git a/erp24/actions/bonus/AjaxBonusHistoryAction.php b/erp24/actions/bonus/AjaxBonusHistoryAction.php
new file mode 100644 (file)
index 0000000..a881cb9
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+namespace yii_app\actions\bonus;
+
+use yii\base\Action;
+
+class AjaxBonusHistoryAction extends Action
+{
+    public function run() {
+        return $this->controller->renderPartial('ajax-bonus-history');
+    }
+}
\ No newline at end of file
diff --git a/erp24/actions/bonus/AjaxBonusRemoveAction.php b/erp24/actions/bonus/AjaxBonusRemoveAction.php
new file mode 100644 (file)
index 0000000..ae20b9e
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+namespace yii_app\actions\bonus;
+
+use yii\base\Action;
+
+class AjaxBonusRemoveAction extends Action
+{
+    public function run() {
+        return $this->controller->renderPartial('ajax-bonus-remove');
+    }
+}
\ No newline at end of file
diff --git a/erp24/actions/bonus/AjaxUserAddStopListAction.php b/erp24/actions/bonus/AjaxUserAddStopListAction.php
new file mode 100644 (file)
index 0000000..f7cdc8b
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+namespace yii_app\actions\bonus;
+
+use yii\base\Action;
+
+class AjaxUserAddStopListAction extends Action
+{
+    public function run() {
+        return $this->controller->renderPartial('ajax-user-add-stop-list');
+    }
+}
\ No newline at end of file
diff --git a/erp24/actions/bonus/AjaxUserRemoveStopListAction.php b/erp24/actions/bonus/AjaxUserRemoveStopListAction.php
new file mode 100644 (file)
index 0000000..c25583b
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+namespace yii_app\actions\bonus;
+
+use yii\base\Action;
+
+class AjaxUserRemoveStopListAction extends Action
+{
+    public function run() {
+        return $this->controller->renderPartial('ajax-user-remove-stop-list');
+    }
+}
\ No newline at end of file
diff --git a/erp24/actions/bonus/UsersAction.php b/erp24/actions/bonus/UsersAction.php
new file mode 100644 (file)
index 0000000..9fc8243
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+namespace yii_app\actions\bonus;
+
+use yii\base\Action;
+
+class UsersAction extends Action
+{
+    public function run() {
+        return $this->controller->render('users');
+    }
+}
\ No newline at end of file
index 1e58eb1c5dc02824236263f311fb8521e9ee98d3..27babf42927ae6d5c71e856e2a1ed61f38fccb20 100644 (file)
@@ -10,6 +10,11 @@ class BonusController extends \yii\web\Controller
             'stat' => \yii_app\actions\bonus\StatAction::class,
             'vozvrat-stats' => \yii_app\actions\bonus\VozvratStatsAction::class,
             'ajax-show-check' => \yii_app\actions\bonus\AjaxShowCheckAction::class,
+            'users' => \yii_app\actions\bonus\UsersAction::class,
+            'ajax-bonus-history' => \yii_app\actions\bonus\AjaxBonusHistoryAction::class,
+            'ajax-user-add-stop-list' => \yii_app\actions\bonus\AjaxUserAddStopListAction::class,
+            'ajax-user-remove-stop-list' => \yii_app\actions\bonus\AjaxUserRemoveStopListAction::class,
+            'ajax-bonus-remove' => \yii_app\actions\bonus\AjaxBonusRemoveAction::class,
         ];
     }
 }
\ No newline at end of file
diff --git a/erp24/views/bonus/ajax-bonus-history.php b/erp24/views/bonus/ajax-bonus-history.php
new file mode 100644 (file)
index 0000000..63ee33a
--- /dev/null
@@ -0,0 +1,136 @@
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+include_once(dirname(__DIR__, 2) . "/inc/uni.php");
+include_once(dirname(__DIR__, 2) . "/inc/bonus.php");
+
+error_reporting(E_ALL ^ E_NOTICE);
+
+
+if(!empty($_REQUEST["id"])) {
+    $user_id=(int)$_REQUEST["id"];
+    $phone=phoneClear($_REQUEST["phone"]);
+
+
+
+    if($_REQUEST["dell_hostory"]==0) $dell_hostory=0; else $dell_hostory=1;
+
+    $store_arr=get_sql_array("city_store", "id", "name", "" );
+    $user_arr=get_sql_array("admin", "id", "name", "" );
+
+
+
+
+    $phone_user = $db::getValue("SELECT phone FROM users WHERE  phone=? LIMIT 1",[$phone]);
+    if(empty($phone_user)) echo"<div class=\"text-center\"><a href=\"/users/add/\" target=new class=\"btn btn-lg btn-success mt-5 mb-5\">Добавить клиента в бонусную</a></div>";
+
+
+    $data = $db::getRows("SELECT id,tip, tip_sale, store_id,bonus,date, name,admin_id, check_id, DATE_FORMAT(date,'%d.%m.%Y в %H:%i') as date_h,
+DATE_FORMAT(date_end,'%d.%m.%Y') as date_end, price,price_skidka
+FROM users_bonus WHERE  phone=? order by date DESC",[$phone]);
+    echo"<table class=\"table table-bordered table-hover table-sm m-0\">
+<thead><th width=120>бонусы</th><th width=150>дата</th><th width=25%>магазин, сотрудник</th><th>наименование</th><th>дата сгорания</th></thead><tbody>";
+    foreach ($data as $row)  {
+        if($row["tip"]=="plus") {$tip="+"; $store_arr_bonus[$row["store_id"]]["plus"]=$store_arr_bonus[$row["store_id"]]["plus"]+$row["bonus"];}
+        else { $tip="-"; $minus=$minus+$row["bonus"]; $store_arr_bonus[$row["store_id"]]["minus"]=$store_arr_bonus[$row["store_id"]]["minus"]+$row["bonus"];  }
+
+        echo'<tr class="bg-'; if($row["tip"]=="plus") echo'success';
+        if($row["tip"]=="minus") echo'danger';
+
+
+        echo'"><td>';
+
+        if($dell_hostory==1)
+            echo'<span id=his'.$row["id"].' onclick="ajax_bonus_remove('.$row["id"].')" class="btn btn-sm btn-danger">X</span>';
+
+
+        echo $tip.' '.$row["bonus"].'<br> от '.(int)$row["price"].'</td>
+<td>'.$row["date_h"].'';
+        if($row["check_id"]) {
+
+
+            echo'<br><span id=ch'.$row["id"].' onclick="ajax_show_check(\''.$row["check_id"].'\')" class="btn btn-sm btn-info">просмотр чека</span> ';
+
+
+            $operation= $db::getValue("SELECT operation FROM sales WHERE id=? LIMIT 1",[$row["check_id"]]);
+
+
+            if($operation=="Удален")  echo'<sapn class="btn btn-lg btn-danger ">'.$operation.'</span> ';
+
+
+
+
+
+        }
+
+
+        $zov='';
+
+        if($row["tip"]=="plus" and $row["tip_sale"]=="sale") {
+            $data_v = $db::getRow("SELECT id, date, payments,summ,sales_check, operation FROM sales WHERE sales_check=? AND sales_check!='' LIMIT 1",[$row["check_id"]]);
+            if(!empty($data_v)) {
+                $paym=json_decode($data_v["payments"],true);
+                $nal=0;
+                $paym_txt='';
+                foreach($paym as $kl =>$arrr) {
+                    if($arrr["type"]=="Наличные") $nal=1;
+                    $paym_txt .='1) Тип: '.$arrr["type"].'  '.$arrr["terminal"].'  Сумма:'.$arrr["summ"].'<br> ';
+                }
+
+
+
+                $zov='<div class="alert alert-danger">По этому чеку был возврат <b>'.$data_v["operation"].'</b><br> Дата: <b>'.$data_v["date"].'<br> '.$paym_txt.'</div>';
+
+                if(!empty($row["check_id"]) and !empty($phone)) {
+                    $id_ol = $db::getValue("SELECT  check_id FROM users_bonus WHERE phone=? AND check_id=? AND tip='minus' 
+AND tip_sale='vozvrat' LIMIT 1",[$phone,$data_v["id"]]);
+                    if(empty($id_ol)) {
+                        $db::sql("INSERT INTO users_bonus (name, phone,date,store_id,check_id,tip,tip_sale,price,bonus) 
+VALUES ('Возврат по чеку', ?,?,?,?,'minus','vozvrat',?,?)",
+                            [$phone, $data_v["date"], $row["store_id"], $data_v["id"],$data_v["summ"] ,$row["bonus"] ]);
+                        get_bonus_balans($phone, "update");
+                    }
+
+                }
+            }
+        }
+
+
+        /*function insert_bonus_vozvrat($phone,$check_id) {
+        global $db;
+        $id_ol = $db::getValue("SELECT  check_id FROM users_bonus WHERE phone=? AND check_id=? AND tip='minus' AND tip_sale='vozvrat' LIMIT 1",[$phone,$check_id]);
+        if(empty($id_ol)) {
+
+        $data_v = $db::getRow("SELECT id, date, payments,summ FROM sales WHERE sales_check=?",[$row["check_id"]]);
+
+
+
+        $db::sql("INSERT INTO users_bonus (name, phone,date,store_id,check_id,tip,tip_sale,price,bonus)
+        VALUES ('Возврат по чеку', ?,?,?,?,'minus','vozvrat',?,?)",
+        [$phone, $data_v["date"], $row["store_id"], $check_id,$data_v["summ"] ,$row["bonus"] ]);
+        get_bonus_balans($phone, "update");
+        }
+
+        }*/
+
+
+        echo'</td>
+<td>'.$store_arr[$row["store_id"]].', '.$user_arr[$row["admin_id"]].'</td>
+<td>'.$row["name"].' Сумма покупки: '.$row["price"].'';
+        $row["price_skidka"]=(int)$row["price_skidka"];
+        if(!empty($row["price_skidka"])) echo'Скидка:'.$row["price_skidka"];
+
+        echo $zov;
+
+        echo'</td><td>'.$row["date_end"].'</td></tr>';
+    }
+
+    echo'<tr><td colspan=2>Итого Списано бонусов: '.$minus.'</td></tr>';
+
+    echo'</tbody></table>';
+
+}
+
+
diff --git a/erp24/views/bonus/ajax-bonus-remove.php b/erp24/views/bonus/ajax-bonus-remove.php
new file mode 100644 (file)
index 0000000..e843cde
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
+if(!empty($_REQUEST["id"])) {
+    $id=(int)$_REQUEST["id"];
+
+    if($_SESSON["group_id"]<3) {
+        $db::sql("DELETE FROM users_bonus WHERE id=? LIMIT 1",[$id]);
+        echo"Удален $id !";
+    }
+
+
+}
+
+
diff --git a/erp24/views/bonus/ajax-user-add-stop-list.php b/erp24/views/bonus/ajax-user-add-stop-list.php
new file mode 100644 (file)
index 0000000..6a98477
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
+error_reporting(E_ALL ^ E_NOTICE);
+
+if(!empty($_REQUEST["phone"])) {
+    $phone=(int)$_REQUEST["phone"];
+    $db::sql("INSERT IGNORE INTO users_stop_list (phone,date, admin_id) VALUES (?,NOW(),?)",[$phone,$_SESSION["admin_id"]]);
+    $db::sql("UPDATE users SET black_list='1' WHERE phone=?",[$phone]);
+    echo"Добавлен!";
+
+}
+
+
diff --git a/erp24/views/bonus/ajax-user-remove-stop-list.php b/erp24/views/bonus/ajax-user-remove-stop-list.php
new file mode 100644 (file)
index 0000000..e872a55
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
+error_reporting(E_ALL ^ E_NOTICE);
+
+if(!empty($_REQUEST["phone"])) {
+    $phone=(int)$_REQUEST["phone"];
+    $db::sql("DELETE  FROM users_stop_list WHERE phone=?",[$phone]);
+    $db::sql("UPDATE users SET black_list='0' WHERE phone=?",[$phone]);
+    echo"Удален из стоп листа!";
+
+}
+
+
diff --git a/erp24/views/bonus/users.php b/erp24/views/bonus/users.php
new file mode 100644 (file)
index 0000000..85fc4f0
--- /dev/null
@@ -0,0 +1,317 @@
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+include_once(dirname(__DIR__, 2) . "/inc/design_new.php");
+include_once(dirname(__DIR__, 2) . "/inc/uni2.php");
+include_once(dirname(__DIR__, 2) . "/inc/bonus.php");
+
+global $modul,$act;
+$modul="bonus";
+$act="users";
+
+error_reporting(E_ALL ^ E_NOTICE);
+
+/*
+$arr["bonus"]=rand(10,999);
+$arr["phone"]="7".rand(0,9)."".rand(0,9)."".rand(0,9)."".rand(0,9)."".rand(0,9)."".rand(0,9)."".rand(0,9)."".rand(0,9)."".rand(0,9)."";
+$arr["name"]="Добавлен бонус за приведенного друга +".$arr["bonus"]." ";
+$arr["lid_id"]="".rand(1000,999999)."";
+$arr["site_id"]=1;
+$arr["store_id"]=0;
+$arr["tip"]="minus";
+$arr["ip"]="1.1.1.".rand(0,99).".1";
+$arr["user_id"]=rand(1,9);
+bonus_act($arr);
+*/
+//bonus_user_add();
+
+
+$arr["bonus"]=150;
+$arr["date"]="".rand(2014,2021)."-".rand(01,12)."-".rand(01,31)."";
+$arr["name"]="мама ".rand(0,99)." (".$arr["date"].")";
+//user_date_add($arr);
+
+
+
+
+/*
+$q = mysql_query("SELECT * FROM users_bonus WHERE 1 order by date");
+$users_bonus=array();
+while ($row = mysql_fetch_array($q)) {
+$users_bonus[$row["user_id"]] .= " <br>".$row["tip"]." ".$row["bonus"]."  ".$row["name"]." ".$row["date"]." ";
+
+}
+
+$q = mysql_query("SELECT * FROM users_date WHERE 1 order by date");
+
+while ($row = mysql_fetch_array($q)) {
+$users_date[$row["user_id"]] .= " <br>".$row["name"]." ".$row["date"]."  ".$row["date_end"]." ".$row["date_end"]." ";
+}
+
+*/
+$get="";
+$where=" AND id>? ";
+$binding[]=0;
+
+if(!empty($_REQUEST["search"])) {
+    foreach($_REQUEST["search"] as $pole =>$val) {
+        $search[$pole]=$val;
+        if(!empty($val)) {
+            $get .="&search[$pole]=$val";
+            $where .=" AND $pole LIKE ?";
+            $binding[]='%'.$val.'%';
+        }
+    }
+
+
+}
+$sort_by="date"; $asc_desc="DESC";
+if(!empty($_REQUEST["sort_by"]))  $sort_by=htmlentities($_REQUEST["sort_by"]);
+if(!empty($_REQUEST["asc_desc"]))  $asc_desc=htmlentities($_REQUEST["asc_desc"]);
+
+
+
+
+$where .="order by $sort_by $asc_desc";
+
+
+// получаем кол-во записей
+$resultNum = $db::getRow("SELECT COUNT(*) as postNum FROM users WHERE 1 $where ",$binding); //'%'.$name.'%'
+$rowCount = $resultNum['postNum'];
+
+$limit = 100;
+$offset = !empty($_GET['p'])?(($_GET['p']-1)*$limit):0;
+$offset=(int)$offset;
+
+echo $where;
+$data = $db::getRows("SELECT *,DATE_FORMAT(bdate,'%d.%m.%Y') as bdate2,DATE_FORMAT(date,'%d.%m.%Y %H:%i') as date2 FROM users WHERE 1 $where   LIMIT $offset,$limit",$binding);
+
+echo"<h1>Клиенты в программе лояльности</h1> ";
+// $where ".print_r($binding)."
+//пагинация
+if(!empty($data))  {
+    //инициализируем класс pagination
+    $pagConfig = array(
+        'baseURL'=>'/'.$modul.'/'.$act.'/?'.$get,
+        'totalRows'=>$rowCount,
+        'perPage'=>$limit
+    );
+    $pagination =  new Pagination($pagConfig);
+    echo $pagination->createLinks();
+
+}
+
+
+echo"<div class=\"table-rosponsive\"><form method=post action=\"/$modul/$act/\">
+<input type=\"hidden\" name=\"_csrf\" value=\"" . Yii::$app->request->getCsrfToken() . "\" />
+<table class=\"table table-bordered table-sm\">
+<thead><th>дата добавления</th><th>Клиент <br> <input type=text name=search[name] value=\"".$search["name"]."\">
+<button type=submit class=\"btn btn-success btn-sm\">поиск</button>
+</th><th>Телефон <br> <input type=text name=search[phone] value=\"".$search["phone"]."\">
+<button type=submit class=\"btn btn-success btn-sm\">поиск</button>
+</th><th>продаж</th>
+<th>Даты клиента</th>
+
+<th>дата рождения</th>
+<th>Баланс</th><th>потрачено</th><th>Пароль и код </th></thead><tbody>";
+
+
+$filter=array(
+    "sale_cnt" => "Продаж",
+    "bonus_minus" => "Потрачено бонусов",
+    "sale_avg_price" => "Средний чек",
+    "sale_price" => "Сумма продажи",
+    "balans" => "Баланс",
+    "date" => "Дате добавления" ,
+    "date_last_sale" => "Дате последней продажи" ,
+
+
+);
+
+echo'<tr><td colspan=7><select class="form-control" name=sort_by style="width:200px;">';
+foreach($filter as $pole =>$name) {
+    echo'<option value='.$pole.''; if($pole==$sort_by) echo' selected'; echo'>'.$name.'</option>';
+
+}
+
+echo'</select>
+<button type=submit name=asc_desc value="DESC" class="btn btn-success btn-sm">сортировать по уменшьшению</button>
+<button type=submit  name=asc_desc value="ASC" class="btn btn-success btn-sm">по возрастнию</button>
+
+</td></tr>';
+$pol_arr=array("man"=>"М","women"=>"Ж","none"=>"-",""=>"-");
+
+foreach ($data as $row) {
+    $balans="";
+    if(!isset($_SESSION["balance_usr"][$row["phone"]])) {
+        $balans=get_bonus_balans($row["phone"],'update');
+        $_SESSION["balance_usr"][$row["phone"]]=1;
+
+    }
+
+
+    echo'<tr id=tr_'.$row["id"].' onclick="$(\'#trr_'.$row["id"].'\').toggle();"; class="bg-'; if(!empty($row["black_list"])) echo'gray-900';  elseif($row["sale_cnt"]>3) echo'danger'; echo'">
+<td>'.$row["date2"].'</td>
+<td><span onclick="ajax_bonus_history('.$row["id"].',\''.$row["phone"].'\');" class="btn btn-success m-2">+</span> ';
+
+
+    if($_SESSION["group_id"]<5) echo'<a href="/users/add/?id='.$row["id"].'" class="btn btn-info">';
+    echo $row["name"];
+    if($_SESSION["group_id"]<5) echo'</a>';
+
+
+    echo '  '.$row["comment"].'';
+
+    echo'</td><td>'.$row["phone"].'</td><td>'.$row["sale_cnt"].'</td>
+<td><a href="/users_events/edit/?phone='.$row["phone"].'" target=new class="btn btn-sm btn-';
+    $date1 = $db::getValue("SELECT date FROM users_events WHERE  phone=? LIMIT 1",[phoneClear($row["phone"])]);
+
+    if(!empty($date1)) echo'success'; else echo'default';
+    echo'">даты клиента</a></td><td>';
+    if($row["bdate"]!='0000-00-00') {
+
+        $barr=explode("-",$row["bdate"]);
+        echo '<small>'.$barr[2].'.'.$barr[1].'.'.$barr[0].'</small>';
+        $vozrast=date("Y")-(float)$barr[0];
+        echo'('.$vozrast.')';
+    }
+
+
+    echo'</td>
+
+
+
+<td>'.$row["balans"].' <font color=red>'.$balans.'</font></td><td>'.$row["bonus_minus"].'</td>
+<td> '.$row["referal_id"].'
+ Сума продажи '.$row["sale_price"].'
+';
+
+    if(empty($row["black_list"]))
+        echo'<span class="btn btn-primary" onclick="ajax_user_add_stop_list('.$row["phone"].');" id=tdstop_'.$row["phone"].'>в черный список</span>';
+    if(!empty($row["black_list"]))
+        echo'<span class="btn btn-success" onclick="ajax_user_remove_stop_list('.$row["phone"].');" id=tdstop_'.$row["phone"].'>удалить из стоплиста</span>';
+
+
+
+
+
+    echo'</td><td>'.$row["sale_store"].'
+</td></tr>';
+//'.$row["password"].' <tr><td colspan=4>'.$users_bonus[$row["id"]].' '.$users_date[$row["id"]].'</td></tr>
+}
+echo'</tbody></table></form></div>';
+
+if(!empty($data))  echo $pagination->createLinks();
+
+
+
+//
+
+
+$_CONFIG["jscss"]="
+
+
+
+<script>
+const param8x = $('meta[name=csrf-param]').attr('content');
+const token8x = $('meta[name=csrf-token]').attr('content');
+
+
+function ajax_bonus_history(id,phone) {
+
+$.ajax({
+       url: '/bonus/ajax-bonus-history/',
+       method: 'post',       
+       dataType: 'html',        
+       data: {id: ''+id+'',phone: ''+phone+'', [param8x]: token8x},  
+       success: function(data){  
+    $('#tr_'+id).after('<tr id=\"trr_'+id+'\" class=\"bg-gray-400\"><td colspan=10>'+data+'</td></tr>');
+       }}); 
+}
+
+function ajax_user_add_stop_list(phone) {
+$.ajax({
+       url: '/bonus/ajax-user-add-stop-list/',
+       method: 'post',       
+       dataType: 'html',        
+       data: {phone: ''+phone+'', [param8x]: token8x},  
+       success: function(data){  
+    $('#tdstop_'+phone).html(data);
+       }}); 
+}
+
+
+function ajax_user_remove_stop_list(phone) {
+$.ajax({
+       url: '/bonus/ajax-user-remove-stop-list/',
+       method: 'post',       
+       dataType: 'html',        
+       data: {phone: ''+phone+'', [param8x]: token8x},  
+       success: function(data){  
+    $('#tdstop_'+phone).html(data);
+       }}); 
+}
+
+
+
+function ajax_bonus_remove(id) {
+$.ajax({
+       url: '/bonus/ajax-bonus-remove/',
+       method: 'post',       
+       dataType: 'html',        
+       data: { id: ''+id+'', [param8x]: token8x},  
+       success: function(data){  
+    $('#his'+id).html(data);
+       }}); 
+}
+
+
+
+function ajax_show_check(id) {
+ jQuery('#modal-7').modal('show', {backdrop: 'static'}); $('#modal-7 .modal-title').text('');  
+$.ajax({
+       url: '/bonus/ajax-show-check/',
+       method: 'post',       
+       dataType: 'html',        
+       data: { id: ''+id+'', [param8x]: token8x},  
+       success: function(data){  
+       $('#modal-7 .modal-body').html(data);
+       }}); 
+}
+
+
+</script>";
+
+
+
+
+
+
+echo'<!-- MODAL -->
+               <div class="modal fade" id="modal-7">
+                       <div class="modal-dialog modal-dialog-centered text-center" role="document">
+                               <div class="modal-content modal-content-demo">
+                                       <div class="modal-header">
+                                               <h6 class="modal-title"></h6><button aria-label="Close" class="btn-close" data-bs-dismiss="modal" type="button"><span aria-hidden="true">&times;</span></button>
+                                       </div>
+                                       <div class="modal-body">
+                               
+                                       </div>
+                                       <div class="modal-footer">
+                                               
+                                        <button class="btn btn-secondary" data-bs-dismiss="modal" type="button">закрыть</button>
+                                       </div>
+                               </div>
+                       </div>
+               </div>
+
+';
+
+
+
+
+include_once dirname(__DIR__, 2) . '/templates/bottom_light.php';
+