MMCT TEAM
Server IP : 103.191.208.50  /  Your IP : 216.73.216.53
Web Server : LiteSpeed
System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User : celkcksm ( 1031)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, popen, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0750) :  /home/celkcksm/cms.ncriptech.com/../websites/attendance.rmpharma.in/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/cms.ncriptech.com/../websites/attendance.rmpharma.in/grand1_attendance.php
<?php
    include("include/config.inc.php");
?>
<!DOCTYPE html>
<html>
<head>
    <style>
        footer {
            font-size: 9px;
            color: #f00;
            text-align: center;
        }
        
        @page {
            size: A4;
            margin: 11mm 17mm 17mm 17mm;
        }
        
        @media print {
            footer {
                position: fixed;
                bottom: 0;
            }
            header {
                position:fixed;
                top:0;
            }
            .content-block, p {
                page-break-inside: avoid;
            }
            tr{
                page-break-before:right;
            }
            html, body {
                width: 210mm;
                height: 297mm;
            }
        }
    </style>
</head>
<body>
    <header>
        <h4>Company Name: Akshay Patel College</h3>
        <h5>Location: Address fulll</h4>
        <h5>Date: 23/12/100020</h4>
    </header>
    <table width="100%" style="margin-top:50px;">
        <thead>
            <tr>
                <th>Date</th>
                <th>Code</th>
                <th>Name</th>
                <th>Course - Session</th>
                <th>In Time</th>
                <th>Out Time</th>
                <th>TH<br /><small>Total Hours</small></th>
                <th>WH<br /><small>Working Hours</small></th>
                <th>Status</th>
            </tr>
        </thead>
        <tbody>
            <?php
                $start=mysqli_real_escape_string($con,$_REQUEST['start']);
                $end=mysqli_real_escape_string($con,$_REQUEST['end']);
                $session_id=mysqli_real_escape_string($con,$_REQUEST['session_id']);
                $course_id=mysqli_real_escape_string($con,$_REQUEST['course_id']);
                $condition="";
                $condition1="";
                if(!empty($start)){
                    $condition.=" AND date>='$start'";
                }if(!empty($end)){
                    $condition.=" AND date<='$end'";
                }
                if(!empty($session_id)){
                    $condition1.=" AND register.session_id=$session_id";
                }if(!empty($course_id)){
                    $condition1.=" AND register.course_id=$course_id";
                }
            
                $q=mysqli_query($con,"select status,date from attendance
                where 1=1 $condition order by id asc");
                $timeR=mysqli_fetch_array(mysqli_query($con,"select in_time,out_time from time order by id desc limit 1"));
                $dateDiff = intval((strtotime($timeR['out_time'])-strtotime($timeR['in_time']))/60);
                $hours = intval($dateDiff/60);
                $minutes = $dateDiff%60;
                while($r=mysqli_fetch_array($q)){
                    $attendance=explode(",",$r['status']);
                    for($i=0;$i<count($attendance)-1;$i++){
                        if(explode("_",$attendance[$i])[1]==0){
                            $status="Absent";
                        }else if(explode("_",$attendance[$i])[1]==1){
                            $status="Present";
                        }
                        $studentR=mysqli_fetch_array(mysqli_query($con,"select student_name,register.id,
                            registration_no,session.name as session_name,course.name as course_name
                            from register
                            left join course on course.id=register.course_id
                            left join session on session.id=register.session_id
                            where register.id=".explode("_",$attendance[$i])[0].$condition1));
                            if(!empty($studentR['id'])){
                            ?>
                        <tr>
                            <td><?=$r['date'];?></td>
                            <td><?=$studentR['registration_no'];?></td>
                            <td><?=$studentR['student_name'];?></td>
                            <td><?=$studentR['course_name']." [".$studentR['session_name']."]";?></td>
                            <td><?php if($status=="Present") echo explode("_",$attendance[$i])[2];?></td>
                            <td><?php if($status=="Present") echo explode("_",$attendance[$i])[3];?></td>
                            <td><?=$hours." HH ".$minutes." MM";?></td>
                            <?php
                                if($status=="Present"){
                                    $dateDiff1 = intval((strtotime(explode("_",$attendance[$i])[3])-strtotime(explode("_",$attendance[$i])[2]))/60);
                                }
                            ?>
                            <td><?php if($status=="Present") echo intval($dateDiff1/60)." HH ".($dateDiff1%60)." MM"; else echo "0 HH 00 MM";?></td>
                            <td class="status" <?php if($status=="Absent") echo "style='color:red;'";?>><?=$status;?></td>
                        </tr>
            <?php
                        }
                    }
                }
            ?>
        </tbody>
    </table>
    <footer>
        This is the text that goes at the bottom of every page.
    </footer>
</body>
</html>

MMCT - 2023