10-12-2018, 06:45 AM
(This post was last modified: 10-12-2018, 06:47 AM by usamusa.
Edit Reason: comment dnd()
)
I think a working example for you would be the following:
Form input (yes after the delete label):
and the form processing php:
I hope you find this helpful
Form input (yes after the delete label):
Code:
<label>Clone this user?
<input type='checkbox' name='clone[userId]' id='clone[<?php echo "$userId"; ?>]'
value='<?php echo $userId; ?>' <?php if (!checkMenu(2,$user->data()->id) || $userId == 1){ ?>disabled<?php } ?>>
</label>
and the form processing php:
Code:
if(!empty($_POST['delete'])){
$deletions = $_POST['delete'];
if ($deletion_count = deleteUsers($deletions)){
logger($user->data()->id,"User Manager","Deleted user named $userdetails->fname.");
Redirect::to($us_url_root.'users/admin_users.php?msg='.lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count)));
}
else {
$errors[] = lang("SQL_ERROR");
}
}
// here is the clone input
elseif(!empty($_POST['clone'])){
$userID = $_POST['clone']['userId'];
$db->insert("members", ["memberid"=>$userID]);
//dnd($_POST['clone']);
}
// end of clone input
else
{
if(!empty($_POST['cloak'])){......
I hope you find this helpful