<?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;
    $loca = isset($_POST['loca'])?$_POST['loca']:null;
    $email = isset($_POST['email'])?$_POST['email']:null;
    $branch = isset($_POST['branch'])?$_POST['branch']:null;
    $grade = isset($_POST['grade'])?$_POST['grade']:null;
    $code = isset($_POST['code'])?$_POST['code']:null;
    $img = $_FILES['img']['name'];
    $tempimgname1= $_FILES['img']['tmp_name'];
  move_uploaded_file($tempimgname1,"images/$img");
  $center = $_FILES['center']['name'];
    $tempimgname1= $_FILES['img']['tmp_name'];
  move_uploaded_file($tempimgname1,"images/$center");
  $hony = $_FILES['director']['name'];
    $tempimgname1= $_FILES['img']['tmp_name'];
  move_uploaded_file($tempimgname1,"images/$hony");

  $result = mysqli_query($sql_con,"UPDATE `create_certificate` SET `AdmissionNo`='$no',`Name`='$location',`FatherName`='$landmark',`Course`='$country', `Start`='$email', `End`='$branch', `Grade`='$grade', `Sign`='$img', `Center`='$center', `Director`='$hony', `Category`='$category', `Short`='$short', `Duration`='$duration', `Branch`='$loca', `Code`='$code' 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 `create_certificate` WHERE Sno='$id'");
}
  
?>

 <?php 
                $due = mysqli_query($sql_con, "SELECT count(Sno) as snos From create_certificate");
                while($row4 = mysqli_fetch_array($due))
                {
                    $sno = $row4["snos"];
                }

               
                ?>

<!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 Traning 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/select2/select2.min.css" rel="stylesheet">
    <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/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="../HRMS/HRMS/security.php?branch=<?php echo $values; ?>" target="_blank"><i class="ti-user"></i> HRMS Login</a></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-bordered table-responsive-lg table-active" style="border: 2px solid black;">
                           <tr>
                               <td style="text-transform: uppercase; text-align: center; font-weight: bolder; color: black;">Total Certificate: <?php echo $sno; ?></td>
                              
                           </tr>
                       </table>
                    </div>
                    
                </div>
                <!-- /# row -->
                <section id="main-content">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="card">
                                <div class="card-body">
                                <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">
                     <input type="submit" class="btn btn-info" name="search" value="Search"> 
                      <button onclick="ExportToExcel('xlsx')" class="btn btn-success">Excel File</button>
             <input type="button" value="Create PDF" id="btPrint" onclick="createPDF()" class="btn btn-success" />
                    </div>
                    
                </div>
                 
            </form>
            
                                    <div class="table-responsive" >
                                        <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-2" style="color: black;">Branch</th>
        <th class="col-2" style="color: black;">Adm. No</th>
        <th class="col-2" style="color: black;">Student Name</th>
        <th class="col-2" style="color: black;">Course Category</th>
        <th class="col-2" style="color: black;">Course Name</th>
        <th class="col-1" style="color: black;">Duration</th>
        <th class="col-2" style="color: black;">Starting Date</th>
        <th class="col-2" style="color: black;">Ending Date</th>
        <th class="col-2" 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("m-d-Y", $timestamp);


$original_date1 = isset($_POST['end'])?$_POST['end']:null;
$timestamp1 = strtotime($original_date1);
$new_date1 = date("m-d-Y", $timestamp1);

 $oquery = mysqli_query($sql_con,"SELECT * FROM create_certificate WHERE Start BETWEEN '$new_date' AND '$new_date1'");
 while($row21 = mysqli_fetch_array($oquery))
 {
  $no= $row21["Sno"];
  $numb = $row21["AdmissionNo"];
  $location = $row21["Name"];
  $landmark = $row21["FatherName"];
  $country = $row21["Course"];
  $category = $row21["Category"];
  $short = $row21["Short"];
  $dur = $row21["Duration"];
  $email = $row21["Start"];
  $branch = $row21["End"];
  $loca = $row21["Branch"];
  $code = $row21["Code"];
  $grade = $row21["Grade"];
  $image = $row21["Sign"];
  $center = $row21["Center"];
  $direc = $row21["Director"];
  ?>
 <tr class="d-flex">
   <td class="col-1"><?php echo $no;?></td> 
    <td class="col-2"><?php echo $loca;?></td>
   <td class="col-2"><?php echo $numb; ?></td>
<td class="col-2"><?php echo $location;?></td>
 <td class="col-2"><?php echo $category;?></td>
        <td class="col-2"><?php echo $country;?></td>
        <td class="col-1"><?php echo $dur;?></td>
        <td class="col-2"><?php echo $email;?></td>
        <td class="col-2"><?php echo $branch; ?></td>
        <td class="col-2"><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('landmark').value = '<?php echo $landmark; ?>';document.getElementById('category').value = '<?php echo $category; ?>';document.getElementById('country').value = '<?php echo $country; ?>';document.getElementById('short').value = '<?php echo $short; ?>';document.getElementById('duration').value = '<?php echo $dur; ?>';document.getElementById('email1').value = '<?php echo $email; ?>';document.getElementById('branch').value = '<?php echo $branch; ?>';document.getElementById('loca').value = '<?php echo $loca; ?>';document.getElementById('code').value = '<?php echo $code; ?>';document.getElementById('grade').value = '<?php echo $grade; ?>';document.getElementById('image').value = '<?php echo $image; ?>';document.getElementById('center').value = '<?php echo $center; ?>';document.getElementById('direc').value = '<?php echo $direc; ?>';"
         data-target="#myModal" style="font-size: 12px;">Details
  </button><a href="try.php?value=<?php echo $no; ?>" target="_blank" class="btn btn-success" style="font-size: 12px;">Print</a></td></tr>
  <?php
}
}
else if(isset($_POST['search']))
        { 
$result2 = mysqli_query($sql_con,"SELECT * FROM `create_certificate` where Name like '%$search%' or AdmissionNo like '%$search%' or FatherName like '%$search%' or Course like '%$search%' or Category like '%$search%' or Short like '%$search%' or Duration like '%$search%' or Start like '%$search%' or Branch like '%$search%' or Code like '%$search%' or Grade like '%$search%' or Sign like '%$search%' or Center like '%$search%' or Director like '%$search%'");
   while($sub1 = mysqli_fetch_array($result2))
{
 $no= $sub1["Sno"];
  $numb = $sub1["AdmissionNo"];
  $location = $sub1["Name"];
  $landmark = $sub1["FatherName"];
  $country = $sub1["Course"];
  $category = $sub1["Category"];
  $short = $sub1["Short"];
  $dur = $sub1["Duration"];
  $email = $sub1["Start"];
  $branch = $sub1["End"];
  $loca = $sub1["Branch"];
  $code = $sub1["Code"];
  $grade = $sub1["Grade"];
  $image = $sub1["Sign"];
  $center = $sub1["Center"];
  $direc = $sub1["Director"];
  ?>
  <tr class="d-flex">
   <td class="col-1"><?php echo $no;?></td> 
    <td class="col-2"><?php echo $loca;?></td>
   <td class="col-2"><?php echo $numb; ?></td>
<td class="col-2"><?php echo $location;?></td>
 <td class="col-2"><?php echo $category;?></td>
        <td class="col-2"><?php echo $country;?></td>
        <td class="col-1"><?php echo $dur;?></td>
        <td class="col-2"><?php echo $email;?></td>
        <td class="col-2"><?php echo $branch; ?></td>
        <td class="col-2"><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('landmark').value = '<?php echo $landmark; ?>';document.getElementById('category').value = '<?php echo $category; ?>';document.getElementById('country').value = '<?php echo $country; ?>';document.getElementById('short').value = '<?php echo $short; ?>';document.getElementById('duration').value = '<?php echo $dur; ?>';document.getElementById('email1').value = '<?php echo $email; ?>';document.getElementById('branch').value = '<?php echo $branch; ?>';document.getElementById('loca').value = '<?php echo $loca; ?>';document.getElementById('code').value = '<?php echo $code; ?>';document.getElementById('grade').value = '<?php echo $grade; ?>';document.getElementById('image').value = '<?php echo $image; ?>';document.getElementById('center').value = '<?php echo $center; ?>';document.getElementById('direc').value = '<?php echo $direc; ?>';"
         data-target="#myModal" style="font-size: 12px;">Details
  </button><a href="try.php?value=<?php echo $no; ?>" target="_blank" class="btn btn-success" style="font-size: 12px;">Print</a></td></tr>
  <?php
}
}
else
{
$result = mysqli_query($sql_con,"SELECT * FROM `create_certificate` where Branch='$values'");
while($row = mysqli_fetch_array($result))
{
  $no= $row["Sno"];
  $numb = $row["AdmissionNo"];
  $location = $row["Name"];
  $landmark = $row["FatherName"];
  $country = $row["Course"];
  $category = $row["Category"];
  $short = $row["Short"];
  $dur = $row["Duration"];
  $email = $row["Start"];
  $branch = $row["End"];
  $loca = $row["Branch"];
  $code = $row["Code"];
  $grade = $row["Grade"];
  $image = $row["Sign"];
  $center = $row["Center"];
  $direc = $row["Director"];
  ?>
   <tr class="d-flex">
   <td class="col-1"><?php echo $no;?></td> 
    <td class="col-2"><?php echo $loca;?></td>
   <td class="col-2"><?php echo $numb; ?></td>
<td class="col-2"><?php echo $location;?></td>
 <td class="col-2"><?php echo $category;?></td>
        <td class="col-2"><?php echo $country;?></td>
        <td class="col-1"><?php echo $dur;?></td>
        <td class="col-2"><?php echo $email;?></td>
        <td class="col-2"><?php echo $branch; ?></td>
        <td class="col-2"><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('landmark').value = '<?php echo $landmark; ?>';document.getElementById('category').value = '<?php echo $category; ?>';document.getElementById('country').value = '<?php echo $country; ?>';document.getElementById('short').value = '<?php echo $short; ?>';document.getElementById('duration').value = '<?php echo $dur; ?>';document.getElementById('email1').value = '<?php echo $email; ?>';document.getElementById('branch').value = '<?php echo $branch; ?>';document.getElementById('loca').value = '<?php echo $loca; ?>';document.getElementById('code').value = '<?php echo $code; ?>';document.getElementById('grade').value = '<?php echo $grade; ?>';document.getElementById('image').value = '<?php echo $image; ?>';document.getElementById('center').value = '<?php echo $center; ?>';document.getElementById('direc').value = '<?php echo $direc; ?>';"
         data-target="#myModal" style="font-size: 12px;">Details
  </button><a href="try.php?value=<?php echo $no; ?>" target="_blank" class="btn btn-success" 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">Certificate 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 has-success">
    <label for="Name">Sno </label>
    <input type="name" class="form-control" id="address_id" placeholder="Location" name="address_sno" >
  </div>
   <div class="form-group has-success">
    <label for="Name">Admission No</label>
    <input type="name" class="form-control" id="numb" placeholder="Location" name="no" >
  </div>
  <div class="form-group has-success">
    <label for="Name">Name</label>
    <input type="name" class="form-control" id="location" placeholder="Name" name="location" >
  </div>
  <div class="form-group has-warning">
    <label for="landmark">Father Name</label>
    <input type="landmark" class="form-control" id="landmark" placeholder="Father Name" name="landmark">
  </div>  
  <div class="form-group has-error">
    <label for="country">Course Name</label>
     <input type="country" class="form-control" id="country" placeholder="Course Name" name="country">
  </div> 
  <div class="form-group has-error">
    <label for="time1">Course Category</label>
    <input type="text" class="form-control" id="category" placeholder="Course Category" name="category">
  </div>
  <div class="form-group has-error">
    <label for="time1">Course Short Name</label>
   <textarea class="form-control" rows="2" cols="3" name="short" id="short"></textarea>
  </div>
  <div class="form-group has-error">
    <label for="time1">Duration</label>
    <input type="text" class="form-control" id="duration" placeholder="Duration" name="duration">
  </div>
   <div class="form-group has-error">
    <label for="country">Starting Date</label>
     <input type="date" class="form-control" id="email1" placeholder="Statrting Date" name="email">
  </div> 
   <div class="form-group has-error">
    <label for="country">Ending date</label>
     <input type="date" class="form-control" id="branch" placeholder="Ending date" name="branch">
  </div>
  <div class="form-group has-error">
    <label for="time1">Branch Location</label>
    <input type="text" class="form-control" id="loca" placeholder="Branch Location" name="loca">
  </div>
  <div class="form-group has-error">
    <label for="time1">Branch Code</label>
    <input type="text" class="form-control" id="code" placeholder="Branch Code" name="code">
  </div>
  <div class="form-group has-error">
    <label for="country">Grade</label>
     <input type="text" class="form-control" id="grade" placeholder="Grade" name="grade">
  </div>
  <div class="form-group has-error">
    <label for="country">Trainer Image</label>
     <input type="file" class="form-control" id="image" placeholder="Fees Pay" name="img">
  </div> 
   <div class="form-group has-error">
    <label for="country">Center Incharge Image</label>
     <input type="file" class="form-control" id="center" placeholder="Fees Pay" name="center">
  </div>
  <div class="form-group has-error">
    <label for="country">Director Image</label>
     <input type="file" class="form-control" id="direc" placeholder="Fees Pay" name="director">
  </div>

  <button type="submit" class="btn btn-info" name="update">Update Information</button>
  <button type="submit" class="btn btn-info" name="delete">Delete Information</button>
  
  
</form>
<br><br/>
</div>
        </div>
        
        <!-- Modal footer -->
        <div class="modal-footer">
          <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
        </div>
        
      </div>
    </div>
  </div>
  
</div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                    <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>
    
    <!-- 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 -->
    <!-- Select2 -->
    <script src="assets/js/lib/select2/select2.full.min.js"></script>
    <script src="assets/js/lib/form-validation/jquery.validate.min.js"></script>
    <script src="assets/js/lib/form-validation/jquery.validate-init.js"></script>
    <script src="assets/js/lib/bootstrap.min.js"></script><script src="assets/js/scripts.js"></script>
    <!-- scripit init-->

   <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>