setMenu('/ip hotspot user'); $iv = count($util); if ((!empty($username)) and (!empty($password)) and (!empty($profile))) { if (intval($limit_bytes) != 0) { $limit_bytes_total = (intval($limit_bytes) * 1024 * 1024 * 1024 ); $util->add( array( 'name' => "$username", 'password' => "$password", 'disabled' => "no", 'limit-uptime' => "$limit_uptime", 'limit-bytes-total' => "$limit_bytes_total", 'profile' => "$profile", 'comment' => "Zetozone", ) ); } else { $util->add( array( 'name' => "$username", 'password' => "$password", 'disabled' => "no", 'limit-uptime' => "$limit_uptime", 'profile' => "$profile", 'comment' => "Zetozone", ) ); $limit_bytes = 0; // For Adding it to Local database } if ($iv != count($util)) { include('dbconfig.php'); $stmt = $DB_con->prepare("SELECT booking_id from hotspot_vouchers ORDER BY booking_id DESC LIMIT 1"); $stmt->execute(array()); $row = $stmt->fetch(PDO::FETCH_ASSOC); $booking_id = $row['booking_id']; $booking_id++; $uid = $booking_id.'-1-'.date('dmY'); //$creator = $_SESSION['username'].'['.$_SESSION['id'].']'; $stmt = $DB_con->prepare("UPDATE hotspot_vouchers set status=:status WHERE 1"); $stmt->execute(array(':status' => 'Over')); $stmt = $DB_con->prepare("insert into hotspot_vouchers (created_on, created_by, creator, user_name, password, printed_times, printed_last, status, group_of, booking_id, limit_uptime, limit_bytes, profile, uid) values(NOW(), :created_by, :creator, :user_name, :password, :printed_times, :printed_last, :status, :group_of, :booking_id, :limit_uptime, :limit_bytes, :profile, :uid)"); $stmt->execute(array(':created_by' => $_SESSION['username'], ':creator' => $_SESSION['id'], ':user_name' => $username, ':password' => $password, ':printed_times' => 0, ':printed_last' => '', ':status' => 'Active', ':group_of' => 1, ':booking_id' => $booking_id, ':limit_uptime' => $limit_uptime, ':limit_bytes' => $limit_bytes, ':profile' => $profile, ':uid' => $uid)); // here starts Echo String $echo_text ='

Hotspot User Voucher

'; $echo_text .= ''; if (intval($limit_bytes) != 0) { $echo_text .= ''; } else { $echo_text .= ''; } $echo_text .= '
Username Password
Validity : '.$limit_uptime.'ays; Counts from First login; Data usage Maximum : '.$limit_bytes_total.' Bytes; Bandwidth : '.$profile.'; HAPPY BROWSING...Validity : '.$limit_uptime.'ays; Counts from First login; Bandwidth/Profile : '.$profile.'; HAPPY BROWSING...
        
'; echo $echo_text; } else { echo ''; } } //End Adding a Guest User ?>