Browse Source

Merge branch 'master' of http://git.bocai108.com:10180/Ethan/Customer-Service

vali 6 years ago
parent
commit
6d97d207dc

+ 47 - 31
application/admin/controller/Report.php

@@ -26,32 +26,41 @@ class Report extends Base
      */
      */
     public function index()
     public function index()
     {
     {
-        $param = input('param.');
-        $startTime = isset($param['start']) ? $param['start'] : date('Y-m-d', strtotime("-6 day"));
-        $endTime = isset($param['end']) ? $param['end'] : date('Y-m-d');
-        $timeInterval = $this->Date_segmentation($startTime, $endTime);
-        $queueData = [];
-        $chatData = [];
-        $serviceData = [];
-        $xData = [];
+        $param             = input('param.');
+        $startTime         = isset($param['start']) === true ? $param['start'] : date('Y-m-d', strtotime("-6 day"));
+        $endTime           = isset($param['end']) === true ? $param['end'] : date('Y-m-d');
+        $timeInterval      = $this->Date_segmentation($startTime, $endTime);
+        $queueData         = []; // 排队数据.
+        $chatData          = []; // 消息数据.
+        $serviceData       = []; // 会话数据.
+        $xData             = []; // x轴数据.
+        $system            = []; // 系统数据.
+        $evaluateGood      = 0;  // 好评数.
+        $evaluateSecondary = 0;  // 中评数.
+        $evaluateBad       = 0;  // 差评数.
+        $evaluateNo        = 0;  // 未评数.
         foreach ($timeInterval['days_list'] as $k => $value) {
         foreach ($timeInterval['days_list'] as $k => $value) {
-            $allCount = 0;
-            $evaluateGood = 0;
-            $evaluateSecondary = 0;
-            $evaluateBad = 0;
-            $evaluateNo = 0;
+            $allCount = 0;  // 会话总数.
             $dayBegin = strtotime($value);
             $dayBegin = strtotime($value);
-            $dayEnd = strtotime($value) + 24 * 60 * 60;
-            $chatLogCountWhere['start_time'] = ['between', [$dayBegin, $dayEnd]];
-            $join = [
+            $dayEnd   = (strtotime($value) + 24 * 60 * 60);
+            $chatLogCountWhere['start_time'] = [
+                'between',
+                [
+                    $dayBegin,
+                    $dayEnd,
+                ],
+            ];
+            $join  = [
                 'alarm b' => 'a.servicelog_id = b.servicelog_id',
                 'alarm b' => 'a.servicelog_id = b.servicelog_id',
             ];
             ];
-            $field = ['alarm_count', 'evaluate_id', 'system'];
-            $system = [];
-            $systemCount = [];
+            $field = [
+                'alarm_count',
+                'evaluate_id',
+                'system',
+            ];
             // 查询当天的工单.
             // 查询当天的工单.
             $serviceLog = model('serviceLog')->selectServiceLog($field, $join, $chatLogCountWhere);
             $serviceLog = model('serviceLog')->selectServiceLog($field, $join, $chatLogCountWhere);
-            foreach ($serviceLog as $ke => $va) {
+            foreach ($serviceLog as $va) {
                 $allCount += $va['alarm_count'];
                 $allCount += $va['alarm_count'];
                 if ($va['evaluate_id'] == 1) {
                 if ($va['evaluate_id'] == 1) {
                     $evaluateGood++;
                     $evaluateGood++;
@@ -62,38 +71,45 @@ class Report extends Base
                 } elseif ($va['evaluate_id'] == 0) {
                 } elseif ($va['evaluate_id'] == 0) {
                     $evaluateNo++;
                     $evaluateNo++;
                 }
                 }
-                if (!isset($system[$va['system']])) {
+
+                if (isset($system[$va['system']]) === false) {
                     $system[$va['system']] = 1;
                     $system[$va['system']] = 1;
+
                 } else {
                 } else {
                     $system[$va['system']]++;
                     $system[$va['system']]++;
                 }
                 }
             }
             }
+
             // 会话总数.
             // 会话总数.
-            $xData[] = $value;
+            $xData[]      = $value;
             $chatData[$k] = $allCount;
             $chatData[$k] = $allCount;
             // 当天工单总数.
             // 当天工单总数.
             $serviceData[$k] = model('serviceLog')->countServiceLog($chatLogCountWhere);
             $serviceData[$k] = model('serviceLog')->countServiceLog($chatLogCountWhere);
-        }
+        }//end foreach
+
         foreach ($system as $k => $v) {
         foreach ($system as $k => $v) {
             $systemCount[] = [
             $systemCount[] = [
                 'value' => $v,
                 'value' => $v,
-                'name' => $k,
+                'name'  => $k,
             ];
             ];
         }
         }
 
 
         $queueData = (new  Countmidtable())->getQueryDay($timeInterval['days_list']);
         $queueData = (new  Countmidtable())->getQueryDay($timeInterval['days_list']);
 
 
+        $defaultTime = "$startTime , $endTime";
+
         $this->assign([
         $this->assign([
-            'xData' => json_encode($xData),
-            'chatData' => json_encode($chatData),
+            'xData'       => json_encode($xData),
+            'chatData'    => json_encode($chatData),
             'serviceData' => json_encode($serviceData),
             'serviceData' => json_encode($serviceData),
-            'queueData' => json_encode($queueData),
+            'queueData'   => json_encode($queueData),
             'systemCount' => json_encode($systemCount),
             'systemCount' => json_encode($systemCount),
-            'evaluate' => json_encode([
-                'evaluateGood' => $evaluateGood,
+            'defaultTime' => json_encode($defaultTime),
+            'evaluate'    => json_encode([
+                'evaluateGood'      => $evaluateGood,
                 'evaluateSecondary' => $evaluateSecondary,
                 'evaluateSecondary' => $evaluateSecondary,
-                'evaluateBad' => $evaluateBad,
-                'evaluateNo' => $evaluateNo,
+                'evaluateBad'       => $evaluateBad,
+                'evaluateNo'        => $evaluateNo,
             ]),
             ]),
         ]);
         ]);
 
 

+ 119 - 71
application/admin/view/report/index.html

@@ -9,6 +9,7 @@
     <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
     <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
     <link href="__CSS__/style.min.css?v=4.1.0" rel="stylesheet">
     <link href="__CSS__/style.min.css?v=4.1.0" rel="stylesheet">
+    <link href="__JS__/layui/css/layui.css" rel="stylesheet">
 </head>
 </head>
 <body class="gray-bg">
 <body class="gray-bg">
 <div class="wrapper wrapper-content">
 <div class="wrapper wrapper-content">
@@ -20,9 +21,25 @@
         <div class="col-sm-12">
         <div class="col-sm-12">
             <div class="ibox float-e-margins">
             <div class="ibox float-e-margins">
                 <div class="ibox-title">
                 <div class="ibox-title">
-                    <h5>今日数据分析</h5>
+                    <h5>会话总览</h5>
                 </div>
                 </div>
                 <div class="ibox-content">
                 <div class="ibox-content">
+                    <!--搜索框开始-->
+                    <form id='commentForm' role="form" method="post" class="form-inline pull-right">
+                        <div class="content clearfix m-b">
+                            <div class="form-group">
+                                <label>时间区间:</label>
+                                <div class="layui-input-inline">
+                                    <input style="width: 180px;" type="text" class="layui-input" name="daterang" id="daterang" value={$defaultTime} placeholder="时间段"
+                                           readonly="">
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <button class="btn btn-primary" type="button" style="margin-top:5px" id="search"><strong>搜 索</strong>
+                                </button>
+                            </div>
+                        </div>
+                    </form>
                     <div class="ibox-content" style="height: 350px" id="bar">
                     <div class="ibox-content" style="height: 350px" id="bar">
 
 
                     </div>
                     </div>
@@ -40,19 +57,23 @@
         <div class="col-sm-12">
         <div class="col-sm-12">
             <div class="ibox float-e-margins">
             <div class="ibox float-e-margins">
                 <div style="display: flex;">
                 <div style="display: flex;">
-                    <div class="ibox-title" style="width: 50%;">
-                        <h5>今日数据分析</h5>
-                    </div>
-                    <div class="ibox-title" style="width: 50%;">
-                        <h5>今日数据分析</h5>
-                    </div>
-                </div>
-                <div class="ibox-content no-padding" style="display: flex;">
-                    <div class="ibox-content" style="width: 50%;height: 350px" id="pie_evaluate">
+                    <div style="width: 50%;">
+                        <div class="ibox-title">
+                            <h5>满意度</h5>
+                        </div>
+                        <div class="ibox-content" style="height: 350px" id="pie_evaluate">
 
 
+                        </div>
                     </div>
                     </div>
-                    <div class="ibox-content" style="width: 50%;height: 350px" id="pie_system">
+                    <div style="width: 50%; border-left: 1px solid #e7eaec;">
+                        <div class="ibox-title">
+                            <h5>访问来源</h5>
+                        </div>
+                        <div id="system_data" style="text-align: center; width: 100%; font-size: 16px;">
+                            <div class="ibox-content" style="height: 350px" id="pie_system">
 
 
+                            </div>
+                        </div>
                     </div>
                     </div>
                 </div>
                 </div>
             </div>
             </div>
@@ -63,13 +84,14 @@
 <script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
 <script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
 <script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
 <script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
 <script src="/static/admin/js/plugins/echarts/echarts.min.js"></script>
 <script src="/static/admin/js/plugins/echarts/echarts.min.js"></script>
+<script src="__JS__/layui/layui.all.js"></script>
 <script type="text/javascript">
 <script type="text/javascript">
     var xData = {$xData};
     var xData = {$xData};
     var chatData = {$chatData};
     var chatData = {$chatData};
     var serviceData = {$serviceData};
     var serviceData = {$serviceData};
     var queueData = {$queueData};
     var queueData = {$queueData};
     var evaluate = {$evaluate};
     var evaluate = {$evaluate};
-    var systemCount = {$systemCount};
+    var systemCount = {$systemCount}.length  ? {$systemCount} : '';
     // 基于准备好的dom,初始化echarts实例
     // 基于准备好的dom,初始化echarts实例
     var myChart_bar = echarts.init(document.getElementById('bar'));
     var myChart_bar = echarts.init(document.getElementById('bar'));
     var pie_evaluate = echarts.init(document.getElementById('pie_evaluate'));
     var pie_evaluate = echarts.init(document.getElementById('pie_evaluate'));
@@ -258,74 +280,100 @@
             }
             }
         }]
         }]
     };
     };
-    var option_PS = {
-        backgroundColor: '#fff',
 
 
-        tooltip: {
-            trigger: 'item',
-            formatter: "{b} : {c} ({d}%)"
-        },
+    // 使用刚指定的配置项和数据显示图表。
+    pie_evaluate.setOption(option_PE);
+    if (systemCount) {
+        var option_PS = {
+            backgroundColor: '#fff',
 
 
-        visualMap: {
-            show: false,
-            min: 500,
-            max: 600,
-            inRange: {
-                //colorLightness: [0, 1]
-            }
-        },
-        series: [{
-            name: '满意度',
-            type: 'pie',
-            radius: '50%',
-            center: ['50%', '50%'],
-            color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'], //'#FBFE27','rgb(11,228,96)','#FE5050'
-            data: systemCount.sort(function(a, b) {
-                return a.value - b.value
-            }),
-            roseType: 'radius',
+            tooltip: {
+                trigger: 'item',
+                formatter: "{b} : {c} ({d}%)"
+            },
 
 
-            label: {
-                normal: {
-                    formatter: ['{c|{c}次}', '{b|{b}}'].join('\n'),
-                    rich: {
-                        c: {
-                            color: 'rgb(241,246,104)',
-                            fontSize: 20,
-                            fontWeight:'bold',
-                            lineHeight: 5
+            visualMap: {
+                show: false,
+                min: 500,
+                max: 600,
+                inRange: {
+                    //colorLightness: [0, 1]
+                }
+            },
+            series: [{
+                name: '满意度',
+                type: 'pie',
+                radius: '50%',
+                center: ['50%', '50%'],
+                color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'], //'#FBFE27','rgb(11,228,96)','#FE5050'
+                data: systemCount.sort(function(a, b) {
+                    return a.value - b.value
+                }),
+                roseType: 'radius',
+
+                label: {
+                    normal: {
+                        formatter: ['{c|{c}次}', '{b|{b}}'].join('\n'),
+                        rich: {
+                            c: {
+                                color: 'rgb(241,246,104)',
+                                fontSize: 20,
+                                fontWeight:'bold',
+                                lineHeight: 5
+                            },
+                            b: {
+                                color: 'rgb(98,137,169)',
+                                fontSize: 15,
+                                height: 40
+                            },
                         },
                         },
-                        b: {
+                    }
+                },
+                labelLine: {
+                    normal: {
+                        lineStyle: {
                             color: 'rgb(98,137,169)',
                             color: 'rgb(98,137,169)',
-                            fontSize: 15,
-                            height: 40
                         },
                         },
-                    },
-                }
-            },
-            labelLine: {
-                normal: {
-                    lineStyle: {
-                        color: 'rgb(98,137,169)',
-                    },
-                    smooth: 0.2,
-                    length: 10,
-                    length2: 20,
+                        smooth: 0.2,
+                        length: 10,
+                        length2: 20,
 
 
+                    }
+                },
+                itemStyle: {
+                    normal: {
+                        shadowColor: 'rgba(0, 0, 0, 0.8)',
+                        shadowBlur: 50,
+                    }
                 }
                 }
-            },
-            itemStyle: {
-                normal: {
-                    shadowColor: 'rgba(0, 0, 0, 0.8)',
-                    shadowBlur: 50,
-                }
-            }
-        }]
-    };
+            }]
+        };
+        pie_system.setOption(option_PS);
+    } else {
+        let pie_system_html = "<div style='margin-top: 150px;'>暂无数据</div>";
+        $("#system_data").html(pie_system_html);
+    }
 
 
-    // 使用刚指定的配置项和数据显示图表。
-    pie_evaluate.setOption(option_PE);
-    pie_system.setOption(option_PS);
+    function search() {
+        let daterang = $("#daterang").val();
+        let data = daterang.split(",");
+        let start = data[0];
+        let end = data[1];
+        window.location.href = '/admin/report/index?start='+start+'&end='+end;
+    }
+    $(document).ready(function () {
+
+        //当点击查询按钮的时候执行
+        $("#search").bind("click", search);
+    });
+    layui.use('laydate', function () {
+        var laydate = layui.laydate;
+        laydate.render({
+            elem: '#daterang'
+            , range: ','
+        });
+
+    });
 </script>
 </script>
 </body>
 </body>
 </html>
 </html>

+ 1 - 1
application/service/controller/Login.php

@@ -70,4 +70,4 @@ class Login extends Controller
 
 
         $this->redirect(url('login/index'));
         $this->redirect(url('login/index'));
     }
     }
-}
+}

+ 69 - 72
vendor/GatewayWorker_linux/GatewayWorker/vendor/workerman/gateway-worker/src/Lib/Gateway.php

@@ -53,7 +53,7 @@ class Gateway
      * @var bool
      * @var bool
      */
      */
     public static $persistentConnection = true;
     public static $persistentConnection = true;
-    
+
     /**
     /**
      * 向所有客户端连接(或者 client_id_array 指定的客户端连接)广播消息
      * 向所有客户端连接(或者 client_id_array 指定的客户端连接)广播消息
      *
      *
@@ -170,7 +170,7 @@ class Gateway
     {
     {
         return (int)self::getClientIdByUid($uid);
         return (int)self::getClientIdByUid($uid);
     }
     }
-    
+
     /**
     /**
      * 判断某个客户端连接是否在线
      * 判断某个客户端连接是否在线
      *
      *
@@ -261,7 +261,7 @@ class Gateway
     {
     {
         return self::getAllClientSessions($group);
         return self::getAllClientSessions($group);
     }
     }
-    
+
     /**
     /**
      * 获取所有连接数
      * 获取所有连接数
      *
      *
@@ -319,10 +319,10 @@ class Gateway
         }
         }
         return $client_list;
         return $client_list;
     }
     }
-    
+
     /**
     /**
      * 生成验证包,用于验证此客户端的合法性
      * 生成验证包,用于验证此客户端的合法性
-     * 
+     *
      * @return string
      * @return string
      */
      */
     protected static function generateAuthBuffer()
     protected static function generateAuthBuffer()
@@ -407,16 +407,15 @@ class Gateway
     }
     }
 
 
     /**
     /**
-     * 踢掉某个客户端,并以$message通知被踢掉客户端
+     * 关闭某个客户端
      *
      *
      * @param int $client_id
      * @param int $client_id
-     * @param string $message
      * @return bool
      * @return bool
      */
      */
-    public static function closeClient($client_id, $message = null)
+    public static function closeClient($client_id)
     {
     {
         if ($client_id === Context::$client_id) {
         if ($client_id === Context::$client_id) {
-            return self::closeCurrentClient($message);
+            return self::closeCurrentClient();
         } // 不是发给当前用户则使用存储中的地址
         } // 不是发给当前用户则使用存储中的地址
         else {
         else {
             $address_data = Context::clientIdToAddress($client_id);
             $address_data = Context::clientIdToAddress($client_id);
@@ -424,60 +423,22 @@ class Gateway
                 return false;
                 return false;
             }
             }
             $address      = long2ip($address_data['local_ip']) . ":{$address_data['local_port']}";
             $address      = long2ip($address_data['local_ip']) . ":{$address_data['local_port']}";
-            return self::kickAddress($address, $address_data['connection_id'], $message);
+            return self::kickAddress($address, $address_data['connection_id']);
         }
         }
     }
     }
 
 
     /**
     /**
-     * 踢掉当前客户端,并以$message通知被踢掉客户端
+     * 踢掉当前客户端
      *
      *
-     * @param string $message
      * @return bool
      * @return bool
      * @throws Exception
      * @throws Exception
      */
      */
-    public static function closeCurrentClient($message = null)
+    public static function closeCurrentClient()
     {
     {
         if (!Context::$connection_id) {
         if (!Context::$connection_id) {
             throw new Exception('closeCurrentClient can not be called in async context');
             throw new Exception('closeCurrentClient can not be called in async context');
         }
         }
-        $address = long2ip(Context::$local_ip) . ':' . Context::$local_port;
-        return self::kickAddress($address, Context::$connection_id, $message);
-    }
-
-    /**
-     * 踢掉某个客户端并直接立即销毁相关连接
-     *
-     * @param int $client_id
-     * @return bool
-     */
-    public static function destoryClient($client_id)
-    {
-        if ($client_id === Context::$client_id) {
-            return self::destoryCurrentClient();
-        } // 不是发给当前用户则使用存储中的地址
-        else {
-            $address_data = Context::clientIdToAddress($client_id);
-            if (!$address_data) {
-                return false;
-            }
-            $address      = long2ip($address_data['local_ip']) . ":{$address_data['local_port']}";
-            return self::destroyAddress($address, $address_data['connection_id']);
-        }
-    }
-
-    /**
-     * 踢掉当前客户端并直接立即销毁相关连接
-     *
-     * @return bool
-     * @throws Exception
-     */
-    public static function destoryCurrentClient()
-    {
-        if (!Context::$connection_id) {
-            throw new Exception('destoryCurrentClient can not be called in async context');
-        }
-        $address = long2ip(Context::$local_ip) . ':' . Context::$local_port;
-        return self::destroyAddress($address, Context::$connection_id);
+        return self::kickAddress(long2ip(Context::$local_ip) . ':' . Context::$local_port, Context::$connection_id);
     }
     }
 
 
     /**
     /**
@@ -634,7 +595,7 @@ class Gateway
         }
         }
         return self::setSocketSession($client_id, Context::sessionEncode($session));
         return self::setSocketSession($client_id, Context::sessionEncode($session));
     }
     }
-    
+
     /**
     /**
      * 更新 session,实际上是与老的session合并
      * 更新 session,实际上是与老的session合并
      *
      *
@@ -649,12 +610,12 @@ class Gateway
         }
         }
         return self::sendCmdAndMessageToClient($client_id, GatewayProtocol::CMD_UPDATE_SESSION, '', Context::sessionEncode($session));
         return self::sendCmdAndMessageToClient($client_id, GatewayProtocol::CMD_UPDATE_SESSION, '', Context::sessionEncode($session));
     }
     }
-    
+
     /**
     /**
      * 获取某个client_id的session
      * 获取某个client_id的session
      *
      *
      * @param int   $client_id
      * @param int   $client_id
-     * @return mixed false表示出错、null表示用户不存在、array表示具体的session信息 
+     * @return mixed false表示出错、null表示用户不存在、array表示具体的session信息
      */
      */
     public static function getSession($client_id)
     public static function getSession($client_id)
     {
     {
@@ -675,7 +636,7 @@ class Gateway
     }
     }
 
 
     /**
     /**
-     * 某个用户网关发送命令和消息
+     * 某个用户网关发送命令和消息
      *
      *
      * @param int    $client_id
      * @param int    $client_id
      * @param int    $cmd
      * @param int    $cmd
@@ -830,27 +791,11 @@ class Gateway
      * @param int    $connection_id
      * @param int    $connection_id
      * @return bool
      * @return bool
      */
      */
-    protected static function kickAddress($address, $connection_id, $message)
+    protected static function kickAddress($address, $connection_id)
     {
     {
         $gateway_data                  = GatewayProtocol::$empty;
         $gateway_data                  = GatewayProtocol::$empty;
         $gateway_data['cmd']           = GatewayProtocol::CMD_KICK;
         $gateway_data['cmd']           = GatewayProtocol::CMD_KICK;
         $gateway_data['connection_id'] = $connection_id;
         $gateway_data['connection_id'] = $connection_id;
-        $gateway_data['body'] = $message;
-        return self::sendToGateway($address, $gateway_data);
-    }
-
-    /**
-     * 销毁某个网关的 socket
-     *
-     * @param string $address
-     * @param int    $connection_id
-     * @return bool
-     */
-    protected static function destroyAddress($address, $connection_id)
-    {
-        $gateway_data                  = GatewayProtocol::$empty;
-        $gateway_data['cmd']           = GatewayProtocol::CMD_DESTROY;
-        $gateway_data['connection_id'] = $connection_id;
         return self::sendToGateway($address, $gateway_data);
         return self::sendToGateway($address, $gateway_data);
     }
     }
 
 
@@ -912,6 +857,58 @@ class Gateway
         }
         }
         return $addresses_cache;
         return $addresses_cache;
     }
     }
+
+    /**
+     * 获得访客操作系统
+     * @return string
+     */
+    public static function get_os(){
+        if (!empty($_SESSION['userAgent'])) {
+            $os = $_SESSION['userAgent'];
+            if (preg_match('/win/i', $os)) {
+                $os = 'Windows';
+            } else if (preg_match('/mac/i', $os)) {
+                $os = 'MAC';
+            } else if (preg_match('/linux/i', $os)) {
+                $os = 'Linux';
+            } else if (preg_match('/unix/i', $os)) {
+                $os = 'Unix';
+            } else if (preg_match('/bsd/i', $os)) {
+                $os = 'BSD';
+            } else {
+                $os = 'Other';
+            }
+            return $os;
+        } else {
+            return 'unknow';
+        }
+    }
+
+    /**
+     * 获得访问者浏览器
+     * @return string
+     */
+    public static function browse_info(){
+        if (!empty($_SESSION['userAgent'])) {
+            $br = $_SESSION['userAgent'];
+            if (preg_match('/MSIE/i', $br)) {
+                $br = 'MSIE';
+            } else if (preg_match('/Firefox/i', $br)) {
+                $br = 'Firefox';
+            } else if (preg_match('/Chrome/i', $br)) {
+                $br = 'Chrome';
+            } else if (preg_match('/Safari/i', $br)) {
+                $br = 'Safari';
+            } else if (preg_match('/Opera/i', $br)) {
+                $br = 'Opera';
+            } else {
+                $br = 'Other';
+            }
+            return $br;
+        } else {
+            return 'unknow';
+        }
+    }
 }
 }
 
 
 if (!class_exists('\Protocols\GatewayProtocol')) {
 if (!class_exists('\Protocols\GatewayProtocol')) {