-
Notifications
You must be signed in to change notification settings - Fork 0
/
earnings.php
189 lines (169 loc) · 7.07 KB
/
earnings.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
if(!isset($_SESSION)){
session_start();
}
$access_roles = [1];
if(! in_array($_SESSION['login'],$access_roles)){
header("location: login.php");
die();
}
require_once("config.php");
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=2, viewport-fit=cover" />
<meta name="description" content="في هذه الصفحة الرئيسية لشركة النهر تستطيع ان تتعرف على الطلبيات الخاصة بك الواصة والراجعة والكثير من المعلومات">
<meta name="الصفحة الرئيسية للعميل" property="og:title" content="معلومات متكاملة للعميل في هذه الصفحة خاصة بعملاء شركة النهر">
<title>شركة النهر للحلول البرمجية</title>
<link href="https://fonts.googleapis.com/css?family=Cairo:300,300i,400,400i,500,500i,700,700i,900,900i|Source+Sans+Pro:300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="styles/style.css">
<link rel="stylesheet" type="text/css" href="styles/framework.css">
<link rel="stylesheet" type="text/css" href="styles/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="fonts/css/fontawesome-all.min.css">
<link rel="stylesheet" type="text/css" href="styles/datapicker.css">
<!-- load header -->
<style type="text/css">
#search{
}
#start {
}
#end{
}
.tit {
}
.val {
}
</style>
</head>
<body class="theme-light" data-background="none" data-highlight="red2">
<div id="page">
<!-- load main header and footer -->
<div id="page-preloader">
<div class="loader-main"><div class="preload-spinner border-highlight"></div></div>
</div>
<?php include_once('top-menu.php');?>
<?php include_once('footer-menu.php');?>
<div class="page-content header-clear-medium">
<div class="content">
<form id="searchForm">
<div class="col-12">
<div class="input-group mb-2 ">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">من</span>
</div>
<input type="text" name="start" id="startdate" value="<?php echo date('Y-m-d',strtotime(' - 31 day'));?>" class="datepicker form-control" placeholder="من">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">الى</span>
</div>
<input type="text" name="end" id="enddate" value="<?php echo date('Y-m-d',strtotime(' + 1 day'));?>" class="datepicker form-control" placeholder="الى">
</div>
<div class="input-group mb-2">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">السوق</span>
</div>
<select class="form-control" id="store" name="store">
<option>--- اختر السوق ---</option>
</select>
</div>
<div class="input-group">
<button onclick="earnings()" class="btn form-control btn btn-success" type="button" value="">
بحث
</button>
</div>
</div>
<!-- <input type="hidden" name="currentPage" id="currentPage" value="1">-->
</form>
</div>
<div class="content-boxed">
<div class="content bottom-0">
<h3 class="bolder text-right">المعلقه</h3>
</div>
<div id="inprocess">
</div>
<div class="content bottom-0">
<h3 class="bolder text-right">الكشوفات</h3>
</div>
<div id="earnings">
<h4 class="text-danger">لايوجد كشف للفتره الزمنيه المحدده</h4>
</div>
</div>
<!-- load footer -->
<div id="footer-loader"></div>
</div>
</div>
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/plugins.js"></script>
<script type="text/javascript" src="scripts/custom.js"></script>
<script type="text/javascript" src="scripts/moneyformat.js"></script>
<script type="text/javascript" src="scripts/datapicker.js"></script>
<script type="text/javascript" src="scripts/getStores.js"></script>
<script>
$('#startdate').datepicker({ format: 'yyyy-mm-dd'});
$('#enddate').datepicker({ format: 'yyyy-mm-dd'});
getStores($('#store'));
function earnings(){
$.ajax({
url:"php/_recivedOrders.php",
type:"POST",
data:$("#searchForm").serialize(),
beforeSend:function(){
$("#earnings").addClass("loading");
$("#inprocess").addClass("loading");
},
success:function(res){
$("#earnings").html("");
$("#inprocess").html("");
$("#earnings").removeClass("loading");
$("#inprocess").removeClass("loading");
console.log(res);
if(res.data.income == null){
res.data.income = 0;
}
if(res.data.dev == null){
res.data.dev = 0;
}
if(res.data.client_price == null){
res.data.client_price = 0;
}
$("#inprocess").append(
'<div class="clear text-right" >'+
'<div class="content-boxed bottom-20">'+
'<div class="content bottom-15">'+
'<div class="col-sm-12"><span class="tit col-sm-6">عدد الطلبات : </span><span class="val col-6">'+res.data.orders+'</span></div>'+
'<div class="col-sm-12"><span class="tit col-sm-6">المبلغ الكلي: </span><span class="val col-6">'+formatMoney(res.data.income)+'</span></div>'+
'<div class="col-sm-12"><span class="tit col-sm-6">المبلغ التوصيل: </span><span class="val col-6">'+formatMoney(res.data.dev)+'</span></div>'+
'<div class="col-sm-12"><span class="tit col-sm-6">المبلغ الصافي: </span><span class="val col-6">'+formatMoney(res.data.client_price)+'</span></div>'+
'</div>'+
'</div>'+
'</div>'
);
$.each(res.invoice,function(){
$("#earnings").append(
'<a href="invoiceVeiwer.php?invoice='+this.path+'">'+
'<div class="clear text-right" >'+
'<div class="content-boxed bg-green1-light bottom-20">'+
'<div class=" content bottom-15">'+
'<h5 class="color-black text-center">كشف يوم ('+this.in_date+')</h5>'+
'<h6 class="text-center top-5 bottom-0">'+this.store_name+'</h6>'+
'<p class="text-center bold font-14 top-5 bottom-0">'+this.orders+' طلبيه</p>'+
'</div>'+
'</div>'+
'</div>'+
'</a>'
)
});
},
error:function(e){
console.log(e);
$("#earnings").removeClass("loading");
$("#inprocess").removeClass("loading");
}
});
}
earnings();
</script>
</body>
</html>