FIX_23rd disscussion : ps

This commit is contained in:
VE10-Sanjeev 2024-04-25 02:56:51 +00:00
parent 5408d2dc37
commit 5e16aa99f6
16 changed files with 444 additions and 65 deletions

View File

@ -99,8 +99,9 @@ class Books extends BaseController
} else {
// It's an update operation
$isactive = $this->request->getPost('isactive');
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
// $isactive = $this->request->getPost('isactive');
// $data['isactive'] = ($isactive == 'on') ? 1 : 0;
$data['isactive'] = 1;
$data['updated_by'] = $session_uid;
$BooksModel->update($causes_id, $data);

View File

@ -7,6 +7,32 @@ use App\Models\HomeModel;
class Home extends BaseController
{
public function index()
{
helper('session');
$session_role = get_user_role();
if (!empty($session_role)) {
switch ($session_role) {
case 'admin':
case 'auditor':
$this->dashboard();
break;
case 'accounts':
$this->dashboard_accounts();
break;
case 'volunteer':
$this->dashboard_volunteers();
break;
default:
$data['page_name'] = 'Dashboard';
$this->render_page('dashboard', $data);
}
}
}
//Default Dashboard..
public function dashboard()
{
// echo "hwllo"
helper('session');
@ -33,7 +59,6 @@ class Home extends BaseController
$where['users.branch_id'] = $branch_id;
}
break;
case 'donor':
case 'volunteer':
if ($branch_id) {
$where['users.branch_id'] = $branch_id;
@ -42,7 +67,7 @@ class Home extends BaseController
break;
}
}
$data['donordetails'] = $model->donordetails($where);
$data['donordetails']['label'] = "donors";
@ -51,6 +76,36 @@ class Home extends BaseController
}
public function dashboard_accounts()
{
helper('session');
$session_bid = get_business_id();
$model = new HomeModel();
$where = ['users.business_id' => $session_bid];
$data = $model->dashboard_account($where);
$data['page_name'] = 'Dashboard';
// $this->render_page('dashboard', $data);
$this->render_page('dashboard_accounts', $data);
}
public function dashboard_volunteers()
{
helper('session');
$session_bid = get_business_id();
$session_uid = get_logged_user_id();
$model = new HomeModel();
$bwhere = ['user_id'=> $session_uid,'users.business_id'=> $session_bid,'users.isactive'=> 1];
$branch_id = $model->getbranchid($bwhere);
$data = $model->dashboard_volunteer($bwhere);
$data['page_name'] = 'Dashboard';
$this->render_page('dashboard', $data);
}
## Dynamic Validation For Existing Check AJAX Call
# USED in 1) User Module
# 2) Recepit-DonorQuickAdd Module

View File

@ -108,7 +108,7 @@ class Invoice extends BaseController
$upt_data = $model->updateData('donations_accepted', $data, $where);
}
}
session()->setFlashdata('success', 'Data has been added successfully.');
session()->setFlashdata('success', 'Recepit Updated Successfully.');
return redirect()->route('donations_accepted');
}
catch (\Throwable $e)
@ -140,7 +140,8 @@ class Invoice extends BaseController
// Get customer names for the dropdown, events details, and books details
$data['currency'] = $this->BusinessModel->select('currency')->where($where)->findAll();
$data['currency_code'] = $this->BusinessModel->select('currency')->where($where)->first()['currency'] ?? null;
$data['causes'] = $bmodel->select('*')->where('business_id', (int)get_business_id())->where('isactive',1)->get()->getResult();
$data['campaign'] = $model->getData('campaign', $where);
$data['invoice_number_formatting'] = $model->getData('business', $where);
@ -165,7 +166,7 @@ class Invoice extends BaseController
$cus_where = ['business_id' => (int)get_business_id() , 'isactive' => 1, 'donor_type'=>$data['receipt_type']];
$data['typebaseddonors'] = $model->getData('donor', $cus_where);
$data['alldonors'] = $model->getData('donor', ['business_id' => (int)get_business_id() , 'isactive' => 1]);
// print_r($data);die;
$this->render_page('invoice_form', $data);
}
@ -201,7 +202,7 @@ class Invoice extends BaseController
$this->AuditHistoryModel->save($audit_data);
/************************************* */
if($upt_data){ session()->setFlashdata('success', 'Data has been accepted successfully.');echo true; }
if($upt_data){ session()->setFlashdata('success', 'Recepit has been accepted successfully.');echo true; }
else echo false;
}
@ -234,7 +235,7 @@ class Invoice extends BaseController
];
$this->AuditHistoryModel->save($audit_data);
/************************************* */
session()->setFlashdata('success', 'Data has been rejected successfully.');
session()->setFlashdata('success', 'Recepit has been rejected successfully.');
return redirect()->route('receipt_list');
}

View File

@ -6,8 +6,7 @@ class HomeModel extends Model
public function donordetails($where) {
$totalDonors = $this->db->table('donor')
->where($where)->countAll();
$totalDonors = $this->db->table('donor')->where($where)->countAllResults();
$activeDonors = $this->db->table('donor')->select('donor.*, users.branch_id,users.business_id as users_business_id')
->join('users', 'users.user_id = donor.created_by AND users.business_id = donor.business_id', 'left')
@ -36,5 +35,87 @@ class HomeModel extends Model
$result = $query->select('branch_id')->where($bwhere)->get()->getRow();
return $result ? (int)$result->branch_id : 0;
}
public function dashboard_account($where){
$query = $this->db->table('users')
->select('users.user_id,receipt.receipt_header,SUM(receipt.amount) AS total_amount')
->select("CONCAT_WS(' ', users.first_name, users.last_name) AS full_name")
->join('receipt', 'receipt.created_by = users.user_id', 'left')
->where('users.isactive', 1)
->where('receipt.receipt_header', 'Receipt')
->where($where)
->like('users.role', 'volunteer')
->groupby('users.user_id, full_name');
$result = $query->get()->getResult();
// echo $this->db->getLastQuery()->getQuery();die;
$total_amount_today = $this->db->table('receipt')
->select('SUM(amount) AS total_amount_today')
->join('users', 'receipt.created_by = users.user_id', 'left')
->where('receipt.receipt_header', 'Receipt')
->where($where)
->where('DATE(receipt.created_on) = CURDATE()')
->get()->getRow();
$today = ($total_amount_today) ? $total_amount_today->total_amount_today : 0;
$total_amount_current_month = $this->db->table('receipt')
->select('SUM(amount) AS total_amount_current_month')
->join('users', 'receipt.created_by = users.user_id', 'left')
->where('receipt.receipt_header', 'Receipt')
->where($where)
->where('YEAR(receipt.created_on)', date('Y'))
->where('MONTH(receipt.created_on)', date('m'))
->get()->getRow();
$month = ($total_amount_current_month) ? $total_amount_current_month->total_amount_current_month : 0;
$total_amount_current_financial_year = $this->db->table('receipt')
->select('SUM(amount) AS total_amount_current_financial_year')
->join('users', 'receipt.created_by = users.user_id', 'left')
->where('receipt.receipt_header', 'Receipt')
->where($where)
->where('receipt.created_on >=', date('Y-04-01'))
->where('receipt.created_on <', date('Y-04-01', strtotime('+1 year')))
->get()->getRow();
$financial_year = ($total_amount_current_financial_year) ? $total_amount_current_financial_year->total_amount_current_financial_year : 0;
$final['volunter'] = $result;
$final['month'] = (int)$month;
$final['today'] = (int)$today;
$final['year'] = (int)$financial_year;
return $final;
}
public function dashboard_volunteer($where){
$common_query = $this->db->table('users')
->select('users.user_id, SUM(receipt.amount) AS total_amount')
->select("CONCAT_WS(' ', users.first_name, users.last_name) AS full_name")
->join('receipt', 'receipt.created_by = users.user_id', 'left')
->where($where)
->like('users.role', 'volunteer')
->groupby('users.user_id');
$today_collection = clone $common_query;
$today_collection = $today_collection->where('DATE(receipt.created_on)', date('Y-m-d'))->get()->getRow();
$final['today_collection'] = ($today_collection) ? (int)$today_collection->total_amount : 0;
$overall_collection = clone $common_query;
$overall_collection = $overall_collection->get()->getRow();
// echo $this->db->getLastQuery()->getQuery();die;
$final['overall_collection'] = ($overall_collection) ? (int)$overall_collection->total_amount : 0;
$settlement_today = clone $common_query;
$settlement_today = $settlement_today->where('DATE(receipt.created_on)', date('Y-m-d'))
->where('receipt.receipt_header', 'Receipt')
->get()->getRow();
$final['settlement_today'] = ($settlement_today) ? (int)$settlement_today->total_amount : 0;
$settlement_overall = clone $common_query;
$settlement_overall = $settlement_overall->where('receipt.receipt_header', 'Receipt')->get()->getRow();
$final['settlement_overall'] = ($settlement_overall) ? (int)$settlement_overall->total_amount : 0;
return $final;
}
}

View File

@ -21,7 +21,9 @@
<link href="<?= base_url() . "public/assets/css/icons.min.css" ?>" rel="stylesheet" type="text/css" />
</head>
<style>
.debug-bar-ndisplay {display: none !important;}
</style>
<body class="loading">
<div class="account-pages mt-5 mb-5">

View File

@ -96,6 +96,14 @@
<script>
$(function() {
// don't for validation.
var get_fromdate = "<?php echo isset($details[0]['from_date']) ? $details[0]['from_date'] : ''; ?>";
var default_mindate = new Date().toISOString().split('T')[0];
var from_mindate = default_mindate ; //default today date is MinDate Of From Date
var to_mindate = (get_fromdate === '') ? default_mindate : get_fromdate; //default today date is MinDate Of To Date but in edit Screen From Date Availble Means Setted to min date
$("#from_date").attr("min", from_mindate);
$("#to_date").attr("min", to_mindate);
role = "<?php echo get_user_role() ?>";
console.log(role);
if(role == "auditor")
@ -112,7 +120,13 @@
});
}
});
$("#from_date").on("change", function() {
$("#to_date").val('');
var fromDate = $(this).val();
$("#to_date").attr("min", fromDate);
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
const coverPictureInput = documenxt.getElementById("cover_picture");

View File

@ -276,6 +276,7 @@
<div class="form-group col-md-6">
<label for="logo" class="col-form-label">Logo</label>
<input type="file" class="form-control" style="border: 0px !important; " id="logo" name="business_logo" placeholder="Logo Name" accept=".png, .jpg, .jpeg" value="<?= isset($organzations['business_logo']) ? $organzations['business_logo'] : '' ?>" />
<span class="help-block"><small>Image dimensions should be between <strong>140x45</strong> pixels and <strong>150x50</strong> pixels. (formats: .png, .jpg, .jpeg)</small></span>
<p id="logo-error-message" style="color: red;"></p>
</div>
@ -288,6 +289,7 @@
<div class="form-group col-md-6">
<label for="favicon" class="col-form-label">Favicon</label>
<input type="file" class="form-control" style="border: 0px !important; " id="favic" name="favicon" placeholder="Fav-icon Name" accept=".png, .jpg, .jpeg" value="<?= isset($organzations['favicon']) ? $organzations['favicon'] : '' ?>" />
<span class="help-block"><small>Image dimensions should be <strong>216x216</strong> pixels.(formats: .png, .jpg, .jpeg) </small></span>
<p id="favic-error-message" style="color: red;"></p>
</div>
@ -304,7 +306,8 @@
<div class="form-group col-md-6">
<label for="bfile" class="col-form-label">Signature</label>
<input type="file" onchange="validateImage(this)" class="form-control" style="border: 0px !important;" id="signature" name="signature" value="<?= isset($organzations['signature']) ? $organzations['signature'] : null ?>" multiple />
<input type="file" onchange="validateImage(this)" class="form-control" style="border: 0px !important;" id="signature" name="signature" value="<?= isset($organzations['signature']) ? $organzations['signature'] : null ?>" accept=".png, .jpg, .jpeg"/>
<span class="help-block"><small>Image dimensions should be <strong>50x50</strong> pixels. (formats: .png, .jpg, .jpeg) </small></span>
<p id="error-message"></p>
</div>

View File

@ -1,4 +1,4 @@
<?php if ($loggedin_person_role !== 'sadmin') : ?>
<?php if ($loggedin_person_role === 'auditor' || $loggedin_person_role === 'admin') : ?>
<div class="row justify-content-center">
<div class="col-xl-3 col-md-6">
<div class="card">
@ -22,4 +22,46 @@
</div>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($loggedin_person_role === 'volunteer') : ?>
<div class="row">
<div class="col-lg-12">
<div class="row mb-3">
<div class="col-lg-6">
<div>
<!-- <h4 class="font-15 mb-2">Today Collection</h4> -->
<div class="card p-2 mb-lg-0">
<div class="text-center">
<h3><b>Collections</b></h3>
</div>
<div class="mt-4 pt-1">
<div class="d-flex justify-content-between">
<p class="mb-1"><span class="font-weight-semibold">Today :</span><?= $today_collection; ?></p>
<p class="mb-0"><span class="font-weight-semibold">Overall :</span><?= $overall_collection; ?></p>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div>
<!-- <h4 class="font-15 mb-2">Settlement Amount</h4> -->
<div class="card p-2 mb-lg-0">
<div class="text-center">
<h3><b>Pending Settlement</b></h3>
</div>
<div class="mt-4 pt-1">
<div class="d-flex justify-content-between">
<p class="mb-1"><span class="font-weight-semibold">Today :</span><?= $settlement_today; ?></p>
<p class="mb-0"><span class="font-weight-semibold">Overall :</span><?= $settlement_overall; ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end row -->
<?php endif; ?>

View File

@ -0,0 +1,124 @@
<!-- Start Content-->
<div class="container-fluid">
<h4 class="header-title mb-3">Account Overviews</h4>
<div class="row">
<div class="col-xl-4 col-md-4">
<div class="card">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Financial year">Financial year</h5>
<h3 class="my-2 py-1"><span data-plugin="counterup"><span data-toggle="tooltip" data-placement="bottom" data-original-title="Current Financial year"><?= $year ?></span></span></h3>
<!-- <p class="mb-0 text-muted">
<span class="text-success mr-2"><span class="mdi mdi-arrow-up-bold"></span> 5.27%</span>
<span class="text-nowrap">Since last month</span>
</p> -->
</div>
<!-- <div class="avatar-sm">
<span class="avatar-title bg-soft-primary rounded">
<i class="ri-stack-line font-20 text-primary"></i>
</span>
</div> -->
</div>
</div>
</div>
</div><!-- end col -->
<div class="col-xl-4 col-md-4">
<div class="card">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Month">Month</h5>
<h3 class="my-2 py-1"><span data-plugin="counterup"><span data-toggle="tooltip" data-placement="bottom" data-original-title="Current Month"><?= $month ?></span></span></h3>
<!-- <p class="mb-0 text-muted">
<span class="text-danger mr-2"><span class="mdi mdi-arrow-down-bold"></span> 3.27%</span>
<span class="text-nowrap">Since last month</span>
</p> -->
</div>
<!-- <div class="avatar-sm">
<span class="avatar-title bg-soft-primary rounded">
<i class="ri-slideshow-2-line font-20 text-primary"></i>
</span>
</div> -->
</div>
</div>
</div>
</div><!-- end col -->
<div class="col-xl-4 col-md-4">
<div class="card">
<div class="card-body">
<div class="d-flex justify-content-between">
<div>
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Today">Today</h5>
<h3 class="my-2 py-1"><span data-plugin="counterup"><span data-toggle="tooltip" data-placement="bottom" data-original-title="Current Today"><?= $today; ?></span></span></h3>
<!-- <p class="mb-0 text-muted">
<span class="text-success mr-2"><span class="mdi mdi-arrow-up-bold"></span> 8.58%</span>
<span class="text-nowrap">Since last month</span>
</p> -->
</div>
<!-- <div class="avatar-sm">
<span class="avatar-title bg-soft-primary rounded">
<i class="ri-hand-heart-line font-20 text-primary"></i>
</span>
</div> -->
</div>
</div>
</div>
</div><!-- end col -->
</div>
<!-- end row -->
<div class="row">
<div class="col-xl-5">
<div class="card">
<div class="card-body">
<h4 class="header-title mb-3">Volunteer Performing</h4>
<div class="table-responsive">
<table class="table table-striped table-sm table-nowrap table-centered mb-0">
<thead>
<tr>
<th>Name</th>
<th>Amount</th>
<!-- <th></th> -->
</tr>
</thead>
<tbody>
<!-- <tr> <td>
<h5 class="font-15 mb-1 font-weight-normal">Volunt</h5>
<span class="text-muted font-13">Senior </span>
</td> -->
<!-- <td>187</td> -->
<!-- <td class="table-action">
<a href="javascript: void(0);" class="action-icon"> <i class="mdi mdi-eye"></i></a>
</td></tr> -->
<?php if (empty($volunter)) : ?>
<tr>
<td colspan="2"><center>No data available</center></td>
</tr>
<?php else : ?>
<?php foreach ($volunter as $value) : ?>
<tr>
<td><?= $value->full_name; ?></td>
<td><?= $value->total_amount; ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div> <!-- end table-responsive-->
</div> <!-- end card-body-->
</div> <!-- end card-->
</div>
<!-- end col-->
</div>
<!-- end row-->
</div> <!-- container -->

View File

@ -16,14 +16,14 @@
<div class="form-row">
<div class="form-group col-md-6">
<label for="nextid" class="col-form-label">Start Date<span class="text-danger">*</span></label>
<input type="date" class="form-control" name="start_date" value="<?= isset($campaign['start_date']) ? $campaign['start_date'] : '' ?>" placeholder="" required />
<label for="start_date" class="col-form-label">Start Date<span class="text-danger">*</span></label>
<input type="date" class="form-control" id="start_date" name="start_date" value="<?= isset($campaign['start_date']) ? $campaign['start_date'] : '' ?>" placeholder="" required />
<div class="invalid-feedback"> Please provide. </div>
</div>
<div class="form-group col-md-6">
<label for="leftpad" class="col-form-label">End Date<span class="text-danger">*</span></label>
<input type="date" class="form-control" name="end_date" placeholder="000" value="<?= isset($campaign['end_date']) ? $campaign['end_date'] : '' ?>" required>
<label for="end_date" class="col-form-label">End Date<span class="text-danger">*</span></label>
<input type="date" class="form-control" id="end_date" name="end_date" placeholder="000" value="<?= isset($campaign['end_date']) ? $campaign['end_date'] : '' ?>" required>
<div class="invalid-feedback"> Please provide. </div>
</div>
</div>
@ -55,6 +55,13 @@
<script>
$(function() {
// don't for validation.
var get_startdate = "<?php echo isset($details[0]['start_date']) ? $details[0]['start_date'] : ''; ?>";
var default_mindate = new Date().toISOString().split('T')[0];
var from_mindate = default_mindate ; //default today date is MinDate Of Start Date
var to_mindate = (get_startdate === '') ? default_mindate : get_startdate; //default today date is MinDate Of To Date but in edit Screen Start Date Availble Means Setted to min date
$("#start_date").attr("min", from_mindate);
$("#end_date").attr("min", to_mindate);
role = "<?php echo get_user_role() ?>";
console.log(role);
if(role == "auditor")
@ -70,6 +77,11 @@
element.setAttribute('disabled', true);
});
}
$("#start_date").on("change", function() {
$("#end_date").val('');
var fromDate = $(this).val();
$("#end_date").attr("min", fromDate);
});
});
</script>

View File

@ -53,27 +53,51 @@
</div>
</div>
<div class="form-row">
<?php
$uniqueData = [];
$mobileNumbers = [];
$selected_donor_mobile = "";
$selected_donor_id = isset($receipt_details['donor_id']) ? $receipt_details['donor_id'] : "";
foreach ($typebaseddonors as $object) {
$mobile = $object->mobile_no;
if ($object->donor_id == $selected_donor_id) {
$selected_donor_mobile = $mobile;
}
if (!isset($mobileNumbers[$mobile])) {
$mobileNumbers[$mobile] = true;
$uniqueData[] = $object;
}
}
?>
<div class="form-group col-md-6">
<label for="customerMobile" class="col-form-label dm_label">Donor Mobile<span class="text-danger"> *</span></label>
<label for="customerMobile" class="col-form-label dm_label">Contributor Mobile<span class="text-danger"> *</span></label>
<!-- <?php if (get_user_role() != 'accounts') { ?>
&nbsp;&nbsp;&nbsp;&nbsp;
<i type="button" class="fe-plus-circle" id="add-quk-donar" style="font-size: 24px;" data-toggle="modal" data-target="#standard-modal" title="Add Donor"></i>
<i type="button" class="fe-plus-circle" id="add-quk-donar" style="font-size: 24px;" data-toggle="modal" data-target="#standard-modal" title="Add Contributor "></i>
<?php } ?> -->
<select class="form-control" id="donor_mobile" name="donor_mobile" required data-toggle="select2">
<!-- <select class="form-control" id="donor_mobile" name="donor_mobile" required data-toggle="select2">
<option value="">--Select--</option>
<?php if (get_user_role() != 'accounts') { ?> <option class="blueText" value="0"> + Add a donor</option> <?php } ?>
<?php foreach ($typebaseddonors as $customer) : ?>
<option value="<?= $customer->mobile_no ?>" <?php if (isset($receipt_details['donor_id']) && ($receipt_details['donor_id'] == $customer->donor_id)) echo "selected"; ?>> <?= $customer->mobile_no ?> </option>
<?php endforeach; ?>
</select> -->
<select class="form-control" id="donor_mobile" name="donor_mobile" required data-toggle="select2">
<option value="">--Select--</option>
<?php if (get_user_role() != 'accounts') : ?>
<option class="blueText" value="0"> + Add a Contributor </option>
<?php endif; ?>
<?php foreach ($uniqueData as $customer) : ?>
<option value="<?= $customer->mobile_no ?>" <?php if ($selected_donor_mobile == $customer->mobile_no) echo "selected"; ?>> <?= $customer->mobile_no ?> </option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group col-md-6">
<label for="donor_first_name" class="col-form-label dfn_label">Donor Name<span class="text-danger"> *</span></label>
<label for="donor_first_name" class="col-form-label dfn_label">Contributor Name<span class="text-danger"> *</span></label>
<select class="form-control" id="donor_first_name" name="donor_id" required data-toggle="select2">
<option value="">--Select--</option>
<?php if (get_user_role() != 'accounts') { ?> <option class="blueText" value="0"> + Add a donor</option><?php } ?>
<?php if (get_user_role() != 'accounts') { ?> <option class="blueText" value="0"> + Add a Contributor</option><?php } ?>
<?php foreach ($typebaseddonors as $customer) : ?>
<option value="<?= $customer->donor_id ?>" <?php if (isset($receipt_details['donor_id']) && ($receipt_details['donor_id'] == $customer->donor_id)) echo "selected"; ?>>
<?php if ($receipt_type == "individual") : echo $customer->first_name; endif; ?>
@ -123,7 +147,8 @@
</div>
</div>
<div class="form-row">
<div class="form-group col-md-1">
<input type="hidden" id="currency" name="currency" value="<?= isset($receipt_details['currency']) ? $receipt_details['currency'] : $currency_code; ?>" />
<!-- <div class="form-group col-md-1">
<label for="csname" class="col-form-label">Currency<span class="text-danger"> *</span></label>
<select class="form-control" id="currency" name="currency" data-toggle="select2" required>
<?php
@ -136,12 +161,17 @@
</option>
<?php endforeach; ?>
</select>
</div>
</div> -->
<div class="form-group col-md-5">
<div class="form-group col-md-6">
<label for="csname" class="col-form-label">Amount<span class="text-danger"> *</span></label>
<input type="text" class="form-control" id="org_name_field" name="amount" value="<?= isset($receipt_details['amount']) ? $receipt_details['amount'] : '' ?>" placeholder="Amount" oninput="this.value = this.value.replace(/[^0-9]/g, '')" required maxlength="9" />
<div class="input-group">
<!-- <div class="input-group-prepend">
<span class="input-group-text" id="validationTooltipUsernamePrepend"><?= $currency_code; ?></span>
</div> -->
<input type="text" class="form-control" id="org_name_field" name="amount" value="<?= isset($receipt_details['amount']) ? $receipt_details['amount'] : '' ?>" placeholder="Amount" oninput="this.value = this.value.replace(/[^0-9]/g, '')" required maxlength="9" aria-describedby="validationTooltipUsernamePrepend"/>
</div>
</div>
<div class="form-group col-md-3">
<label for="invoiceDate" class="col-form-label">Payment Mode<span class="text-danger"> *</span></label>
@ -230,6 +260,7 @@
if (response.success) {
$('#successModal').modal('show');
$('#downloadButton').attr('href', "<?= base_url('generate_invoice_pdf/'); ?>" + response.invoice_id);
$('#successModal').modal('hide');
} else {
// Handle errors or display a different modal for failure
console.log(response.message);
@ -243,10 +274,12 @@
});
$('#closeButton').on('click', function(e) {
e.preventDefault();
var url = "<?php echo base_url('receipt_list'); ?>";
// var url = "<?php echo base_url('receipt_list'); ?>";
var baseUrl = "<?php echo base_url(); ?>";
var url = baseUrl + 'receipt_list';
window.location.href = url;
$('#successModal').modal('hide');
$('#receiptForm')[0].reset();
window.location.href = url;
});
});
</script>
@ -265,7 +298,7 @@
$('.dm_label').find('.text-danger').remove();
} else {
$('#donor_mobile').prop('disabled', false).attr('required', true);
$('.dfn_label').html('Donor Name<span class="text-danger"> *</span>');
$('.dfn_label').html('Contributor Name<span class="text-danger"> *</span>');
if ($('.dm_label').find('.text-danger').length == 0) {
$('.dm_label').append('<span class="text-danger"> *</span>');
}
@ -284,7 +317,7 @@
var selectedMobile = $(this).val();
var options = '<option value="">--Select--</option>';
if(role != 'accounts'){
options += '<option value="0">+ Add a donor</option>';
options += '<option value="0">+ Add a Contributor</option>';
}
// Assuming `data` is an array of objects containing donor information
@ -307,7 +340,7 @@
var Rtype = $('.receipt_type:checked').val();
var options = '<option value="">--Select--</option>';
if(role != 'accounts'){
options += '<option value="0">+ Add a donor</option>';
options += '<option value="0">+ Add a Contributor</option>';
}
// Assuming `data` is an array of objects containing donor information
console.log(donor);
@ -337,7 +370,7 @@
var selectedID = $(this).val();
var options = '<option value="">--Select--</option>';
if(role != 'accounts'){
options += '<option value="0">+ Add a donor</option>';
options += '<option value="0">+ Add a Contributor</option>';
}
// Filter the donors array based on the selectedID
var filter_array = alldonors.filter(function(d) {
@ -386,10 +419,10 @@
}));
if(role != 'accounts'){
$('#donor_mobile').append($('<option>', {
value: "0",text: "+ Add a donor"
value: "0",text: "+ Add a Contributor"
}));
$('#donor_first_name').append($('<option>', {
value: "0",text: "+ Add a donor"
value: "0",text: "+ Add a Contributor"
}));
}
@ -499,14 +532,12 @@
$('#org_name_fie').prop('required', true);
$('#pan_no_org').prop('required', true);
$('#org_reg_details').prop('required', true);
$('#pan_no').prop('required', false);
$('#ind_pan').hide();
} else {
$('#org_details_form').hide();
$('#org_name_fie').prop('required', false);
$('#pan_no_org').prop('required', false);
$('#org_reg_details').prop('required', false);
$('#pan_no').prop('required', true);
$('#ind_pan').show();
}
})
@ -519,7 +550,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="standard-modalLabel">Add Donor</h4>
<h4 class="modal-title" id="standard-modalLabel">Add Contributor</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
@ -530,7 +561,7 @@
<div class="form-row">
<div class="form-group col-md-12">
<label for="DonorType" class="col-form-label">Donor Type<span class="text-danger"> *</span></label>
<label for="DonorType" class="col-form-label">Contributor Type<span class="text-danger"> *</span></label>
<select class="form-control" id="DonorType" name="DonorType" required>
<option value="">--Select--</option>
<?php $typeArr = array('individual', 'organization');
@ -591,8 +622,8 @@
<div class="form-row" id="ind_pan">
<div class="form-group col-md-12">
<label for="pan_no" class="col-form-label">PAN Number<span class="text-danger"> *</span></label>
<input type="text" class="form-control" id="pan_no" name="pan_no" value="<?= isset($receipt_details['pan_no']) ? $receipt_details['pan_no'] : '' ?>" placeholder="PAN Number" oninput="validatePANFormat(this)" required onchange="checkExisting(this,'pan_no','pan_no')"/>
<label for="pan_no" class="col-form-label">PAN Number</label>
<input type="text" class="form-control" id="pan_no" name="pan_no" value="<?= isset($receipt_details['pan_no']) ? $receipt_details['pan_no'] : '' ?>" placeholder="PAN Number" oninput="validatePANFormat(this)" onchange="checkExisting(this,'pan_no','pan_no')"/>
<div id="panNoError" style="display: none; color: red;">Invalid PAN format</div>
<div class="invalid-feedback"> Please provide. </div>
</div>
@ -665,13 +696,14 @@
$('.dm_label').find('.text-danger').remove();
} else {
$('#donor_mobile').prop('disabled', false).attr('required', true);
$('.dfn_label').html('Donor Name<span class="text-danger"> *</span>');
$('.dfn_label').html('Contributor Name<span class="text-danger"> *</span>');
if ($('.dm_label').find('.text-danger').length == 0) {
$('.dm_label').append('<span class="text-danger"> *</span>');
}
}
$('#donor_mobile').val("");
$('#donor_first_name').val("");
var uniqueMobiles = [];
$.ajax({
type: "POST",
url: "<?= base_url() . 'get_donor_details' ?>",
@ -687,7 +719,7 @@
}));
$('#donor_mobile').append($('<option>', {
value: "0",
text: "+ Add a donor"
text: "+ Add a Contributor"
}));
$('#donor_first_name').empty().append($('<option>', {
value: "",
@ -695,13 +727,20 @@
}));
$('#donor_first_name').append($('<option>', {
value: "0",
text: "+ Add a donor"
text: "+ Add a Contributor"
}));
$.each(donor, function(k, v) {
$('#donor_mobile').append($('<option>', {
value: v.mobile_no,
text: v.mobile_no
}));
// $('#donor_mobile').append($('<option>', {
// value: v.mobile_no,
// text: v.mobile_no
// }));
if(uniqueMobiles.indexOf(v.mobile_no) === -1) {
uniqueMobiles.push(v.mobile_no);
$('#donor_mobile').append($('<option>', {
value: v.mobile_no,
text: v.mobile_no
}));
}
if (option == 'organization') {
$('#donor_first_name').append($('<option>', {
value: v.donor_id,text: v.org_name+' - '+v.pan_no
@ -754,4 +793,5 @@
}
});
}
</script>
</script>
<!-- <script src="<?= base_url() . "public/assets/js/pages/form-advanced.init.js" ?>"></script> -->

View File

@ -10,7 +10,7 @@
<div class="float-right">
<div id="checkAll" style="display:none;">
<span id="totalAmt" style="margin-right:30px;"></span>
<button type="button" class="btn btn-secondary" id="multi_success">Accept</button>
<button type="button" class="btn btn-success" id="multi_success">Accept</button>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#delete-all-modal">Reject</button>
</div>
<div id="addDonorBtn">
@ -80,8 +80,8 @@
<?php
$currencySymbol = '';
switch ($row['currency']) {
case 'Rs':
switch (strtoupper($row['currency'])) {
case 'RS':
$currencySymbol = '₹'; // Rupees symbol
break;
case 'USD':
@ -250,7 +250,9 @@ function totalAmt() {
sum = 0;
for (const checkbox of $('.select-checkbox:checked')) {
const id = $(checkbox).val();
sum = parseInt($('#'+id).html()) + sum;
var string = $('#'+id).html();
var number = string.replace(/\D/g, '');
sum = parseInt(number) + sum;
}
$('#totalAmt').html('Total selected amount: <b>'+sum+'</b>');
}

View File

@ -82,9 +82,9 @@
<td style="width: 20%; height: 25px; text-align: center;border: none;"> <img src="<?= $baseurl ?>" alt="Your Organization Logo" style="width: 100%;"></td>
<td style="width: 80%; height: 20px;border: none;">
<h3 style="text-align: right;text-decoration: underline"><strong><?= $data->title ?></strong></h3>
<p class="sub-add" style="padding-left: 80px; text-align: right;"><?= $data->org_address ?> <?= $data->org_city ?? ",".$data->org_city ?> <?= $data->org_state ?? ",".$data->org_state ?> <?= $data->org_zip ?? ",".$data->org_zip."." ?><br>
<?= $data->org_mobile ?? "MobileNo: ".$data->org_mobile.", " ?> <?= $data->org_email ?? "Email: ".$data->org_email.", " ?><br>
<?= $data->org_pan ?? "PAN No: ".$data->org_pan.", " ?> <?= $data->org_reg_no ?? "Register No: ".$data->org_reg_no ?></p>
<p class="sub-add" style="padding-left: 80px; text-align: right;"><?= $data->org_address ?> <?= $data->org_city ? ",".$data->org_city :""; ?> <?= $data->org_state ? ",".$data->org_state :""; ?> <?= $data->org_zip ? ",".$data->org_zip.".":""; ?><br>
<?= $data->org_mobile ? "Mobile No: ".$data->org_mobile.", ":""; ?> <?= $data->org_email ? "Email: ".$data->org_email.", ":""; ?><br>
<?= $data->org_pan ? "PAN No: ".$data->org_pan.", ":""; ?> <?= $data->org_reg_no ? "Register No: ".$data->org_reg_no:""; ?></p>
</td>
</tr>
<tr style="height: 18px;">
@ -93,11 +93,11 @@
</td>
</tr>
<tr style="height: 18px;">
<td style="width: 50% !important; height: 18px; text-align: left;border: none;"><strong>Receipt:</strong>&nbsp;<?=$data->receipt_number?></td>
<td style="width: 50% !important; height: 18px; text-align: left;border: none;"><strong>Receipt Number:</strong>&nbsp;<?=$data->receipt_number?></td>
<td style="width: 49% !important; height: 18px; text-align: right;border: none;"><strong>Date:</strong>&nbsp; <?=date("d-m-Y", strtotime($data->receipt_date));?></td>
</tr>
<tr style="height: 18px;">
<td style="width: 100%; height: 18px; text-align: justify;border: none;padding:30px;" colspan="2"><p>Received with thanks from <b><?= $data->customer_name . ($data->cust_org_name ? ' (' . $data->cust_org_name . ')' : '') ?></b><?php if($data->cust_pan_no) { echo ', PAN <b>'.$data->cust_pan_no.'</b>'; } ?>, a sum of (<?= $currency ?>.<?= $data->amount ?>) <b><?= $currency ?> <?= $currency_in_words ? $currency_in_words.' Only' :'' ?></b>, towards <b><?= $data->cause_name ?></b>.</td>
<td style="width: 100%; height: 18px; text-align: justify;border: none;padding:30px;" colspan="2"><p>Received with thanks from <b><?= $data->customer_name . ($data->cust_org_name ? ' (' . $data->cust_org_name . ')' : '') ?></b><?php if($data->cust_pan_no) { echo ', PAN <b>'.$data->cust_pan_no.'</b>'; } ?>, a sum of <b><?= $currency ?> <?= $currency_in_words ? $currency_in_words.' Only' :'' ?></b> (<?= $currency ?>.<?= $data->amount ?>), towards <b><?= $data->cause_name ?></b>.</td>
</tr>
<tr style="height: 18px;">
<td style="width: 30.5118%; height: 18px;border: none;"><strong>Collected by:</strong>&nbsp; <?= $staff_name ?></td>

View File

@ -13,7 +13,7 @@
<!-- plugin css -->
<link href="<?= base_url()."public/assets/libs/multiselect/css/multi-select.css" ?>" rel="stylesheet" type="text/css" />
<link href="<?= base_url()."public/assets/libs/select2/css/select2.min.css" ?>" rel="stylesheet" type="text/css" />
<link href="<?= base_url() . "public//assets/libs/sweetalert2/sweetalert2.min.css" ?>" rel="stylesheet" type="text/css" /> <!-- <link href="<?= base_url()."public/assets/libs/selectize/css/selectize.bootstrap3.css" ?>" rel="stylesheet" type="text/css" /> -->
<link href="<?= base_url() . "public/assets/libs/sweetalert2/sweetalert2.min.css" ?>" rel="stylesheet" type="text/css" /> <!-- <link href="<?= base_url()."public/assets/libs/selectize/css/selectize.bootstrap3.css" ?>" rel="stylesheet" type="text/css" /> -->
<!-- third party css -->
<link href="<?= base_url()."public/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" ?>" rel="stylesheet" type="text/css" />
@ -40,7 +40,9 @@
<link href="<?= base_url()."public/assets/libs/summernote/summernote-bs4.min.css" ?>" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<style>
.debug-bar-ndisplay {display: none !important;}
</style>
<body class="loading">
<!-- Begin page -->

View File

@ -27,7 +27,7 @@
<label for="role" class="col-form-label" id="role_label">Role <span class="text-danger">*</span></label>
<select id="role" name="role" class="form-control" required>
<option value="">--Select--</option>
<?php $roleArr = array('admin', 'accounts', 'auditor','donor','volunteer');
<?php $roleArr = array('admin', 'accounts', 'auditor','volunteer');
foreach ($roleArr as $value) {
$selected = (isset($details['role']) && $details['role'] === $value) ? "selected" : "";
?>

View File

@ -3,7 +3,7 @@
©2008-2020 SpryMedia Ltd - datatables.net/license
*/
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,H){E||(E=window);H||(H="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(H,E,E.document)}:h(jQuery,window,document)})(function(h,E,H,k){function $(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
d[c]=e,"o"===b[1]&&$(a[e])});a._hungarianMap=d}function J(a,b,c){a._hungarianMap||$(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),J(a[d],b[d],c)):b[d]=b[e]})}function Ea(a){var b=n.defaults.oLanguage,c=b.sDecimal;c&&Fa(c);if(a){var d=a.sZeroRecords;!a.sEmptyTable&&(d&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(d&&"Loading..."===b.sLoadingRecords)&&F(a,
d[c]=e,"o"===b[1]&&$(a[e])});a._hungarianMap=d}function J(a,b,c){a._hungarianMap||$(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),J(a[d],b[d],c)):b[d]=b[e]})}function Ea(a){var b=n.defaults.oLanguage,c=b.sDecimal;c&&Fa(c);if(a){var d=a.sZeroRecords;!a.sEmptyTable&&(d&&"No data available"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(d&&"Loading..."===b.sLoadingRecords)&&F(a,
a,"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&c!==a&&Fa(a)}}function gb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":
"");"boolean"===typeof a.scrollX&&(a.scrollX=a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&J(n.models.oSearch,a[b])}function hb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"===typeof b&&!h.isArray(b)&&(a.aDataSort=[b])}function ib(a){if(!n.__browser){var b={};n.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:-1*h(E).scrollLeft(),height:1,width:1,
overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,n.__browser);a.oScroll.iBarWidth=n.__browser.barWidth}
@ -142,7 +142,7 @@ b.aaSorting=[];b.aaSortingFixed=[];ya(b);h(m).removeClass(b.asStripeClasses.join
{nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};n.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,
sWidthOrig:null};n.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){return{}}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+
a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",
a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",
sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},n.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};
$(n.defaults);n.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};$(n.defaults.column);n.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,
bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],