testChanges:GWM
This commit is contained in:
parent
2d4d862e5e
commit
d127bfebe1
@ -106,6 +106,11 @@ class Admin_controller extends BaseController
|
||||
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']))
|
||||
|
||||
@ -684,7 +689,7 @@ class Admin_controller extends BaseController
|
||||
->join('member', 'transactions.member_id = member.id', 'left')
|
||||
->orderBy('transactions.created_at' , 'desc')
|
||||
->findAll();
|
||||
//echo '<pre>'; echo print_r($data['creditsData']); '</pre>';
|
||||
// echo '<pre>'; echo print_r($data['creditsData']); '</pre>';
|
||||
echo view('layout/header',$userdata);
|
||||
echo view('transactions_list',$data);
|
||||
echo view('layout/footer');
|
||||
@ -724,11 +729,11 @@ class Admin_controller extends BaseController
|
||||
->where('member_credits.order_id', $order_id )
|
||||
->findAll();
|
||||
// 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) {
|
||||
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></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><td>'.$status.'</td></tr>';
|
||||
}
|
||||
echo $output .= '</tbody></table></div> ';
|
||||
|
||||
|
||||
@ -97,31 +97,21 @@ class Common_controller extends BaseController
|
||||
{
|
||||
|
||||
if($this->request->getVar('table'))
|
||||
|
||||
{
|
||||
|
||||
if($this->request->getVar('table') == 'member')
|
||||
|
||||
$data = $this->MemberModel->where('email', $this->request->getVar('email'))->where('is_active', 1)->find();
|
||||
|
||||
else if($this->request->getVar('table') == 'users')
|
||||
|
||||
$data = $this->UserModel->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'){
|
||||
$data = $this->UserModel->where('email', $this->request->getVar('email'))->find();
|
||||
}
|
||||
if ($data)
|
||||
|
||||
{
|
||||
|
||||
echo true;
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
echo false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -470,7 +470,7 @@ class Member_controller extends BaseController
|
||||
if($this->request->getmethod() == 'post')
|
||||
|
||||
{
|
||||
|
||||
|
||||
//insert member details
|
||||
|
||||
$MemberData = $this->request->getVar();
|
||||
|
||||
@ -314,7 +314,7 @@ class PaymentController extends BaseController
|
||||
|
||||
//Trancaction Table initial entry for this transaction
|
||||
|
||||
$TrancactionData['status'] = 'initialized';
|
||||
$TrancactionData['status'] = 'In-Progress';
|
||||
|
||||
$TrancactionData['member_id'] = session()->get('logged_user');
|
||||
|
||||
@ -490,7 +490,7 @@ class PaymentController extends BaseController
|
||||
|
||||
//Trancaction Table Data
|
||||
|
||||
$TrancactionData['status'] = 'success';
|
||||
$TrancactionData['status'] = 'Success';
|
||||
|
||||
//$TrancactionData['member_id'] = session()->get('logged_user');
|
||||
|
||||
@ -548,7 +548,7 @@ class PaymentController extends BaseController
|
||||
|
||||
//Trancaction Table Data
|
||||
|
||||
$TrancactionData['status'] = 'failed';
|
||||
$TrancactionData['status'] = 'Failed';
|
||||
|
||||
// $TrancactionData['member_id'] = session()->get('logged_user');
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ class User_model extends Model
|
||||
{
|
||||
|
||||
$builder = $this->db->table('users');
|
||||
$builder -> select("id,mobile,email,password");
|
||||
$builder -> select("id,mobile,email,password,is_active");
|
||||
$builder -> where('email',$email);
|
||||
$result = $builder->get();
|
||||
if(count($result->getResultArray()) ==1)
|
||||
|
||||
@ -95,10 +95,10 @@
|
||||
<script src="<?= base_url()."/public"; ?>/assets/js/pages/email.init.js"></script>
|
||||
|
||||
<!-- 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-->
|
||||
<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 -->
|
||||
<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>
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="inputEmail3" class="col-4 col-form-label">Email<span class="text-danger">*</span></label>
|
||||
<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>
|
||||
|
||||
@ -126,10 +126,18 @@
|
||||
<!-- end row-->
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
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();
|
||||
$.ajax({
|
||||
if(validateEmail(email)){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<?php echo base_url(); ?>/check_if_mail_exists",
|
||||
data:{ email:email , table : 'member'},
|
||||
@ -142,6 +150,9 @@ $.ajax({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<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>
|
||||
</div>
|
||||
<div class="modal-body" id="model-table">
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
</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>
|
||||
<tr>
|
||||
<th>Order Id</th>
|
||||
@ -40,8 +40,8 @@
|
||||
<th>Transaction Id</th>
|
||||
<th>Cost</th>
|
||||
<th>Member</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
<th>Payment Status</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
@ -50,7 +50,7 @@
|
||||
<tbody>
|
||||
<?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 $date = new DateTime($row['created_at']); echo $date->format('M-d-Y'); ?></td>
|
||||
<td><?php echo $row['transaction_id'];?></td>
|
||||
@ -60,10 +60,7 @@
|
||||
?></td>
|
||||
<td><?php echo $row['member_name'];?></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>
|
||||
@ -102,9 +99,12 @@
|
||||
<script>
|
||||
$(document).on('click','.order_details',function(){
|
||||
|
||||
var member_id = $(this).closest('i').attr('id');
|
||||
var order_id = $(this).closest('i').attr('value');
|
||||
|
||||
// var member_id = $(this).closest('i').attr('id');
|
||||
// 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({
|
||||
url:"<?= base_url(); ?>/order_details",
|
||||
method: 'POST',
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="inputEmail3" class="col-4 col-form-label">Email<span class="text-danger">*</span></label>
|
||||
<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'; }?>>
|
||||
</div>
|
||||
</div>
|
||||
@ -158,16 +158,24 @@
|
||||
<!-- end row-->
|
||||
|
||||
|
||||
<script>
|
||||
<script>
|
||||
|
||||
|
||||
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();
|
||||
$.ajax({
|
||||
if(validateEmail(email)){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<?php echo base_url(); ?>/check_if_mail_exists",
|
||||
data:{ email:email , table : 'users'},
|
||||
success:function(response)
|
||||
{
|
||||
{
|
||||
if (response == true)
|
||||
{
|
||||
alert("This mail id already exists");
|
||||
@ -175,6 +183,9 @@ $.ajax({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user