alert move to tpl
This commit is contained in:
parent
4f975fbf0d
commit
baca2d706f
@ -59,11 +59,8 @@ switch ($do) {
|
|||||||
$ui->assign('address', $address);
|
$ui->assign('address', $address);
|
||||||
$ui->assign('email', $email);
|
$ui->assign('email', $email);
|
||||||
$ui->assign('phonenumber', $phonenumber);
|
$ui->assign('phonenumber', $phonenumber);
|
||||||
$ui->assign('notify', '<div class="alert alert-success">
|
$ui->assign('notify', 'Wrong Verification code');
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
$ui->assign('notify_t', 'd');
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<div>Verification code is Wrong</div></div>');
|
|
||||||
$ui->display('register-otp.tpl');
|
$ui->display('register-otp.tpl');
|
||||||
exit();
|
exit();
|
||||||
}else{
|
}else{
|
||||||
@ -95,11 +92,8 @@ switch ($do) {
|
|||||||
$ui->assign('address', $address);
|
$ui->assign('address', $address);
|
||||||
$ui->assign('email', $email);
|
$ui->assign('email', $email);
|
||||||
$ui->assign('phonenumber', $phonenumber);
|
$ui->assign('phonenumber', $phonenumber);
|
||||||
$ui->assign('notify', '<div class="alert alert-danger">
|
$ui->assign('notify', 'Failed to register');
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
$ui->assign('notify_t', 'd');
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<div>Failed to register</div></div>');
|
|
||||||
run_hook('view_otp_register'); #HOOK
|
run_hook('view_otp_register'); #HOOK
|
||||||
$ui->display('register-rotp.tpl');
|
$ui->display('register-rotp.tpl');
|
||||||
}
|
}
|
||||||
@ -109,11 +103,8 @@ switch ($do) {
|
|||||||
$ui->assign('address', $address);
|
$ui->assign('address', $address);
|
||||||
$ui->assign('email', $email);
|
$ui->assign('email', $email);
|
||||||
$ui->assign('phonenumber', $phonenumber);
|
$ui->assign('phonenumber', $phonenumber);
|
||||||
$ui->assign('notify', '<div class="alert alert-danger">
|
$ui->assign('notify', $msg);
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
$ui->assign('notify_t', 'd');
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<div>' . $msg . '</div></div>');
|
|
||||||
$ui->display('register.tpl');
|
$ui->display('register.tpl');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -134,22 +125,16 @@ switch ($do) {
|
|||||||
//expired 10 minutes
|
//expired 10 minutes
|
||||||
if(file_exists($otpPath) && time()-filemtime($otpPath)<1200){
|
if(file_exists($otpPath) && time()-filemtime($otpPath)<1200){
|
||||||
$ui->assign('username', $username);
|
$ui->assign('username', $username);
|
||||||
$ui->assign('notify', '<div class="alert alert-success">
|
$ui->assign('notify', 'Please wait '.(1200-(time()-filemtime($otpPath))).' seconds before sending another SMS');
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
$ui->assign('notify_t', 'd');
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<div>Please wait '.(1200-(time()-filemtime($otpPath))).' seconds before sending another SMS</div></div>');
|
|
||||||
$ui->display('register-otp.tpl');
|
$ui->display('register-otp.tpl');
|
||||||
}else{
|
}else{
|
||||||
$otp = rand(100000,999999);
|
$otp = rand(100000,999999);
|
||||||
file_put_contents($otpPath, $otp);
|
file_put_contents($otpPath, $otp);
|
||||||
Message::sendSMS($username,$config['CompanyName']."\nYour Verification code are: $otp");
|
Message::sendSMS($username,$config['CompanyName']."\nYour Verification code are: $otp");
|
||||||
$ui->assign('username', $username);
|
$ui->assign('username', $username);
|
||||||
$ui->assign('notify', '<div class="alert alert-success">
|
$ui->assign('notify', 'Verification code has been sent to your phone');
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
$ui->assign('notify_t', 's');
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<div>Verification code has been sent to your phone</div></div>');
|
|
||||||
$ui->display('register-otp.tpl');
|
$ui->display('register-otp.tpl');
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
@ -22,10 +22,11 @@
|
|||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
{if isset($notify)}
|
{if isset($notify)}
|
||||||
<div class="row">
|
<div class="alert alert-{if $notify_t == 's'}success{else}danger{/if}">
|
||||||
<div class="col-md-6 col-md-offset-3">
|
<button type="button" class="close" data-dismiss="alert">
|
||||||
{$notify}
|
<span aria-hidden="true">×</span>
|
||||||
</div>
|
</button>
|
||||||
|
<div>{$notify}</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -34,10 +34,11 @@
|
|||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
{if isset($notify)}
|
{if isset($notify)}
|
||||||
<div class="row">
|
<div class="alert alert-{if $notify_t == 's'}success{else}danger{/if}">
|
||||||
<div class="col-md-6 col-md-offset-3">
|
<button type="button" class="close" data-dismiss="alert">
|
||||||
{$notify}
|
<span aria-hidden="true">×</span>
|
||||||
</div>
|
</button>
|
||||||
|
<div>{$notify}</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -22,10 +22,11 @@
|
|||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
{if isset($notify)}
|
{if isset($notify)}
|
||||||
<div class="row">
|
<div class="alert alert-{if $notify_t == 's'}success{else}danger{/if}">
|
||||||
<div class="col-md-6 col-md-offset-3">
|
<button type="button" class="close" data-dismiss="alert">
|
||||||
{$notify}
|
<span aria-hidden="true">×</span>
|
||||||
</div>
|
</button>
|
||||||
|
<div>{$notify}</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -21,10 +21,11 @@
|
|||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
{if isset($notify)}
|
{if isset($notify)}
|
||||||
<div class="row">
|
<div class="alert alert-{if $notify_t == 's'}success{else}danger{/if}">
|
||||||
<div class="col-sm-6 col-sm-offset-3">
|
<button type="button" class="close" data-dismiss="alert">
|
||||||
{$notify}
|
<span aria-hidden="true">×</span>
|
||||||
</div>
|
</button>
|
||||||
|
<div>{$notify}</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user