234 lines
6.5 KiB
PHP
234 lines
6.5 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="#">Data Setup</li><li class="#">Company Setup</li><li class="active">Bussiness Unit</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_firm">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="firm_id" id="flex_firm_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;
|
|
$("#flex1").flexigrid({
|
|
url: 'manage_firm_script.php',
|
|
dataType: 'json',
|
|
colModel: [
|
|
{display: 'Sr', name: 'count', width: w*.04, sortable: false, align: 'left'},
|
|
|
|
{display: 'Business Unit Name', name: 'firm_name', width: w*.2, sortable: true, align: 'left'},
|
|
{display: 'Unit Code', name: 'firm_code', width: w*.2, sortable: true, align: 'left'},
|
|
{display: 'Location', name: 'firm_location', width: w*.2, sortable: true, align: 'left'},
|
|
|
|
{display: '', name: '', width: w*.1, sortable: false, 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: 'Business Unit Name', name: 'firm_name', isdefault: true},
|
|
{display: 'Unit Code', name: 'firm_code'},
|
|
{display: 'Location', name: 'firm_location'}
|
|
],
|
|
sortname: "firm_name",
|
|
sortorder: "asc",
|
|
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
|
|
});
|
|
});
|
|
|
|
function pdf(){
|
|
window.open('pdf_firm.php');
|
|
}
|
|
function excel(){
|
|
window.location = 'excel_firm.php';
|
|
}
|
|
|
|
function add(){
|
|
$(".save_button").show();
|
|
$("#firm_id").val("");
|
|
$("#firm_name").val("");
|
|
$("#firm_code").val("");
|
|
$("#firm_location").val("");
|
|
$("#firm_location1").val("");
|
|
$("#state_id").val("");
|
|
$("#pin").val("");
|
|
$("#firm_head_office").val("");
|
|
$("#firm_phone").val("");
|
|
$("#firm_fax").val("");
|
|
$("#firm_email").val("");
|
|
$("#firm_contact").val("");
|
|
$("#firm_logo").val("");
|
|
$("#gst_in").val("");
|
|
$("#bank").val("");
|
|
$("#branch").val("");
|
|
$("#account").val("");
|
|
$("#ifsc").val("");
|
|
$("#firm_id").val("");
|
|
$("#pan_no").val("");
|
|
$("#tin_no").val("");
|
|
$("#service_no").val("");
|
|
$("#central_no").val("");
|
|
$("#division").val("");
|
|
$("#range1").val("");
|
|
$("#colleborate").val("");
|
|
$("#remarks").val("");
|
|
$("#status").val("");
|
|
$('#modal-add-firm').modal("show");
|
|
}
|
|
|
|
function delete_firm(firmId){
|
|
$("#flex_firm_id").val(firmId);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the Business Unit ?', function(result){
|
|
if(result) {
|
|
$.ajax({
|
|
url : 'delete_manage_firm.php',
|
|
type : "POST",
|
|
data : $("#flex_form_firm").serialize(),
|
|
success : function(data) {
|
|
if(data.indexOf("SUCCESS")!=-1){
|
|
BootstrapDialog.alert('Business Unit Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
}else{
|
|
BootstrapDialog.alert('Error Deleting Business Unit');
|
|
}
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Deleting Business Unit');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function save_firm(){
|
|
$.ajax({
|
|
|
|
url : 'save_manage_firm.php',
|
|
type : "POST",
|
|
data : $("#firm_form").serialize(),
|
|
success : function(data) {
|
|
BootstrapDialog.alert('Business Unit Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Saving Business Unit');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
|
|
|
|
function open_firm(firmId, action) {
|
|
if(action=="V"){
|
|
$(".save_button").hide();
|
|
|
|
}else{
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url : 'select_manage_firm.php?firmId='+firmId+' ',
|
|
type : 'POST',
|
|
success : function(data) {
|
|
//alert(data);
|
|
var data = $.parseJSON(data);
|
|
//alert(data);
|
|
|
|
$("#firm_id").val(data.firm_id);
|
|
$("#firm_name").val(data.firm_name);
|
|
$("#firm_code").val(data.firm_code);
|
|
$("#firm_location").val(data.firm_location);
|
|
$("#firm_location1").val(data.firm_location1);
|
|
$("#state_id").val(data.state_id);
|
|
$("#pin").val(data.pin);
|
|
$("#firm_head_office").val(data.firm_head_office);
|
|
$("#firm_phone").val(data.firm_phone);
|
|
$("#firm_fax").val(data.firm_fax);
|
|
$("#firm_email").val(data.firm_email);
|
|
$("#firm_contact").val(data.firm_contact);
|
|
$("#firm_logo").val(data.firm_logo);
|
|
$("#gst_in").val(data.gstn);
|
|
$("#bank").val(data.bank);
|
|
$("#branch").val(data.branch);
|
|
$("#firm_name").val(data.firm_name);
|
|
$("#account").val(data.account);
|
|
$("#ifsc").val(data.ifsc);
|
|
$("#pan_no").val(data.pan_no);
|
|
$("#tin_no").val(data.tin_no);
|
|
$("#service_no").val(data.service_no);
|
|
$("#central_no").val(data.central_no);
|
|
$("#division").val(data.division);
|
|
$("#range1").val(data.range1);
|
|
$("#colleborate").val(data.colleborate);
|
|
$("#remarks").val(data.remarks);
|
|
$("#status").val(data.status);
|
|
$('#modal-add-firm').modal("show");
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Populating Business Unit');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<?php include('form/add_firms.php');?>
|