<?php require_once('auth.php'); ?>
<?php
$company_query= mysqli_query($conn,"SELECT co_name,co_logo FROM company WHERE coid='$coid' LIMIT 1") or die(mysqli_error($conn));
$rowcom= mysqli_fetch_assoc($company_query);

$Branch_query= mysqli_query($conn,"SELECT branch_name FROM branch WHERE brid='$brid' LIMIT 1") or die(mysqli_error($conn));
$brow= mysqli_fetch_assoc($Branch_query);
?>
<!DOCTYPE html>
<html lang="en">
   <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
   <head>
       <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
      <meta name="facebook-domain-verification" content="ec1y2lzkwcivkhd0ovnx9jyesbxo0r" />
      <title class="lanbn"><?php echo $rowcom['co_name'];?></title>
      
   
         <link href="data:image/gif;base64,<?php echo $rowcom['co_logo']?>" rel="icon">
   <link href="data:image/gif;base64,<?php echo $rowcom['co_logo']?>" rel="apple-touch-icon">
   
      <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&amp;display=fallback">
      <link rel="stylesheet" href="../../plugins/font-awesome/css/all.css">
      <link rel="stylesheet" href="../../plugins/ionicons/ionicons.min.css">
      <link rel="stylesheet" href="../../plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
      <link rel="stylesheet" href="../../plugins/icheck-bootstrap/icheck-bootstrap.min.css">
      <link rel="stylesheet" href="../../plugins/select2/css/select2.min.css">
      <link rel="stylesheet" href="../../plugins/jqvmap/jqvmap.min.css">


      <link rel="stylesheet" href="../../dist/css/welldiv.css">
      <link rel="stylesheet" href="../../dist/css/welldiv.min.css">
      <link rel="stylesheet" href="../../dist/css/custom.css">


      <link rel="stylesheet" href="../../plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
      <link rel="stylesheet" href="../../plugins/daterangepicker/daterangepicker.css">
      <link rel="stylesheet" href="../../plugins/summernote/summernote-bs4.min.css">
      <link rel="stylesheet" href="../../plugins/flag-icon-css/css/flag-icon.min.css">
      <link rel="stylesheet" href="../../plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
      <link rel="stylesheet" href="../../plugins/toastr/toastr.min.css">
      <link rel="stylesheet" href="../../dist/css/fullcalendar.min.css">

      <link rel="stylesheet" href="../../plugins/jquery-ui/jquery-ui.min.css">
      <link rel="stylesheet" href="../../plugins/sweetalert2/sweetalert2.min.css">
         <!-- new chart  -->
      <link rel="stylesheet" href="../../plugins/signature/css/jquery.signature.css">

   </head>
   <body class="hold-transition sidebar-mini layout-fixed text-sm layout-footer-fixed layout-navbar-fixed" onload="pagecall('dashboard.php','#home');">
      <div class="wrapper">
         <nav class="main-header navbar navbar-expand navbar-white navbar-light">
            <ul class="navbar-nav">
               <li class="nav-item">
                  <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
               </li>
            <li class="nav-item d-none d-sm-inline-block  " style="margin-top:3px;">
               <b><?php echo $rowcom['co_name'];?></b> >> <b class="animate-charcter"><?php echo $brow['branch_name'];?></b>
            </li>
            </ul>
            <ul class="navbar-nav ml-auto">
   <!--             <li class="nav-item">
                  <a class="nav-link" data-widget="navbar-search" href="#" role="button">
                  <i class="fas fa-search"></i>
                  </a>
                  <div class="navbar-search-block">
                     <form class="form-inline">
                        <div class="input-group input-group-sm">
                           <input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search">
                           <div class="input-group-append">
                              <button class="btn btn-navbar" type="submit">
                              <i class="fas fa-search"></i>
                              </button>
                              <button class="btn btn-navbar" type="button" data-widget="navbar-search">
                              <i class="fas fa-times"></i>
                              </button>
                           </div>
                        </div>
                     </form>
                  </div>
               </li> -->
     <!--           <li class="nav-item dropdown">
                  <a class="nav-link" data-toggle="dropdown" href="#">
                  <i class="far fa-comments"></i>
                  <span class="badge badge-danger navbar-badge">3</span>
                  </a>
                  <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                     <a href="#" class="dropdown-item">
                        <div class="media">
                           <img src="../../dist/img/user1-128x128.jpg" alt="User Avatar" class="img-size-50 mr-3 img-circle">
                           <div class="media-body">
                              <h3 class="dropdown-item-title">
                                 Brad Diesel
                                 <span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span>
                              </h3>
                              <p class="text-sm">Call me whenever you can...</p>
                              <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                           </div>
                        </div>
                     </a>
                     <div class="dropdown-divider"></div>
                     <a href="#" class="dropdown-item">
                        <div class="media">
                           <img src="../../dist/img/user8-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3">
                           <div class="media-body">
                              <h3 class="dropdown-item-title">
                                 John Pierce
                                 <span class="float-right text-sm text-muted"><i class="fas fa-star"></i></span>
                              </h3>
                              <p class="text-sm">I got your message bro</p>
                              <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                           </div>
                        </div>
                     </a>
                     <div class="dropdown-divider"></div>
                     <a href="#" class="dropdown-item">
                        <div class="media">
                           <img src="../../dist/img/user3-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3">
                           <div class="media-body">
                              <h3 class="dropdown-item-title">
                                 Nora Silvester
                                 <span class="float-right text-sm text-warning"><i class="fas fa-star"></i></span>
                              </h3>
                              <p class="text-sm">The subject goes here</p>
                              <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                           </div>
                        </div>
                     </a>
                     <div class="dropdown-divider"></div>
                     <a href="#" class="dropdown-item dropdown-footer">See All Messages</a>
                  </div>
               </li> -->
                         <?php
                           $count=0;
                           $notiv_result=mysqli_query($conn,"SELECT * FROM notice_board WHERE status=1 AND coid='$coid' ");
                           $count=mysqli_num_rows($notiv_result);

                             ?>
               <span class="mark1" style="height: 20px;margin-top: 6px;"><?php echo $company_balance;?></span>
               <li class="nav-item dropdown" id="notihide">
                  <a class="nav-link dropbtn" id="notification-icon" name="button" onclick="myFunction()" data-toggle="dropdown" href="#">
                  <i class="far fa-bell"></i>
                  <span class="badge badge-warning navbar-badge" id="notification-count"><?php if($count>0) { echo $count; } ?></span>
                  </a>





                  <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right" id="notification-latest">
                     <span class="dropdown-item dropdown-header">15 Notifications</span>
                     <div class="dropdown-divider"></div>
                 


               
                     <div class="dropdown-divider"></div>
                     <a href="#" class="dropdown-item dropdown-footer">See All Notifications</a>
                  </div>



               </li>


           <script type="text/javascript">
           function myFunction() {
              $.ajax({
                 url: "../auth/view_notification.php",
                 type: "POST",
                 processData:false,
                 success: function(data){
                    $("#notification-count").remove();              
                    $("#notification-latest").show();$("#notification-latest").html(data);
                 },
                 error: function(){}           
              });
              
                    $('#notihide').click(function(e){
                 if ( e.target.id != 'notification-icon'){
                    $("#notification-latest").hide();
                 }
              });
            }
           </script>
           <li class="nav-item" > 
              <a class="nav-link" style="color:red;" onclick="pagecall('../event/event_index.php','#home');"  href="#">  <i class="fa fa-calendar-plus mr-2"></i> </a>
            </li>
            
             <li class="nav-item" > 
              <a class="nav-link text-success"  onclick="pagecall('../notebook/note_index.php','#home');"  href="#">  <i class="fa fa-book mr-2"></i> </a>
            </li>
            
            
           <li class="nav-item">
             <a class="nav-link" onclick="bsync(this);" href="#">
                <i class="fa-solid fa-rotate"></i> <span class="d-none d-md-inline">Sync</span>
             </a>
           </li>

           <script>
            function bsync(select) {
                $(".preloader").css('display','flex');
                $(select).html('<i class="fas fa-cog fa-spin"></i> <span class="d-none d-md-inline">Loading..?</span>');
                 $.post("../auth/balance_sync.php",
                  {},
                function(data){
                   $(select).html('<i class="fa-regular fa-circle-check"></i> <span class="d-none d-md-inline">Complete</span>');
                    $(select).children().fadeOut("slow", function(){
                        $(select).html('<i class="fa-solid fa-rotate"></i> <span class="d-none d-md-inline">Sync</span>');
                        $('.preloader').hide();
                    });
                //   toastr.success(Successfully, yourdata);
                });
              }  
            </script>   
            
             
               <li class="nav-item dropdown">
                  <a class="nav-link" data-toggle="dropdown" href="#">
                               <?php 
                     if ($u_langg==1) {
                        echo '<i class="flag-icon flag-icon-bd mr-2"></i> Bangla';
                     }else if ($u_langg==2) {
                        echo '<i class="flag-icon flag-icon-us mr-2"></i> English';
                     }else if ($u_langg==3) {
                        echo '<i class="flag-icon flag-icon-sa">   </i> Arabic';
                     }else if ($u_langg==4) {
                        echo '<i class="flag-icon flag-icon-in">   </i> Hindi';
                     }else if ($u_langg==5) {
                        echo '<i class="flag-icon flag-icon-cn">   </i> China'; 
                     }else if ($u_langg==6) {
                        echo '<i class="flag-icon flag-icon-ma">   </i> Malaysia'; 
                     }
                     ?>
                  </a>
                  <div class="dropdown-menu dropdown-menu-right p-0">
                    <a class="dropdown-item <?php if ($u_langg==1) {echo 'active';}?>" onclick="abc(1)">
                        <i class="flag-icon flag-icon-bd mr-2"></i> Bangla
                     </a>
                     <a class="dropdown-item <?php if ($u_langg==2) {echo 'active';}?>" onclick="abc(2)">
                        <i class="flag-icon flag-icon-us mr-2"></i> English
                     </a>
                     <a class="dropdown-item <?php if ($u_langg==3) {echo 'active';}?>" onclick="abc(3)">
                        <i class="flag-icon flag-icon-sa mr-2"></i> Arabic
                     </a>
                      <a class="dropdown-item <?php if ($u_langg==4) {echo 'active';}?>" onclick="abc(4)">
                        <i class="flag-icon flag-icon-in mr-2"></i> Hindi
                     </a>
                      <a class="dropdown-item <?php if ($u_langg==5) {echo 'active';}?>" onclick="abc(5)">
                        <i class="flag-icon flag-icon-cn mr-2"></i> China
                     </a>
                     <a class="dropdown-item <?php if ($u_langg==6) {echo 'active';}?>" onclick="abc(6)">
                        <i class="flag-icon flag-icon-ma mr-2"></i> Malaysia
                     </a>
                  </div>
               </li>
               
            <script>
            function abc(language) {
                 $(".preloader").css('display','flex');
                 $.post("../company_setup/language_db.php",
                  {language: language, userid:<?php echo $uid;?>},
                function(data){
                   toastr.success(Successfully, yourdata);
                   window.location.reload();       
                });
              }  
            </script>               
               
<?php 
  $emq = mysqli_query($conn,"SELECT em_acname,join_date,desig_name,accounts.picture FROM em_employee 
  LEFT JOIN em_designation ON (em_employee.em_dis_id=em_designation.em_desid)
  LEFT JOIN accounts ON (accounts.acid=em_employee.em_acid)
  WHERE em_employee.em_id='$us_em_id' LIMIT 1 ") or die (mysqli_error($conn));
  $rem= mysqli_fetch_assoc($emq);
   $picture=$rem['picture'];
?>

            <li class="nav-item dropdown user-menu">
               <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
                 <?php if($picture != ""): ?>
                  <img src="data:image/gif;base64,<?php echo $picture;?>" class="user-image img-circle elevation-2" alt="User Image">
                 <?php else : ?> 
                  <img src="../../dist/img/no_img.jpg" class="user-image img-circle elevation-2" alt="User Image">
                 <?php endif; ?>
<!--                   <span class="d-none d-md-inline"><?php echo $rem['em_acname'];?></span>
 -->               </a>
               <ul class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                  <li class="user-header bg-primary">
                    <?php if($picture != ""): ?>
                     <img src="data:image/gif;base64,<?php echo $picture;?>" class="img-circle elevation-2" alt="User Image">
                    <?php else : ?> 
                     <img src="../../dist/img/no_img.jpg" class="img-circle elevation-2" alt="User Image">
                    <?php endif; ?>
                     <p><?php echo $rem['em_acname'];?> 
                     <small><?php echo $rem['desig_name'];?></small>
                     <small>Member since <?php echo date("d M Y", strtotime($rem['join_date']));?></small>
                     </p>
                  </li>

                  <li class="user-body">
                     <div class="row">
                        <div class="col-4 text-center">
                           <a href="#">Waiting</a>
                        </div>
                        <div class="col-4 text-center">
                           <a href="#">Waiting</a>
                        </div>
                        <div class="col-4 text-center">
                           <a href="#">Waiting</a>
                        </div>
                     </div>
                  </li>

                  <li class="user-footer">
                     <a href="#" class="btn btn-default btn-flat">Profile</a>
                     <a href="../../logout.php" class="btn btn-default btn-flat float-right">Sign out</a>
                  </li>
               </ul>
            </li>              
               <li class="nav-item">
                  <a class="nav-link" data-widget="fullscreen" href="#" role="button">
                  <i class="fas fa-expand-arrows-alt"></i>
                  </a>
               </li>
               
               <!--    <li class="nav-item">-->
               <!--   <a class="nav-link" data-widget="control-sidebar" data-controlsidebar-slide="true" href="#" role="button">-->
               <!--   <i class="fas fa-th-large"></i>-->
               <!--   </a>-->
               <!--</li>-->
               
                <li class="nav-item">
                     <a class="nav-link"  onclick="return confirm('Do you Want To Exit Now ?')" href="../../logout.php" role="button">
                      <i class="fas fa-sign-out-alt" style='font-size:24px;color:#000000;'> </i>
                   </a>
                </li>
           
      </ul>
   </nav>

<!--<div class="modal fade" id="modal-sm">-->
<!--   <div class="modal-dialog modal-sm">-->
<!--      <div class="modal-content" id="smdview" style="max-height: 500px;overflow-x: hidden;overflow-y: auto;"></div>-->
<!--   </div>-->
<!--</div>-->

<!--<div class="modal fade" id="modal-lg">-->
<!--   <div class="modal-dialog modal-lg">-->
<!--      <div class="modal-content" id="mdview" style="max-height:700px;overflow-x: hidden;overflow-y: auto;"></div>-->
<!--   </div>-->
<!--</div>-->

<!--<div class="modal fade" id="modal-xl">-->
<!--   <div class="modal-dialog modal-xl">-->
<!--      <div class="modal-content" id="xlmdview" style="max-height: 700px;overflow-x: hidden;overflow-y: auto;"></div>-->
<!--   </div>-->
<!--</div>-->


 
<!--tabindex="-1"-->

 <div class="modal fade" id="modal-sm"  role="dialog" aria-labelledby="exampleModalScrollableTitle" aria-hidden="true">
  <div class="modal-dialog modal-sm modal-dialog-scrollable" role="document">
    <div class="modal-content">
         <div class="modal-body" id="smdview"></div>
    </div>
  </div>
</div>



 <div class="modal fade" id="modal-lg"  role="dialog" aria-labelledby="exampleModalScrollableTitle" aria-hidden="true">
  <div class="modal-dialog modal-lg modal-dialog-scrollable" role="document">
    <div class="modal-content">
         <div class="modal-body" id="mdview"></div>
    </div>
  </div>
</div>


 <div class="modal fade" id="modal-xl"  role="dialog" aria-labelledby="exampleModalScrollableTitle" aria-hidden="true">
  <div class="modal-dialog modal-xl modal-dialog-scrollable" role="document">
    <div class="modal-content">
         <div class="modal-body" id="xlmdview"></div>
    </div>
  </div>
</div>


<style type="text/css">
.animate-charcter
{
   text-transform: uppercase;
  background-image: linear-gradient(
    -225deg,
    #231557 0%,
    #44107a 29%,
    #ff1361 67%,
    #fff800 100%
  );
  background-size: auto auto;
  background-clip: border-box;
  background-size: 200% auto;
  color: #fff;
  background-clip: text;
  text-fill-color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textclip 2s linear infinite;
  display: inline-block;
      font-size: 13px;
}

@keyframes textclip {
  to {
    background-position: 200% center;
  }
}

</style>