File manager - Edit - /home/autoph/public_html/connectv1/app/employee/activate_account.php
Back
<?php include_once("../../cfg/db.php"); $return_arr["status"]=0; $return_arr["message"]=" No Action."; if(isset($_POST['input_code'],$_POST['account_key'])){ $post_accountkey = $db -> escape(trim($_POST['account_key'])); $post_inputcode = $db -> escape(trim($_POST['input_code'])); $account_information = $db -> sql_query("SELECT ea.`employee_id`, ea.`account_key`, ea.`account_code`,ea.date_start,ea.date_expire , ec.contact_number, ea.status FROM `employee_account_key` ea INNER JOIN employee_contact ec ON ea.employee_id=ec.employee_id WHERE ea.account_key = '$post_accountkey' AND status = 1"); $account_information_count = $account_information -> num_rows; while($row = $account_information->fetch_assoc()) { $employee_id = $row['employee_id']; $account_key = $row['account_key']; $account_code = $row['account_code']; $contact_number = $row['contact_number']; $date_start = $row['date_start']; $date_expire = $row['date_expire']; } if($post_inputcode != $account_code ){ $return_arr["status"]=0; $return_arr["message"]=" Invalid activation code."; echo json_encode($return_arr); return; } $db -> sql_query("UPDATE `employee_account` SET `status`= 1 WHERE `employee_id` = '$employee_id'"); $db -> sql_query("UPDATE `employee_account_key` SET `status`= 0 WHERE `employee_id` = '$employee_id' AND `account_key` = '$post_accountkey'"); $return_arr["status"]=1; $return_arr["message"]=" Account successfully activated, you can login now!"; }else{ $return_arr["status"]=0; $return_arr["message"]=" Invalid Request. Please try again."; } echo json_encode($return_arr); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings