<?php 


$userId = $_GET['id'];


$re_users =  $obj->details_by_cond("_createuser", "UserId='$userId'" );

$reAccess = $obj->details_by_cond("_useraccess", "UserId='$userId'");


    $_SESSION["login"] = true;
    $_SESSION['userid'] = $re_users['UserId'];
    $_SESSION['username'] = $re_users['UserName'];
    $_SESSION['usertype'] = 'SA';
    $_SESSION['userfullname'] = $re_users['FullName'];
    $_SESSION['userimage'] = $re_users['PhotoPath'];
    $_SESSION['admin_userid'] = null;


    $obj->resellerHistoryLog([
        're_id'        => $userId,
        'header'       => 'Login Reseller to Admin',
        'descriptions' => 'Reseller To Admin Back',
        'type'         => 'login',
    ]);



    header('Location: ?page=dashboard');
    
    
        