Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.145.79.214
<?php
include ("../database.php");
require_once('../../sms/sendsmsapiv1.php');
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$mobile = trim($_POST['mobile']);
$femail = trim($_POST['email']);
$query = "SELECT fname, ifnull(femail,'') as femail
from collstud where fmobileno = '{$mobile}' and factive = 'T'";
$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);
if($count == 0)
{
//date_default_timezone_set('Asia/Kolkata');
//$time = date("h:i A");
//$motpaswrd = rand(1000, 9000); //strtoupper(substr(sha1(rand()), 0, 4));
//$smsotp = "Dear Student, Your mobile OTP for Registration is {$motpaswrd} sent at {$time}";
$db = $_REQUEST['db'];
$FFOLDER = "";
if($db == 'bcu')
$FFOLDER = "BCU";
else if($db == 'vskub')
$FFOLDER = "VSKUB";
else if($db == 'rcub')
$FFOLDER = "RCUB";
else if($db == 'ru')
$FFOLDER = "RUR";
else if($db == 'acu')
$FFOLDER = "ACU";
date_default_timezone_set('Asia/Kolkata');
$time = date("h:i A");
$otp = rand(1000, 9000);
$smsotp = "From $FFOLDER: Dear Student, OTP for Registration is $otp. sent at {$time} - Uniclare";
// $username = 'logisyhttp';
// $password = 'logisy@928';
// $from = 'UNISOL';
// $to = $mobile;
// $text = $smsotp;
// $category = '';
// $smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);
$sms = new SMS('026', 'OTP');
$sms->sendIndvidualSms($mobile, $smsotp, '900', 'PHD','','');
//var_dump($smsresp);
$smsresp = 'Sent';
$row["sms"] = $smsresp;
/*$query = "update collstud set fmobileotp = '{$motpaswrd}', fmobotptime = now(),
fotpcounter = fotpcounter+1
where fmobileno = '{$mobile}'";*/
$query = "insert into collstud(fmobileno, fmobileotp, fmobotptime, fotpcounter, fcollcode, fdegree)
values( '{$mobile}', '{$otp}', now(), 1, 'PHD', 'PHD')
on duplicate key update
fmobileotp = '{$otp}',
fmobotptime = now(),
fotpcounter = fotpcounter+1";
$result = mysqli_query($conn,$query);
if($result)
$row["status"] = 'success';
echo json_encode($row);
}
else
{
$row["status"] = 'invalid';
$row["msg"] = 'You have already registered, Please Login';
echo json_encode($row);
}
?>
|