EVOLUTION-NINJA
Edit File: institution_view_1.php
<?php echo view('includes/admin_header.php');?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Institution Details</title> <style> table { border-collapse: collapse; width: 60%; } table, th, td { border: 1px solid black; } th, td { padding: 10px; text-align: left; } th { background-color: #f2f2f2; } </style> </head> <body> <section> <h2>Institution Details</h2> <a href="javascript:history.back()" class="btn btn-primary" style="float: right;">Back</a> <button type="button" class="btn btn-primary" onclick="editDetails()">Edit</button> </section> </section> <table> <tr> <th>Field</th> <th>Details</th> </tr> <tr> <td>Institution Name</td> <td><?= $details['name'] ?></td> </tr> <tr> <td>Address</td> <td><?= $details['address'] ?></td> </tr> <tr> <td>Email</td> <td><?= $details['email'] ?></td> </tr> <tr> <td>Phone</td> <td><?= $details['phone'] ?></td> </tr> </table> </body> </html> <?php echo view('includes/admin_footer.php')?> <script> function editDetails() { <?php if (isset($_GET['id'])) : ?> // Redirect to the edit page with necessary parameters window.location.href = `<?php echo site_url('edit'); ?>?institution_id=<?= urlencode($_GET['id']); ?>&institution_name=<?= urlencode($details['name']); ?>&address=<?= urlencode($details['address']); ?>&email=<?= urlencode($details['email']); ?>&phone=<?= urlencode($details['phone']); ?>&contact_person_details=<?= urlencode($details['contact_person_details']); ?>`; <?php endif; ?> } </script>