<?php 
    session_start();
    if(!$_SESSION['id']){
        header('location:index.php');
    }
      require_once '../system/conn.php';
?>
        <?php
            $date=date('Y-m', strtotime(date('Y-m')." -1 month"));
            $date=explode('-',$date);
            $month=$date[1];
            $monthNum  = $month;
            $dateObj   = DateTime::createFromFormat('!m', $monthNum);
            $monthName = $dateObj->format('F');
            $year=$date[0];
        ?>
<!doctype html>
<html lang="en" class="semi-dark">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="assets/css/pace.min.css" rel="stylesheet" />
	<script src="assets/js/pace.min.js"></script>
    <link href="assets/plugins/perfect-scrollbar/css/perfect-scrollbar.css" rel="stylesheet" />
    <link href="assets/plugins/simplebar/css/simplebar.css" rel="stylesheet" />
    <link href="assets/plugins/metismenu/css/metisMenu.min.css" rel="stylesheet" />
    <link href="assets/plugins/datatable/css/dataTables.bootstrap5.min.css" rel="stylesheet" />
    <link href="assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/bootstrap-extended.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">
    <link href="assets/css/icons.css" rel="stylesheet">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
    <link href="assets/css/dark-theme.css" rel="stylesheet" />
    <link href="assets/css/semi-dark.css" rel="stylesheet" />
    <link href="assets/css/header-colors.css" rel="stylesheet" />
    <title>Archive Data (<?php echo $monthName;?>-<?php echo $year;?>)</title>
  </head>
  <body>
    <div class="wrapper">
    <?php include'system/header.php'?>
	    <div class="page-content-wrapper">
         <div class="page-content">
          <!--start breadcrumb-->
          
          <div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
            <div class="breadcrumb-title pe-3">Archive Old Data</div>
            <div class="ms-auto">
                <?php 
                // $id=$_SESSION['branch'];
                ?>
                <!--<a href="attendace-processing.php" class="btn btn-success px-5"  onclick="return confirm('Are you want to clear all employee salary table data of this month ?')">Genarate Salary</a>-->
            </div>
          </div>
          
          <div class="col-sm-12">
              <?php if(isset($_SESSION['delete'])){?>
              <div class="alert alert-dismissible fade show py-2 bg-danger">
                <div class="d-flex align-items-center">
                  <div class="fs-3 text-white"><ion-icon name="close-circle-sharp" role="img" class="md hydrated" aria-label="close circle sharp"></ion-icon>
                  </div>
                  <div class="ms-3">
                    <div class="text-white"><b><?php echo $_SESSION['delete'];?></b></div>
                  </div>
                </div>
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
              </div>
                <?php }?>
                <?php if(isset($_SESSION['s_sa'])){?>
                <div class="alert alert-dismissible fade show py-2 bg-danger">
                <div class="d-flex align-items-center">
                  <div class="fs-3 text-white"><ion-icon name="close-circle-sharp" role="img" class="md hydrated" aria-label="close circle sharp"></ion-icon>
                  </div>
                  <div class="ms-3">
                    <div class="text-white"><b><?php echo $_SESSION['s_sa'];?></b></div>
                  </div>
                </div>
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
              </div>
                <?php }?>
               
            </div>
			<hr/>
			
			
			<div class="card">
              <div class="card-body">
                <div class="p-4 border rounded">
                  <div class="row mb-3">
                   <!-- <div class="col l3 s12">
                      <a href="archive-payment-entry.php" class="btn btn-success px-5"  onclick="return confirm('Are you sure ?')">Archive Payment Data</a>
                    </div>-->
                    <!--archive-payment-entry.php, archive-reverse-payment.php -->
                    <div class="col l6 s12">
                        <a href="archive-processing.php" class="btn btn-success px-5"  onclick="return confirm('Are you want to clear all employee salary table data of this month ?')">Archive Salary Data</a>
                    </div>
                    <div class="col l6 s12">
                         <a href="archive-left-emp.php" class="btn btn-success px-5"  onclick="return confirm('Are you sure ?')">Left Employee</a>
                    </div>
                  </div>
                </div>
              </div>
            </div>	
             

          </div>
          <!-- end page content-->
         </div>
         
         <?php
    if(isset($_SESSION['delete'])){
        unset($_SESSION['delete']);
    }
    if(isset($_SESSION['s_sa'])){
        unset($_SESSION['s_sa']);
    }
    ?>

<?php include'system/footer.php'?>