The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Option to Insert record in admin_user.php
#6
I think a working example for you would be the following:

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
  Reply


Messages In This Thread
RE: Option to Insert record in admin_user.php - by usamusa - 10-12-2018, 06:45 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)