testChanges:GWM
This commit is contained in:
parent
2d4d862e5e
commit
d127bfebe1
@ -106,6 +106,11 @@ class Admin_controller extends BaseController
|
|||||||
if($userdata)
|
if($userdata)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
if($userdata['is_active'] == 0)
|
||||||
|
{
|
||||||
|
$this->session->setTempdata('error','Your account is deactivated',3);
|
||||||
|
return redirect()->to(base_url()."admin");
|
||||||
|
}
|
||||||
|
|
||||||
if (password_verify($password, $userdata['password']))
|
if (password_verify($password, $userdata['password']))
|
||||||
|
|
||||||
@ -684,7 +689,7 @@ class Admin_controller extends BaseController
|
|||||||
->join('member', 'transactions.member_id = member.id', 'left')
|
->join('member', 'transactions.member_id = member.id', 'left')
|
||||||
->orderBy('transactions.created_at' , 'desc')
|
->orderBy('transactions.created_at' , 'desc')
|
||||||
->findAll();
|
->findAll();
|
||||||
//echo '<pre>'; echo print_r($data['creditsData']); '</pre>';
|
// echo '<pre>'; echo print_r($data['creditsData']); '</pre>';
|
||||||
echo view('layout/header',$userdata);
|
echo view('layout/header',$userdata);
|
||||||
echo view('transactions_list',$data);
|
echo view('transactions_list',$data);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
@ -724,11 +729,11 @@ class Admin_controller extends BaseController
|
|||||||
->where('member_credits.order_id', $order_id )
|
->where('member_credits.order_id', $order_id )
|
||||||
->findAll();
|
->findAll();
|
||||||
// echo 'member_id ='.$member_id; echo 'order_id ='.$order_id; echo '<pre>'; echo print_r($creditsData); '</pre>'; die();
|
// echo 'member_id ='.$member_id; echo 'order_id ='.$order_id; echo '<pre>'; echo print_r($creditsData); '</pre>'; die();
|
||||||
$output = '<div class="table-responsive"><table class="table mb-0"><thead class="thead-light"><tr> <th>Order Id</th><th>Package Name</th><th>Cost</th><th>Total Amount</th><th>Credits</th></tr></thead><tbody>';
|
$output = '<div class="table-responsive"><table class="table mb-0"><thead class="thead-light"><tr> <th>Order Id</th><th>Package Name</th><th>Cost</th><th>Total Amount</th><th>Credits</th><th>Payment Status</th></tr></thead><tbody>';
|
||||||
foreach ($creditsData as $row) {
|
foreach ($creditsData as $row) {
|
||||||
|
if($row['is_active'] == 1 ){ $status = 'Success';}else{ $status = 'Failed';}
|
||||||
|
|
||||||
|
$output .='<tr><td>'.$row['order_id'].'</td><td>'.$row['package_name'].'</td><td>'.$row['cost'].'</td></td><td>'.$row['cost_with_tax'].'</td></td><td>'.$row['credit_points'].'</td><td>'.$status.'</td></tr>';
|
||||||
$output .='<tr><td>'.$row['order_id'].'</td><td>'.$row['package_name'].'</td><td>'.$row['cost'].'</td></td><td>'.$row['cost_with_tax'].'</td></td><td>'.$row['credit_points'].'</td></tr>';
|
|
||||||
}
|
}
|
||||||
echo $output .= '</tbody></table></div> ';
|
echo $output .= '</tbody></table></div> ';
|
||||||
|
|
||||||
|
|||||||
@ -97,31 +97,21 @@ class Common_controller extends BaseController
|
|||||||
{
|
{
|
||||||
|
|
||||||
if($this->request->getVar('table'))
|
if($this->request->getVar('table'))
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->request->getVar('table') == 'member')
|
if($this->request->getVar('table') == 'member')
|
||||||
|
{
|
||||||
$data = $this->MemberModel->where('email', $this->request->getVar('email'))->where('is_active', 1)->find();
|
$data = $this->MemberModel->where('email', $this->request->getVar('email'))->find();
|
||||||
|
}else if($this->request->getVar('table') == 'users'){
|
||||||
else if($this->request->getVar('table') == 'users')
|
$data = $this->UserModel->where('email', $this->request->getVar('email'))->find();
|
||||||
|
}
|
||||||
$data = $this->UserModel->where('email', $this->request->getVar('email'))->where('is_active', 1)->find();
|
|
||||||
|
|
||||||
if ($data)
|
if ($data)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
echo true;
|
echo true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
echo false;
|
echo false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -470,7 +470,7 @@ class Member_controller extends BaseController
|
|||||||
if($this->request->getmethod() == 'post')
|
if($this->request->getmethod() == 'post')
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
//insert member details
|
//insert member details
|
||||||
|
|
||||||
$MemberData = $this->request->getVar();
|
$MemberData = $this->request->getVar();
|
||||||
|
|||||||
@ -314,7 +314,7 @@ class PaymentController extends BaseController
|
|||||||
|
|
||||||
//Trancaction Table initial entry for this transaction
|
//Trancaction Table initial entry for this transaction
|
||||||
|
|
||||||
$TrancactionData['status'] = 'initialized';
|
$TrancactionData['status'] = 'In-Progress';
|
||||||
|
|
||||||
$TrancactionData['member_id'] = session()->get('logged_user');
|
$TrancactionData['member_id'] = session()->get('logged_user');
|
||||||
|
|
||||||
@ -490,7 +490,7 @@ class PaymentController extends BaseController
|
|||||||
|
|
||||||
//Trancaction Table Data
|
//Trancaction Table Data
|
||||||
|
|
||||||
$TrancactionData['status'] = 'success';
|
$TrancactionData['status'] = 'Success';
|
||||||
|
|
||||||
//$TrancactionData['member_id'] = session()->get('logged_user');
|
//$TrancactionData['member_id'] = session()->get('logged_user');
|
||||||
|
|
||||||
@ -548,7 +548,7 @@ class PaymentController extends BaseController
|
|||||||
|
|
||||||
//Trancaction Table Data
|
//Trancaction Table Data
|
||||||
|
|
||||||
$TrancactionData['status'] = 'failed';
|
$TrancactionData['status'] = 'Failed';
|
||||||
|
|
||||||
// $TrancactionData['member_id'] = session()->get('logged_user');
|
// $TrancactionData['member_id'] = session()->get('logged_user');
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class User_model extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
$builder = $this->db->table('users');
|
$builder = $this->db->table('users');
|
||||||
$builder -> select("id,mobile,email,password");
|
$builder -> select("id,mobile,email,password,is_active");
|
||||||
$builder -> where('email',$email);
|
$builder -> where('email',$email);
|
||||||
$result = $builder->get();
|
$result = $builder->get();
|
||||||
if(count($result->getResultArray()) ==1)
|
if(count($result->getResultArray()) ==1)
|
||||||
|
|||||||
@ -95,10 +95,10 @@
|
|||||||
<script src="<?= base_url()."/public"; ?>/assets/js/pages/email.init.js"></script>
|
<script src="<?= base_url()."/public"; ?>/assets/js/pages/email.init.js"></script>
|
||||||
|
|
||||||
<!-- Table Editable plugin-->
|
<!-- Table Editable plugin-->
|
||||||
<script src="<?= base_url()."/public"; ?>assets/libs/jquery-tabledit/jquery.tabledit.min.js"></script>
|
<script src="<?= base_url()."/public"; ?>/assets/libs/jquery-tabledit/jquery.tabledit.min.js"></script>
|
||||||
|
|
||||||
<!-- Table editable init-->
|
<!-- Table editable init-->
|
||||||
<script src="<?= base_url()."/public"; ?>assets/js/pages/tabledit.init.js"></script>
|
<script src="<?= base_url()."/public"; ?>/assets/js/pages/tabledit.init.js"></script>
|
||||||
<!-- plugin js -->
|
<!-- plugin js -->
|
||||||
<script src="<?= base_url()."/public"; ?>/assets/libs/moment/min/moment.min.js"></script>
|
<script src="<?= base_url()."/public"; ?>/assets/libs/moment/min/moment.min.js"></script>
|
||||||
<script src="<?= base_url()."/public"; ?>/assets/libs/@fullcalendar/core/main.min.js"></script>
|
<script src="<?= base_url()."/public"; ?>/assets/libs/@fullcalendar/core/main.min.js"></script>
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="inputEmail3" class="col-4 col-form-label">Email<span class="text-danger">*</span></label>
|
<label for="inputEmail3" class="col-4 col-form-label">Email<span class="text-danger">*</span></label>
|
||||||
<div class="col-7">
|
<div class="col-7">
|
||||||
<input type="email" id="email" onchange="check_if_exists();" required parsley-type="email" class="form-control" name="email" value="<?php if(isset($Memberdata)){echo $Memberdata[0]['email'];} ?>" placeholder="Email">
|
<input type="email" id="email" onkeyup="check_if_exists();" required parsley-type="email" class="form-control" name="email" value="<?php if(isset($Memberdata)){echo $Memberdata[0]['email'];} ?>" placeholder="Email">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -126,10 +126,18 @@
|
|||||||
<!-- end row-->
|
<!-- end row-->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
function check_if_exists() {
|
function check_if_exists() {
|
||||||
|
|
||||||
|
const validateEmail = (email) => {
|
||||||
|
return email.match(
|
||||||
|
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
||||||
|
);
|
||||||
|
};
|
||||||
var email = $("#email").val();
|
var email = $("#email").val();
|
||||||
$.ajax({
|
if(validateEmail(email)){
|
||||||
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url: "<?php echo base_url(); ?>/check_if_mail_exists",
|
url: "<?php echo base_url(); ?>/check_if_mail_exists",
|
||||||
data:{ email:email , table : 'member'},
|
data:{ email:email , table : 'member'},
|
||||||
@ -142,6 +150,9 @@ $.ajax({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@
|
|||||||
<div class="modal-dialog modal-lg">
|
<div class="modal-dialog modal-lg">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title" id="myLargeModalLabel">Credit points purchase and Transaction Details</h4>
|
<h4 class="modal-title" id="myLargeModalLabel">Transaction Details</h4>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" id="model-table">
|
<div class="modal-body" id="model-table">
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
</p> -->
|
</p> -->
|
||||||
|
|
||||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100">
|
<table id="datatable-buttons" data-order="[[1, 'desc']]" class="table table-striped dt-responsive nowrap w-100">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Order Id</th>
|
<th>Order Id</th>
|
||||||
@ -40,8 +40,8 @@
|
|||||||
<th>Transaction Id</th>
|
<th>Transaction Id</th>
|
||||||
<th>Cost</th>
|
<th>Cost</th>
|
||||||
<th>Member</th>
|
<th>Member</th>
|
||||||
<th>Status</th>
|
<th>Payment Status</th>
|
||||||
<th>Action</th>
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -50,7 +50,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($creditsData as $row)
|
<?php foreach ($creditsData as $row)
|
||||||
{ ?>
|
{ ?>
|
||||||
<tr>
|
<tr class="order_details" id="<?php echo $row['member_id'];?>">
|
||||||
<td><?php echo $row['order_id'];?></td>
|
<td><?php echo $row['order_id'];?></td>
|
||||||
<td><?php $date = new DateTime($row['created_at']); echo $date->format('M-d-Y'); ?></td>
|
<td><?php $date = new DateTime($row['created_at']); echo $date->format('M-d-Y'); ?></td>
|
||||||
<td><?php echo $row['transaction_id'];?></td>
|
<td><?php echo $row['transaction_id'];?></td>
|
||||||
@ -60,10 +60,7 @@
|
|||||||
?></td>
|
?></td>
|
||||||
<td><?php echo $row['member_name'];?></td>
|
<td><?php echo $row['member_name'];?></td>
|
||||||
<td><?php echo $row['status'];?></td>
|
<td><?php echo $row['status'];?></td>
|
||||||
<td> <?php if($row['status'] == 'success'){ ?>
|
|
||||||
<i class="mdi mdi-eye-outline order_details" value="<?php echo $row['order_id'];?>" id="<?php echo $row['member_id'];?>" style="font-size:18px;" title="Order Details"> </i>
|
|
||||||
<?php } ?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@ -102,9 +99,12 @@
|
|||||||
<script>
|
<script>
|
||||||
$(document).on('click','.order_details',function(){
|
$(document).on('click','.order_details',function(){
|
||||||
|
|
||||||
var member_id = $(this).closest('i').attr('id');
|
// var member_id = $(this).closest('i').attr('id');
|
||||||
var order_id = $(this).closest('i').attr('value');
|
// var order_id = $(this).closest('i').attr('value');
|
||||||
|
var member_id = $(this).closest('tr').attr('id');
|
||||||
|
|
||||||
|
var order_id = $(this).children("td:nth-child(1)").text();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"<?= base_url(); ?>/order_details",
|
url:"<?= base_url(); ?>/order_details",
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
@ -57,7 +57,7 @@
|
|||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="inputEmail3" class="col-4 col-form-label">Email<span class="text-danger">*</span></label>
|
<label for="inputEmail3" class="col-4 col-form-label">Email<span class="text-danger">*</span></label>
|
||||||
<div class="col-7">
|
<div class="col-7">
|
||||||
<input type="email" id="email" onchange="check_if_exists();" required parsley-type="email" class="form-control" name="<?php if($check){ echo 'mail'; } else { echo 'email'; }?>" value="<?php if(isset($userList)){echo $userList[0]['email'];} ?>" placeholder="Email"
|
<input type="email" id="email" onkeyup="check_if_exists();" required parsley-type="email" class="form-control" name="<?php if($check){ echo 'mail'; } else { echo 'email'; }?>" value="<?php if(isset($userList)){echo $userList[0]['email'];} ?>" placeholder="Email"
|
||||||
<?php if($check){ echo 'readonly'; }?>>
|
<?php if($check){ echo 'readonly'; }?>>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -158,16 +158,24 @@
|
|||||||
<!-- end row-->
|
<!-- end row-->
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
function check_if_exists() {
|
function check_if_exists() {
|
||||||
|
|
||||||
|
const validateEmail = (email) => {
|
||||||
|
return email.match(
|
||||||
|
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
||||||
|
);
|
||||||
|
};
|
||||||
var email = $("#email").val();
|
var email = $("#email").val();
|
||||||
$.ajax({
|
if(validateEmail(email)){
|
||||||
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url: "<?php echo base_url(); ?>/check_if_mail_exists",
|
url: "<?php echo base_url(); ?>/check_if_mail_exists",
|
||||||
data:{ email:email , table : 'users'},
|
data:{ email:email , table : 'users'},
|
||||||
success:function(response)
|
success:function(response)
|
||||||
{
|
{
|
||||||
if (response == true)
|
if (response == true)
|
||||||
{
|
{
|
||||||
alert("This mail id already exists");
|
alert("This mail id already exists");
|
||||||
@ -175,6 +183,9 @@ $.ajax({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user