<?php
$values = $_GET['branch'];
  include 'connection.php';
  
  //address
if(isset($_POST['update']))
{
   $id = isset($_POST['address_sno'])?$_POST['address_sno']:null;
    $no = isset($_POST['no'])?$_POST['no']:null;
  $location = isset($_POST['location'])?$_POST['location']:null;
    $landmark = isset($_POST['landmark'])?$_POST['landmark']:null;
    $country =  isset($_POST['country'])?$_POST['country']:null;
     $category = isset($_POST['category'])?$_POST['category']:null;
    $short = isset($_POST['short'])?$_POST['short']:null;
    $duration = isset($_POST['duration'])?$_POST['duration']:null;
    $email = isset($_POST['email'])?$_POST['email']:null;
    $branch = isset($_POST['branch'])?$_POST['branch']:null;
    $loca = isset($_POST['loca'])?$_POST['loca']:null;
    $code = isset($_POST['code'])?$_POST['code']:null;
    $grade = isset($_POST['grade'])?$_POST['grade']:null;
    $img = isset($_POST['img'])?$_POST['img']:null;
    $center = isset($_POST['center'])?$_POST['center']:null;
    $admission = isset($_POST['admission'])?$_POST['admission']:null;
    $paid = isset($_POST['paidfees'])?$_POST['paidfees']:null;
    $due = isset($_POST['duefees'])?$_POST['duefees']:null;
    $branchname = isset($_POST['branchname'])?$_POST['branchname']:null;

  $result = mysqli_query($sql_con,"UPDATE `print_fees` SET `RollNo`='$no',`Name`='$location',`Address`='$landmark',`CourseName`='$country', `BatchTiming`='$category', `AdmissionFees`='$short', `TuitionFees`='$duration', `Latefees`='$email', `LibraryFees`='$branch', `StudyMaterial`='$loca', `OtherCharges`='$code', `DepositDate`='$grade', `Fees`='$img', `Word`='$center', `AdmissionDate`='$admission', `PaidFees`='$paid',`BranchName`='$branchname',`DueFees`='$due' WHERE Sno ='$id'");
}

if(isset($_POST['delete']))
{
  //$sql_con=mysqli_connect('localhost','root','','hospital_management_website');

$id = isset($_POST['address_sno'])?$_POST['address_sno']:null;
$result1 = mysqli_query($sql_con,"DELETE FROM `print_fees` WHERE Sno='$id'");
}

?>

 <?php 
                $due = mysqli_query($sql_con, "SELECT sum(PaidFees) as dues2 From print_fees");
                while($row4 = mysqli_fetch_array($due))
                {
                    $due6 = $row4["dues2"];
                }

                $due = mysqli_query($sql_con, "SELECT sum(PaidFees) as dates FROM `print_fees` where MONTH(PaidFees)=MONTH(now()) and YEAR(PaidFees)=YEAR(now()) and BranchName='Ashram'");
                while($row4 = mysqli_fetch_array($due))
                {
                    $dates = $row4["dates"];
                }

                $due = mysqli_query($sql_con, "SELECT sum(PaidFees) as dates FROM `print_fees` where MONTH(PaidFees)=MONTH(now()) and YEAR(PaidFees)=YEAR(now()) and BranchName='Govindpuri'");
                while($row4 = mysqli_fetch_array($due))
                {
                    $dates2 = $row4["dates"];
                }
                ?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Modi Training Institute</title>

    <!-- ================= Favicon ================== -->
    <!-- Standard -->
    <link rel="shortcut icon" href="http://placehold.it/64.png/000/fff">
    <!-- Retina iPad Touch Icon-->
    <link rel="apple-touch-icon" sizes="144x144" href="http://placehold.it/144.png/000/fff">
    <!-- Retina iPhone Touch Icon-->
    <link rel="apple-touch-icon" sizes="114x114" href="http://placehold.it/114.png/000/fff">
    <!-- Standard iPad Touch Icon-->
    <link rel="apple-touch-icon" sizes="72x72" href="http://placehold.it/72.png/000/fff">
    <!-- Standard iPhone Touch Icon-->
    <link rel="apple-touch-icon" sizes="57x57" href="http://placehold.it/57.png/000/fff">

    <!-- Styles -->
    <link href="assets/css/lib/font-awesome.min.css" rel="stylesheet">
    <link href="assets/css/lib/themify-icons.css" rel="stylesheet">
    <link href="assets/css/lib/data-table/buttons.bootstrap.min.css" rel="stylesheet" />
    <link href="assets/css/lib/menubar/sidebar.css" rel="stylesheet">
    <link href="assets/css/lib/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/lib/helper.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">

     <script type="text/javascript" src="https://unpkg.com/xlsx@0.15.1/dist/xlsx.full.min.js"></script>

</head>

<body>

        <div class="sidebar sidebar-hide-to-small sidebar-shrink sidebar-gestures">
            <div class="nano">
                <div class="nano-content">
<div class="logo"><a href="address.php?BranchName=<?php echo $values; ?>"><!-- <img src="assets/images/logo.png" alt="" /> --><span>Modi Traning Institute</span></a></div>
                    <ul>
                        <li class="label">Main</li>
                        <li><a class="sidebar-sub-toggle"><i class="ti-layout"></i>Website Master <span class="sidebar-collapse-icon ti-angle-down"></span></a>
                            <ul>
                               <li><a href="online-exam-course.php?branch=<?php echo $values; ?>">Online Exam Course Master</a></li>
                         <li><a href="contact.php?branch=<?php echo $values; ?>">Contact Form</a></li>
                          <li><a href="demo.php?branch=<?php echo $values; ?>">Demo Form</a></li>
                          <li><a href="register.php?branch=<?php echo $values; ?>">REG by Website</a></li>
                          <li><a href="enquiry.php?branch=<?php echo $values; ?>">Enquiry Form</a></li>
                         <li><a href="idcard.php?branch=<?php echo $values; ?>">Student Id Card Master</a></li>
                        <li><a href="address.php?BranchName=<?php echo $values; ?>">Address Master</a></li>
                        <li><a href="link.php?branch=<?php echo $values; ?>"> Link Master</a></li>
                        <li><a href="testimonial.php?branch=<?php echo $values; ?>">Testimonial Master</a></li>
                        <li><a href="team.php?branch=<?php echo $values; ?>">Team Master</a></li>
                         <li><a href="gallery.php?branch=<?php echo $values; ?>">Gallery Master</a></li>
                        <li><a href="blog.php?branch=<?php echo $values; ?>">Blog Master</a></li>
                        <li><a href="event.php?branch=<?php echo $values; ?>">Event Master</a></li>
                        <li><a href="course.php?branch=<?php echo $values; ?>">Course Master</a></li>
                        <li><a href="course-content.php?branch=<?php echo $values; ?>">Course Content Master</a></li>
                        <li><a href="batch.php?branch=<?php echo $values; ?>">Batch Master</a></li>
                        <li><a href="course-description.php?branch=<?php echo $values; ?>">Course Description Master</a></li>
                        <li><a href="offer.php?branch=<?php echo $values; ?>">Offer Master</a></li>
                        <li><a href="afflication.php?branch=<?php echo $values; ?>">Afflication Master</a></li>
                        <li><a href="placement.php?branch=<?php echo $values; ?>">Placement Master</a></li>
                            </ul>
                        </li>
                        <li><a class="sidebar-sub-toggle"><i class="ti-layout"></i>Admission Master <span class="sidebar-collapse-icon ti-angle-down"></span></a>
                            <ul>
                                <li><a href="personal.php?branch=<?php echo $values; ?>">Personal Info</a></li>
                                <li><a href="bank.php?branch=<?php echo $values; ?>">Bank Detail</a></li>
                                
                                <li><a href="course-admin.php?branch=<?php echo $values; ?>">Course Detail</a></li>
                                <li><a href="fee.php?branch=<?php echo $values; ?>">Fees Detail</a></li>
                            </ul>
                        </li>
                        <li><a class="sidebar-sub-toggle"><i class="ti-panel"></i>Inquiry <span class="sidebar-collapse-icon ti-angle-down"></span></a>
                            <ul>
                                <li><a href="inquiry.php?branch=<?php echo $values; ?>">Inquiry Form</a></li>
                                <li><a href="inquiry-report.php?branch=<?php echo $values; ?>">All Inquiry Report</a></li>
                                <li><a href="converted.php?branch=<?php echo $values; ?>">Converted</a></li>
                                <li><a href="not-converted.php?branch=<?php echo $values; ?>">Not Converted</a></li>
                            </ul>
                        </li>
                        <li><a class="sidebar-sub-toggle"><i class="ti-layout-grid4-alt"></i>Fees Master <span class="sidebar-collapse-icon ti-angle-down"></span></a>
                            <ul>
                                <li><a href="create-fee.php?branch=<?php echo $values; ?>">Fees Form</a></li>
                               
                                <li><a href="print-fees.php?branch=<?php echo $values; ?>">All Fees Detail</a></li>
                                <li><a href="due-fees.php?branch=<?php echo $values; ?>">Due Fees Detail</a></li>
                            </ul>
                        </li>
                        <li><a class="sidebar-sub-toggle"><i class="ti-heart"></i>Document Master <span class="sidebar-collapse-icon ti-angle-down"></span></a>
                            <ul>
                                <li><a href="document.php?branch=<?php echo $values; ?>">Document</a></li>
                                <li><a href="certificate.php?branch=<?php echo $values; ?>">Certificate</a></li>
                                <li><a href="document-records.php?branch=<?php echo $values; ?>">All Document Records</a></li>
                                <li><a href="Certificate-record.php?branch=<?php echo $values; ?>">All Certificate Records</a></li>
                            </ul>
                        </li>
                         <li><a class="sidebar-sub-toggle"><i class="ti-heart"></i>Certificate Master <span class="sidebar-collapse-icon ti-angle-down"></span></a>
                            <ul>
                                <li><a href="create-certificate.php?branch=<?php echo $values; ?>">Certificate Create</a></li>
                                <li><a href="print-certificate.php?branch=<?php echo $values; ?>">All Certificate Records</a></li>
                            </ul>
                        </li>
                        <li><a href="../admin-dashboard.php"><i class="ti-close"></i> Logout</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <!-- /# sidebar -->


    <div class="header">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                    <div class="float-left">
                        <div class="hamburger sidebar-toggle">
                            <span class="line"></span>
                            <span class="line"></span>
                            <span class="line"></span>
                        </div>
                    </div>
                    
            </div>
        </div>
    </div>




    <div class="content-wrap">
        <div class="main">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12 p-r-0 title-margin-right">
                          <table class="table table-responsive-lg table-bordered table-active" style="border: 2px solid black;" align="left">
                           <tr>
                               <td style="color: black; font-weight: bolder; text-align: left; text-transform: uppercase;">Total Fees: <?php echo $due6; ?></td>
                               <td style="color: black; font-weight: bolder; text-align: left; text-transform: uppercase;">Ashram Total Fees : <?php echo $due6; ?></td>
                               <td style="color: black; font-weight: bolder; text-align: left; text-transform: uppercase;">Govindpuri Total Fees: <?php echo $dates2; ?></td>
                           </tr>
                       </table>
                    </div>
                </div>
                <!-- /# row -->
                <section id="main-content">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="card">
                              
                                    <div class="table-responsive">
                                          <form method="post">
                                        <div class="row">
                    <div class="col-md-8">
                        <div class="row">
                            <div class="col-4">
                        <input type="text" name="search1" class="form-control" placeholder="Search Here .....">
                    </div>
                    <div class="col-4">
                        <input type="date" name="start" class="form-control rounded" placeholder="Search" />
                    </div>
                    <div class="col-4">
                        <input type="date" name="end" class="form-control rounded" placeholder="Search" />
                    </div>
                </div>
            </div>
                    <div class="col-md-4">
                     &nbsp;&nbsp;<input type="submit" class="btn btn-info" name="search" value="Search"> 
                     <button style="font-size: 15px;" onclick="ExportToExcel('xlsx')" class="btn btn-success">Excel File</button>
             <input type="button" style="font-size: 15px;" value="Create PDF" id="btPrint" onclick="createPDF()" class="btn btn-success" />      
                    </div>
                    
                </div>
                 
            </form>
            
          
                                    
                                        <div id="tab">
                                                                                <table class="table table-bordered" id="tblData">
    <thead class="thead-light">
      <tr class="d-flex">
        <th class="col-1" style="color: black;">Sno</th>
        <th class="col-1" style="color: black;">Roll No</th>
        <th class="col-1" style="color: black;">Student Name</th>
        <th class="col-1" style="color: black;">Address</th>
        <th class="col-1" style="color: black;">Course Name</th>
        <th class="col-1" style="color: black;">Branch</th>
        <th class="col-1" style="color: black;">Batch Timing</th>
        <th class="col-1" style="color: black;">Adm. Date</th>
        <th class="col-1" style="color: black;">Adm. Fees</th>
        <th class="col-1" style="color: black;">Tuition Fees</th>
        <th class="col-1" style="color: black;">Late Fees</th>
        <th class="col-1" style="color: black;">Library Fees</th>
        <th class="col-1" style="color: black;">Study Material Fees</th>
        <th class="col-1" style="color: black;">Other Charges</th>
        <th class="col-1" style="color: black;">Deposit Date</th>
        <th class="col-1" style="color: black;">Total Fees</th>
        <th class="col-1" style="color: black;">Paid Fees</th>
        <th class="col-1" style="color: black;">Due Fees</th>
         <th class="col-1" style="color: black;">Action</th>
      </tr>
    </thead>
    <tbody>
     
        <?php
 $search = isset($_POST['search1'])?$_POST['search1']:null;

if($search==null && isset($_POST['search']))
{
 $original_date = isset($_POST['start'])?$_POST['start']:null;
$timestamp = strtotime($original_date);
$new_date = date("Y-m-d", $timestamp);


$original_date1 = isset($_POST['end'])?$_POST['end']:null;
$timestamp1 = strtotime($original_date1);
$new_date1 = date("Y-m-d", $timestamp1);

 $oquery = mysqli_query($sql_con,"SELECT * FROM print_fees WHERE DepositDate BETWEEN '$new_date' AND '$new_date1'");
 while($row21 = mysqli_fetch_array($oquery))
$search = isset($_POST['search1'])?$_POST['search1']:null;
{
  $no= $sub1["Sno"];
  $numb = $sub1["RollNo"];
  $location = $sub1["Name"];
  $landmark = $sub1["Address"];
  $country = $sub1["CourseName"];
  $category = $sub1["BatchTiming"];
  $add = $sub1["AdmissionDate"];
  $dur = $sub1["AdmissionFees"];
  $email = $sub1["TuitionFees"];
  $branch = $sub1["Latefees"];
  $loca = $sub1["LibraryFees"];
  $code = $sub1["StudyMaterial"];
  $grade = $sub1["OtherCharges"];
  $short = $sub1["DepositDate"];
  $image = $sub1["Fees"];
  $paid = $sub1["PaidFees"];
  $due = $sub1["DueFees"];
  $center = $sub1["Word"];
  $name = $sub1["BranchName"];
  ?>
    <tr class="d-flex">
   <td class="col-1" style="color: black;"><?php echo $no;?></td> 
   <td class="col-1" style="color: black;"><?php echo $numb; ?></td>
<td class="col-1" style="color: black;"><?php echo $location;?></td>
        <td class="col-1" style="color: black;"><?php echo $landmark;?></td>
        <td class="col-1" style="color: black;"><?php echo $country;?></td>
         <td class="col-1" style="color: black;"><?php echo $name; ?></td>
        <td class="col-1" style="color: black;"><?php echo $category;?></td>
        <td class="col-1" style="color: black;"><?php echo $add;?></td>
        <td class="col-1" style="color: black;"><?php echo $dur;?></td>
        <td class="col-1" style="color: black;"><?php echo $email;?></td>
        <td class="col-1" style="color: black;"><?php echo $branch; ?></td>
        <td class="col-1" style="color: black;"><?php echo $loca;?></td>
        <td class="col-1" style="color: black;"><?php echo $code;?></td>
        <td class="col-1" style="color: black;"><?php echo $grade; ?></td>
        <td class="col-1" style="color: black;"><?php echo $short;?></td>
        <td class="col-1" style="color: black;"><?php echo $image; ?></td>
        <td class="col-1" style="color: black;"><?php echo $paid; ?></td>
        <td class="col-1" style="color: black;"><?php echo $due; ?></td>

        <td class="col-1" style="color: black;"><button type="button" class="btn btn-primary" data-toggle="modal" onclick="document.getElementById('address_id').value = '<?php echo $no; ?>';document.getElementById('numb').value = '<?php echo $numb; ?>';document.getElementById('location').value = '<?php echo $location; ?>';document.getElementById('address').value = '<?php echo $landmark; ?>';document.getElementById('course').value = '<?php echo $country; ?>';document.getElementById('branchname').value = '<?php echo $name; ?>';document.getElementById('category').value = '<?php echo $category; ?>';document.getElementById('admissiondate').value = '<?php echo $add; ?>';document.getElementById('duration').value = '<?php echo $dur; ?>';document.getElementById('branch').value = '<?php echo $branch; ?>';document.getElementById('email1').value = '<?php echo $email; ?>';document.getElementById('loca').value = '<?php echo $loca; ?>';document.getElementById('code').value = '<?php echo $code; ?>';document.getElementById('grade').value = '<?php echo $grade; ?>';document.getElementById('short').value = '<?php echo $short; ?>';document.getElementById('image').value = '<?php echo $image; ?>';document.getElementById('paidfees').value = '<?php echo $paid; ?>';document.getElementById('duefees').value = '<?php echo $due; ?>';document.getElementById('center').value = '<?php echo $center; ?>';"
         data-target="#myModal" style="font-size: 12px;">Details
  </button><a href="slip.php?value=<?php echo $no; ?>" class="btn btn-success" target="blank" style="font-size: 12px;">Print</a></td></tr> 
  <?php
}
}
       else if(isset($_POST['search']))
        { 
$result2 = mysqli_query($sql_con,"SELECT * FROM `print_fees` where RollNo like '%$search%' or Name like '%$search%' or Address like '%$search%' or CourseName like '%$search%' or BatchTiming like '%$search%' or `AdmissionDate` like '%$search%' or AdmissionFees like '%$search%' or TuitionFees like '%$search%' or Latefees like '%$search%' or LibraryFees like '%$search%' or StudyMaterial like '%$search%' or OtherCharges like '%$search%' or Fees like '%$search%' or PaidFees like '%$search%' or BalanceFees like '%$search%' or Word like '%$search%' or BranchName like '%$search%' or DepositDate like '%$search%'");
   while($sub1 = mysqli_fetch_array($result2))
{
  $no= $sub1["Sno"];
  $numb = $sub1["RollNo"];
  $location = $sub1["Name"];
  $landmark = $sub1["Address"];
  $country = $sub1["CourseName"];
  $category = $sub1["BatchTiming"];
  $add = $sub1["AdmissionDate"];
  $dur = $sub1["AdmissionFees"];
  $email = $sub1["TuitionFees"];
  $branch = $sub1["Latefees"];
  $loca = $sub1["LibraryFees"];
  $code = $sub1["StudyMaterial"];
  $grade = $sub1["OtherCharges"];
  $short = $sub1["DepositDate"];
  $image = $sub1["Fees"];
  $paid = $sub1["PaidFees"];
  $due = $sub1["DueFees"];
  $center = $sub1["Word"];
  $name = $sub1["BranchName"];
  ?>
   <tr class="d-flex">
   <td class="col-1" style="color: black;"><?php echo $no;?></td> 
   <td class="col-1" style="color: black;"><?php echo $numb; ?></td>
<td class="col-1" style="color: black;"><?php echo $location;?></td>
        <td class="col-1" style="color: black;"><?php echo $landmark;?></td>
        <td class="col-1" style="color: black;"><?php echo $country;?></td>
         <td class="col-1" style="color: black;"><?php echo $name; ?></td>
        <td class="col-1" style="color: black;"><?php echo $category;?></td>
        <td class="col-1" style="color: black;"><?php echo $add;?></td>
        <td class="col-1" style="color: black;"><?php echo $dur;?></td>
        <td class="col-1" style="color: black;"><?php echo $email;?></td>
        <td class="col-1" style="color: black;"><?php echo $branch; ?></td>
        <td class="col-1" style="color: black;"><?php echo $loca;?></td>
        <td class="col-1" style="color: black;"><?php echo $code;?></td>
        <td class="col-1" style="color: black;"><?php echo $grade; ?></td>
        <td class="col-1" style="color: black;"><?php echo $short;?></td>
        <td class="col-1" style="color: black;"><?php echo $image; ?></td>
        <td class="col-1" style="color: black;"><?php echo $paid; ?></td>
        <td class="col-1" style="color: black;"><?php echo $due; ?></td>

        <td class="col-1" style="color: black;"><button type="button" class="btn btn-primary" data-toggle="modal" onclick="document.getElementById('address_id').value = '<?php echo $no; ?>';document.getElementById('numb').value = '<?php echo $numb; ?>';document.getElementById('location').value = '<?php echo $location; ?>';document.getElementById('address').value = '<?php echo $landmark; ?>';document.getElementById('course').value = '<?php echo $country; ?>';document.getElementById('branchname').value = '<?php echo $name; ?>';document.getElementById('category').value = '<?php echo $category; ?>';document.getElementById('admissiondate').value = '<?php echo $add; ?>';document.getElementById('duration').value = '<?php echo $dur; ?>';document.getElementById('branch').value = '<?php echo $branch; ?>';document.getElementById('email1').value = '<?php echo $email; ?>';document.getElementById('loca').value = '<?php echo $loca; ?>';document.getElementById('code').value = '<?php echo $code; ?>';document.getElementById('grade').value = '<?php echo $grade; ?>';document.getElementById('short').value = '<?php echo $short; ?>';document.getElementById('image').value = '<?php echo $image; ?>';document.getElementById('paidfees').value = '<?php echo $paid; ?>';document.getElementById('duefees').value = '<?php echo $due; ?>';document.getElementById('center').value = '<?php echo $center; ?>';"
         data-target="#myModal" style="font-size: 12px;">Details
  </button><a href="slip.php?value=<?php echo $no; ?>" class="btn btn-success" target="blank" style="font-size: 12px;">Print</a></td></tr> 
  <?php
}
}
else
{
$result = mysqli_query($sql_con,"SELECT * FROM `print_fees` where BranchName='$values'");
while($row = mysqli_fetch_array($result))
{
  $no= $row["Sno"];
  $numb = $row["RollNo"];
  $location = $row["Name"];
  $landmark = $row["Address"];
  $country = $row["CourseName"];
  $category = $row["BatchTiming"];
  $add = $row["AdmissionDate"];
  $dur = $row["AdmissionFees"];
  $email = $row["TuitionFees"];
  $branch = $row["Latefees"];
  $loca = $row["LibraryFees"];
  $code = $row["StudyMaterial"];
  $grade = $row["OtherCharges"];
  $short = $row["DepositDate"];
  $image = $row["Fees"];
  $paid = $row["PaidFees"];
  $due = $row["BalanceFees"];
  $name = $row["BranchName"];
  ?>
   <tr class="d-flex">
   <td class="col-1" style="color: black;"><?php echo $no;?></td> 
   <td class="col-1" style="color: black;"><?php echo $numb; ?></td>
<td class="col-1" style="color: black;"><?php echo $location;?></td>
        <td class="col-1" style="color: black;"><?php echo $landmark;?></td>
        <td class="col-1" style="color: black;"><?php echo $country;?></td>
         <td class="col-1" style="color: black;"><?php echo $name; ?></td>
        <td class="col-1" style="color: black;"><?php echo $category;?></td>
        <td class="col-1" style="color: black;"><?php echo $add;?></td>
        <td class="col-1" style="color: black;"><?php echo $dur;?></td>
        <td class="col-1" style="color: black;"><?php echo $email;?></td>
        <td class="col-1" style="color: black;"><?php echo $branch; ?></td>
        <td class="col-1" style="color: black;"><?php echo $loca;?></td>
        <td class="col-1" style="color: black;"><?php echo $code;?></td>
        <td class="col-1" style="color: black;"><?php echo $grade; ?></td>
        <td class="col-1" style="color: black;"><?php echo $short;?></td>
        <td class="col-1" style="color: black;"><?php echo $image; ?></td>
        <td class="col-1" style="color: black;"><?php echo $paid; ?></td>
        <td class="col-1" style="color: black;"><?php echo $due; ?></td>

        <td class="col-1" style="color: black;"><button type="button" class="btn btn-primary" data-toggle="modal" onclick="document.getElementById('address_id').value = '<?php echo $no; ?>';document.getElementById('numb').value = '<?php echo $numb; ?>';document.getElementById('location').value = '<?php echo $location; ?>';document.getElementById('address').value = '<?php echo $landmark; ?>';document.getElementById('course').value = '<?php echo $country; ?>';document.getElementById('branchname').value = '<?php echo $name; ?>';document.getElementById('category').value = '<?php echo $category; ?>';document.getElementById('admissiondate').value = '<?php echo $add; ?>';document.getElementById('duration').value = '<?php echo $dur; ?>';document.getElementById('branch').value = '<?php echo $branch; ?>';document.getElementById('email1').value = '<?php echo $email; ?>';document.getElementById('loca').value = '<?php echo $loca; ?>';document.getElementById('code').value = '<?php echo $code; ?>';document.getElementById('grade').value = '<?php echo $grade; ?>';document.getElementById('short').value = '<?php echo $short; ?>';document.getElementById('image').value = '<?php echo $image; ?>';document.getElementById('paidfees').value = '<?php echo $paid; ?>';document.getElementById('duefees').value = '<?php echo $due; ?>';document.getElementById('center').value = '<?php echo $center; ?>';"
         data-target="#myModal" style="font-size: 12px;">Details
  </button><a href="slip.php?value=<?php echo $no; ?>" class="btn btn-success" target="blank" style="font-size: 12px;">Print</a></td></tr>
  <?php
}
}
       ?>
        
      
      
    </tbody>
  </table></div>
<div class="container">
  

  <!-- The Modal -->
  <div class="modal fade" id="myModal">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
      
        <!-- Modal Header -->
        <div class="modal-header">
          <h4 class="modal-title">Fees Information</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
        
        <!-- Modal body -->
        <div class="modal-body">
          <div class="container">

          <form method="POST" enctype="multipart/form-data">
            <div class="form-group row has-success" style="height: 20px;">
    <label for="Name">Sno </label>
    <div class="col-lg-8">
    <input type="name" class="form-control" id="address_id" placeholder="Location" name="address_sno" style="height: 20px;">
  </div>
  </div>
   <div class="form-group row has-success" style="height: 20px;">
    <label for="Name">Roll No</label>
     <div class="col-lg-8">
    <input type="name" class="form-control" id="numb" placeholder="Roll No" name="no" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-success" style="height: 20px;">
    <label for="Name">Name</label>
     <div class="col-lg-8">
    <input type="name" class="form-control" id="location" placeholder="Name" name="location" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-warning" style="height: 20px;">
    <label for="landmark">Address</label>
     <div class="col-lg-8">
    <input type="landmark" class="form-control" id="address" placeholder="Address" name="landmark" style="height: 20px;">
  </div>  
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="country">Course Name</label>
     <div class="col-lg-8">
     <input type="country" class="form-control" id="course" placeholder="Course Name" name="country" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="country">Branch Name</label>
     <div class="col-lg-8">
     <input type="country" class="form-control" id="branchname" placeholder="Branch Name" name="branchname" style="height: 20px;">
  </div> 
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="time1">Batch Timing</label>
     <div class="col-lg-8">
    <input type="text" class="form-control" id="category" placeholder="Batch Timing" name="category" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="time1">Admission Date</label>
     <div class="col-lg-8">
   <input type="text" class="form-control" id="admissiondate" placeholder="Admission Date" name="admission" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="time1">Admission Fees</label>
     <div class="col-lg-8">
    <input type="text" class="form-control" id="duration" placeholder="Admission Fees" name="duration" style="height: 20px;">
  </div>
  </div>
 <div class="form-group row has-error" style="height: 20px;">
    <label for="country">Tuition Fees</label>
     <div class="col-lg-8">
     <input type="text" class="form-control" id="email1" placeholder="Tuition Fees" name="email" style="height: 20px;">
  </div> 
  </div>
   <div class="form-group row has-error" style="height: 20px;">
    <label for="country">Late Fees</label>
     <div class="col-lg-8">
     <input type="text" class="form-control" id="branch" placeholder="Late Fees" name="branch" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="time1">Library Fees</label>
     <div class="col-lg-8">
    <input type="text" class="form-control" id="loca" placeholder="Library Fees" name="loca" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="time1">Study Material Fees</label>
     <div class="col-lg-8">
    <input type="text" class="form-control" id="code" placeholder="Study Material" name="code" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="country">Other Charges</label>
     <div class="col-lg-8">
     <input type="text" class="form-control" id="grade" placeholder="Other Charges" name="grade" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="time1">Deposit Date</label>
     <div class="col-lg-8">
   <input type="text" class="form-control" id="short" placeholder="Date" name="short" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="country">Total</label>
     <div class="col-lg-8">
     <input type="text" class="form-control" id="image" placeholder="Total" name="img" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="country">Paid Fees</label>
     <div class="col-lg-8">
     <input type="text" class="form-control" id="paidfees" placeholder="Paid Fees" name="paidfees" style="height: 20px;">
  </div>
  </div>
  <div class="form-group row has-error" style="height: 20px;">
    <label for="time1">Due Fees</label>
     <div class="col-lg-8">
   <input type="text" class="form-control" id="duefees" placeholder="Due Fees" name="duefees" style="height: 20px;">
  </div> 
  </div>

  <button type="submit" class="btn btn-info" name="update" style="font-size: 12px;">Update Information</button>
  <button type="submit" class="btn btn-info" name="delete" style="font-size: 12px;">Delete Information</button>
  
  
</form>
<br><br/>
</div>
        </div>
        
        <!-- Modal footer -->
        <div class="modal-footer">
          <button type="button" class="btn btn-danger" data-dismiss="modal" style="font-size: 12px;">Close</button>
        </div>
        
      </div>
    </div>
  </div>
  
</div>
 
                                    </div>
                                </div>
                            </div>
                            <!-- /# card -->
                        </div>
                        <!-- /# column -->
                    </div>
                    <!-- /# row -->

                    <div class="row">
                        <div class="col-lg-6">
                            <div class="footer">
                                <p>All right reserved by- <a href="">Modi Training Institute</a> 
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="footer" style="text-align: right;">
                                <p style="text-align: right;">Managed By- <a href="https://www.kiyanchsolutions.com/" target="_blank">Kiyan Ch Solutions</a> 
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </div>
</div>
</div>








    
    <!-- jquery vendor -->
    <script src="assets/js/lib/jquery.min.js"></script>
    <script src="assets/js/lib/jquery.nanoscroller.min.js"></script>
    <!-- nano scroller -->
    <script src="assets/js/lib/menubar/sidebar.js"></script>
    <script src="assets/js/lib/preloader/pace.min.js"></script>
    <!-- sidebar -->
    
    <!-- bootstrap -->

    <script src="assets/js/lib/bootstrap.min.js"></script><script src="assets/js/scripts.js"></script>
    <!-- scripit init-->
    <script src="assets/js/lib/data-table/datatables.min.js"></script>
    <script src="assets/js/lib/data-table/dataTables.buttons.min.js"></script>
    <script src="assets/js/lib/data-table/buttons.flash.min.js"></script>
    <script src="assets/js/lib/data-table/jszip.min.js"></script>
    <script src="assets/js/lib/data-table/pdfmake.min.js"></script>
    <script src="assets/js/lib/data-table/vfs_fonts.js"></script>
    <script src="assets/js/lib/data-table/buttons.html5.min.js"></script>
    <script src="assets/js/lib/data-table/buttons.print.min.js"></script>
    <script src="assets/js/lib/data-table/datatables-init.js"></script>

   <script>
    function createPDF() {
        var sTable = document.getElementById('tab').innerHTML;

        var style = "<style>";
        style = style + "table {width: 100%;font: 17px Calibri;}";
        style = style + "table, th, td {border: solid 1px #DDD; border-collapse: collapse;";
        style = style + "padding: 2px 3px;text-align: center;}";
        style = style + "</style>";

        // CREATE A WINDOW OBJECT.
        var win = window.open('', '', 'height=700,width=700');

        win.document.write('<html><head>');
        win.document.write('<title>Profile</title>');   // <title> FOR PDF HEADER.
        win.document.write(style);          // ADD STYLE INSIDE THE HEAD TAG.
        win.document.write('</head>');
        win.document.write('<body>');
        win.document.write(sTable);         // THE TABLE CONTENTS INSIDE THE BODY TAG.
        win.document.write('</body></html>');

        win.document.close();   // CLOSE THE CURRENT WINDOW.

        win.print();    // PRINT THE CONTENTS.
    }
</script>
    
 <script>

        function ExportToExcel(type, fn, dl) {
            var elt = document.getElementById('tblData');
            var wb = XLSX.utils.table_to_book(elt, { sheet: "sheet1" });
            return dl ?
                XLSX.write(wb, { bookType: type, bookSST: true, type: 'base64' }) :
                XLSX.writeFile(wb, fn || ('MySheetName.' + (type || 'xlsx')));
        }

    </script>

<script type="text/javascript">
    function Export2Doc(element, filename = ''){
        var html = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'><head><meta><title>Export HTML To Doc</title></head><body>";
        var footer = "</body></html>";
        var html = html+document.getElementById(element).innerHTML+footer;
    
        
        //link url
        var url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);
        
        //file name
        filename = filename?filename+'.doc':'document.doc';
        
        // Creates the  download link element dynamically
        var downloadLink = document.createElement("a");
    
        document.body.appendChild(downloadLink);
        
        //Link to the file
        downloadLink.href = url;
            
        //Setting up file name
        downloadLink.download = filename;
            
        //triggering the function
        downloadLink.click();
        //Remove the a tag after donwload starts.
        document.body.removeChild(downloadLink);
    }
</script>

<script>
  
 $(document).ready(function () {
    $("#tblData").table2excel({
        filename: "Students.xls"
    });
 });
  
</script>
</body>

</html>