-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathac_cashflow.php
134 lines (111 loc) · 3.34 KB
/
ac_cashflow.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
<?php include "config.php"; session_start(); ?>
<script>
$(function() {
var dates = $( "#from, #to" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
});
</script>
<?php include "config.php";
$q1 = "SELECT max(fdate) as fdate from ac_definefy ";
$result = mysql_query($q1,$conn);
while($row1 = mysql_fetch_assoc($result))
{
$fromdate = $row1['fdate'];
$fromdate = date("d.m.Y",strtotime($fromdate));
}
?>
<center>
<br />
<h1>Cash Flow Statement</h1>
<br /><br /><br />
<form target="_new">
<table align="center">
<tr height="10px"></tr>
</table>
<table align="center">
<tr>
<td align="right"><strong>From </strong></td>
<td width="10px"></td>
<td align="left"><input type="text" size="15" id="from" class="datepicker" name="from" value="<?php echo $fromdate; ?>" onChange="datecomp();"></td>
<td width="10px"></td>
<td><strong align="right">To </strong></td>
<td width="10px"></td>
<td align="left"><input type="text" size="15" id="to" class="datepicker" name="to" value="<?php echo date("d.m.o"); ?>" onChange="datecomp();" ></td>
</tr>
</table>
<br/><br/>
<input type="button" id="report" value="Report" onclick="openreport();" />
</form>
</center>
<script type="text/javascript">
function openreport()
{
var fromdate = document.getElementById('from').value;
var todate = document.getElementById('to').value;
window.open('production/cashflow.php?fromdate=' + fromdate + '&todate=' + todate);
}
function datecomp()
{
<?php echo "
dd = document.getElementById('date2').value;
temp = dd.split('.');
temp = temp[1] + '/' + temp[0] + '/' + temp[2];
temp1 = new Date(temp);
dd1 = document.getElementById('date3').value;
temp3 = dd1.split('.');
temp3 = temp3[1] + '/' + temp3[0] + '/' + temp3[2];
temp4 = new Date(temp3);
if(temp1 >temp4)
{
alert('To date must be greater than or equal to From date');
document.getElementById('report').disabled = true;
}
else
{
document.getElementById('report').disabled = false;
reloadpurord();
}
";
?>
}
function reloadpur()
{
date2 = document.getElementById('date2').value;
date2 = temp = date2.split('.');
var fdate =(date1[2] + '-' + date2[1] + '-' + date2[0]).toString();
date3 = document.getElementById('date3').value;
date3 = temp = date3.split('.');
var tdate =(date3[2] + '-' + date3[1] + '-' + date3[0]).toString();
}
</script>
<script type="text/javascript">
function script1() {
window.open('GLHelp/help_coaledger.php','BIMS','width=500,height=600,toolbar=no,menubar=yes,scrollbars=no,resizable=no');
}
</script>
<footer>
<div class="float-left">
<a href="#" class="button" onClick="script1()">Help</a>
<a href="javascript:void(0)" class="button">About</a>
</div>
<div class="float-right">
<a href="#top" class="button"><img src="images/icons/fugue/navigation-090.png" width="16" height="16"> Page top</a>
</div>
</footer>
<!--[if lt IE 8]></div><![endif]-->
<!--[if lt IE 9]></div><![endif]-->
</body>
</html>