| Server IP : 13.126.101.145 / Your IP : 216.73.216.63 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-11-115-0-196 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.3.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/rentals_updated/wp-content/plugins/equipments/ |
Upload File : |
<?php
function equipments_list() {
?>
<div class="wrap">
<h2>Equipments</h2>
<div class="tablenav top">
<div class="alignleft actions">
<a class="button-secondary checkforspam enable-on-load" href="<?php echo admin_url('admin.php?page=equipments_create'); ?>">Add New</a>
</div>
<br class="clear">
</div>
<?php
global $wpdb;
$table_name = "wp_equipments";
$rows = $wpdb->get_results("SELECT id,name from $table_name");
if(isset($_GET['msg']) == 'succ'){
echo '<div class="notice notice-success"><p>Equipment Created Successfully</p></div>';
}else if(isset($_GET['editmsg']) == 'succ'){
echo '<div class="notice notice-warning"><p>Equipment Updated Successfully</p></div>';
}else if(isset($_GET['deletemsg']) == 'succ'){
echo '<div class="notice notice-danger"><p>Equipment Deleted Successfully</p></div>';
}
?>
<table class='wp-list-table widefat fixed striped table-view-list comments'>
<tr>
<th class="manage-column ss-list-width">ID</th>
<th class="manage-column ss-list-width">Name</th>
<th class="manage-column ss-list-width">Actions</th>
</tr>
<?php foreach ($rows as $row) { ?>
<tr>
<td class="manage-column ss-list-width"><?php echo $row->id; ?></td>
<td class="manage-column ss-list-width"><?php echo $row->name; ?></td>
<td><a href="<?php echo admin_url('admin.php?page=equipments_update&id=' . $row->id); ?>">Update</a> | <a href="<?php echo admin_url('admin.php?page=equipments_delete&id=' . $row->id); ?>" onclick="return confirm('Are you sure you want to delete this equipment')">Delete</a></td>
</tr>
<?php } ?>
</table>
</div>
<?php
}
function hide_screen_options_for_equipement_list() {
?>
<style>
<?php if (isset($_GET['page']) && ($_GET['page'] === 'equipments_list' || $_GET['page'] === 'equipments_create')) : ?>
#screen-meta-links {
display: none !important;
}
<?php endif; ?>
</style>
<?php
}
add_action('admin_head', 'hide_screen_options_for_equipement_list');