158 lines
5.5 KiB
PHP
158 lines
5.5 KiB
PHP
<title>Correspondance</title>
|
|
<?php
|
|
include('top.php');
|
|
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var w=screen.width-25;
|
|
|
|
$("#flex1").flexigrid({
|
|
url: 'flexi_notes_script.php',
|
|
dataType: 'json',
|
|
colModel : [
|
|
{display: 'Sr', name : 'count', width : w*0.015, sortable : false, align: 'left'},
|
|
{display: 'Business Partner', name : 'corr_date', width : w*0.090, sortable : true, align: 'left'},
|
|
{display: 'Correspondance Date', name : 'corr_date', width : w*0.045, sortable : true, align: 'left'},
|
|
{display: 'Case', name : 'associated_id', width : w*0.045, sortable : true, align: 'left'},
|
|
{display: 'Subject', name : 'subject', width : w*0.050, sortable : true, align: 'left'},
|
|
{display: 'Item', name : 'item', width : w*0.090, sortable : true, align: 'left'},
|
|
{display: 'Description', name : 'note_details', width : w*0.250, sortable : true, align: 'left'},
|
|
{display: 'User', name : 'added_id', width : w*0.065, sortable : true, align: 'left'},
|
|
{display: 'Initiated', name : 'added_id', width : w*0.045, sortable : true, align: 'left'},
|
|
{display: 'Received Date', name : 'corr_rec_date', width : w*0.045, sortable : true, align: 'left'},
|
|
{display: 'Reply', name : 'view_link', width : w*0.020, sortable : false, align: 'left'},
|
|
{display: 'PDF', name : 'view_link', width : w*0.020, sortable : false, align: 'left'},
|
|
{display: 'Letter', name : 'letter_link', width : w*0.020, sortable : false, align: 'left'},
|
|
{display: 'PDF', name : 'letter_link', width : w*0.020, sortable : false, align: 'left'},
|
|
|
|
{display: 'Edit', name : 'edit_link', width : w*0.020, sortable : false, align: 'left'},
|
|
{display: 'Delete', name : 'delete_link', width : w*0.020, sortable : false, align: 'left'}
|
|
],
|
|
buttons : [
|
|
{name:'<b><font size="2">Correspondence</font></b>'},
|
|
{name: 'Add', bclass: 'add', onpress : doCommand},
|
|
|
|
{separator: true}
|
|
],
|
|
searchitems : [
|
|
|
|
{display: 'Order File No', name :'associated_id', isdefault: true},
|
|
{display: 'Subject', name : 'subject'},
|
|
{display: 'Date Spread(YYYY-MM-DD,YYYY-MM-DD)', name : 'corr_date'},
|
|
|
|
|
|
],
|
|
sortname: "corr_date",
|
|
sortorder: "desc",
|
|
usepager: true,//pagination
|
|
|
|
useRp: true,
|
|
rp: 25,//records per page
|
|
showTableToggleBtn: false,//toggle button for the whole table
|
|
resizable: false,
|
|
width: window.innerWidth,
|
|
height: window.innerHeight-130,
|
|
singleSelect: true
|
|
});
|
|
});
|
|
|
|
function doCommand(com, grid) {
|
|
if (com == 'Add') {
|
|
//window.open('notes.php?acn=add');
|
|
//window.open ("notes.php?acn=add","mywindow","menubar=1,resizable=1,width=650,height=650");
|
|
window.open('notes.php?acn=add', 'DoSubmit', 'width=760,height=400,screenX=50,left=80,screenY=50,top=50,scrollbars=1');
|
|
}
|
|
if (com == 'Edit') {
|
|
$('.trSelected', grid).each(function() {
|
|
var id = $(this).attr('id');
|
|
id = id.substring(id.lastIndexOf('row')+3);
|
|
alert("Edit row " + id);
|
|
});
|
|
location.href="menu_master.php?acn=update";
|
|
|
|
} else if (com == 'Delete') {
|
|
$('.trSelected', grid).each(function() {
|
|
var id = $(this).attr('id');
|
|
alert((this));
|
|
alert(id);
|
|
id = id.substring(id.lastIndexOf('row')+3);
|
|
alert("Delete row " + id);
|
|
});
|
|
}
|
|
}
|
|
|
|
function delete_menu(button, grid) {
|
|
var total_count = $('.trSelected', grid).length;
|
|
var deleted = 0;
|
|
|
|
$.each($('.trSelected', grid), function() {
|
|
var id = $('td:nth-child(1) div', this).html();
|
|
$.ajax({
|
|
url: '/api/book/' + id,
|
|
type: 'DELETE',
|
|
data: {},
|
|
dataType: 'json',
|
|
success: function() {
|
|
deleted++;
|
|
if (deleted == total_count) {
|
|
$('#books_grid').flexReload();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
function add_menu(button, grid) {
|
|
var form_div = $('#book_form');
|
|
|
|
form_div.load('/ajax/book_form_add', null, function() {
|
|
$('#book_form form').ajaxForm({
|
|
url: '/ajax/book_form_add',
|
|
success: function() {
|
|
form_div.hide();
|
|
$('#books_grid').flexReload();
|
|
}
|
|
});
|
|
form_div.show();
|
|
});
|
|
}
|
|
|
|
function edit_menu(button, grid) {
|
|
var id = $('.trSelected td:nth-child(1) div', grid).html();
|
|
var form_div = $('#book_form');
|
|
var url = '/ajax/book_form_edit/' + id;
|
|
|
|
form_div.load(url, null, function() {
|
|
$('#book_form form').ajaxForm({
|
|
url: url,
|
|
success: function() {
|
|
form_div.hide();
|
|
$('#books_grid').flexReload();
|
|
}
|
|
});
|
|
form_div.show();
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<tr>
|
|
|
|
<td height="350" valign="top" align="center">
|
|
<table width="700px" border="0" cellspacing="0" cellpadding="0" align="center">
|
|
|
|
<tr>
|
|
<td align="justify">
|
|
<form name="f1" method="post" action="<?php echo $this_script?>">
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="4" id="flex1" >
|
|
</table>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|