csrtechnew.ohctech.in/ashirwad_mian_list.php

353 lines
10 KiB
PHP
Raw Permalink Normal View History

2025-04-14 13:28:09 +05:30
<?php include('techsyn_header.php'); ?>
2025-08-29 16:30:39 +05:30
<script>
function addFollowupRow(dateVal = '', remarksVal = '') {
const container = document.getElementById('followup-container');
const row = document.createElement('tr');
row.innerHTML = `
<td>
<input type="date" class="form-control" name="followup_date[]" value="${dateVal}">
</td>
<td>
<textarea class="form-control" name="followup_remarks[]" rows="2">${remarksVal}</textarea>
</td>
<td class="text-center">
<button type="button" class="btn btn-danger btn-sm" onclick="removeFollowupRow(this)">
<i class="fa fa-trash"></i>
</button>
</td>
`;
container.appendChild(row);
}
function removeFollowupRow(btn) {
const row = btn.closest('tr');
row.remove();
}
document.addEventListener('DOMContentLoaded', function() {
addFollowupRow();
});
</script>
2025-04-14 13:28:09 +05:30
<?php include('form/add_cancers_awarenes.php'); ?>
<!-- Main Content Container for sid bar d 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="#">Activity</li>
<li class="active">Cancers Awarenes</li>
</ul>
</div>
<!-- End of breadcrumb -->
<div class="page-content">
<form name="f1" method="post" action="" id="flex_form_indent">
<div id="flex1" style="width:100%">
</div>
<input type="hidden" name="flex_indent_id" id="flex_indent_id" />
2025-08-29 16:30:39 +05:30
2025-04-14 13:28:09 +05:30
</form>
<form name="export_form" method="post" id="export_form" action="">
<input type="hidden" name="pdf_action" id="pdf_action" value="pdf_ashirwad.php" />
2025-08-29 16:30:39 +05:30
<input type="hidden" name="excel_action" id="excel_action" value="excel_ashirwad.php" />
2025-04-14 13:28:09 +05:30
</form>
</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;
$("#flex1").flexigrid({
url: 'ashirwad_mian_script.php',
dataType: 'json',
colModel: [{
display: '',
name: '',
width: w * .11,
sortable: false,
align: 'left'
},
{
display: 'Sr',
name: 'count',
width: w * .04,
sortable: false,
align: 'left'
},
{
display: 'Date',
name: 'date',
width: w * .13,
sortable: true,
align: 'left'
},
{
display: 'Beneficiary',
name: 'beneficiary',
width: w * .20,
sortable: true,
align: 'left'
},
{
display: 'Mobile No',
name: 'mobile_no',
width: w * .15,
sortable: true,
align: 'left'
},
{
display: 'Village',
name: 'village',
width: w * .15,
sortable: true,
align: 'left'
},
{
display: 'Feedback',
name: 'feedback',
width: w * .20,
sortable: true,
align: 'left'
},
],
buttons: [
{
name: 'Add',
bclass: 'add',
onpress: add
},
{
separator: true
},
{
name: 'PDF',
bclass: 'print',
onpress: pdf
},
{
separator: true
},
{
name: 'Excel',
bclass: 'print_excel',
onpress: excel
},
{
separator: true
},
],
searchitems: [
{
display: 'Beneficiary Name',
name: 'beneficiary'
},
{
display: 'Mobile No',
name: 'mobile_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,
//width: w,
height: h,
singleSelect: true
});
});
2025-08-29 16:30:39 +05:30
2025-04-14 13:28:09 +05:30
function add() {
document.getElementById("indent_status_form").reset();
$("#itm_stk").val("");
$("#reorder_level").val("");
$("#indent_qty").val("");
$("#child_item_unit").val("");
$("#indent_id").val("");
$("#indent_date").val("");
$("#approval_button").hide();
total_price();
$('#sup_doc_div').hide();
$("#sup_tab").hide();
$('#modal-indent-status').modal("show");
}
function open_indent_items_pdf(indent_id) {
$("#flex_indent_id").val(indent_id);
$("#flex_form_indent").attr('target', '_blank');
$("#flex_form_indent").attr('method', 'POST');
$("#flex_form_indent").attr('action', 'indent_pdf.php');
$("#flex_form_indent").submit();
}
2025-08-29 16:30:39 +05:30
function open_indent(indent_id, access) {
$.ajax({
url: 'select_cancers_awarenes.php',
type: 'POST',
dataType: 'json',
data: {
indent_id: indent_id
},
success: function(data) {
2025-04-14 13:28:09 +05:30
2025-08-29 16:30:39 +05:30
$('#myTable > tbody').empty();
$("#count_items").val(data['count']);
$("#rrwhs_hidden_id").val(data.id);
$("#doc_indent_id").val(data.id);
$("#beneficiary").val(data.beneficiary);
$("#beneficiary").select2();
$("#feedback").val(data.feedback);
$("#indent_date0").val(data.date);
$("#remarks").val(data.remarks);
2025-04-14 13:28:09 +05:30
2025-08-29 16:30:39 +05:30
// Clear old followup rows
$("#followup-container").empty();
2025-04-14 13:28:09 +05:30
2025-08-29 16:30:39 +05:30
// Add new followup rows from response
if (data.followups && data.followups.length > 0) {
data.followups.forEach(function(f) {
addFollowupRow(f.followup_date, f.followup_remarks);
});
} else {
addFollowupRow(); // default blank row
2025-04-14 13:28:09 +05:30
}
2025-08-29 16:30:39 +05:30
$('#modal-indent-status').modal("show");
},
error: function(data) {
BootstrapDialog.alert('Error Populating Details');
}
});
}
2025-04-14 13:28:09 +05:30
function open_indent1(flex_indent_id, action) {
if (action == "V") {
$("#flex_indent_id").val(flex_indent_id);
$("#flex_form_indent").attr('method', 'POST');
$("#flex_form_indent").attr('action', 'view_indent.php');
$("#flex_form_indent").submit();
} else {
$("#flex_indent_id").val(flex_indent_id);
$("#flex_form_indent").attr('method', 'POST');
$("#flex_form_indent").attr('action', 'edit_indent.php');
$("#flex_form_indent").submit();
}
}
function pdf() {
//window.open('pdf_manage_item.php');
window.open('ajax_pdf.php', 'Indent List');
}
function excel() {
2025-08-29 16:30:39 +05:30
window.open('excel_ashirwad.php', 'Indent List');
2025-04-14 13:28:09 +05:30
}
function delete_rrwhs(indentId) {
$("#flex_indent_id").val(indentId);
BootstrapDialog.confirm('Are you sure to delete the Cancers Awarenes?', function(result) {
if (result) {
$.ajax({
url: 'delete_cancers_awarenes.php',
type: "POST",
data: $("#flex_form_indent").serialize(),
success: function(data) {
if (data.indexOf("SUCCESS") != -1) {
BootstrapDialog.alert('Cancers Awarenes Deleted Successfully.');
$("#flex1").flexReload();
} else {
BootstrapDialog.alert('Error Deleting Cancers Awarenes');
}
return;
},
error: function(data) {
BootstrapDialog.alert('Error Deleting Cancers Awarenes');
return;
}
});
}
});
}
function exporttopdf(flex_indent_id) {
//location.href="view_pdf.php?flex_indent_id="+flex_indent_id+"";
$("#flex_indent_id").val(flex_indent_id);
$("#flex_form_indent").attr('method', 'POST');
$("#flex_form_indent").attr('target', '_blank');
$("#flex_form_indent").attr('action', 'view_pdf.php');
$("#flex_form_indent").submit();
}
</script>
<?php
// include('image_popup_rrwhs.php')
?>
<?php include('techsyn_footer.php'); ?>