/
historyResults.php
249 lines (188 loc) · 6.82 KB
/
historyResults.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<?php
//------------------------------------------------------------------------------
// Author: Denise
// Date : november/2003 //TARGET="_blank"
//------------------------------------------------------------------------------
// Includes
//include("dbglobals.inc.php");
include("session_mysql.php");
// Session
session_start();
sess_gc(get_cfg_var("session.gc_maxlifetime"));
include_once("globals.php");
include_once("request.class.php");
include_once("user.class.php");
import_request_variables("gpc");
// Set Language
if (isset($SESSION_LANGUAGE))
$_SESSION['userLang']=$SESSION_LANGUAGE;
else
if (!isset($_SESSION['userLang'])) $_SESSION['userLang']='PT';
require ("history_".$_SESSION['userLang'].".php");
//require ("cart_".$_SESSION['userLang'].".php");
//require ("arrays_".$_SESSION['userLang'].".php");
// Globals
$dbcat = $GLOBALS["dbcatalog"];
$dbusercat = $GLOBALS["dbusercat"];
// Search for user name
$objUser = new User($dbusercat);
$objUser->selectByUserId($userid);
// Setting Dates
$dateIni = date("Y-m-d H:i:s", mktime (0,0,0,$IDATEM,1,$IDATEY));
if($FDATEM==2)
$dayMonth = checkdate($FDATEM,29,$FDATEY) ? 29 : 28;
else
$dayMonth = checkdate($FDATEM,31,$FDATEY) ? 31 : 30;
$dateEnd = date("Y-m-d H:i:s", mktime (23,59,59,$FDATEM,$dayMonth,$FDATEY));
// Verifying the search arguments
if ($option=="all") $option = '';
if ($option=="closed") $option = 'D';
if ($option=="open") $option="*";
// echo " dateIni = " . $dateIni . " dateEnd = " . $dateEnd ;
$nReg = 0;
if(trim($reqId!=""))
{
$nReg = searchReqByNumber($dbcat, $objReq,'', "", "", $reqId);
if($nReg and $objReq[0]->userId != $userid) $nReg=0;
}
else
$nReg = searchReqByGeneric($dbcat, $objReq, '', '', "", "", "", $dateIni, $dateEnd, $objUser->fullname, $objUser->fullname);
?>
<html>
<head>
<title><?=$strHistory?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Página principal do site da DGI (Divisão de Geração de Imagem)">
<meta name="author" content="Desenvolvimento Web - DGI">
<!-- Estilos -->
<link href="/catalogo/css/bootstrap.css" rel="stylesheet">
<link href="/catalogo/css/style.css" rel="stylesheet">
<link href="/catalogo/css/camera.css" rel="stylesheet">
<link href="/catalogo/css/icons.css" rel="stylesheet">
<!--
O arquivo abaixo define o configuração de cores a serem utilizadas
As opções disponíveis são:
skin-blue.css skin-green.css skin-red.css
skin-bluedark.css skin-green2.css skin-red2.css
skin-bluedark2.css skin-grey.css skin-redbrown.css
skin-bluelight.css skin-khaki.css skin-teal.css
skin-bluelight2.css skin-lilac.css skin-teal2.css
skin-brown.css skin-orange.css skin-yellow.css
skin-brown2.css skin-pink.css
-->
<link href="/catalogo/css/skin-blue.css" rel="stylesheet">
<link href="/catalogo/css/bootstrap-responsive.css" rel="stylesheet">
<script type="text/javascript">
function chamaVerPedido(parametroPedido)
{
top.verPedido(parametroPedido);
return false;
}
</script>
<!--?php include("css.php");?-->
</head>
<body>
<!--
Layout macro do site
As opções são:
boxed Toda estrutura do site encaixada em uma espécie de caixa, possuindo largura
wide Toda estrutura do site utilizando-se de toda a área disponivel, não possuindo margens
-->
<body class="wide" style="background-color:transparent; border-left:thin;border-left-color:#FFF; border-right-width:medium; border-right-color:#C03; border-top:thin; background-size: cover; position: relative; padding: 0px 0 0px; height:100%; padding-bottom:0px;">
<!--
Inicio da área principal
class body
-->
<div class="body" style="background-color:#FFFFFF; border-left:solid thin #FFF;border-left-color:#FFF; border-left-width:thin; border-right:solid thin #FFF;border-right-width:thin; border-right-color:#FFF; border-top:none; border-bottom:none; padding: 0px 0 0px; padding-bottom:0px;">
<div class="row-fluid" style="background-color:#FFFFFF;">
<br>
<form name="historySearch" method="POST" action="historyResults.php">
<?php
if(!$nReg)
{
?>
<br><h1 align="center"><?=$strNoItems?><h1>
<?
} else
{
?>
<!--br><h3 align="center"><?=$strUserReqs?><?=$objUser->fullname?><h3-->
<div><center>
<!--input type="submit" value="<?=$strUpdate?>" name="action" ONCLICK="window.location.href = 'historyResults.php'"-->
<table width="90%" align="center" cellpadding="1" cellspacing="1" class="table table-hover">
<thead>
<tr>
<th><?=$strReqNumber?></th>
<th><?=$strReqDate?></th>
<th><?=$strReqItens?></th>
<th><?=$strReqItensDone?></th>
<th><?=$strReqAction?></th>
</tr>
</thead>
<tbody>
<?php
// Loop for requests
$oneatleast = false;
for ($i=0; $i<$nReg;$i++)
{
if((trim($option)=="") or ($objReq[$i]->status == $option) or ($option=='*' and $objReq[$i]->status!='D'))
{
$oneatleast = true;
?>
<tr>
<td align="center"><?=$objReq[$i]->reqId?></td>
<td align="center"><?=$objReq[$i]->reqDate?></td>
<td align="center"><?=$objReq[$i]->nItens?></td>
<td align="center"><?=$objReq[$i]->nItensDone?></td>
<td align="center"><a href="historyDetails.php?reqId=<?=$objReq[$i]->reqId?>"><?=$strReqDetails?></a></td>
</tr>
<?php
}
}
?>
<input type=hidden name=userid value=<?=$userid?>>
<input type=hidden name=reqId value=<?=$reqId?>>
<input type=hidden name=option value=<?=$option?>>
<input type=hidden name=IDATEM value=<?=$IDATEM?>>
<input type=hidden name=IDATEY value=<?=$IDATEY?>>
<input type=hidden name=FDATEM value=<?=$FDATEM?>>
<input type=hidden name=FDATEY value=<?=$FDATEY?>>
</tbody>
</table>
</form>
<?php
if ( $nReg > 0 )
{
?>
<br>
<center>
<input type="submit" value="Atualizar Pesquisa" name="atualizar" class="btn btn-info" style="width:180px; border-radius:4px">
<input type="button" value="Retornar para Pesquisa" name="retornar" class="btn" style="width:180px; border-radius:4px" onClick="javascript:location.href='history.php'">
</center>
<?php
}
if (!$oneatleast) echo "<h3>" . $strNoItems . "<h3>";
};
?>
</div>
</div>
<!--
Final da área principal
class body
-->
<!--
Inicio da seção de importação de arquivos e definição de
códigos inline Javascript e jQuery
-->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/catalogo/js/jquery.js"></script>
<script src="/catalogo/js/bootstrap.js"></script>
<script src="/catalogo/js/plugins.js"></script>
<script src="/catalogo/js/custom.js"></script>
<!--
Final da seção de importação de arquivos e definição de
códigos inline Javascript e jQuery
-->
</body>
</html>