

<div class="mainholder ">

        <div class="photo-title">
            <span>Tizim bilimdonlari faoliyati</span>
        </div>

        <div class="usercontent ui-corner-all">
        <table cellpadding="0" cellspacing="30" class="datatable">
        <tbody><tr><th>Ism Familyasi</th><th>Tanlagan imtihon yo'nalishi</th><th>Yakun</th></tr>
      



<?php

$foydalanuvchi_query = mysql_query("SELECT * FROM `userexam` ORDER BY `starttime` DESC LIMIT 20");

        $orin = 0;
while ($user = mysql_fetch_assoc($foydalanuvchi_query)) {


$bilimdon = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `user_id` = '{$user['userid']}'"));

$imtihon = mysql_fetch_assoc(mysql_query("SELECT `examid`, `examname`, `catid` FROM `exams` WHERE `examid` = '{$user['examid']}'"));
$bolim = mysql_fetch_assoc(mysql_query("SELECT `catname`, `catid` FROM `exam_category` WHERE `catid` = '{$imtihon['catid']}'"));



    $otgan_imtihoni = mysql_result(mysql_query("SELECT count(*) FROM `userexam` WHERE `status` = 'completed' AND `userid` = {$user['user_id']}"), 0);
    $otolmagan_imtihoni = mysql_result(mysql_query("SELECT count(*) FROM `userexam` WHERE `status` = 'inprogress' AND `userid` = {$user['user_id']}"), 0);
    $jami = $otgan_imtihoni + $otolmagan_imtihoni;
    
        $orin ++;

echo '
<tr>
                <td>' .$bilimdon['firstname']. ' ' .$bilimdon['lastname']. ' </td>
                <td style="text-align: left;width: 500px;padding-left: 10px;">Yo\'nalish: <a class="blue" href="/users/imtihon/' .$bolim['catid']. '">' .$bolim['catname']. '</a> <br />
                Imtihon: <a class="blue" href="/users/takeexam/' .$imtihon['examid']. '">' .$imtihon['examname']. '</a></td>
                <td>' .($user['status'] == 'completed' ? '<img align="top" src="/assets/images/del.png" /> Yiqildi' : '<img align="top" src="/assets/images/yes.png" /> Topshirdi'). '</td>
          </tr>
    ';
}
?>



        </tbody></table>

        </div>
</div>
<style type="text/css">
.datatable {
border: 1px solid #D6DDE6;
border-collapse: collapse;
text-align: center;
width: 100%;
font-size: 1em;
font: 16px/1.3 'Open Sans', HelveticaNeue, Helvetica, Arial;
}
table {
border: 0;
background: #F5F9F4;
font-family: verdana,sans-serif;
font-size: 1.2em;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.datatable th {
border: 1px solid #828282;
background-color: #FCC;
font-weight: 100;
text-align: left;
padding: 1em;
}
.datatable td {
border: 1px solid #D6DDE6;
padding: 1em 0;
text-align: center;
}
</style>

