escape(trim($_GET['account'])); $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 = '$account_key' AND status = 1"); $account_information_count = $account_information -> num_rows; // echo $account_information_count; if($account_information_count > 0){ while($row = $account_information->fetch_assoc()) { $employee_id = $row['employee_id']; $account_key = $row['account_key']; $account_code = $row['account_code']; $contact_number = "0".$row['contact_number']; $date_start = $row['date_start']; $date_expire = $row['date_expire']; if($db -> sql_query("SELECT id FROM employee_account_key T WHERE TIMESTAMPDIFF(MINUTE,T.date_expire,NOW()) < 3 AND `account_key` = '$account_key'") -> num_rows == 0){ //update and send $db -> sql_query("UPDATE employee_account_key SET `date_expire`= NOW() WHERE employee_id = '$employee_id' AND account_key = '$account_key' "); //SEND SMS $site_link = str_replace("https","http",$variable['site_link']); $url = $site_link.'app/sms/sms.php'; $data = array('number' => $contact_number,'message' => $db->select("SELECT value FROM `settings_notification` WHERE `name` = 'activation_sms_message'").' '.$account_code); // use key 'http' even if you send the request to https://... $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === FALSE) { /* Handle error */ } // var_dump($result); } } }else{ header('location:home.php'); } ?> <?php echo $variable['site_name']; ?> | Recover Password
<?php echo $variable['logo']; ?>
Resend Code

Login