-
Notifications
You must be signed in to change notification settings - Fork 0
/
Report_InternetSalesProfitMonthly.php
159 lines (139 loc) · 6.39 KB
/
Report_InternetSalesProfitMonthly.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html lang="en">
<head>
<?php
set_time_limit(300); //300 seconds, 5 minutes
include('general.php');
//include('dbconnect.php');
include('Report_InternetSalesProfitcodeMonthly.php');
putLinks();
session_start();
if( strcasecmp($_SERVER['REQUEST_METHOD'],"POST") === 0) {
$_SESSION['postdata'] = $_POST;
header("Location: ".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']);
exit;
}
if( isset($_SESSION['postdata'])) {
$_POST = $_SESSION['postdata'];
unset($_SESSION['postdata']);
}
?>
<title>Internet Services:Monthly Profit - Chromis BackOffice</title>
</head>
<body>
<header class="site__header island">
<div class="wrap">
<span id="animationSandbox" style="display: block;" class="tada animated">
<h1 class="site__title mega text-center">Internet Services : Profit</h1>
<h2 class="site__title mega text-center">Monthly</h2>
</span>
</div>
</header>
<form action="Report_InternetSalesProfitMonthly.php" method="post" enctype="multipart/form-data" >
<div class="row">
<div class="form-group">
<div class="col-lg-4 text-right"></div>
<div class="col-lg-4 text-right">
<a class="glyphicon glyphicon-home" style="font-size:30px;color:orange" href="/chromisphp/"></a>
<div class="input-group date form_monthly" data-date="" data-date-format="MM yyyy" data-link-field="dtp_input1" data-link-format="mm/yyyy">
<input class="form-control" size="16" type="text" value="" readonly>
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>
<input type="hidden" name="dtp_input1" id="dtp_input1" value="" />
<!--</div>-->
<!---->
<div class="input-group date form_monthly" data-date="" data-date-format="MM yyyy" data-link-field="dtp_input2" data-link-format="mm/yyyy">
<input class="form-control" size="16" type="text" value="" readonly>
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>
<input type="hidden" name="dtp_input2" id="dtp_input2" value="" />
<!--</div>-->
<!---->
<!-- <div class="checkbox">
<label>
<input type="checkbox" id="chkAllSales" name="chkAllSales" value="All"> All Profit Till Date
</label>
</div> -->
<br />
<button type="submit" class="btn btn-success" id="btnReport" name="btnReport" >Run Report</button>
<button type="submit" class="btn btn-warning" id="btnClear" name="btnClear" >Clear</button>
</div>
<br />
</div>
<div class="col-lg-4"></div>
</div>
</form>
<br />
<?php
if (isset($_POST['btnReport']))
{
//displayMessage($_POST['dtp_input1']);
// echo "<meta http-equiv='refresh' content='0'>";
if ((!empty($_POST['dtp_input1'])) && (!empty($_POST['dtp_input2'])))
{
$date1 = date($_POST['dtp_input1']);
$date2 = date($_POST['dtp_input2']);
$cDate1 = ("01/" . $_POST['dtp_input1']);
$cDate2 = ("01/" . $_POST['dtp_input2']);
$d1 = date_parse_from_format("mmyyyy", $cDate1);
$d2 = date_parse_from_format("mmyyyy", $cDate2);
$m1 = $d1["month"];
$m2 = $d2["month"];
$y1 = $d1["year"];
$y2 = $d2["year"];
//displayMessage("M1: $m1 | M2: $m2 | Y1: $y1 | Y2: $y2");
if($y2 >= $y1)
{
// if ($m2 >= $m1)
// {
//displayMessage('Date 1: ' . $date1 . '\n' . 'Date 2: ' . $date2);
echo "<span class=\"label label-info\">Fiter Date: $date1 - $date2</span>";
profitDateFilter("01/" . $date1,"01/" . $date2);
// }
}
else
{
echo "<span class=\"label label-warning\">Invalid Filter</span>";
displayMessage('Invalid date selection');
}
}
elseif ((!empty($_POST['dtp_input1'])) && (empty($_POST['dtp_input2'])))
{
# code...
$date1 = date($_POST['dtp_input1']);
echo "<span class=\"label label-info\">Fiter Date: $date1</span>";
//displayMessage('Date 2 empty!');
profitDateFilter($date1,'');
}
elseif ((empty($_POST['dtp_input1'])) && (!empty($_POST['dtp_input2'])))
{
# code...
echo "<span class=\"label label-warning\">Invalid Filter</span>";
displayMessage('Invalid date selection');
}
else {
# code...
echo "<span class=\"label label-info\">Filter: Profit Till Date</span>";
profitDateFilter('','');
}
//profitTillDate();
}
if (isset($_POST['btnClear']))
{
//php code here
echo "<meta http-equiv='refresh' content='0'>";
}
?>
<!-- </div>
<div class="col-lg-1"></div>
</div>-->
<?php
//include('general.php');
putScripts();
putDatePickerScript();
stickfooter();
?>
</body>
</html>