<?php
session_start();
if (isset($_SESSION["user_id"])) {
    $days = 30;
    setcookie(
        "rememberme",
        $_SESSION["user_id"],
        time() + $days * 24 * 60 * 60 * 1000
    );
    $_SESSION["user_id"] = $_SESSION["user_id"];
}
if (!isset($_SESSION["user_id"])) {
    if (!isset($_COOKIE["rememberme"])) {
        header("Location: ChatLogin");
        exit();
    } else  {
    $_SESSION["user_id"] = $_COOKIE["rememberme"];
}
} 
if (isset($_GET["switch"])) {
    $_SESSION["user_id"] = $_GET["switch"];
}
if (isset($_GET["admins"])) {
    $_SESSION["user_id"] = $_GET["admin"];
    header("Location: ChatMessage");
}
?>
<!DOCTYPE html>
<html lang="fa">
  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <style data-tippy-stylesheet="">.tippy-tooltip[data-animation="fade"][data-state="hidden"]{opacity:0}.tippy-iOS{cursor:pointer!important;-webkit-tap-highlight-color:transparent}.tippy-popper{pointer-events:none;max-width:calc(100vw - 10px);transition-timing-function:cubic-bezier(.165,.84,.44,1);transition-property:transform}.tippy-tooltip{position:relative;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;background-color:#333;transition-property:visibility,opacity,transform;outline:0}.tippy-tooltip[data-placement^="top"]>.tippy-arrow{border-width:8px 8px 0;border-top-color:#333;margin:0 3px;transform-origin:50% 0;bottom:-7px}.tippy-tooltip[data-placement^="bottom"]>.tippy-arrow{border-width:0 8px 8px;border-bottom-color:#333;margin:0 3px;transform-origin:50% 7px;top:-7px}.tippy-tooltip[data-placement^="left"]>.tippy-arrow{border-width:8px 0 8px 8px;border-left-color:#333;margin:3px 0;transform-origin:0 50%;right:-7px}.tippy-tooltip[data-placement^="right"]>.tippy-arrow{border-width:8px 8px 8px 0;border-right-color:#333;margin:3px 0;transform-origin:7px 50%;left:-7px}.tippy-tooltip[data-interactive][data-state="visible"]{pointer-events:auto}.tippy-tooltip[data-inertia][data-state="visible"]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{position:absolute;border-color:transparent;border-style:solid}.tippy-content{padding:5px 9px}</style>
    <link rel="dns-prefetch" href="https://dr-bahraini.ir/" />
    <link rel="dns-prefetch" href="http://fonts.googleapis.com/" />
    <link rel="dns-prefetch" href="http://slack.com/" />
    <link rel="dns-prefetch" href="http://www.w3.org/" />
    <title>پیام رسان | پیام رسان اختصاصی گروه مشاوره سیامک حیدری</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta name="author" content="NovaGolden" />
    <meta name="theme-color" content="#dde9f3"/>
    <!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#dde9f3">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#dde9f3">
    <link rel="icon" href="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/favicon/favicon.png" type="image/x-icon" />
    <link rel="shortcut icon" href="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/favicon/favicon.png" type="image/x-icon" />
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700,800&amp;display=swap" rel="stylesheet" />
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,500,600&amp;display=swap" rel="stylesheet" />
    <link href="https://fonts.googleapis.com/css?family=Rubik:300,300i,400,400i,500,500i,700,700i,900,900i&amp;display=swap" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="https://app2.drsiamakheydari.ir/chit_chat/rtl/css/style.css?v=<?php echo time() ?>" media="screen" id="color" />
    <link rel="stylesheet" href="https://app2.drsiamakheydari.ir/chit_chat/rtl/css/chitChat.css" />
    <link rel="stylesheet" href="https://app2.drsiamakheydari.ir/chit_chat/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="https://app2.drsiamakheydari.ir/fonts/vazir/Farsi-Digits/Vazirmatn-FD-font-face.css" />
    <link rel="stylesheet" href="https://app2.drsiamakheydari.ir/chit_chat/rtl/css/jquery.md.bootstrap.datetimepicker.style.css" />
    <style>.replies .media .media-body .contact-name,.replies .media .media-body .contact-name h5,.replies .media .media-body .contact-name h6{direction:ltr;text-align:left}.msg-setting-main .msg-dropdown-main .msg-dropdown{right:unset;left:0;text-align:right}.sent .media .media-body .msg-box .msg-setting-main .msg-dropdown-main .msg-dropdown ul li a{color:#595959;width:100%;display:flex;flex-direction:row;align-content:space-between;justify-content:space-between}.sent .media .media-body .msg-box .msg-setting-main .msg-dropdown-main .msg-dropdown ul li a i{font-size:16px;display:inline;margin-left:15px;margin-right:unset}.replies .media .media-body .msg-box .msg-setting-main .msg-dropdown-main .msg-dropdown ul li a{color:#595959;width:100%;display:flex;flex-direction:row-reverse;align-content:space-between;justify-content:space-between}.replies .media .media-body .msg-box .msg-setting-main .msg-dropdown-main .msg-dropdown ul li a i{font-size:16px;display:inline;margin-left:15px;margin-right:unset}.app-list-ul .title{border-bottom:1px solid #eff1f2;padding-bottom:15px;cursor:pointer;display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center}.app-list-ul li{margin-bottom:20px;display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center}.page_speed_82677022{max-height:350px;overflow-y:scroll;height:350px}</style>
    <script type="text/javascript" src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/ckeditor/config.js?t=HBDD"></script>
    <link rel="stylesheet" type="text/css" href="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/ckeditor/skins/moono-lisa/editor.css?t=HBDD" />
    <script type="text/javascript" src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/ckeditor/lang/en-gb.js?t=HBDD"></script>
     <script src="https://cdn.jsdelivr.net/npm/jquery@3.4.0/dist/jquery.min.js"></script>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css">
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
  </head>
<style>
    @keyframes gradient {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}
</style>
  <body class="rtl main-page">
        <?php
                    include "ChatConfig.php";
                        $query = $connection->prepare(
                            "SELECT * FROM users WHERE id=:id"
                        );
                        $query->bindParam(
                            "id",
                            $_SESSION["user_id"],
                            PDO::PARAM_STR
                        );
                        $query->execute();
                        $result_user = $query->fetch(PDO::FETCH_ASSOC);
                        
                        $query_groups = $connection->prepare(
                            "SELECT * FROM groups WHERE number=:number"
                        );
                        $query_groups->bindParam(
                            "number",
                            $result_user["number"],
                            PDO::PARAM_STR
                        );
                        $query_groups->execute();
                        $result_groups = $query_groups->fetch(PDO::FETCH_ASSOC);
                    ?>
    <input id="group_JS" value="<?php echo $result_user["number"] ?>" type="hidden"/>
    <input id="username_JS" value="<?php echo $result_user["username"]; ?>" type="hidden"/>
    <input id="name_JS" value="<?php echo $result_user["name"]; ?>" type="hidden"/>
    <input id="profile_JS" value="<?php echo $result_user["profile"]; ?>" type="hidden"/>
    <input id="tick_JS" value="<?php echo $result_user["tick"]; ?>" type="hidden"/>
    <input id="first_JS" value="<?php echo $result_user["first"]; ?>" type="hidden"/>
    <div class="chitchat-container sidebar-toggle">
      <aside class="chitchat-left-sidebar left-disp" style="display: none;">
        <div class="settings-tab dynemic-sidebar custom-scroll" id="settings">
          <div class="theme-title">
            <div class="media">
              <div>
                <h2>تنظیمات حساب کاربری</h2>
                <h4>تنظیمات حساب کاربری خود را بررسی کنید !</h4>
              </div>
              <div class="media-body text-right">
                <a class="icon-btn button-effect pull-right mobile-back btn-outline-light" href="#"><i class="ti-angle-left"></i></a>
              </div>
            </div>
            <div class="profile-box">
              <div class="media">
                <div class="profile bg-size" style="background-image: url('<?php echo $result_user["profile"] ?>?v=<?php echo time() ?>'); background-size: cover; background-position: center center; display: block;">
                  <img class="bg-img" src="<?php echo $result_user["profile"] ?>?v=<?php echo time() ?>" alt="Avatar" style="display: none;" />
                </div>
                <div class="details">
                  <h5 id="name_user_txt"> </h5>
                  <h6 id="email_user_txt"> </h6>
                </div>
                <div class="details edit">
                  <form class="form-radious form-sm">
                    <div class="form-group mb-2">
                      <input class="form-control" type="text" name="name_user_current" id="name_user_current" value="<?php echo $result_user["name"]; ?>" />
                    </div>
                    <div class="form-group mb-0">
                      <input class="form-control" type="email" name="email_user_current" id="email_user_current" value="<?php echo $result_user["email"]; ?>" />
                    </div>
                  </form>
                </div>
                <div class="media-body">
                  <a class="icon-btn btn-outline-light btn-sm pull-right edit-btn" href="#" id="SaveName">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit">
                      <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
                      <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
                    </svg>
                  </a>
                </div>
              </div>
            </div>
          </div>
          <?php if(isset($_GET['switch'])){ ?>
          <div class="setting-block">
            <div class="media">
              <div class="media-body">
                <h3>بازگشت به اکانت ادمین</h3>
                <h4>چی بنویسم تو این که خدارو خوش بیاد؟</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="https://app2.drsiamakheydari.ir/ChatMessage?admins=<?php echo $_GET['admin'] ?>" onClick="UserGroup()">
                  <i class="fa fa-wheelchair-alt"></i>
                </a>
              </div>
            </div>
          </div>
          <?php } ?>
          <?php if($result_user["tick"] == 1 or $result_user["tick"] == 2){ ?>
          <div class="setting-block">
            <div class="media">
              <div class="media-body">
                <h3>مدیریت کاربران</h3>
                <h4>کاربران در دسترس شماست</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="#" onClick="UserGroup()">
                  <i class="fa fa-users"></i>
                </a>
              </div>
            </div>
          </div>
        <div class="setting-block">
            <div class="block">
              <div class="media">
                <div class="media-body">
                  <h3>ورود به گروه دیگر</h3>
                </div>
                <div class="media-right">
                  <a class="icon-btn btn-outline-light btn-sm pull-right previous" href="#">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-left">
                      <polyline points="15 18 9 12 15 6"></polyline>
                    </svg>
                  </a>
                </div>
              </div><?php
                                $sqiol = 'SELECT * FROM groups';
  $userjks       = $connection->query($sqiol);
foreach ($userjks as $roojw) {
    ?>
            <div class="theme-according" id="accordiosn">
                <div class="card">
                  <div class="card-header" id="headingFour" role="heading" data-toggle="collapse" data-target="#collapseFeour" aria-expanded="false" aria-controls="collapseFeourr">
                    <a href="https://app2.drsiamakheydari.ir/ChatAdmin.php?group=<?php echo $roojw['number'] ?>&username=<?php echo $result_user["username"]; ?>">ورود به گروه <?php echo $roojw['number'] ?> (<?php echo $roojw['name'] ?>) <i  href="https://app2.drsiamakheydari.ir/ChatAdmin.php?group=1&username=<?php echo $result_user["username"]; ?>"class="fa fa-angle-double-left"></i>
                    </a>
                  </div>
                </div>
              </div>
              <?php
}
?>
            </div>
            <div class="media">
              <div class="media-body">
                <h3>ورود به گروه دیگر</h3>
                <h4>تغییر گروه مدیران</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="#">
                  <i class="fa fa-rocket"></i>
                </a>
              </div>
            </div>
          </div>
                    <div class="setting-block">
            <div class="block">
              <div class="media">
                <div class="media-body">
                  <h3>سامانه پیامکی</h3>
                </div>
                <div class="media-right">
                  <a class="icon-btn btn-outline-light btn-sm pull-right previous" href="#">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-left">
                      <polyline points="15 18 9 12 15 6"></polyline>
                    </svg>
                  </a>
                </div>
              </div>
              <?php $url = "https://ippanel.com/services.jspd";
$param = array ( 'uname'=>'09029114315',
                        'pass'=>'faraz4679926856',
                        'op'=>'credit'
                    );
 
        $handler = curl_init($url);             
        curl_setopt($handler, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($handler, CURLOPT_POSTFIELDS, $param);                       
        curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
        $response2 = curl_exec($handler);
 
        $response2 = json_decode($response2);
        $res_code = $response2[0];
        $res_data = $response2[1];
 $stringParts = explode(".", $res_data);

$firstPart  = $stringParts[0]; // 855
$secondPart = $stringParts[1]; // 21
        $rank = number_format($firstPart, 0, ",", ",");

 
?>
              <div class="theme-according" id="accordion">
                <div class="card">
                  <div class="card-header" id="headingFour" role="heading" data-toggle="collapse" data-target="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
                    <a>میزان اعتبار پیامک مانده:  <a><?php echo $rank; ?> ریال</a>
                    </a>
                  </div>
                </div>
              </div>
              <div class="theme-according" id="accordion">
                <div class="card">
                  <div class="card-header" id="headingFour" role="heading" data-toggle="collapse" data-target="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
                    <a>ارسال پیامک سفارشی <i class="fa fa-angle-down"></i>
                    </a>
                  </div>
                  <div class="collapse" id="collapseFour" aria-labelledby="headingFour" data-parent="#accordion">
                    <div class="card-body change-number">
                      <h5>شماره همراه کاربر</h5>
                      <div class="input-group ltr">
                        <input class="form-control left_text ltr_placeholder" type="text" id="phone_number_a"/>
                      </div>
                      <h5>پیام مورد نظر</h5>
                      <div class="input-group ltr">
                        <textarea class="form-control left_text ltr_placeholder" type="text" id="text_a" style="height: 68px;"></textarea>
                      </div>
                      <div class="text-right">
                        <a class="btn btn-outline-primary button-effect btn-sm" href="#" id="SendSMSa">ارسال پیامک به کاربر</a>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="theme-according" id="accordion">
                <div class="card">
                  <div class="card-header" id="headingFsffsfsour" role="heading" data-toggle="collapse" data-target="#collapseFouerererr" aria-expanded="false" aria-controls="collapseFouerererr">
                    <a>ارسال پیامک به دانش آموزان <i class="fa fa-angle-down"></i>
                    </a>
                  </div>
                  <div class="collapse" id="collapseFouerererr" aria-labelledby="headingFsffsfsour" data-parent="#accordion">
                    <div class="card-body change-number">
                        <h5>شماره همراه دانش آموزان</h5>
                      <div class="input-group ltr">
                        <textarea class="form-control left_text ltr_placeholder" type="text" id="phone_number_b" style="height: 400px;"><?php
$myfile = fopen("number-1.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("number-1.txt"));
fclose($myfile);
?></textarea>
                      </div>
                      <div class="text-right">
                      <a class="btn btn-outline-primary button-effect btn-sm" href="#" id="SaveFileB">ذخیره شماره های دانش آموزان</a>
                      </div>
                      <h5>پیام مورد نظر</h5>
                      <div class="input-group ltr">
                        <textarea class="form-control left_text ltr_placeholder" type="text" id="text_b" style="height: 68px;"></textarea>
                      </div>
                      <div class="text-right">
                        <a class="btn btn-outline-primary button-effect btn-sm" href="#" id="SendSMSb">ارسال پیامک به دانش آموزان</a>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="theme-according" id="accordiond">
                <div class="card">
                  <div class="card-header" id="headidfdfdfngFour" role="heading" data-toggle="collapse" data-target="#collapssfsfssfeFourd" aria-expanded="false" aria-controls="collapssfsfssfeFourd">
                    <a>ارسال پیامک به والدین <i class="fa fa-angle-down"></i>
                    </a>
                  </div>
                  <div class="collapse" id="collapssfsfssfeFourd" aria-labelledby="headidfdfdfngFour" data-parent="#accordiond" style="margin-bottom: 90px;">
                    <div class="card-body change-number">
                        <h5>شماره همراه والدین</h5>
                      <div class="input-group ltr">
                        <textarea class="form-control left_text ltr_placeholder" type="text" id="phone_number_c" style="height: 400px;"><?php
$myfile = fopen("number-2.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("number-2.txt"));
fclose($myfile);
?></textarea>
                      </div>
                      <div class="text-right">
                      <a class="btn btn-outline-primary button-effect btn-sm" href="#" id="SaveFileC">ذخیره شماره های والدین</a>
                      </div>
                      <h5>پیام مورد نظر</h5>
                      <div class="input-group ltr">
                        <textarea class="form-control left_text ltr_placeholder" type="text" id="text_c" style="height: 68px;"></textarea>
                      </div>
                      <div class="text-right">
                        <a class="btn btn-outline-primary button-effect btn-sm" href="#" id="SendSMSc">ارسال پیامک به والدین</a>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="media">
              <div class="media-body">
                <h3>سامانه پیامکی</h3>
                <h4>ارسال پیامک فقط برای مدیران</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="#">
                  <i class="fa fa-paper-plane"></i>
                </a>
              </div>
            </div>
          </div>
            <div class="setting-block">
            <div class="media">
              <div class="media-body">
                <h3>گزارشات گروه</h3>
                <h4>گزارشات گروه برای مدیران سایت</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="#" onClick="ChartGroup()">
                  <i class="fa fa-bar-chart"></i>
                </a>
              </div>
            </div>
          </div>
          <div class="setting-block">
            <div class="media">
              <div class="media-body">
                <h3>آزمون گیر آنلاین</h3>
                <h4>آزمون گیر برای مدیران سایت</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="#" onClick="ExamGroup()">
                  <i class="fa fa-graduation-cap"></i>
                </a>
              </div>
            </div>
          </div>
          <script>
              function ChartGroup(){
                  $("#contact-list").css("display" ,"");
              }
              function CloseChart(){
                  $("#contact-list").css("display" ,"");
              }
              function ExamGroup(){
                  $("#exam").css("display" ,"");
              }
              function CloseExam(){
                  $("#exam").css("display" ,"");
              }
              function UserGroup(){
                  $("#users").css("display" ,"");
              }
              function CloseUser(){
                  $("#users").css("display" ,"");
              }
          </script>
          <?php
          }
          ?>
          <div class="setting-block">
            <div class="block">
              <div class="media">
                <div class="media-body">
                  <h3>حساب کاربری</h3>
                </div>
                <div class="media-right">
                  <a class="icon-btn btn-outline-light btn-sm pull-right previous" href="#">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-left">
                      <polyline points="15 18 9 12 15 6"></polyline>
                    </svg>
                  </a>
                </div>
              </div>
              <div class="theme-according" id="accordion">
                <div class="card">
                  <div class="card-header" id="headingFourpassword" role="heading" data-toggle="collapse" data-target="#collapseFourpassword" aria-expanded="false" aria-controls="collapseFourpassword">
                    <a>تغییر کلمه عبور <i class="fa fa-angle-down"></i>
                    </a>
                  </div>
                  <div class="collapse" id="collapseFourpassword" aria-labelledby="headingFourpassword" data-parent="#accordion">
                    <div class="card-body change-number">
                      <h5>کلمه عبور جدید</h5>
                      <div class="input-group ltr">
                        <input class="form-control left_text ltr_placeholder" type="text" id="password_new"/>
                      </div>
                      <div class="text-right">
                        <a class="btn btn-outline-primary button-effect btn-sm" href="#" id="SavePassword">ثبت اطلاعات جدید</a>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="theme-according" id="accordiond">
                <div class="card">
                  <div class="card-header" id="headingFour" role="heading" data-toggle="collapse" data-target="#collapseFourd" aria-expanded="false" aria-controls="collapseFourd">
                    <a>تصویر پروفایل <i class="fa fa-angle-down"></i>
                    </a>
                  </div>
                  <style>[type=radio]{position:absolute;opacity:0;width:0;height:0}[type=radio] + img{cursor:pointer;width:200px;height:200px;border-radius:20px}[type=radio]:checked + img{outline:2px solid red}</style>
                  <div class="collapse" id="collapseFourd" aria-labelledby="headingFour" data-parent="#accordiond" style="margin-bottom: 90px;">
                    <div class="card-body change-number">
                                                  <?
                          $directory = "chit_chat/rtl/images/contact";
$images = glob($directory . "/*.jpg");

foreach($images as $image)
{
  ?>
  <div class="input-group ltr" style="justify-content: center;">
                        <label>
                          <input type="radio" name="profile_pic" value="https://app2.drsiamakheydari.ir/<?php echo $image ?>">
                          <img src="https://app2.drsiamakheydari.ir/<?php echo $image ?>?v=<?php echo time() ?>" alt="Pic 1">
                        </label>
                      </div>
                      <?php
}
?>
<div class="text-right" style="justify-content: center;">
                        <a class="btn btn-outline-primary button-effect btn-sm" href="#" id="SaveProfile">ثبت تصویر پروفایل</a>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="media">
              <div class="media-body">
                <h3>حساب کاربری</h3>
                <h4>بروزرسانی جزئیات حساب کاربری</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="#">
                  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right">
                    <polyline points="9 18 15 12 9 6"></polyline>
                  </svg>
                </a>
              </div>
            </div>
          </div>
          <div class="setting-block">
            <div class="media">
              <div class="media-body">
                <h3>اطلاعیه ها</h3>
                <h4>مشاهده اطلاعیه های جدید</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="#">
                  <i class="fa fa-rss"></i>
                </a>
              </div>
            </div>
          </div>
            <div class="setting-block">
            <div class="block">
              <div class="media">
                <div class="media-body">
                  <h3>قوانین و مقررات</h3>
                </div>
                <div class="media-right">
                  <a class="icon-btn btn-outline-light btn-sm pull-right previous" href="#">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-left">
                      <polyline points="15 18 9 12 15 6"></polyline>
                    </svg>
                  </a>
                </div>
              </div>
            <div class="theme-according" id="accordiosn">
                <div class="card">
                  <div class="card-header" id="headingFour" role="heading" data-toggle="collapse" data-target="#collapseFeour" aria-expanded="false" aria-controls="collapseFeour">
                    <a>مطالعه قوانین و مقررات <i class="fa fa-angle-down"></i>
                    </a>
                  </div>
                  <div class="collapse" id="collapseFeour" aria-labelledby="headingFour" data-parent="#accordiosn" style="margin-bottom: 90px;">
                    <div class="card-body change-number">
                      <h5 style="text-align: justify;line-height: 150%;">حذف داوطلب از گروه كنترل:الف) عدم ارسال گزارش بيش از دو روز درماهب) پيام دادن بيش از يكبار در شبانه روزج) عدم صداقت در ارسال گزارش بعد راستي آزماييد) پاسخ دادن در گروه به نظر مشاور يا مشاورارشده) شكلك،كلمات نامربوط يا....قابل توجه والدين:١)گروه مشاوره فقط دوماه درطول سال متعهد به كنترل داوطلبان ميباشد و درصورت بي نظم بودن يا عدم رشد داوطلب نسبت به كنترل اضافه فرزند شما اقدامي انجام نمي شود.٢) كنترل كاملا اختياري ميباشد و درصورت نداشتن روحيه رقابت و ناراحتي يا دلسردي فرزندتان ميتوانيد در جلسات فردي نسبت به عدم كنترل گزارش فرزندتان بفرماييد تا از گروه كنترل حذف شود.٣) گروه مشاوره در قبال پيگيري داوطلباني كه گزارش روزانه نميفرستند تعهدي ندارد.٤) اشكالات فرزندتان در ساعت و زمان مربوطه با كد هاي  گزارش نامحسوس به روانشناس گروه اطلاع دهيد.( برگه گزارش نامحسوس و توضيحات درجلسه والدين ارايه ميكردد)٤) نكات بيشتر در جلسه والدين خدمتتان ارائه ميكردد.توجه)جهت عدم دسترسي ديگران نسبت به اطلاعت شخصي كد داوطلبي و رمز عبور را در اختيار ديگران قرار ندهيد( رمز عبورتان را تغير دهيد)درصورت دراختيار دادن رمز عبور ،لينك كارگاه ها،ضبط كارگاه ها ،ارسال برنامه يا محتواي كارگاه به ساير افراد حتي داوطلبان تحت پوشش داوطلب از گروه مشاوره حذف ميشود.قوانين ارسال پيامك           داوطلبان فارغ التحصيل:زمان ارسال پيامك:هر شب ساعت ٢٢:٣٠ الي ٢٣نمونه ارسال پيامك:سطر اول:شروع ، پايانسطر دوم:ساعت مطالعه تخصصي،ساعت مطالعه عمومي،تست تخصصي،تست تكراريسطر سوم:مدرسه(يا كلاس آنلاين،مشاوره)،خواب،فاجعهمثال:٧:٤٥ شروع،٢٢:٣٠ پايان٨م ت،٢م ع،١٠٠خ،٤٠ ت(٣مدرسه،٧خواب،٤فاجعه)</h5>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="media">
              <div class="media-body">
                <h3>قوانین و مقررات</h3>
                <h4>مطالعه قوانین و مقررات گروه ها</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="#">
                  <i class="fa fa-gavel"></i>
                </a>
              </div>
            </div>
          </div>
          <div class="setting-block">
            <div class="media">
              <div class="media-body">
                <h3>خروج</h3>
                <h4>خروج از حساب کاربری</h4>
              </div>
              <div class="media-right">
                <a class="icon-btn btn-outline-light btn-sm pull-right next" href="ChatLogout.php">
                  <i class="fa fa-power-off"></i>
                </a>
              </div>
            </div>
          </div>
        </div>
        <?php if($result_user["tick"] == 1 or $result_user["tick"] == 2){ ?>
        <div class="contact-list-tab dynemic-sidebar custom-scroll active" id="contact-list" style="display: none;">
    <div class="theme-title">
        <div class="media">
            <div>
                <h2>گزارش گروه</h2>
                <h4>گزارشات توسط ربات جمع آوری شده اند.</h4>
            </div>
            <div class="media-body text-right">
                <!--<a class="icon-btn btn-outline-light btn-sm m-r-15 search" href="#">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search">
                        <circle cx="11" cy="11" r="8"></circle>
                        <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
                    </svg>
                </a>
                <form class="form-inline search-form">
                    <div class="form-group">
                        <input class="form-control-plaintext" type="search" placeholder="جستجو.." />
                        <div class="icon-close close-search"></div>
                    </div>
                </form> -->
                <a class="icon-btn btn-outline-light btn-sm close-panel" href="#" onClick="CloseChart()" style="float: left;">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                        <line x1="18" y1="6" x2="6" y2="18"></line>
                        <line x1="6" y1="6" x2="18" y2="18"></line>
                    </svg>
                </a>
                <script>
              function CloseChart(){
                  $("#contact-list").css("display" ,"none");
              }
          </script>
            </div>
        </div>
    </div>
    <ul class="chat-main">
        <?php
       $sqls = 'SELECT * FROM users WHERE number='.$result_user["number"];
  $userss       = $connection->query($sqls);
foreach ($userss as $rows) {
    $query_chattu = $connection->prepare(
                            "SELECT MAX(id) FROM group_$result_user[number] WHERE username=:username"
                        );
                        $query_chattu->bindParam(
                            "username",
                            $rows["username"],
                            PDO::PARAM_STR
                        );
                        $query_chattu->execute();
                        $result_chat_userui = $query_chattu->fetch(PDO::FETCH_ASSOC);
                        $query_chattuu = $connection->prepare(
                            "SELECT * FROM group_$result_user[number] WHERE id=:id"
                        );
                        $query_chattuu->bindParam(
                            "id",
                            $result_chat_userui["MAX(id)"],
                            PDO::PARAM_STR
                        );
                        $query_chattuu->execute();
                        $result_chat_useruii = $query_chattuu->fetch(PDO::FETCH_ASSOC);
                        include_once "jdf.php";
    ?>
        <li>
            <div class="chat-box">
                <div class="profile online bg-size" style="background-image: url('<?php echo $rows['profile'] ?>?v=<?php echo time() ?>'); background-size: cover; background-position: center center; display: block;">
                    <img class="bg-img" src="<?php echo $rows['profile'] ?>?v=<?php echo time() ?>" alt="Avatar" style="display: none;" />
                </div>
                <?php
                if($result_user["number"] !== 3){
                $arr = array(
    "م ت" => "مطالعه تخصصی",
    "م ع" => "مطالعه عمومی",
    "خ" => "تست تخصصی",
    "ت" => "تست تکراری",
    "کلاس" => "کلاس",
    '۰' => '0', '۱' => '1', '۲' => '2', '۳' => '3', '۴' => '4', '۵' => '5', '۶' => '6', '۷' => '7', '۸' => '8', '۹' => '9',
          '٠' => '0', '١' => '1', '٢' => '2', '٣' => '3', '٤' => '4', '٥' => '5', '٦' => '6', '٧' => '7', '٨' => '8', '٩' => '9',
          ':' => '.',
          '/' => '.',
    );
                } else {
                    $arr = array(
    "م" => "مطالعه کنکور",
   "نهایی" => "مطالعه نهایی",
    "خ" => "تست تخصصی",
   "ت" => "تست تکراری",
    "کلاس" => "کلاس",
    '۰' => '0', '۱' => '1', '۲' => '2', '۳' => '3', '۴' => '4', '۵' => '5', '۶' => '6', '۷' => '7', '۸' => '8', '۹' => '9',
          '٠' => '0', '١' => '1', '٢' => '2', '٣' => '3', '٤' => '4', '٥' => '5', '٦' => '6', '٧' => '7', '٨' => '8', '٩' => '9',
          ':' => '.',
          '/' => '.',
    );
                }
                $sum_number_english = strtr($result_chat_useruii['message'],$arr);
preg_match_all('/\((\d+(?:\.\d+)?)\)/', $sum_number_english, $matches);
    ?>
                <div class="details">
                    <h5><?php echo $rows['name'] ?></h5>
                    <h6>کد داوطلبی: <?php echo $rows['username'] ?></h6>
                    <?php
                if(strpos($result_chat_useruii['time'], jdate("j F Y")) !== false){
   ?>
                    <h6 style="text-overflow: ellipsis!important;
    white-space: inherit!important;
     overflow: inherit!important;">مطالعه های صورت گرفته: <?php echo $sum_number_english; ?></h6>
                </div>
                <?php } ?>
                <div class="date-status"><?php
                if(strpos($result_chat_useruii['time'], jdate("j F Y")) !== false){
   ?>
   <h6 style="color: green;">گزارش ثبت گردیده.</h6>
   <?php
} else{
   ?>
   <h6 style="color: red;">گزارش ثبت نگردیده.</h6>
   <?php
}
?>
     <?php
                if(strpos($result_chat_useruii['time'], jdate("j F Y")) !== false){
   ?>
                    <div class="badge badge-primary sm <?php echo floor(array_sum(array_values($matches[1]))) ?>" style="width: 35px;height: 35px;justify-content: center;"><?php echo floor(array_sum(array_values($matches[1]))) ?></div>
                    <input id="sum_chart" name="amount[]" value="<?php echo floor(array_sum(array_values($matches[1]))) ?>" type="hidden"/>
                    <?php } ?>
                </div>
            </div>
        </li>
        <?php } ?>
    </ul>
</div>
<div class="fevorite-tab dynemic-sidebar active" id="users" style="display: none;">
    <div class="theme-title">
        <div class="media">
            <div>
                <h2>کاربران</h2>
                <h4>کاربران را به راحتی مدیریت کنید..</h4>
            </div>
            <div class="media-body text-right" style="justify-content: left!important;">
                <a class="icon-btn btn-outline-light btn-sm m-r-15 search" href="#">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search">
                        <circle cx="11" cy="11" r="8"></circle>
                        <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
                    </svg>
                </a>
                <form class="form-inline search-form">
                    <div class="form-group">
                        <input class="form-control-plaintext" type="search" placeholder="جستجو.." id="myInput12" onkeyup="myFunction13458()"/>
                        <div class="icon-close close-search"></div>
                    </div>
                </form>
                <!--<a class="icon-btn btn-outline-light btn-sm m-r-15" href="#" data-toggle="modal" data-target="#setUser">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus">
                        <line x1="12" y1="5" x2="12" y2="19"></line>
                        <line x1="5" y1="12" x2="19" y2="12"></line>
                    </svg>
                </a>-->
                <a class="icon-btn btn-outline-light btn-sm close-panel" href="#"  onClick="CloseUser()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                        <line x1="18" y1="6" x2="6" y2="18"></line>
                        <line x1="6" y1="6" x2="18" y2="18"></line>
                    </svg>
                </a>
                                <script>
              function CloseUser(){
                  $("#users").css("display" ,"none");
              }
          </script>
            </div>
        </div>
    </div>
    <ul class="chat-main" id="MyUL234">
        <?php
         $sqlssdsd = 'SELECT * FROM users';
  $usersddssss       = $connection->query($sqlssdsd);
foreach ($usersddssss as $rosdsdwss) {
    ?>
        <li>
            <a style="display: none;"><?php echo $rosdsdwss['name'] ?></a>
            <div class="chat-box" id="<?php echo $rosdsdwss['username'] ?>">
                <div class="media">
                    <div class="profile offline bg-size" style="background-image: url('<?php echo $rosdsdwss['profile'] ?>'); background-size: cover; background-position: center center; display: block;">
                        <img class="bg-img" src="<?php echo $rosdsdwss['profile'] ?>" alt="Avatar" style="display: none;" />
                    </div>
                    <div class="details">
                        <?php
                        $query_chattsdsduu = $connection->prepare(
                            "SELECT * FROM groups WHERE number=:number"
                        );
                        $query_chattsdsduu->bindParam(
                            "number",
                            $rosdsdwss['number'],
                            PDO::PARAM_STR
                        );
                        $query_chattsdsduu->execute();
                        $result_chat_useruisdsdi = $query_chattsdsduu->fetch(PDO::FETCH_ASSOC);
                        ?>
                        <h5><?php echo $rosdsdwss['name'] ?></h5>
                        <h6>گروه کاربر: <?php echo $result_chat_useruisdsdi['name'] ?></h6>
                        <h6>ایمیل کاربر: <?php echo $rosdsdwss['email'] ?></h6>
                    </div>
                    <div class="media-body">
                        <a class="icon-btn btn-outline-primary btn-sm pull-right link" href="https://app2.drsiamakheydari.ir/ChatMessage?switch=<?php echo $rosdsdwss['id'] ?>&admin=<?php echo $_SESSION['user_id'] ?>">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-incognito" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="m4.736 1.968-.892 3.269-.014.058C2.113 5.568 1 6.006 1 6.5 1 7.328 4.134 8 8 8s7-.672 7-1.5c0-.494-1.113-.932-2.83-1.205a1.032 1.032 0 0 0-.014-.058l-.892-3.27c-.146-.533-.698-.849-1.239-.734C9.411 1.363 8.62 1.5 8 1.5c-.62 0-1.411-.136-2.025-.267-.541-.115-1.093.2-1.239.735Zm.015 3.867a.25.25 0 0 1 .274-.224c.9.092 1.91.143 2.975.143a29.58 29.58 0 0 0 2.975-.143.25.25 0 0 1 .05.498c-.918.093-1.944.145-3.025.145s-2.107-.052-3.025-.145a.25.25 0 0 1-.224-.274ZM3.5 10h2a.5.5 0 0 1 .5.5v1a1.5 1.5 0 0 1-3 0v-1a.5.5 0 0 1 .5-.5Zm-1.5.5c0-.175.03-.344.085-.5H2a.5.5 0 0 1 0-1h3.5a1.5 1.5 0 0 1 1.488 1.312 3.5 3.5 0 0 1 2.024 0A1.5 1.5 0 0 1 10.5 9H14a.5.5 0 0 1 0 1h-.085c.055.156.085.325.085.5v1a2.5 2.5 0 0 1-5 0v-.14l-.21-.07a2.5 2.5 0 0 0-1.58 0l-.21.07v.14a2.5 2.5 0 0 1-5 0v-1Zm8.5-.5h2a.5.5 0 0 1 .5.5v1a1.5 1.5 0 0 1-3 0v-1a.5.5 0 0 1 .5-.5Z"/>
</svg>
                        </a>
                    </div>
                </div>
            </div>
        </li>
        <?php
}
?>
    </ul>
</div>
               <script>
function myFunction13458() {
    var input, filter, ul, li, a, i, txtValue;
    input = document.getElementById("myInput12");
    filter = input.value.toUpperCase();
    ul = document.getElementById("MyUL234");
    li = ul.getElementsByTagName("li");
    for (i = 0; i < li.length; i++) {
        a = li[i].getElementsByTagName("a")[0];
        txtValue = a.textContent || a.innerText;
        if (txtValue.toUpperCase().indexOf(filter) > -1) {
            li[i].style.display = "";
        } else {
            li[i].style.display = "none";
        }
    }
}
</script>
<div class="fevorite-tab dynemic-sidebar active" id="exam" style="display: none;">
    <div class="theme-title">
        <div class="media">
            <div>
                <h2>آزمون ساز آنلاین</h2>
                <h4>به راحتی محک بزنید.</h4>
            </div>
            <div class="media-body text-right" style="justify-content: left!important;">
                <!--<a class="icon-btn btn-outline-light btn-sm m-r-15 search" href="#">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search">
                        <circle cx="11" cy="11" r="8"></circle>
                        <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
                    </svg>
                </a>
                <form class="form-inline search-form">
                    <div class="form-group">
                        <input class="form-control-plaintext" type="search" placeholder="جستجو.." />
                        <div class="icon-close close-search"></div>
                    </div>
                </form> -->
                <a class="icon-btn btn-outline-light btn-sm m-r-15" href="#" data-toggle="modal" data-target="#setExam">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus">
                        <line x1="12" y1="5" x2="12" y2="19"></line>
                        <line x1="5" y1="12" x2="19" y2="12"></line>
                    </svg>
                </a>
                <a class="icon-btn btn-outline-light btn-sm close-panel" href="#"  onClick="CloseExam()">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                        <line x1="18" y1="6" x2="6" y2="18"></line>
                        <line x1="6" y1="6" x2="18" y2="18"></line>
                    </svg>
                </a>
                                <script>
              function CloseExam(){
                  $("#exam").css("display" ,"none");
              }
          </script>
            </div>
        </div>
    </div>
    <ul class="chat-main">
        <?php
         $sqlssdsd = 'SELECT * FROM exam';
  $usersddsss       = $connection->query($sqlssdsd);
foreach ($usersddsss as $rosdsdws) {
    ?>
        <li>
            <div class="chat-box" id="<?php echo $rosdsdws['uniqid'] ?>">
                <div class="media">
                    <div class="profile offline bg-size" style="background-image: url('https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo.png'); background-size: cover; background-position: center center; display: block;">
                        <img class="bg-img" src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo.png" alt="Avatar" style="display: none;" />
                    </div>
                    <div class="details">
                        <h5><?php echo $rosdsdws['name'] ?></h5>
                        <h6>زمان آزمون: <?php echo $rosdsdws['timer'] ?></h6>
                    </div>
                    <div class="media-body">
                        <a class="icon-btn btn-outline-primary btn-sm pull-right remove-azmon" data-uid="<?php echo $rosdsdws['uniqid'] ?>" data-id="<?php echo $rosdsdws['id'] ?>">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
  <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/>
  <path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/>
</svg>
                        </a>
                        <a class="icon-btn btn-outline-primary btn-sm pull-right link" href="https://app2.drsiamakheydari.ir/ChatExam.php?id=<?php echo $rosdsdws['uniqid'] ?>&numb=<?php echo $rosdsdws['id'] ?>">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-link-45deg" viewBox="0 0 16 16">
  <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z"/>
  <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z"/>
</svg>
                        </a>
                         <a class="icon-btn btn-outline-primary btn-sm pull-right analize" onClick="ClickExamAnalize('<?php echo $rosdsdws['uniqid'] ?>')">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard-data" viewBox="0 0 16 16">
  <path d="M4 11a1 1 0 1 1 2 0v1a1 1 0 1 1-2 0v-1zm6-4a1 1 0 1 1 2 0v5a1 1 0 1 1-2 0V7zM7 9a1 1 0 0 1 2 0v3a1 1 0 1 1-2 0V9z"/>
  <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/>
  <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/>
</svg>
                        </a>
                        
                        
                    </div>
                </div>
            </div>
        </li>
        <?php
}
?>
    </ul>
</div>
<?php 
$usersddssshhhyy       = $connection->query($sqlssdsd);
foreach ($usersddssshhhyy as $rosdsdwsdf) { 
$sqlssdsdkuhiuhsdsd = 'SELECT * FROM answer WHERE number='.$rosdsdwsdf['id'];
  $usersddsssuhiuuiiuhi       = $connection->query($sqlssdsdkuhiuhsdsd);
  
?>
<div class="status-tab custom-scroll dynemic-sidebar active" id="exam-uniqid-<?php echo $rosdsdwsdf['uniqid'] ?>" style="display: none;">
    <div class="contact-status-box" style="padding-top: 0px!important;">
        <div class="my-status-box">
    <div class="status-content">
        <div class="media">
            <div>
                <h2>جواب های آزمون</h2>
            </div>
            <div class="media-body text-right" style="justify-content: left!important;">
                                <a class="icon-btn btn-outline-light btn-sm close-panel" href="#" onClick="CloseExamAnalize('<?php echo $rosdsdwsdf['uniqid'] ?>')" style="float: left;">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                        <line x1="18" y1="6" x2="6" y2="18"></line>
                        <line x1="6" y1="6" x2="18" y2="18"></line>
                    </svg>
                </a>
            </div>
        </div>
    </div>
</div>
        <div class="theme-title"><h3>آخرین جواب های آزمون</h3></div>
        <?php foreach ($usersddsssuhiuuiiuhi as $rosdsdwsdsdsdsdf) { 
            $querfghfghfghfghy = $connection->prepare(
                            "SELECT * FROM users WHERE username=:username"
                        );
                        $querfghfghfghfghy->bindParam(
                            "username",
                            $rosdsdwsdsdsdsdf["username"],
                            PDO::PARAM_STR
                        );
                        $querfghfghfghfghy->execute();
                        $resultsdfsdfs_user = $querfghfghfghfghy->fetch(PDO::FETCH_ASSOC);
       ?>
        <div class="status-content">
            <ul>
                <li class="user-status">
                    <a
                        class="lightbox img-status status bg-size"
                        href="#statusbox"
                        style="background-image: url('<?php echo $resultsdfsdfs_user['profile'] ?>?v=<?php echo time() ?>'); background-size: cover; background-position: center center; display: block;"
                    >
                        <img class="img-fluid bg-img" src="<?php echo $resultsdfsdfs_user['profile'] ?>?v=<?php echo time() ?>" alt="status" style="display: none;" />
                    </a>
                </li>
                <li>
                    <h5><?php echo $resultsdfsdfs_user['name'] ?></h5>
                    <p><?php echo $rosdsdwsdsdsdsdf["time"] ?></p>
                </li>
                <div class="media-body">
                        <a class="icon-btn btn-outline-primary btn-sm pull-right view" href='https://app2.drsiamakheydari.ir/ChatExam.php?id=<?php echo $rosdsdwsdsdsdsdf["examUID"] ?>&numb=<?php echo $rosdsdwsdsdsdsdf['number'] ?>&ans=<?php echo $rosdsdwsdsdsdsdf["bodyAns"] ?>'>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">
  <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
  <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
</svg>
                        </a>
                    </div>
            </ul>
        </div>
        <?php } ?>
    </div>
</div>

<?php } ?>
<script>
    function ClickExamAnalize(uniqid){
        $("#exam-uniqid-"+uniqid).css("display", "");
    }
    function CloseExamAnalize(uniqid){
        $("#exam-uniqid-"+uniqid).css("display", "none");
    }
</script>
<?php } ?>
      </aside>
      <div class="chitchat-main" id="content">
        <div class="chat-content tabto active">
          <div class="messages custom-scroll active" id="group_chat" style="background-image: url('https://app2.drsiamakheydari.ir/chit_chat/rtl/images/wallpaper/2.jpg'); background-blend-mode: unset; background-color: transparent;">
            <div class="contact-details" style="border-radius: 10px;">
              <div class="row">
                <div class="col-7" data-toggle="modal" data-target="#chatUserOnline">
                  <div class="media left">
                    <div class="media-left mr-3">
                      <div class="profile online menu-trigger bg-size" style="background-image: url('<?php echo $result_groups["profile"] ?>?v=<?php echo time() ?>'); background-size: cover; background-position: center center; display: block;">
                        <img class="bg-img" src="<?php echo $result_groups["profile"] ?>?v=<?php echo time() ?>" alt="Avatar" style="display: none;" />
                      </div>
                    </div>
                    <?php if($result_groups["status"] == 0){ ?>
                    <style>.profile.online:before {background-color: red!important;}</style>
                    <?php } ?>
                    <div class="media-body">
                      <h5><?php echo $result_groups["name"] ?></h5>
                      <div class="badge badge-success" <?php if($result_groups["status"] == 0): echo 'style="background-color: red!important;"'; endif; ?> ><?php if($result_groups["status"] == 0): echo "غیرفعال"; else: echo "فعال"; endif;?></div>
                    </div>
                  </div>
                </div>
<div class="col">
    <ul class="calls text-right">
 
                        <li>
                          <a class="icon-btn btn-light button-effect mute" data-tippy-content="اطلاعیه" href="#" onClick="audio()">
                            <i class="fa fa-volume-up" style="" id="audio_on"></i>
                            <i class="fa fa-volume-off" style="display: none;" id="audio_off"></i>
                          </a>
                        </li>
                        <script>
                            function audio(){
                                if($("#audio_config").val() == 1){
                                $("#audio_on").css("display", "none");
                                $("#audio_off").css("display", "");
                                $("#audio_config").val(null);
                            } else {
                                $("#audio_on").css("display", "");
                                $("#audio_off").css("display", "none");
                                $("#audio_config").val('1');
                            }
                            }
                        </script>
         <li>
                          <a class="icon-btn btn-light button-effect mute" data-tippy-content="حساب‌کاربری" href="#" id="backSetting" style="display: none;"> 
                            <i class="fa fa-user-circle-o"></i>
                          </a>
                        </li>
    </ul>
</div>
              </div>
            </div>
            <div class="contact-chat">
                <?php 
                 $suqql = 'SELECT * FROM group_'.$result_user["number"];
  $userskh       = $connection->query($suqql);
                  if ($userskh->rowCount() > 0) {

                ?>
              <ul class="chatappend" style="margin-bottom: 30px; margin-top: 30px;">
                <?php 
                  $sql = 'SELECT * FROM group_'.$result_user["number"];
  $users       = $connection->query($sql);
foreach ($users as $row) {
    $query_chat = $connection->prepare(
                            "SELECT * FROM users WHERE username=:username"
                        );
                        $query_chat->bindParam(
                            "username",
                            $row["username"],
                            PDO::PARAM_STR
                        );
                        $query_chat->execute();
                        $result_chat_user = $query_chat->fetch(PDO::FETCH_ASSOC);
                ?>
                <li class="<?php if($row["username"] == $result_user["username"]): echo "sent"; else: echo "replies"; endif; ?>" id="<?php echo $row["id"] ?>">
                  <div class="media">
                    <div class="profile mr-4 bg-size" style="background-image: url('<?php echo $result_chat_user["profile"] ?>?v=<?php echo time() ?>'); background-size: cover; background-position: center center; display: block;">
                      <img class="bg-img" src="<?php echo $result_chat_user["profile"] ?>?v=<?php echo time() ?>" alt="Avatar" style="display: none;" />
                    </div>
                    <div class="media-body">
                      <div class="contact-name">
                          <?php if($result_user["tick"] == 1 or $result_user["tick"] == 2){ ?>
                        <h5 style="padding-left: 3px;"><?php echo $result_chat_user["name"] ?>(<?php echo $result_chat_user["username"] ?>)</h5>
                        <?php }else{ ?>
                        <h5 style="padding-left: 3px;"><?php echo $result_chat_user["username"] ?></h5>
                        <?php } ?>
                        <?php 
                        if($result_chat_user["tick"] == 1):
                        ?>
                        <img src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo/verify_tick.png" alt="TickVerify" style="width: 15px;height: 15px;margin-left: 5px;">
                        <?php
                        endif;
                        ?>
                        <?php 
                        if($result_chat_user["tick"] == 2):
                        ?>
                        <img src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo/verify_tick.png" alt="TickVerify" style="width: 15px;height: 15px;margin-left: 5px;">
                        <img src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo/programmer.png" alt="TickVerify" style="width: 15px;height: 15px;margin-left: 5px;">
                        <?php
                        endif;
                        ?>
                        <?php 
                        if($result_chat_user["tick"] == 11):
                        ?>
                        <img src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo/medal_1.png" alt="TickVerify" style="width: 15px;height: 15px;margin-left: 5px;">
                        <?php
                        endif;
                        ?>
                        <?php 
                        if($result_chat_user["tick"] == 12):
                        ?>
                        <img src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo/medal_2.png" alt="TickVerify" style="width: 15px;height: 15px;margin-left: 5px;">
                        <?php
                        endif;
                        ?>
                        <?php 
                        if($result_chat_user["tick"] == 13):
                        ?>
                        <img src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo/medal_3.png" alt="TickVerify" style="width: 15px;height: 15px;margin-left: 5px;">
                        <?php
                        endif;
                        ?>
                        <?php 
                        if($result_chat_user["tick"] == 14):
                        ?>
                        <img src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/logo/warning.png" alt="TickVerify" style="width: 15px;height: 15px;margin-left: 5px;">
                        <?php
                        endif;
                        ?>
                        <h6 style="direction: rtl;"><?php echo $row["time"] ?></h6>
                        <ul class="msg-box">
                          <li class="msg-setting-main" style="width: 100%;height: 100%;">
                              <?php if($row["type"] == 'picture' or $row["type"] == 'png' or $row["type"] == 'jpg' or $row["type"] == 'jpeg' or $row["type"] == 'gif' or $row["type"] == 'svg'){
                                  ?>
                                  <ul class="auto-gallery" style="width: 100%;<?php if($row["username"] == $result_user["username"]): echo "border-radius: 30px 0 25px 30px;"; else: echo "border-radius: 0 50px 50px 50px;"; endif; ?>">
                                      <a href="<?php echo $row["path"] ?>" data-fancybox="gallery" data-caption="">
	                                    <li class="bg-size" style="background-image: url(&quot;<?php echo $row["path"] ?>&quot;); background-position: center center; display: block;width: 100%;height: 215px;"><img class="bg-img" src="<?php echo $row["path"] ?>" alt="Avatar" style="display: none;"></li>
</a>
<h5 style="display: list-item;white-space: pre-line;overflow-wrap: anywhere;direction: rtl;text-align: right;" ondblclick="copy(this)"><?php echo preg_replace('"\b(https?://\S+)"', '<a href="$1" style="color: cyan;">$1</a>', $row["message"]) ?></h5>
</ul>

                             <?php } ?>
                             <?php if($row["type"] == 'video' or $row["type"] == 'mkv' or $row["type"] == 'mp4' or $row["type"] == 'vlc'){
                                  ?>
                                  <ul class="auto-gallery" style="width: 100%;<?php if($row["username"] == $result_user["username"]): echo "border-radius: 30px 0 25px 30px;"; else: echo "border-radius: 0 50px 50px 50px;"; endif; ?>">
                                    <li class="bg-size" style="height: 100%;width: 100%;">
                                        <video width="100%" style="border-radius: 20px;" controls>
  <source src="<?php echo $row["path"] ?>" type="video/mp4">
  مرورگر شما پشتیبانی نمی کند.
</video>
                                    </li>
<h5 style="display: list-item;white-space: pre-line;overflow-wrap: anywhere;direction: rtl;text-align: right;" ondblclick="copy(this)"><?php echo preg_replace('"\b(https?://\S+)"', '<a href="$1" style="color: cyan;">$1</a>', $row["message"]) ?></h5>
</ul>

                             <?php } ?>
                             <?php if($row["type"] == 'audio' or $row["type"] == 'mp3' or $row["type"] == 'wav'){
                                  ?>
                                  <ul class="auto-gallery" style="width: 100%;<?php if($row["username"] == $result_user["username"]): echo "border-radius: 30px 0 25px 30px;"; else: echo "border-radius: 0 50px 50px 50px;"; endif; ?>">
                                    <li class="bg-size" style="height: 100%;width: 100%;">
                                        <audio style="width: 100%"; controls>
  <source src="<?php echo $row["path"] ?>" type="audio/mpeg">
مرورگر شما پشتیبانی نمی کند.
</audio>
                                    </li>
<h5 style="display: list-item;white-space: pre-line;overflow-wrap: anywhere;direction: rtl;text-align: right;" ondblclick="copy(this)"><?php echo preg_replace('"\b(https?://\S+)"', '<a href="$1" style="color: cyan;">$1</a>', $row["message"]) ?></h5>
</ul>

                             <?php } ?>
                             <?php if($row["type"] == 'document' or $row["type"] == 'zip' or $row["type"] == 'rar' or $row["type"] == 'xls' or $row["type"] == 'xlsx' or $row["type"] == 'pdf' or $row["type"] == 'docx'
                             or $row["type"] == 'pptx' or $row["type"] == 'ppt' or $row["type"] == 'pptm'){ ?>
                           <div class="document" style="<?php if($row["username"] == $result_user["username"]): echo "border-radius: 30px 0 25px 30px;"; else: echo "border-radius: 0 50px 50px 50px;"; endif; ?>">
   <?php 
        $ext = pathinfo($row["path"], PATHINFO_EXTENSION); // to get extension
        switch($ext){
            case 'zip':
                $icon = 'fa fa-file-archive-o';
                break;
                case 'rar':
                $icon = 'fa fa-file-archive-o';
                break;
                case 'mp3':
                $icon = 'fa fa-file-audio-o';
                break;
                case 'xls':
                $icon = 'fa fa-file-excel-o';
                break;
                case 'xlsx':
                $icon = 'fa fa-file-excel-o';
                break;
                case 'png':
                $icon = 'fa fa-file-image-o';
                break;
                case 'jpg':
                $icon = 'fa fa-file-image-o';
                break;
                case 'svg':
                $icon = 'fa fa-file-image-o';
                break;
                case 'gif':
                $icon = 'fa fa-file-image-o';
                break;
                case 'jpeg':
                $icon = 'fa fa-file-image-o';
                break;
                case 'mp4':
                $icon = 'fa fa-file-movie-o';
                break;
                case 'mkv':
                $icon = 'fa fa-file-movie-o';
                break;
                case 'pdf':
                $icon = 'fa fa-file-pdf-o';
                break;
                case 'pptx':
                $icon = 'fa fa-file-powerpoint-o';
                break;
                case 'pptm':
                $icon = 'fa fa-file-powerpoint-o';
                break;
                case 'ppt':
                $icon = 'fa fa-file-powerpoint-o';
                break;
                case 'docx':
                $icon = 'fa fa-file-word-o';
                break;
                case 'dot':
                $icon = 'fa fa-file-word-o';
                break;
                case 'dotm':
                $icon = 'fa fa-file-word-o';
                break;
                default:
                    $icon = 'fa fa-file-o';
        }
        ?>
   <i class="<?php echo $icon ?> font-primary"></i>
   <div class="details">
       <?php $path = parse_url($row["path"], PHP_URL_PATH); 
       $head = array_change_key_case(get_headers($row["path"], 1));
    // content-length of download (in bytes), read from Content-Length: field
    $clen = isset($head['content-length']) ? $head['content-length'] : 0;

    // cannot retrieve file size, return "-1"
    if (!$clen) {
        return -1;
    }

    $size = $clen;
    switch ($clen) {
        case $clen < 1024:
            $size = $clen .' B'; break;
        case $clen < 1048576:
            $size = round($clen / 1024, 2) .' KiB'; break;
        case $clen < 1073741824:
            $size = round($clen / 1048576, 2) . ' MiB'; break;
        case $clen < 1099511627776:
            $size = round($clen / 1073741824, 2) . ' GiB'; break;
    }
       ?>
      <h5 style="white-space: pre-line;overflow-wrap: anywhere;direction: rtl;"><?php echo basename($path); ?></h5>
      <h6 style="white-space: pre-line;overflow-wrap: anywhere;direction: rtl;"><?php echo $size; ?></h6>
      <h5 ondblclick="copy(this)" style="white-space: pre-line;overflow-wrap: anywhere;direction: rtl;"><?php echo preg_replace('"\b(https?://\S+)"', '<a href="$1" style="color: cyan;">$1</a>', $row["message"]) ?></h6>
   </div>
   <div class="icon-btns">
      <a class="icon-btn btn-outline-light" href="<?php echo $row["path"] ?>" target="_blank">
         <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-download">
            <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
            <polyline points="7 10 12 15 17 10"></polyline>
            <line x1="12" y1="15" x2="12" y2="3"></line>
         </svg>
      </a>
   </div>
</div>
<?php } ?>
<?php if($row["type"] == null){ ?>
<?php if($row["replay"] == null){ ?>
<h5 ondblclick="copy(this)" style="white-space: pre-line;overflow-wrap: anywhere;direction: rtl;text-align: right;<?php if($row["username"] == $result_user["username"]): echo "border-radius: 30px 0 25px 30px;"; else: echo "border-radius: 0 50px 50px 50px;"; endif; ?>
                            <?php 
                             if($result_chat_user["tick"] == 11):
                            ?>
                            background: linear-gradient(-45deg, #F5CD00, #E1b900, #D7a100);background-size: 400% 400%;animation: gradient 15s ease infinite;
                            <?php endif; ?>
                            <?php 
                             if($result_chat_user["tick"] == 12):
                            ?>
                            background: linear-gradient(-45deg, #808080, #A9A9A9, #D3D3D3);background-size: 400% 400%;animation: gradient 15s ease infinite;
                            <?php endif; ?>
                            <?php 
                             if($result_chat_user["tick"] == 13):
                            ?>
                            background: linear-gradient(-45deg, #CD7F32, #BE7023, #AF6114, #DC8E41);background-size: 400% 400%;animation: gradient 15s ease infinite;
                            <?php endif; ?>
                            <?php 
                             if($result_chat_user["tick"] == 14):
                            ?>
                            background: linear-gradient(-45deg, #ffa6a6, #9b0303, #e14d4d);background-size: 400% 400%;animation: gradient 15s ease infinite;
                            <?php endif; ?>
                            "><?php echo preg_replace('"\b(https?://\S+)"', '<a href="$1" style="color: cyan;">$1</a>', $row["message"]) ?></h5>
                            <?php } else { 
                            $query_chat_qws = $connection->prepare(
                            "SELECT * FROM group_$result_user[number] WHERE id=:id"
                        );
                        $query_chat_qws->bindParam(
                            "id",
                            $row["replay"],
                            PDO::PARAM_STR
                        );
                        $query_chat_qws->execute();
                        $result_chat_user_ws = $query_chat_qws->fetch(PDO::FETCH_ASSOC);
                        $query_chat_qwsd = $connection->prepare(
                            "SELECT * FROM users WHERE username=:username"
                        );
                        $query_chat_qwsd->bindParam(
                            "username",
                            $result_chat_user_ws["username"],
                            PDO::PARAM_STR
                        );
                        $query_chat_qwsd->execute();
                        $result_chat_user_wsd = $query_chat_qwsd->fetch(PDO::FETCH_ASSOC);
                            ?>
                            <h5 ondblclick="copy(this)" style="white-space: pre-line;overflow-wrap: anywhere;direction: rtl;text-align: right;<?php if($row["username"] == $result_user["username"]): echo "border-radius: 30px 0 25px 30px;"; else: echo "border-radius: 0 50px 50px 50px;"; endif; ?>
                            <?php 
                             if($result_chat_user["tick"] == 11):
                            ?>
                            background: linear-gradient(-45deg, #F5CD00, #E1b900, #D7a100);background-size: 400% 400%;animation: gradient 15s ease infinite;
                            <?php endif; ?>
                            <?php 
                             if($result_chat_user["tick"] == 12):
                            ?>
                            background: linear-gradient(-45deg, #808080, #A9A9A9, #D3D3D3);background-size: 400% 400%;animation: gradient 15s ease infinite;
                            <?php endif; ?>
                            <?php 
                             if($result_chat_user["tick"] == 13):
                            ?>
                            background: linear-gradient(-45deg, #CD7F32, #BE7023, #AF6114, #DC8E41);background-size: 400% 400%;animation: gradient 15s ease infinite;
                            <?php endif; ?>
                            <?php 
                             if($result_chat_user["tick"] == 14):
                            ?>
                            background: linear-gradient(-45deg, #ffa6a6, #9b0303, #e14d4d);background-size: 400% 400%;animation: gradient 15s ease infinite;
                            <?php endif; ?>
                            ">ریپلای به <?php echo $result_chat_user_wsd["name"] . ': "'?> <?php echo preg_replace('"\b(https?://\S+)"', '<a href="$1" style="color: cyan;">$1</a>', $result_chat_user_ws["message"])   . '"' ?> <hr><?php echo preg_replace('"\b(https?://\S+)"', '<a href="$1" style="color: cyan;">$1</a>', $row["message"]) ?> </h5>
                            <?php } ?>
                            <?php } ?>
                            <div class="msg-dropdown-main" style="margin-right: 10px;">
                                <?php if($row["username"] == $result_user["username"]){ ?>
                                <div class="remove-msg msg-setting" data-id="<?php echo $row["id"] ?>"><i class="ti-trash"></i></div>
                                <div class="reply-msg msg-setting" data-id="<?php echo $row["id"] ?>" style="margin-bottom: 5px;margin-top: 5px;"><i class="fa fa-share"></i></div>
                                 <div class="reply-cancle msg-setting" data-id="<?php echo $row["id"] ?>" style="display: none;margin-bottom: 5px;margin-top: 5px;"><i class="fa fa-times"></i></div>
                                 <?php }else{ ?> 
                                 <?php if($result_user["tick"] == 1 || $result_user["tick"] == 2){ ?>
                                <div class="remove-msg msg-setting" data-id="<?php echo $row["id"] ?>" style="margin-bottom: 5px;margin-top: 5px;">
                                    <i class="ti-trash"></i>
                                </div>
                                 <?php } ?>
                                 <div class="reply-msg msg-setting" data-id="<?php echo $row["id"] ?>"><i class="fa fa-share"></i></div>
                                 <div class="reply-cancle msg-setting" data-id="<?php echo $row["id"] ?>" style="display: none"><i class="fa fa-times"></i></div>
                                 <?php } ?>
                            </div>
                          </li>
                        </ul>
                      </div>
                    </div>
                  </div>
                </li>
                <?php
                }
                $users->execute();
                ?>
              </ul>
              <?php
} else {
  ?>
  <div class="call-list-center"><img src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/chat.png" alt=""><div class="animated-bg"><i></i><i></i><i></i></div><p>برای خواندن پیام ها یک چت انتخاب کنید</p></div>
  <?
}
?>
              <script>
function copy(that){
var inp =document.createElement('input');
document.body.appendChild(inp)
inp.value =that.textContent
inp.select();
document.execCommand('copy',false);
inp.remove();
alert('متن کپی شد');
}
</script>
              <script>
                  function removeMsgNow(ids){
         var group_s = $('#group_JS').val();
         $.post(
            "https://app2.drsiamakheydari.ir/ChatRemove.php", {
                id: ids,
                group: group_s,
            },
            function(data, status) {
             $("#" + ids).remove();
            }
        );
                  }
                  function replyMsgNow(ids){
        $('#replay_config').val(ids);
        $("#RPMG").css("display", "none");
$("#CRPMG").css("display", "");
$("#RPMGS").css("display", "none");
$("#CRPMGS").css("display", "");
alert("متن ریپلای شد. لطفا پیام خود را بنویسید.");
                  }
                  function CreplyMsgNow(ids){
        $('#replay_config').val(null);
        $("#RPMG").css("display", "");
$("#CRPMG").css("display", "none");
$("#RPMGS").css("display", "");
$("#CRPMGS").css("display", "none");
alert("آخرین متن ریپلای شده از ریپلای خارج شد.");
                  }
              </script>
            </div>
          </div>
          <div class="message-input">
            <?php if( $result_groups["status"] == 1 || $result_user["tick"] == 1 || $result_user["tick"] == 2){ ?>
            <?php if( $result_user["tick"] == 15){ ?>
            <h2 style="text-align: center;">حساب کاربری شما محدود است.</h2>
            <?php } else { ?>
            <div class="wrap emojis-main">
  <div class="contact-poll">
      <input id="replay_config" value="" type="hidden">
      <input id="voice_config" value="" type="hidden">
      <input id="audio_config" value="" type="hidden">
    <a class="icon-btn btn-outline-primary mr-4 outside" onclick="document.getElementById('file').click()" id="Routside">
        <input type="file" name="file" id="file" style="display: none;">
      <i class="fa fa-plus"></i>
    </a>
    <a class="icon-btn btn-outline-primary mr-4 remove" style="display: none;" id="Rremove">
      <i class="fa fa-times"></i>
    </a>
    <a class="icon-btn btn-outline-primary mr-4 progress" style="display: none;" id="Rprogress">
      <h5 id="progress_percent"></h5>
    </a>
  </div>
  <textarea class="setemoj" id="setemoj" type="text" placeholder="پیام خود را اینجا بنویسید..."></textarea>
  <a class="icon-btn btn-outline-primary button-effect mr-3 ml-3" style="width: 62px;display: none;" href="#" id="playButton">
    <i class="fa fa-play"></i>
  </a>
  <a class="icon-btn btn-outline-primary button-effect mr-3 ml-3" style="width: 62px;margin-right: -1rem !important;" href="#" id="startRecordingButton">
    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mic">
      <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path>
      <path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>
      <line x1="12" y1="19" x2="12" y2="23"></line>
      <line x1="8" y1="23" x2="16" y2="23"></line>
    </svg>
  </a>
  <a class="icon-btn btn-outline-primary button-effect mr-3 ml-3" style="width: 62px;display: none;" href="#" id="stopRecordingButton">
    <i class="fa fa-pause"></i>
  </a>
  <button class="submit icon-btn btn-primary disabled" style="width: 50px;" id="send-msg" disabled="disabled">
    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-send">
      <line x1="22" y1="2" x2="11" y2="13"></line>
      <polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
    </svg>
  </button>
</div>
<script>
       
    </script>
<script>
    function Voice(){
        alert('در حال بروزرسانی سرور هستیم.');
    }
</script>
            <?php }
            } else if( $result_user["tick"] == 15){ ?>
                <h2 style="text-align: center;">حساب کاربری شما محدود است.</h2>
            <?php } else { ?>
            
            <h2 style="text-align: center;" id="timerLock"></h2>
            <script>
            <?php if( $result_user["number"] == "1" || $result_user["number"] == "3"){
                $TimeTimerSet = "22:00";
            } else {
                 $TimeTimerSet = "22:30";
                }?>
// Set the date we're counting down to
var countDownDate = new Date("<?php echo date("Y/m/d") ?> <?php echo  $TimeTimerSet ?>").getTime();

// Update the count down every 1 second
var x = setInterval(function() {

  // Get today's date and time
  var now = new Date().getTime();
    
  // Find the distance between now and the count down date
  var distance = countDownDate - now;
    
  // Time calculations for days, hours, minutes and seconds
  var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  var seconds = Math.floor((distance % (1000 * 60)) / 1000);
    
  // Output the result in an element with id="timerLock"
  document.getElementById("timerLock").innerHTML = days + "روز " + hours + "ساعت "
  + minutes + "دقیقه " + seconds + "ثانیه ";
    
  // If the count down is over, write some text 
  if (distance < 0) {
    clearInterval(x);
    document.getElementById("timerLock").innerHTML = "گزارش دهی امشب به پایان رسید!";
  }
}, 1000);
</script>
<?php } ?>
          </div>
        </div>
      </div>
    </div>
<div class="modal fade show" id="nointernetmodal" tabindex="-1" role="dialog" style="display: none;">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-body">
            <div class="no-internet animat-rate">
                <div class="connection-img">
                    <img class="left-img" src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/disconnect/3.png" alt="Disconnected" />
                    <img class="right-img" src="https://app2.drsiamakheydari.ir/chit_chat/rtl/images/disconnect/2.png" alt="Disconnected internet" />
                </div>
                <div class="quarterCircle">
                    <div class="close-btn" data-dismiss="modal"><span aria-hidden="true">×</span></div>
                </div>
                <div class="bg_circle">
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                </div>
                <div class="cross"></div>
                <div class="cross1"></div>
                <div class="dot"></div>
                <div class="dot1"></div>
                <div class="content text-center">
                    <a class="icon-btn btn-danger button-effect btn-sm is-animating" href="#"><i class="fa fa-wifi"></i></a>
                    <h3>خطای اتصال</h3>
                    <div class="title2">خطا ارتباط با اینترنت</div>
                    <button class="btn reconnect-btn" type="button" data-dismiss="modal">تلاش مجدد</button>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal reminder-modal-main add-popup show" id="setExam" tabindex="-1" role="dialog" style="display: none;">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title">آزمون ساز آنلاین</h2>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close" id="CloseExamNew"><span aria-hidden="true">×</span></button>
            </div>
            <div class="modal-body">
                <form class="form default-form">
                    <div class="lable">نام آزمون:</div>
                    <div class="form-group"><input class="form-control" type="text" id="nameExam" placeholder="مثال: آزمون فیزیک" /></div>
                    <div class="lable">شناسه آزمون:</div>
                    <div class="form-group"><input class="form-control" type="text" id="uidExam" placeholder="مثال: fizik" /></div>
                    <div class="lable">زمان آزمون:</div>
                    <div class="form-group"><input class="form-control" type="text" id="timerExam" placeholder="مثال: 90:00" /></div>
                    <div class="lable">بدنه آزمون:</div>
                    <div class="form-group"><lable for="examFile" id="fileLbaelExam" class="form-control" onclick="document.getElementById('examFile').click()">برای بارگذاری بدنه، کلیک کنید.</lable>
                    <input id="examFile" type="file" style="display: none;" onchange="document.getElementById('fileLbaelExam').innerHTML = 'فایل انتخاب شده است! ' + '(' + this.files[0].name + ')'"/>
                    <script>
                        document.getElementById('examFile').addEventListener('change', function() {
    var fr = new FileReader();
    fr.onload = function() {
        document.getElementById('bodyExam').value = fr.result;
    }
    fr.readAsText(this.files[0]);
})
                    </script>
                    <input id="bodyExam" value="" type="hidden"/>
                    </div>
                    <div class="create-exam-btn"><a class="btn btn-primary button-effect">ثبت و ساخت آزمون</a></div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade add-popup msg-chat-modal show" id="chatUserOnline" tabindex="-1" role="dialog" style="display: none; padding-left: 17px;">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title">کاربران</h2>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
            </div>
            <div class="modal-body">
                <div class="chat-msg-search">
                    <div class="input-group">
                        <input class="form-control" type="text" placeholder="نام کاربر را وارد کنید... " aria-label="Recipient's username" aria-describedby="basic-addon21" id="myInput" onkeyup="myFunction23458()" />
                    </div>
                </div>
                <ul class="chat-main custom-scroll" id="myUL">
                    <?php $userss2       = $connection->query($sqls);
foreach ($userss2 as $rows2) { ?>
                    <li data-to="blank">
                        <a style="display: none;"><?php echo $rows2['name'] ?></a>
                        <div class="chat-box">
                            <div class="profile offline bg-size" style="right: 0!important;left: unset!important;background-image: url('<?php echo $rows2['profile'] ?>?v=<?php echo time() ?>'); background-size: cover; background-position: center center; display: block;">
                                <img class="bg-img" src="<?php echo $rows2['profile'] ?>?v=<?php echo time() ?>" alt="Avatar" style="display: none;" />
                            </div>
                            <div class="details">
                                <h5><?php echo $rows2['name'] ?></h5>
                            </div>
                            <div class="date-status">
                                <h6>آخرین‌بازدید: <?php echo $rows2['last_seen'] ?></h6>
                                <!--<h6 class="font-success status">دیده شده</h6>-->
                            </div>
                        </div>
                    </li>
                    <?php } ?>
                </ul>
                <script>
function myFunction23458() {
    var input, filter, ul, li, a, i, txtValue;
    input = document.getElementById("myInput");
    filter = input.value.toUpperCase();
    ul = document.getElementById("myUL");
    li = ul.getElementsByTagName("li");
    for (i = 0; i < li.length; i++) {
        a = li[i].getElementsByTagName("a")[0];
        txtValue = a.textContent || a.innerText;
        if (txtValue.toUpperCase().indexOf(filter) > -1) {
            li[i].style.display = "";
        } else {
            li[i].style.display = "none";
        }
    }
}
</script>
            </div>
        </div>
    </div>
</div>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/jquery-3.3.1.min.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/owl.carousel.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/popper.min.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/tippy-bundle.iife.min.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/bootstrap.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/switchery.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/easytimer.min.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/index.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/feather-icon/feather.min.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/feather-icon/feather-icon.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/ckeditor/ckeditor.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/ckeditor/styles.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/ckeditor/adapters/jquery.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/ckeditor/ckeditor.custom.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/date-picker/datepicker.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/date-picker/datepicker.en.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/date-picker/datepicker.custom.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/tour/intro.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/tour/intro-init.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/jquery.magnific-popup.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/zoom-gallery.js"></script>
    <script src="https://app2.drsiamakheydari.ir/chit_chat/rtl/js/script.js?v=<?php echo time() ?>"></script>
  </body>
</html>