template mail:suseendhiran

This commit is contained in:
suseendhiran17 2023-05-12 14:33:32 +05:30
parent 3fab83345e
commit b4b714cc5d
12 changed files with 205 additions and 22 deletions

View File

@ -70,6 +70,8 @@ $routes->match(['get','post'],'/credits_pack_add','Admin_controller::credits_pac
$routes->match(['get','post'],'/user_password_change','Admin_controller::user_password_change');
$routes->match(['get','post'],'/user_deactivate/(:any)','Admin_controller::user_deactivate/$1');
$routes->match(['get','post'],'/user_activate/(:any)','Admin_controller::user_activate/$1');
$routes->match(['get','post'],'/user_forgot_password','Admin_controller::user_forgot_password');
$routes->match(['get'],'/admin_home','Dashboard::admin_home');
$routes->match(['get'],'/member_home','Dashboard::member_home');

View File

@ -300,5 +300,34 @@ class Admin_controller extends BaseController
echo view('layout/footer');
}
public function user_forgot_password()
{
if($this->request->getmethod() == 'get')
{
$this->session->setTempdata('user',"user",3);
return view('forgot_password.php');
}
else if($this->request->getmethod() == 'post')
{
$email = $this->request->getVar('email');
$user_data = $this->UserModel->where('email', $email)->find();
if ($user_data)
{
$otp = rand(1000 , 9999);
$this->index($this->request->getVar('email') , $otp , 2 );
$data['status'] = 'success';
$data['otp'] = $otp;
echo json_encode($data);
}
else
{
$data['status'] = 'failed';
echo json_encode($data);
}
}
}
// -----------------------------------------------
}

View File

@ -19,18 +19,24 @@ class Sendmail_controller extends BaseController
$email->setTo($to);
if ($return == 2)
{
$message = $code;
$data['id'] = '2';
$data['otp'] = $code;
$message = view('verification_mail_temp',$data);
}
if($return == 3)
{
$message = "<p>username : $to </p>";
$message .= "<p>password : $code </p>";
$message .= '<p><a href="'.base_url().'admin">Login here</a></p>';
$data['id'] = '3';
$data['username'] = $to;
$data['password'] = $code;
$data['url'] = base_url()."admin";
$message = view('verification_mail_temp',$data);
}
else
{
$message = '<p>Please click the following link to verify your email address</p>';
$message .= '<p><a href="'.base_url().'verify_email/'.md5($code).'">Verify Email</a></p>';
$data['to'] = $to;
$data['code'] = $code;
$data['url'] = base_url()."/verify_email/".md5($code);
$message = view('verification_mail_temp',$data);
}
$email->setSubject('Verify your email address');
$email->setMessage($message);
@ -85,6 +91,7 @@ class Sendmail_controller extends BaseController
public function forgot_password()
{
$this->session->setTempdata('user',"member",3);
if($this->request->getmethod() == 'get')
{
return view('forgot_password.php');

View File

@ -87,7 +87,7 @@
<div class="row mt-3">
<div class="col-12 text-center">
<p> <a href="#" class="text-muted ml-1">Forgot your password?</a></p>
<p> <a href="<?= base_url()."user_forgot_password"; ?>" class="">Forgot your password?</a></p>
<!-- <p class="text-muted">Don't have an account? <a href="<?= base_url()."register"; ?>" class="text-primary font-weight-medium ml-1">Sign Up</a></p> -->
</div> <!-- end col -->
</div>
@ -102,7 +102,7 @@
<!-- end page -->
<footer class="footer footer-alt">
<script>document.write(new Date().getFullYear())</script> &copy; theme by <a href="" class="text-dark">Venba</a>
<script>document.write(new Date().getFullYear())</script> &copy; <a href="" class="text-dark"></a>
</footer>
<!-- Vendor js -->

View File

@ -46,6 +46,7 @@
</br>
<form method="post" action="<?php echo base_url();?>change_password_form" method="post">
<input type="hidden" id="verify_otp" name="verify_otp" value="">
<input type="hidden" id="user" value="<?= session()->getTempdata('user'); ?>">
<div id="alert1"></div>
@ -90,7 +91,7 @@
<!-- end page -->
<footer class="footer footer-alt">
<script>document.write(new Date().getFullYear())</script> &copy; theme by <a href="" class="text-dark">Venba</a>
<script>document.write(new Date().getFullYear())</script> &copy; <a href="" class="text-dark"></a>
</footer>
<!-- Vendor js -->
@ -109,16 +110,22 @@ $('#alert').delay(3000).fadeOut('slow');
$(".disable").hide();
$(document).on('click','#submit1',function(){
$('#alert1').html('Please wait...');
var email = $("#email").val();
var url;
var user_role = $('#user').val();
if ($('#user').val() == 'member') { url = "<?php echo base_url();?>forgot_password" }
else { url = "<?php echo base_url();?>user_forgot_password" }
$.ajax({
type: "post",
url: "<?php echo base_url();?>forgot_password",
url: url,
data: { email : email },
json: true,
success: function(response) {
response = jQuery.parseJSON(response);
if (response.status == "success")
{
$('#alert1').html('');
$(".disable").show();
$('#verify_otp').val(response.otp);
$("#re-sub").html('<button class="btn btn-primary btn-block" type="submit"> Submit </button>');
@ -126,8 +133,17 @@ $(document).on('click','#submit1',function(){
}
else
{
console.log(user_role);
$('#alert1').html('');
$('#alert1').addClass('alert alert-danger');
$('#alert1').html('Email is not verified.please check your mail.')
if (user_role == 'member')
{
$('#alert1').html('Email is not verified.please check your mail.');
}
else
{
$('#alert1').html('Invalid email.');
}
}

View File

@ -288,10 +288,10 @@ $(document).ready(function(){
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
<?php if (!$userdata) { ?>
<img src='<?php echo base_url()."/public/assets/images/users/avatar-1.jpg" ?>' class="rounded-circle avatar-xl img-thumbnail" alt="profile-image">
<img src='<?php echo base_url()."/public/assets/images/users/avatar-1.jpg" ?>' class="rounded-circle" alt="profile-image">
<?php }
else { ?>
<img src='<?php echo base_url()."/public/assets/images/users/"?><?= $userdata->profile; ?>' class="rounded-circle avatar-xl img-thumbnail" alt="profile-image">
<img src='<?php echo base_url()."/public/assets/images/users/"?><?= $userdata->profile; ?>' class="rounded-circle" alt="profile-image">
<?php } ?>
<!-- <img src="<?= base_url()."/public"; ?>/assets/images/users/avatar-1.jpg" alt="user-image" class="rounded-circle"> -->
<span class="pro-user-name ml-1">

View File

@ -49,7 +49,7 @@
<div class="form-group row">
<label for="inputEmail3" class="col-4 col-form-label">Mobile<span class="text-danger">*</span></label>
<div class="col-7">
<input type="text" required class="form-control" name="mobile" value="<?php if(isset($Memberdata)){echo $Memberdata[0]['mobile'];} ?>" placeholder="Mobile Nomber">
<input type="text" required class="form-control" name="mobile" value="<?php if(isset($Memberdata)){echo $Memberdata[0]['mobile'];} ?>" placeholder="Mobile Number">
</div>
</div>

View File

@ -106,7 +106,7 @@
<!-- end page -->
<footer class="footer footer-alt">
<script>document.write(new Date().getFullYear())</script> &copy; theme by <a href="" class="text-dark">Venba</a>
<script>document.write(new Date().getFullYear())</script> &copy; <a href="" class="text-dark"></a>
</footer>
<!-- Vendor js -->

View File

@ -80,7 +80,7 @@ body {
<div class="profilepic">
<!-- <img style="width: 100%;height: 100%; display: block;" src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="Avatar" title="Change the avatar"> -->
<img src='<?php echo base_url()."/public/assets/images/users/avatar-1.jpg" ?>' class="rounded-circle avatar-xl img-thumbnail" alt="profile-image">
<input id="file_profile" name="profile" class="typeFile1" type="file" hidden/>
<input id="file_profile" name="profile" class="typeFile1" onchange="onFileInputChange()" type="file" hidden/>
<div class="profilepic__content">
<span class="profilepic__icon"><i class="fa fa-camera" style="font-size:25px;color:black"></i></span>
<span class="profilepic__text"><b>Edit Profile</b></span>
@ -91,7 +91,7 @@ body {
<div class="profilepic">
<!-- <img style="width: 100%;height: 100%; display: block;" src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="Avatar" title="Change the avatar"> -->
<img src='<?php echo base_url()."/public/assets/images/users/"?><?php echo $userList[0]['profile'] ?>' class="rounded-circle avatar-xl img-thumbnail" alt="profile-image">
<input id="file_profile" name="profile" class="typeFile1" type="file" hidden/>
<input id="file_profile" name="profile" class="typeFile1" onchange="onFileInputChange()" type="file" hidden/>
<div class="profilepic__content">
<span class="profilepic__icon"><i class="fa fa-camera" style="font-size:25px;color:black"></i></span>
<span class="profilepic__text"><b>Edit Profile</b></span>
@ -131,13 +131,10 @@ body {
</div> <!-- end col-->
</div>
<script>
// The handler is executed at most once per element per event type => one()
$(".profilepic").one('click',function() {
$("#file_profile").trigger("click");
});
// change login person profile pic => file name : user/profile.php
$("#file_profile").change(function(){
$(".btn-success").click();
});

View File

@ -64,7 +64,7 @@
<div class="form-group row">
<label for="inputEmail3" class="col-4 col-form-label">Mobile<span class="text-danger">*</span></label>
<div class="col-7">
<input type="text" required class="form-control" name="mobile" value="<?php if(isset($userList)){echo $userList[0]['mobile'];} ?>" placeholder="Mobile Nomber">
<input type="text" required class="form-control" name="mobile" value="<?php if(isset($userList)){echo $userList[0]['mobile'];} ?>" placeholder="Mobile Number">
</div>
</div>

View File

@ -35,7 +35,8 @@
<div class="form-group row">
<label for="hori-pass1" class="col-4 col-form-label">Password<span class="text-danger">*</span></label>
<div class="col-7">
<input id="hori-pass1" type="password" placeholder="Password" required
<input id="hori-pass1" type="password" placeholder="Password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,}"
title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" required
class="form-control" name="password">
</div>
</div>

View File

@ -0,0 +1,131 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<head>
<meta name="viewport" content="width=device-width"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Minton - Responsive Bootstrap 4 Admin Dashboard</title>
</head>
<body style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;"
bgcolor="#f6f6f6">
<table class="body-wrap"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;"
bgcolor="#f6f6f6">
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;"
valign="top"></td>
<td class="container" width="600"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;"
valign="top">
<div class="content"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
<table class="main" width="100%" cellpadding="0" cellspacing="0" itemprop="action" itemscope
itemtype="http://schema.org/ConfirmAction"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; margin: 0; border: none;"
>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-wrap"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;padding: 30px;border: 3px solid #3bafda;border-radius: 7px; background-color: #fff;"
valign="top">
<meta itemprop="name" content="Confirm Email"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"/>
<table width="100%" cellpadding="0" cellspacing="0"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<tr>
<td style="text-align: center">
<a href="#" style="display: block;margin-bottom: 10px;">
<img [src]="<?php echo base_url()."public/assets/images/company-logo/GolfEvolution_White.png" ?>" height="24" alt="logo"/></a> <br/>
<!-- <img src="<?= base_url()."/public/assets/images/company-logo/GolfEvolution_White.png"; ?> alt="" height="40"> -->
</td>
</tr>
<?php if ($id == 2) { ?>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
valign="top">
Please use the verification code below on the Golf Evolution Website.<br>If you didn't request this, you can ignore this email or let us know.<br>OTP : <b><?= $otp ?></b>
</td>
</tr>
<?php }
else if ($id == 3) { ?>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
valign="top">
Please login by clicking the link below.
</td>
</tr>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
valign="top">
Username : <?php echo $username ?><br>Password : <?php echo $password ?>
</td>
</tr>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block" itemprop="handler" itemscope
itemtype="http://schema.org/HttpActionHandler"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
valign="top">
<a href="<?php echo $url ?>" class="btn-primary" itemprop="url"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #f1556c; margin: 0; border-color: #f1556c; border-style: solid; border-width: 8px 16px;">
Login</a>
</td>
</tr>
<?php }
else
{ ?>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
valign="top">
Please confirm your email address by clicking the link below.
</td>
</tr>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
valign="top">
We may need to send you critical information about our service and it is
important that we have an accurate email address.
</td>
</tr>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block" itemprop="handler" itemscope
itemtype="http://schema.org/HttpActionHandler"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
valign="top">
<a href="<?php echo $url ?>" class="btn-primary" itemprop="url"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #f1556c; margin: 0; border-color: #f1556c; border-style: solid; border-width: 8px 16px;">
Verify Email</a>
</td>
</tr> <?php
} ?>
</table>
</td>
</tr>
</table>
<div class="footer"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
<table width="100%"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="aligncenter content-block"
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;" align="center" valign="top"><a href="#"
</td>
</tr>
</table>
</div>
</div>
</td>
<td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;"
valign="top"></td>
</tr>
</table>
</body>
</html>