-
Notifications
You must be signed in to change notification settings - Fork 1
/
ac_bankcashmasters.php
141 lines (113 loc) · 4.05 KB
/
ac_bankcashmasters.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php include "jquery.php" ?>
<script type="text/javascript">
$(document).ready(function()
{
$('.sortable').each(function(i)
{
var table = $(this),
oTable = table.dataTable({
sDom: '<"block-controls"<"controls-buttons"p>>rti<"block-footer clearfix"lf>',
fnDrawCallback: function()
{
this.parent().applyTemplateSetup();
},
fnInitComplete: function()
{
this.parent().applyTemplateSetup();
}
});
table.find('thead .sort-up').click(function(event)
{
event.preventDefault();
var column = $(this).closest('th'),
columnIndex = column.parent().children().index(column.get(0));
oTable.fnSort([[columnIndex, 'asc']]);
return false;
});
table.find('thead .sort-down').click(function(event)
{
event.preventDefault();
var column = $(this).closest('th'),
columnIndex = column.parent().children().index(column.get(0));
oTable.fnSort([[columnIndex, 'desc']]);
return false;
});
});
});
</script>
<div id="control-bar" class="grey-bg clearfix"><div class="container_12">
<div class="float-right">
<button type="button" onClick="document.location='dashboardsub.php?page=ac_addbankcashmastersTop'"><img src="images/icons/fugue/tick-circle.png" width="16" height="16"> Add</button>
</div>
</div></div>
<section class="grid_12">
<div class="block-border">
<form class="block-content form" id="table_form" method="post" action="">
<h1>Bank/Cash Masters</h1>
<table class="table sortable no-margin" cellspacing="0" style="size:50%" width="100%">
<thead>
<tr>
<th style="text-align:left"><span class="column-sort">
<a href="javascript:void(0)" title="Sort up" class="sort-up"></a>
<a href="javascript:void(0)" title="Sort down" class="sort-down"></a>
</span>Bank/Cash Code</th>
<th style="text-align:left"><span class="column-sort">
<a href="javascript:void(0)" title="Sort up" class="sort-up"></a>
<a href="javascript:void(0)" title="Sort down" class="sort-down"></a>
</span>Bank/CashBook Name</th>
<th style="text-align:left">Coacode</th>
<th style="text-align:left">A/c.No</th>
<th style="text-align:left">Sector</th>
<th style="text-align:left">Address</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
include "config.php";
$query = "SELECT * FROM ac_bankcashcodes ORDER BY code ASC ";
$result = mysql_query($query,$conn);
while($row1 = mysql_fetch_assoc($result))
{
$code=$row1['code'];
$flag=0;
$q="select * from `ac_bankmasters` where code='$code'";
$r=mysql_query($q,$conn);
while($row=mysql_fetch_array($r))
{
$coa=$row['coacode'];
$acno=$row['acno'];
}
$q="select distinct(coacode) as coacode from `ac_financialpostings` ";
$r=mysql_query($q,$conn);
while($row=mysql_fetch_array($r))
{
if($coa==$row['coacode'])
$flag=1;
}
?>
<tr>
<td><?php echo $row1['code']; ?></td>
<td><?php echo $row1['name']; ?></td>
<td><?php echo $coa; ?></td>
<td><?php echo $acno; ?></td>
<td><?php echo $row1['sector']; ?></td>
<td><?php echo $row1['address']; ?></td>
<td>
<a href="dashboardsub.php?page=ac_editbankcashmasters&id=<?php echo $row1['id']; ?>"><img src="images/icons/fugue/pencil.png" style="border:0px" title="Edit"/></a>
<?php if($flag == "1") { ?>
<img src="images/icons/fugue/lock.png" style="border:0px" title="Cannot Delete" /></a>
<?php } else { ?>
<a onclick="if(confirm('Are you sure,want to delete')) document.location ='ac_deletebankcashmasters.php?id=<?php echo $row1['id']; ?>'"><img src="images/icons/fugue/cross-circle.png" style="border:0px" title="Delete" /></a>
<?php } ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</form>
</div>
</section>
<br />