| Server IP : 13.126.101.145 / Your IP : 216.73.217.50 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_create() {
$name = $_POST["name"] ?? '';
//insert
if (isset($_POST['insert'])) {
global $wpdb;
$table_name = "wp_equipments";
$wpdb->insert(
$table_name, //table
array('name' => $name), //data
array('%s', '%s') //data format
);
$message="Equipments Created Successfully";
header('Location: admin.php?page=equipments_list&msg=succ');
}
?>
<div class="wrap">
<h2>Add New Equipments</h2>
<?php if (isset($message)): ?><div class="updated"><p><?php echo $message; ?></p></div><?php endif; ?>
<a href="<?php echo admin_url('admin.php?page=equipments_list') ?>">« Back to equipments list</a>
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<p>Equipment Create Page</p>
<p class="form-row form-row-last validate-required" id="billing_last_name_field" data-priority="20">
<label for="billing_last_name" class="">Equipment Name</label>
<span class="woocommerce-input-wrapper">
<input type="text" class="input-text " name="name" id="name" value="<?php echo $name;?>" required>
</span>
</p>
<input type='submit' name="insert" value='Save' class='button'>
</form>
</div>
<?php
}