
<script>
$(document).ready(function(){
  $("#regform").validationEngine();
}); 
</script>
<?
$session = get_session_details();
$loggeduser = (object)$session->userdetails;
$userid = $loggeduser->userid;




//echo $user['username'];


$sahifa_id = $_SERVER['REQUEST_URI'];
$sahifa_id = str_replace('/users/anketa_malumoti/', '', $sahifa_id);


$foydalanuvchi_query = mysql_query("SELECT * FROM `users` WHERE `username` = '{$sahifa_id}'");
$user = mysql_fetch_assoc($foydalanuvchi_query);


 $oy = array(
    1 => 'Yanvar',
    2 => 'Fevral',
    3 => 'Mart',
    4 => 'Aprel',
    5 => 'May',
    6 => 'Iyun',
    7 => 'Iyul',
    8 => 'Avgust',
    9 => 'Sentyabr',
    10 => 'Oktyabr',
    11 => 'Noyabr',
    12 => 'Dekabr',
);

if ($sahifa_id == $user['username']) {
?>


<div class="container main main_top-30 ">
    <div class="row">
        <div class="col-md-24 col-xs-24">
            <div>
                <h1 class="h1 h1_black h1_center h1_without-marginbottom">
                    Anketa ma'lumotlari
                </h1>
            </div>
            
            <div class="article-area article-area_without-top-radius ">
                
                <div class="school-join-step3-school-info ">
                    <div class="row">
                        <div class="col-md-4 col-xs-4"><?
                            echo '<img class="school-photo"  src="' .base_url(). '' .$user['avatar']. '"  />';
                        ?>
                        </div>
                        <div class="col-md-20 col-xs-20">
                            <h4 class="h4 h4_bold">
                                <?=$user['firstname'];?> <?=$user['lastname'];?>
                            </h4>
                            <p class="paragraph paragraph_color-grey paragraph_font-size-16 paragraph_bottom-30 paragraph_without-line-height">
                                Doimiy yashash joyi: <b><?=$user['joylashuv'];?></b>
                            </p>
                            <div class="row">
                                <div class="col-md-11 col-xs-11">
                                    <p class="paragraph paragraph_font-size-14">
                                        <b class="b">
                                            Bog'lanish
                                        </b>
                                    </p>
                                    <p class="paragraph paragraph_font-size-14">
                                        Telefon: <?=$user['telefon'];?>
                                    </p>
                                    <p class="paragraph paragraph_font-size-14">
                                         E-mail: 
                                        <a href="mailto:<?=$user['email'];?>" class="link">
                                           <?=$user['email'];?>
                                        </a>
                                    </p>
                                    <p class="paragraph paragraph_font-size-14">
                                        Sahifa: 
                                        <a class="link" target="_blank" href="<?=base_url();?>/users/anketa_malumoti/<?=$user['user_id'];?> ">
                                            <?=base_url();?><?=$user['username'];?> 
                                        </a>
                                    </p>
                                </div>
                                <div class="col-md-8 col-md-offset-2 col-xs-8 col-xs-offset-2">
                                    <p class="paragraph paragraph_font-size-14">
                                        <b class="b">
                                            Tug'ilgan sanasi
                                        </b>
                                    </p>
                                    <p class="paragraph paragraph_font-size-14 paragraph_marginbottom">
                                        <?=$user['t_kun'];?>-<?=$oy[$user['t_oy']];?> <?=$user['t_yil'];?>yil.
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?
} elseif ($sahifa_id != $user['username']) {
    echo 'Bunday foydalanuvchi mavjud emas.';
} else {
    
$foydalanuvchi_query = mysql_query("SELECT * FROM `users` WHERE `user_id` = '{$userid}'");
$user = mysql_fetch_assoc($foydalanuvchi_query);
    ?>

<div class="container main main_top-30 ">
    <div class="row">
        <div class="col-md-24 col-xs-24">
            <div>
                <h1 class="h1 h1_black h1_center h1_without-marginbottom">
                    Anketa ma'lumotlari
                </h1>
            </div>
            
            <div class="article-area article-area_without-top-radius ">
                
                <div class="school-join-step3-school-info ">
                    <div class="row">
                        <div class="col-md-4 col-xs-4"><?
                            echo '<img class="school-photo"  src="' .base_url(). '' .$user['avatar']. '"  />';
                        ?>
                        </div>
                        <div class="col-md-20 col-xs-20">
                            <h4 class="h4 h4_bold">
                                <?=$user['firstname'];?> <?=$user['lastname'];?>
                            </h4>
                            <p class="paragraph paragraph_color-grey paragraph_font-size-16 paragraph_bottom-30 paragraph_without-line-height">
                                Doimiy yashash joyi: <b><?=$user['joylashuv'];?></b>
                            </p>
                            <div class="row">
                                <div class="col-md-11 col-xs-11">
                                    <p class="paragraph paragraph_font-size-14">
                                        <b class="b">
                                            Bog'lanish
                                        </b>
                                    </p>
                                    <p class="paragraph paragraph_font-size-14">
                                        Telefon: <?=$user['telefon'];?>
                                    </p>
                                    <p class="paragraph paragraph_font-size-14">
                                         E-mail: 
                                        <a href="mailto:<?=$user['email'];?>" class="link">
                                           <?=$user['email'];?>
                                        </a>
                                    </p>
                                    <p class="paragraph paragraph_font-size-14">
                                        Sahifa: 
                                        <a class="link" target="_blank" href="<?=base_url();?>/users/anketa_malumoti/<?=$user['user_id'];?> ">
                                            <?=base_url();?><?=$user['username'];?> 
                                        </a>
                                    </p>
                                </div>
                                <div class="col-md-8 col-md-offset-2 col-xs-8 col-xs-offset-2">
                                    <p class="paragraph paragraph_font-size-14">
                                        <b class="b">
                                            Tug'ilgan sanasi
                                        </b>
                                    </p>
                                    <p class="paragraph paragraph_font-size-14 paragraph_marginbottom">
                                        <?=$user['t_kun'];?>-<?=$oy[$user['t_oy']];?> <?=$user['t_yil'];?>yil.
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?
}
?>