EVOLUTION-NINJA
Edit File: view_institution.php
<?php echo view('includes/admin_header.php')?> <!-- Include jQuery --> <!-- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> --> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <div class="col-sm-12 col-md-offset-1 col-md-10 col-lg-offset-1 col-lg-10"> <section class="content-header"> <br> <a href="javascript:history.back()" class="btn btn-primary" style="float: right;">Back</a> </section> <br> <br> <!-- Main content --> <section class="content enrolled_details" style="margin-left: 20%; width:100%;"> <!-- Display the submitted data here in a table --> <div class="row" style="margin:0 !important;"> <div class="col-sm-6"> <!-- <h2>Institution Details <a href="<?php echo base_url('edit'); ?>?institution_id=<?php echo urlencode($_GET['id']); ?>&institution_name=<?php echo urlencode($_GET['institution_name']); ?>&address=<?php echo urlencode($_GET['address']); ?>&email=<?php echo urlencode($_GET['email']); ?>&phone=<?php echo urlencode($_GET['phone']); ?>&contact_person_details=<?php echo urlencode($_GET['contact_person_details']); ?>"> <button type="submit" class="btn btn-primary editb">Edit</button></h2> </a> --> <div class="inline-container"> <h3>Institution Details</h3> <a href="<?php echo base_url('edit'); ?>?institution_id=<?php echo urlencode($_GET['id']); ?>&institution_name=<?php echo urlencode($_GET['institution_name']); ?>&address=<?php echo urlencode($_GET['address']); ?>&email=<?php echo urlencode($_GET['email']); ?>&phone=<?php echo urlencode($_GET['phone']); ?>&contact_person_details=<?php echo urlencode($_GET['contact_person_details']); ?>"> <button type="submit" class="btn btn-primary editb">Edit</button> </a> </div> <table class="table tab-data"> <input type="hidden" name="institution_id" value="<?php echo isset($_GET['institution_id']) ? htmlspecialchars($_GET['institution_id']) : ''; ?>"> <tr> <th>Institution Name :</th> <td ><?php echo isset($_GET['institution_name']) ? htmlspecialchars($_GET['institution_name']) : ''; ?></td> </tr> <!-- <tr> <th>Institution Name :</th> <td><?php //echo isset($_GET['institution_id']) ? htmlspecialchars($_GET['institution_id']) : ''; ?></td> </tr> --> <tr> <th>Address :</th> <td ><?php echo isset($_GET['address']) ? htmlspecialchars($_GET['address']) : ''; ?></td> </tr> <tr> <th>Email :</th> <td ><?php echo isset($_GET['email']) ? htmlspecialchars($_GET['email']) : ''; ?></td> </tr> <tr> <th>Phone :</th> <td ><?php echo isset($_GET['phone']) ? htmlspecialchars($_GET['phone']) : ''; ?></td> </tr> <tr> <th>Contact Person Details :</th> <td ><?php echo isset($_GET['contact_person_details']) ? htmlspecialchars($_GET['contact_person_details']) : ''; ?></td> </tr> </table> </div> </div> </section> <!-- /.content --> </div> </div> <!-- JavaScript for the Edit button --> <script> $(document).ready(function() { $('.editb').click(function(e) { console.log("clicke") e.preventDefault(); // Prevent the default link behavior // Get the institution name from the data attribute of the button var institutionName = $(this).data('institution-name'); // Send an AJAX request to the controller to open "view_institution" $.ajax({ type: 'GET', url: "<?php echo base_url('edit');?>"; // Replace with the actual URL of your controller data: { action: 'editInstitution', institution_name: institutionName }, success: function(response) { // Handle the response, which should be the "view_institution" page // You can load it into a specific div or replace the entire page. // For example, to load it into a specific div with id "content": $('#content').html(response); } }); }); }); </script> <?php echo view('includes/admin_footer.php')?> <style> .editb { margin-top: 4px; margin-left: 400px; } .table,th,tr,td{ border: 1px solid black; } .tab-data td,th{ border: 1px solid black !important; } .inline-container { display: flex; align-items: center; } .inline-container h2 { margin-right: 10px; /* Adjust the margin as needed */ } .content-wrapper{ background-image: url('public/assets/website_assets/images/banner.png'); } </style>