0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.23.102.79


Current Path : /var/www/html/oums/src/
Upload File :
Current File : /var/www/html/oums/src/home_clients.php

<?php
include("sys_session.php");
include("sys_connect.php");
include("sys_mainphp.php");

?>
<div style="margin-bottom: 5px;" class="head_blue">Clients</div>
<ul class="nav nav-tabs">
    <li class="active"><a data-toggle="tab" href="#menu1">University</a></li>
    <li><a data-toggle="tab" href="#menu2">University (Deemed)</a></li>
    <li><a data-toggle="tab" href="#menu3">Colleges (Autonomus)</a></li>
    <li><a data-toggle="tab" href="#menu4">Others</a></li>
</ul>

<div class="tab-content" id="home-content-note">
    <div id="menu1" class="tab-pane fade in active">
        <?php
        if ($type_id == 'ADMIN') {
            $mysql = "select * from masdept where fdepttype='UNIV' and fdeptcode<>'000' and fdeptstat='T' and fdeleted<>'T' order by fdeptname";
        } else {
            $mysql = "select * from masdept d inner join masdept_user u on d.fdeptcode = u.fdeptcode ";
            $mysql .= "and u.fusercode='$user_id' and d.fdepttype='UNIV' and d.fdeptcode<>'000' ";
            $mysql .= "and d.fdeptstat='T' and d.fdeleted<>'T' order by fdeptname";
        }
        $myres = mysqli_query($mycon, $mysql);
        while ($myrow = mysqli_fetch_assoc($myres)) {
            $dept_logo = strtolower("img-clients/" . $myrow['fdeptlogo']);
            echo "<div class='panel-group' style='padding:0px; margin-bottom:2px; border-radius:0px;'>";
            echo "<div class='panel panel-default' style='padding:0px; margin:0px; border-radius:0px;'>";
            echo "<div class='panel-heading' style='padding:0px; margin:0px; border-radius:0px;'>";
            echo "<a data-toggle='collapse' href='#$myrow[fdeptcode]'>";
            echo "<img src='$dept_logo' height='30px' width='30px' align='absmiddle' alt='logo'></img>&nbsp;&nbsp;$myrow[fdeptname]";
            echo "</a>";
            echo "</div>";
            echo "<div id='$myrow[fdeptcode]' class='panel-collapse collapse'>";
            echo "<div class='panel-body' style='padding:0px; margin:0px;'>";
            //result status start
            get_result_data($myrow['fdatabase'], $myrow['fdeptcode']);
            //result status end
            echo "</div>";
            echo "</div>";
            echo "</div>";
            echo "</div>";
        }
        ?>
    </div>

    <div id="menu2" class="tab-pane fade">
        <?php
        if ($type_id == 'ADMIN') {
            $mysql = "select * from masdept where fdepttype='DEEM' and fdeptcode<>'000' and fdeptstat='T' and fdeleted<>'T' order by fdeptname";
        } else {
            $mysql = "select * from masdept d inner join masdept_user u on d.fdeptcode = u.fdeptcode ";
            $mysql .= "and u.fusercode='$user_id' and d.fdepttype='DEEM' and d.fdeptcode<>'000' ";
            $mysql .= "and d.fdeptstat='T' and d.fdeleted<>'T' order by fdeptname";
        }
        $myres = mysqli_query($mycon, $mysql);
        while ($myrow = mysqli_fetch_assoc($myres)) {
            $dept_logo = strtolower("img-clients/" . $myrow['fdeptlogo']);
            echo "<div class='panel-group' style='padding:0px; margin-bottom:2px; border-radius:0px;'>";
            echo "<div class='panel panel-default' style='padding:0px; margin:0px; border-radius:0px;'>";
            echo "<div class='panel-heading' style='padding:0px; margin:0px; border-radius:0px;'>";
            echo "<a data-toggle='collapse' href='#$myrow[fdeptcode]'>";
            echo "<img src='$dept_logo' height='30px' width='30px' align='absmiddle' alt='logo'></img>&nbsp;&nbsp;$myrow[fdeptname]";
            echo "</a>";
            echo "</div>";
            echo "<div id='$myrow[fdeptcode]' class='panel-collapse collapse'>";
            echo "<div class='panel-body' style='padding:0px; margin:0px;'>";
            //result status start
            get_result_data($myrow['fdatabase'], $myrow['fdeptcode']);
            //result status end
            echo "</div>";
            echo "</div>";
            echo "</div>";
            echo "</div>";
        }
        ?>
    </div>

    <div id="menu3" class="tab-pane fade">
        <?php
        if ($type_id == 'ADMIN') {
            $mysql = "select * from masdept where fdepttype='AUTO' and fdeptcode<>'000' and fdeptstat='T' and fdeleted<>'T' order by fdeptname";
        } else {
            $mysql = "select * from masdept d inner join masdept_user u on d.fdeptcode = u.fdeptcode ";
            $mysql .= "and u.fusercode='$user_id' and d.fdepttype='AUTO' and d.fdeptcode<>'000' ";
            $mysql .= "and d.fdeptstat='T' and d.fdeleted<>'T' order by fdeptname";
        }
        $myres = mysqli_query($mycon, $mysql);
        while ($myrow = mysqli_fetch_assoc($myres)) {
            $dept_logo = strtolower("img-clients/" . $myrow['fdeptlogo']);
            echo "<div class='panel-group' style='padding:0px; margin-bottom:2px; border-radius:0px;'>";
            echo "<div class='panel panel-default' style='padding:0px; margin:0px; border-radius:0px;'>";
            echo "<div class='panel-heading' style='padding:0px; margin:0px; border-radius:0px;'>";
            echo "<a data-toggle='collapse' href='#$myrow[fdeptcode]'>";
            echo "<img src='$dept_logo' height='30px' width='30px' align='absmiddle' alt='logo'></img>&nbsp;&nbsp;$myrow[fdeptname]";
            echo "</a>";
            echo "</div>";
            echo "<div id='$myrow[fdeptcode]' class='panel-collapse collapse'>";
            echo "<div class='panel-body' style='padding:0px; margin:0px;'>";
            //result status start
            get_result_data($myrow['fdatabase'], $myrow['fdeptcode']);
            //result status end
            echo "</div>";
            echo "</div>";
            echo "</div>";
            echo "</div>";
        }
        ?>
    </div>

    <div id="menu4" class="tab-pane fade">
        <?php
        if ($type_id == 'ADMIN') {
            $mysql = "select * from masdept where fdepttype='OTHR' and fdeptcode<>'000' and fdeptstat='T' and fdeleted<>'T' order by fdeptname";
        } else {
            $mysql = "select * from masdept d inner join masdept_user u on d.fdeptcode = u.fdeptcode ";
            $mysql .= "and u.fusercode='$user_id' and d.fdepttype='OTHR' and d.fdeptcode<>'000' ";
            $mysql .= "and d.fdeptstat='T' and d.fdeleted<>'T' order by fdeptname";
        }
        $myres = mysqli_query($mycon, $mysql);
        while ($myrow = mysqli_fetch_assoc($myres)) {
            $dept_logo = strtolower("img-clients/" . $myrow['fdeptlogo']);
            echo "<div class='panel-group' style='padding:0px; margin-bottom:2px; border-radius:0px;'>";
            echo "<div class='panel panel-default' style='padding:0px; margin:0px; border-radius:0px;'>";
            echo "<div class='panel-heading' style='padding:0px; margin:0px; border-radius:0px;'>";
            echo "<a data-toggle='collapse' href='#$myrow[fdeptcode]'>";
            echo "<img src='$dept_logo' height='30px' width='30px' align='absmiddle' alt='logo'></img>&nbsp;&nbsp;$myrow[fdeptname]";
            echo "</a>";
            echo "</div>";
            echo "<div id='$myrow[fdeptcode]' class='panel-collapse collapse'>";
            echo "<div class='panel-body' style='padding:0px; margin:0px;'>";
            echo "Details not available";
            echo "</div>";
            echo "</div>";
            echo "</div>";
            echo "</div>";
        }
        ?>
    </div>
</div>

<?php
function get_result_data($data_base, $dept_code)
{
    include("sys_connect.php");

    $mysql = "select d.fdegree,d.fdescpn,d.fexamno,d.fexamname,d.fexamdate,d.fresultdate ";
    $mysql .= "from " . $data_base . ".degree d ";
    $mysql .= "inner join " . $data_base . ".canddet c on c.fdegree=d.fdegree ";
    $mysql .= "and c.fexamno=d.fexamno and c.fyear=d.fmeyear and c.fexamtype=d.fmeexamtyp ";
    $mysql .= "where c.fpresent='P' ";
    $mysql .= "group by d.fdegree,d.fexamno order by ISNULL(fresultdate), fdegree,fexamno";
    $myres = mysqli_query($mycon, $mysql);

    echo "<div class='panel-group' style='padding:0px; margin:2px; border-radius:0px;'>";
    echo "<div class='panel panel-default' style='padding:0px; margin:0px; border-radius:0px;'>";
    echo "<div class='panel-heading' style='padding:0px; margin:0px; border-radius:0px;'>";
    echo "<a data-toggle='collapse' href='#res$dept_code'>";
    echo "<div class='row'>";
    echo "<div class='col-sm-5'>RESULT STATUS</div>";
    echo "<div class='col-sm-3'>Active:</div>";
    echo "<div class='col-sm-3'>Announced:</div>";
    echo "</div>";
    echo "</a>";
    echo "</div>";
    echo "<div id='res$dept_code' class='panel-collapse collapse'>";
    echo "<div class='panel-body' style='padding:0px; margin:0px;'>";
    $mysql1 = "select d.fdegree,d.fdescpn,d.fexamno,d.fexamname,d.fexamdate,d.fresultdate ";
    $mysql1 .= "from " . $data_base . ".degree d ";
    $mysql1 .= "inner join " . $data_base . ".canddet c on c.fdegree=d.fdegree ";
    $mysql1 .= "and c.fexamno=d.fexamno and c.fyear=d.fmeyear and c.fexamtype=d.fmeexamtyp ";
    $mysql1 .= "where c.fpresent='P' ";
    $mysql1 .= "group by d.fdegree,d.fexamno order by ISNULL(fresultdate), fdegree,fexamno";
    $myres1 = mysqli_query($mycon, $mysql1);
    $mycnt1 = mysqli_num_rows($myres1);
    if ($mycnt1 == 0) {
        echo "Details not available";
    } else {
        echo "<table class='table table-striped table-condensed'>";
        echo "<tr>";
        echo "<th class='text-left'>  Degree</th>";
        echo "<th class='text-left'>  Description</th>";
        echo "<th class='text-center'>Exam</th>";
        echo "<th class='text-left'>  Exam Date</th>";
        echo "<th class='text-center'>Active</th>";
        echo "<th class='text-center'>Result Date</th>";

        echo "</tr>";
        while ($myrow1 = mysqli_fetch_assoc($myres1)) {
            $mysql2 = "select count(fregno) as ftotactive ";
            $mysql2 .= "from " . $data_base . ".candsum where fdegree='$myrow1[fdegree]' and fexamfee" . $myrow1['fexamno'] . ">0";
            $myres2 = mysqli_query($mycon, $mysql2);
            $myrow2 = mysqli_fetch_assoc($myres2);

            echo "<tr>";
            echo "<td class='text-left'>  $myrow1[fdegree]</td>";
            echo "<td class='text-left'>  $myrow1[fdescpn]</td>";
            echo "<td class='text-center'>$myrow1[fexamno]</td>";
            echo "<td class='text-left'>  $myrow1[fexamdate]</td>";
            echo "<td class='text-center'>$myrow2[ftotactive]</td>";
            echo "<td class='text-center'>$myrow1[fresultdate]</td>";
            echo "</tr>";
        }
        echo "</table>";
    }
    echo "</div>";
    echo "</div>";
    echo "</div>";
    echo "</div>";
}
?>