<?php
$values = $_GET['branch'];
  include 'connection.php';
  
 //event
if(isset($_POST['update6']))
{
  $id = isset($_POST['event_sno'])?$_POST['event_sno']:null;
  $title = isset($_POST['title1'])?$_POST['title1']:null;
    $date = isset($_POST['date1'])?$_POST['date1']:null;
    $author =  isset($_POST['author1'])?$_POST['author1']:null;
    $short = isset($_POST['short1'])?$_POST['short1']:null;
    $long_1 = isset($_POST['long_1'])?$_POST['long_1']:null;
    $long_2 = isset($_POST['long_2'])?$_POST['long_2']:null;
    $long_3 = isset($_POST['long_3'])?$_POST['long_3']:null; 
    $short_img = $_FILES['short_img']['name']; 
      $tempimgname1= $_FILES['short_img']['tmp_name'];
    $long_img = $_FILES['long_img']['name']; 
      $tempimgname2= $_FILES['long_img']['tmp_name'];
    move_uploaded_file($tempimgname1,"images/$short_img");
    move_uploaded_file($tempimgname2,"images/$long_img");
  $result = mysqli_query($sql_con, "UPDATE `event` SET `title`='$title', `date`='$date',`authorperson`='$author',`shortdescription`='$short',`longdescriptionparagraph1`='$long_1',`longdescriptionparagraph2`='$long_2',`longdescriptionparagraph3`='$long_3',`shortimage`='$short_img',`longimage`='$long_img' WHERE Sno='$id'");
}
if(isset($_POST['delete6']))
{
  $id = isset($_POST['event_sno'])?$_POST['event_sno']:null;
$result1 = mysqli_query($sql_con,"DELETE FROM `event` WHERE Sno='$id'");

}
  
?>


<!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">
</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>
                            </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-8 p-r-0 title-margin-right">
                        <div class="page-header">
                            <div class="page-title">
                                <h1>Address Information</h1>
                            </div>
                        </div>
                    </div>
                    
                </div>
                <!-- /# row -->
                <section id="main-content">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="card">
                                <div class="card-body">
                                    <div class="table-responsive">
<table class="table table-bordered">
    <thead>
      <tr>
        <th>Sno</th>
        <th>Title</th>
        <th>Date</th>
        <th>Author Person</th>
        <th>Short Description paragraph</th>
        <th>Long Description paragraph 1</th>
        <th>Long Description paragraph 2</th>
        <th>Long Description paragraph 3</th>
        <th>Select short image :</th>
        <th>Select Long image : </th>
      </tr>
    </thead>
    <tbody>
     
        <?php
$result = mysqli_query($sql_con,"SELECT * FROM `event`");
while($row = mysqli_fetch_array($result))
{
  $id = $row["Sno"];
  $ti = $row["title"];
  $da = $row["date"];
  $auth = $row["authorperson"];
  $sd = $row["shortdescription"];
  $long = $row["longdescriptionparagraph1"];
  $long2 = $row["longdescriptionparagraph2"];
  $long3 = $row["longdescriptionparagraph3"];
  $sm = $row["shortimage"];
  $lm = $row["longimage"];
  
  ?>
   <tr>
    <td><?php echo $id;?></td>
<td><?php echo $ti;?></td>
        <td><?php echo $da;?></td>
        <td><?php echo $auth;?></td>
        <td><?php echo $sd;?></td>
        <td><?php echo $long;?></td>
        <td><?php echo $long2;?></td>
        <td><?php echo $long3;?></td>
        <td><?php echo $sm;?></td>
        <td><?php echo $lm;?></td>
    <td><button type="button" class="btn btn-primary" data-toggle="modal" onclick="document.getElementById('event_id').value = '<?php echo $id; ?>';document.getElementById('tit').value = '<?php echo $ti; ?>';document.getElementById('da').value = '<?php echo $da; ?>';document.getElementById('auth').value = '<?php echo $auth; ?>';document.getElementById('sd').value = '<?php echo $sd; ?>';document.getElementById('lm').value = '<?php echo $long; ?>';document.getElementById('lm2').value = '<?php echo $long2; ?>';document.getElementById('lm3').value = '<?php echo $long3; ?>';
    document.getElementById('sm').value = '<?php echo $sm; ?>';document.getElementById('lme').value = '<?php echo $lm; ?>';" data-target="#myModal5">Details
  </button></td></tr>
  <?php
}
       ?>
        
      
      
    </tbody>
  </table>
  <div class="container">
  

  <!-- The Modal -->
  <div class="modal fade" id="myModal5">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
      
        <!-- Modal Header -->
        <div class="modal-header">
          <h4 class="modal-title">Event 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="event_id" placeholder="Location" name="event_sno" >
  </div>
  <div class="form-group has-warning">
    <label for="day1"> Title</label>
    <input type="text" class="form-control" id="tit" placeholder="Title" name="title1">
  </div> 
  <div class="form-group has-warning">
    <label for="Date"> Date</label>
    <input type="text" class="form-control" id="da" placeholder="Date" name="date1">
  </div>  
  <div class="form-group has-warning">
    <label for="day1"> Author Person</label>
    <input type="text" class="form-control" id="auth" placeholder="Author Person" name="author1">
  </div> 
  <div class="form-group has-error">
    <label for="time1">Short Description paragraph </label>
    <textarea class="form-control" rows="2" name="short1" id="sd"></textarea>
  </div>
  <div class="form-group has-error">
    <label for="time1">Long Description paragraph 1</label>
    <textarea class="form-control" rows="5" name="long_1" id="lm"></textarea>
  </div>
  <div class="form-group has-error">
    <label for="time1">Long Description paragraph 2</label>
    <textarea class="form-control" rows="5" name="long_2" id="lm2"></textarea>
  </div>
  <div class="form-group has-error">
    <label for="time1">Long Description paragraph 3</label>
    <textarea class="form-control" rows="5" name="long_3" id="lm3"></textarea>
  </div>
   <div class="form-group">
    <label for="Inputselect">Select short image : </label>
    
    <input type="file" name="short_img"  id="sm" />
  </div> 
   <div class="form-group">
    <label for="Inputselect">Select Long image : </label>
    <input type="file"  id="lme" name="long_img" />
  </div>  

  
  <button type="submit" name="update6" class="btn btn-info">Update Information</button>
  <button type="submit" name="delete6" class="btn btn-info">Delete Information</button>
</form>

</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-->
</body>

</html>