<?php 

$akbar_mail = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail` LEFT JOIN `cms_contact` ON `cms_mail`.`user_id`=`cms_contact`.`from_id` AND `cms_contact`.`user_id`='$user_id' WHERE `cms_mail`.`from_id`='$user_id' AND `cms_mail`.`sys`='0' AND `cms_mail`.`read`='0' AND `cms_mail`.`delete`!='$user_id' AND `cms_contact`.`ban`!='1' AND `cms_mail`.`spam`='0'"), 0); ?>
<!-- Navbar -->
<div class="w3-top">
  <div class="w3-bar w3-theme-d2 w3-left-align w3-large">
   <a class="w3-bar-item w3-button w3-hide-medium w3-hide-large w3-right w3-padding-large w3-hover-white w3-large w3-theme-d2" href="javascript:void(0);" onclick="openNav()"><i class="fa fa-bars"></i></a>

   <a href=" <?php echo  $home; ?> " class="w3-bar-item w3-button w3-padding-large w3-theme-d4"><i class="fa fa-home w3-margin-right"></i></a>

   <a href=" <?php echo $home; ?>/library/index.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Kutubhona"><i class="fa fa-book-open"></i></a>

   <a href=" <?php echo $home; ?>/news/index.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Sayt yangliklari"><i class="fa fa-globe"></i></a>

   <a href=" <?php echo $home; ?>/download/index.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Yuklamalar"><i class="fa fa-download"></i></a>

   <a href=" <?php echo $home; ?>/guestbook/index.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Mehmonhona"><i class="fa fa-comment-dots"></i></a>

   <a href=" <?php echo $home; ?>/chat.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Mehmonhona"><i class="fa fa-comments"></i></a>

   <a href="<?php echo  $home; ?>/forum/index.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Forum"><i class="fa fa-users"></i></a>
   <a href="<?php echo $home ?>/mail/index.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Shaxsiy xabarlar"><i class="fa fa-envelope"></i></a>
   <div id="akajshx"></div>
   <a href="<?php echo  $home; ?>/users/profile.<?php echo$akb_for;?>?act=edit&user=<?php echo $user_id; ?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Anketani o`zgartirish"><i class="fa fa-user-edit"></i></a>
   <a href="<?php echo $home ?>/exit.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Saytdan chiqish"><i class="fa fa-sign-out-alt"></i></a>
   <a href="<?php echo $home; ?>/users/profile.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-hide-small w3-right w3-padding-large w3-hover-white" title="My Account"> 
    <?php if ($user_avatar) {
      if (file_exists((ROOTPATH . 'files/users/photo/' . $user_id . '.jpg'))) 
        echo '<img src="'.$home.'/files/users/photo/' . $user_id . '.jpg" class="w3-circle" style="height:29px; width:29px" alt="Profil"/>';
      else 
        echo '<img src="' .$home . '/images/akbarico.jpg" class="w3-circle" style="height:29px; width:29px" alt="Profil" />&#160;';
    } ?>
  </a>
</div>
<!-- Navbar on small screens -->
<div id="navDemo" class="w3-bar-block w3-theme-d2 w3-hide w3-hide-large w3-hide-medium w3-large">
 <a href="#" class="w3-bar-item w3-button w3-padding-large">Link 1</a>
 <a href="#" class="w3-bar-item w3-button w3-padding-large">Link 2</a>
 <a href="#" class="w3-bar-item w3-button w3-padding-large">Link 3</a>
 <a href="<?php echo $home ?>/users/profile.<?php echo$akb_for;?>" class="w3-bar-item w3-button w3-padding-large">Anketa</a>
</div>
</div>
<!-- Page Container -->
<div class="w3-container w3-content" style="max-width:1400px; margin-top:80px">  
 <!-- The Grid -->
 <div class="w3-row">
  <!-- Left Column -->
  <div class="w3-col m3">
   <!-- Profile -->
   <div class="w3-card w3-round w3-white">
    <div class="w3-container">
     <p class="w3-center">
      <?php 
      if ($user_avatar) {
        if (file_exists((ROOTPATH . 'files/users/photo/' . $user_id. '.jpg')))
          echo '<img src="' .$home . '/files/users/photo/' . $user_id . '.jpg" width="210" height="210" alt="" class="w3-circle" style="margin-right:2px; width: 210px; height: 210px; border: 2px solid #4D636F;">';
        else 
          echo '<img src="' .$home . '/images/akbarico.jpg" width="110" height="110" alt="" class="w3-circle" style="margin-right:2px; width: 210px; height: 210px; border: 2px solid #4D636F;">&#160;'; } ?>
        <h4 class="w3-center"><strong><?php echo $login; ?></strong></h4></p>
        <?php if ($datauser['live']) { ?>
         <hr><p><i class="fa fa-home fa-fw w3-margin-right w3-text-theme"></i> <?php echo $datauser['live']; ?></p>
         <p><i class="fa fa-birthday-cake fa-fw w3-margin-right w3-text-theme"></i><?php echo $datauser['dayb']; ?>/<?php echo $datauser['monthb'];?>/<?php print($datauser['yearofbirth']) ?> yil</p> <?php } ?>
       </div></div><br>
       <!-- Accordion -->
       <div class="w3-card w3-round">
         <div class="w3-white">
          <?php if ($rights >= 1) { ?>
            <button onclick="myFunction('Demo1')" class="w3-button w3-block w3-theme-l1 w3-left-align"><i class="fa fa-circle-o-notch fa-fw w3-margin-right"></i>Admin Panel</button>
            <div id="Demo1" class="w3-hide w3-container">
             <p>
              <a href=" <?php echo $home; ?>/panel/index.<?php echo$akb_for;?>">Admin Panel</a>
            </p><p>
              <p><a href="/panel/index.<?php echo$akb_for;?>?act=forum"> <?php echo $lng['forum']; ?></a></p>
              <p><a href="/panel/index.<?php echo$akb_for;?>?act=news"> <?php echo $lng['news'];?></a></p>
              <p><a href="/panel/index.<?php echo$akb_for;?>?act=ads">Reklama</a></p>
            </p>
            </div> <?php } ?>
            <button onclick="myFunction('Demo3')" class="w3-button w3-block w3-theme-l1 w3-left-align"><i class="fa fa-users fa-fw w3-margin-right"></i> <?php echo $lng['photo_albums'] ?></button>
            <div id="Demo3" class="w3-hide w3-container">
             <div class="w3-row-padding"><br>
              <?php 
              $album_rasmlari = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `user_id` = '" . $datauser['id'] . "'"), 0);
              $fotoalbom = mysql_query("SELECT `id`, `user_id`, `album_id`, `img_name` FROM `cms_album_files` WHERE `user_id` = '" .$datauser['id']. "' ORDER BY `time`  DESC LIMIT 6");
              $fotosurat = mysql_fetch_array($fotoalbom); 
              if (file_exists('../files/users/album/' . $datauser['id'] . '/' . $fotosurat['img_name'] . '')) { 
                $fotoalbom = mysql_query("SELECT `id`, `user_id`, `album_id`, `img_name` FROM `cms_album_files` WHERE `user_id` = '" .$datauser['id']. "' ORDER BY `time`  DESC LIMIT 8");
                while ($fotosurat = mysql_fetch_array($fotoalbom)){?>
                  <div class="w3-half">
                   <a href="<?php echo $home; ?>/users/album.<?php echo$akb_for;?>?act=show&amp;al=<?php echo $fotosurat['album_id']; ?>&amp;img=<?php echo $fotosurat['id']; ?>&amp;user=<?php echo $fotosurat['user_id'];  ?>&amp;view">
                    <img src="<?php echo $home; ?>/files/users/album/<?php print $fotosurat['user_id']; ?>/<?php print $fotosurat['img_name']; ?>" style="width:100%" class="w3-margin-bottom"></a> 
                  </div>
                <?php } } else { ?>
                 <?php echo $login; ?> siz rasm yuklamagansiz 
                 <br> <a href=" <?php echo $home; ?>/users/album.<?php echo $akb_for; ?>?act=list&user=<?php echo $user_id; ?>">Rasm yuklang</a> 
               <?php  } ?>
               <br> <br>    
             </div>
           </div>
         </div>      
       </div> <br>