csrtechnew.ohctech.in/beneficiary_list.php
2025-08-29 16:30:39 +05:30

520 lines
20 KiB
PHP

<?php include('techsyn_header.php'); ?>
<!-- Main Content Container for side bar and body-->
<div class="main-container ace-save-state" id="main-container">
<script type="text/javascript">
try {
ace.settings.loadState('main-container')
} catch (e) {}
</script>
<?php include('techsyn_sidebar.php'); ?>
<!--breadcrumb-->
<div class="main-content">
<div class="main-content-inner">
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
<li class="#">Masters</li>
<li class="active"> Activity Master</li>
</ul>
</div>
<!-- End of breadcrumb -->
<div class="page-content">
<div id="flexigridDiv" class="table-responsive">
<form name="f1" method="post" action="" id="flex_form_unit">
<div id="flex1" style="width:100%">
</div>
<input type="hidden" name="flex_unit_id" id="flex_unit_id" />
</form>
</div>
</div>
</div><!-- /.page-content -->
</div>
</div><!-- /.main-content -->
<script type="text/javascript">
$(function() {
var w = screen.width * .90;
var h = 0;
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
function formatDate(dateStr) {
const dateParts = dateStr.split('-');
return `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
}
$("#flex1").flexigrid({
url: 'beneficiary_list_script.php',
dataType: 'json',
colModel: [{
display: 'Actions',
name: '',
width: w * .10,
sortable: true,
align: 'center'
},
{
display: 'Sr.',
name: 'id',
width: w * .05,
sortable: false,
align: 'center'
},
{
display: "Beneficiary Category",
name: "beneficiary_category",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "Beneficiary Name",
name: "patient_name",
width: w * .15,
sortable: true,
align: "left"
},
{
display: "Bnf Code",
name: "emp_code",
width: w * .10,
sortable: true,
align: "left"
},
{
display: "Gender",
name: "gender",
width: w * .05,
sortable: true,
align: "center"
},
{
display: "Age/Birth Date",
name: "dob",
width: w * .07,
sortable: true,
align: "left",
process: function(cell, row) {
const originalDate = $(cell).text();
$(cell).text(formatDate(originalDate));
}
},
{
display: "Marital Status",
name: "marital_status",
width: w * .1,
sortable: true,
align: "left"
},
{
display: 'Disabilty',
name: 'disabilty',
width: w * .15,
sortable: true,
align: 'left'
},
{
display: "Caste",
name: "caste",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "Religion",
name: "religen",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "Economic Category",
name: "economic_category",
width: w * .1,
sortable: true,
align: "left"
}, {
display: "Annual Income",
name: "annual_income",
width: w * .1,
sortable: true,
align: "left"
},
// {
// display: "Identity Type",
// name: "identity_type",
// width: w * .1,
// sortable: true,
// align: "left"
// },
// {
// display: "Identity Number",
// name: "identity_number",
// width: w * .1,
// sortable: true,
// align: "left"
// },
{
display: "Aadhar Card No",
name: "aadhar_card",
width: w * .10,
sortable: true,
align: "center"
},
{
display: "Aadhar Linked Phone Number",
name: "aadhar_phone",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "Phone Number",
name: "primary_phone",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "Residing Village",
name: "village",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "Tehsil",
name: "tehsil",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "District",
name: "district",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "State",
name: "state",
width: w * .1,
sortable: true,
align: "left"
},
// {
// display: "Street Location",
// name: "post",
// width: w * .1,
// sortable: true,
// align: "left"
// },
{
display: "Pin Code",
name: "pin_code",
width: w * .1,
sortable: true,
align: "left"
},
// {
// display: "Qualification",
// name: "qualification",
// width: w * .1,
// sortable: true,
// align: "left"
// },
// {
// display: "Experience",
// name: "experience",
// width: w * .1,
// sortable: true,
// align: "left"
// },
{
display: "Activation Date",
name: "activation_date",
width: w * .07,
sortable: true,
align: "left"
},
// {
// display: "Activation Status",
// name: "status",
// width: w * .05,
// sortable: true,
// align: "left"
// },
{
display: "Verification Status",
name: "pending_status",
width: w * .05,
sortable: true,
align: "left"
},
{
display: "Benefit Program Eligibility",
name: "benefit_program_eligibility",
width: w * .1,
sortable: true,
align: "left"
},
// {
// display: "Distribution Center",
// name: "distribution_left",
// width: w * .1,
// sortable: true,
// align: "left"
// },
{
display: "License Number",
name: "license_no",
width: w * .1,
sortable: true,
align: "left"
},
{
display: "Last Modified By",
name: "modified_by",
width: w * .1,
sortable: true,
align: "left"
},
],
buttons: [{
name: 'Add Beneficiary Enquiry',
bclass: 'add',
onpress: add
},
{
name: 'PDF',
bclass: 'print',
onpress: function() {
pdf('pdf'); // Pass 'pdf' to the pdf function
}
},
{
separator: true
},
{
name: 'Excel',
bclass: 'print_excel',
onpress: function() {
pdf('excel'); // Pass 'excel' to the pdf function
}
},
{
separator: true
},
{
name: 'Download Template',
bclass: 'print_excel',
onpress: download_template
},
{
separator: true
},
{
name: 'Upload Excel',
bclass: 'print_excel',
onpress: upload_excel
},
{
separator: true
}
],
searchitems: [{
display: 'Beneficiary Name',
name: 'patient_name',
isdefault: true
},
{
display: 'Beneficiary Category',
name: 'beneficiary_category',
isdefault: true
},
{
display: 'Aadhar No',
name: 'aadhar_card',
isdefault: true
},
{
display: 'Father/Husband Name',
name: 'father_name'
},
{
display: 'Gender',
name: 'gender'
},
{
display: 'License Number',
name: 'license_no'
},
],
sortname: "id",
sortorder: "desc",
usepager: true, //pagination
useRp: true,
rp: 50, //records per page
showTableToggleBtn: false, //toggle button for the whole table
resizable: true,
height: h,
singleSelect: true
});
});
function add() {
$("#minimum_eligibility").val("");
$("#program_id").val("");
$("#program_name").val("");
$("#program_status").val("");
$("#program_code").val("");
$("#involved_process").val('').trigger('chosen:updated');
$("#beneficiary_category").val("");
$('#model-checkup-parameter').modal("show");
}
function pdf() {
window.open('activity_pdf.php');
}
function excel() {
window.location = 'activity_excel.php';
}
function open_trainer_program_form(program_id, action) {
if (action == 'V') {
$(".save_button").hide();
} else {
$(".save_button").show();
}
$.ajax({
url: 'select_program_master.php?program_id=' + program_id +
' ',
type : 'POST',
success : function(data) {
//alert(data);
var data = $.parseJSON(data);
$("#program_id").val(data.program_id);
$("#program_name").val(data.program_name);
$("#program_status").val(data.program_status);
$("#program_code").val(data.program_code);
// $("#involved_process").val(data.involved_process).trigger('chosen:updated');
if (data.involved_process != null) {
var involved_process = data.involved_process;
var dataarray = involved_process.split(",");
$("#involved_process").val(dataarray).trigger('chosen:updated');
}else{
$("#involved_process").val('').trigger('chosen:updated');
}
$("#beneficiary_category").val(data.beneficiary_category);
$('#model-checkup-parameter').modal("show");
},
error: function(data) {
BootstrapDialog.alert('Error Populating injury');
return;
}
});
}
function delete_trainer_program_form(program_id) {
$("#flex_unit_id").val(program_id);
BootstrapDialog.confirm('Are you sure to delete the program?', function(result) {
if (result) {
$.ajax({
url: 'delete_program_master.php',
type: "POST",
data: $("#flex_form_unit").serialize(),
success: function(data) {
if (data.indexOf("SUCCESS") != -1) {
BootstrapDialog.alert('Activity Deleted Successfully.');
$("#flex1").flexReload();
} else {
BootstrapDialog.alert('Activity Parameter group');
}
return;
},
error: function(data) {
BootstrapDialog.alert('Activity Parameter group');
return;
}
});
}
});
}
function validate() {
save_trainer_program();
}
$(document).on("keypress", "#c_name", function(event) {
var character = String.fromCharCode(event.keyCode);
// alert(character); // alert(isValid(character));
return isValid(character);
});
function isValid(str) {
return !/[~`!@#$%\^&*()+=\-\\ \[\]\\';,/{}|\\":<>\?]/g.test(str);
}
function save_trainer_program() {
$.ajax({
url: 'program_master_save.php',
type: "POST",
data: $("#trainer_program_form").serialize(),
success: function(data) {
BootstrapDialog.alert('Trainer Activity Form Saved Successfully.');
$("#flex1").flexReload();
return;
},
error: function(data) {
BootstrapDialog.alert('Error Saving Unit');
return;
}
});
$('.close').click();
}
</script>
<?php include('techsyn_footer.php'); ?>
<?php include('form/program_master_main_form.php'); ?>