script type text javascript src php print mosConfig_live_site includes

  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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
script type="text/javascript" src="<?php print $mosConfig_live_site;?>/includes/js/jquery.pack.js"></script>
<script type="text/javascript">
<!--
function toggle_check(id)
{
var disabled = $('input:text', '#'+id).attr('disabled');
$('input:text', '#'+id).attr({disabled: !disabled});
}
//-->
</script>
<?php
# Don't allow direct linking
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// конфигурационный файл
require_once($mosConfig_absolute_path . '/administrator/components/com_mau/config.mau.php');
// общий класс
require_once($mosConfig_absolute_path . '/administrator/components/com_mau/mau.class.php');
// обрабатываем присланные параметры в запросе GET
$data = array();
foreach($_GET as $key=>&$get)
{
$get = mysql_escape_string(strip_tags($get));
$data[$key] = htmlspecialchars($get, ENT_QUOTES, 'windows-1251');
}
// дата начала периода
$start = strtotime(MAu::date_format($data['start']));
if($start != -1 && !empty($data['start']))
{
$data['start'] = date('d.m.Y', $start);
}
else
{
$data['start'] = date('d.m.Y', strtotime('-6 day'));
}
// дата конца периода
$finish = strtotime(MAu::date_format($data['finish']));
if($finish != -1 && !empty($data['finish']))
{
$data['finish'] = date('d.m.Y', $finish);
}
else
{
$data['finish'] = date('d.m.Y');
}
// сортировка
if(!in_array($data['sort'], array('about', 'title', 'date')))
{
$data['sort'] = 'about';
}
if(!in_array($data['order'], array('asc', 'desc')))
{
$data['order'] = 'asc';
}
if(!empty($data['id']))
{
$params = array
(
'table' => 'auctions',
'where' => '`id` = '.$data['id'],
);
$mau = new MAu();
$item = $mau->get($params);
$item = array_shift($item['rows']);
$params = array
(
'table' => 'auction_files',
'where' => '`id_auction` = '.$data['id'],
);
$mau = new MAu();
$files = $mau->get($params);
if(!empty($item)):
?>
<b>Предмет контракта:<br><?php print $item['title']?></b>
<table border="0" cellspacing="2" cellpadding="3">
<tr>
<td>Дата проведения:</td>
<td><?php print date('d.m.Y', strtotime($item['start']));?>&nbsp;-&nbsp;<?php print date('d.m.Y', strtotime($item['finish']));?></td>
</tr>
<tr>
<tr>
<td>Статус:</td>
<td><?php print $statuses[$item['status']]['title'];?></td>
</tr>
</tr>
<tr>
<td>Форма торгов:</td>
<td><?php print $methods[$item['method']]['title'];?></td>
</tr>
<tr>
<td>Номер извещения:</td>
<td><?php print $item['about'];?></td>
</tr>
</table><br>
<?php if(!empty($files['rows'])):?>
<b>Документация</b><br>
<table width="50%" border="0" cellspacing="2" cellpadding="3">
<?php foreach($files['rows'] as $file):?>
<tr>
<td><a href="<?php print MAU_FILES_HREF.$file['file'];?>"><?php print $file['title'];?></a></td>
<td><?php print date('d.m.Y', strtotime($file['date']));?></td>
<td><?php print number_format($file['size'] / 1024, 0, '.', ' ');?> Кб</td>
</tr>
<?php endforeach;?>
</table>
<?php endif;?>
<?php
else:
?>
Извините, указанная Вами страница не найдена. Вернитесь на <a href="<?php print $mosConfig_live_site;?>">главную страницу</a> сайта либо воспользуйтесь поиском.
<?php
endif;
}
// общий список закупок
else
{
// формируем фильтр для запроса к БД
$where = '';
if(!empty($data['status'])) $where[] = '`status` = '.$data['status'];
if(!empty($data['method'])) $where[] = '`method` = '.$data['method'];
if(!empty($start) && !empty($data['use_date'])) $where[] = '`start` >= "'.date('Y-m-d', $start).'"';
if(!empty($finish) && !empty($data['use_date'])) $where[] = '`finish` <= "'.date('Y-m-d', $finish).'"';
if(!empty($data['title'])) $where[] = '`title` LIKE "%'.$data['title'].'%"';
if(!empty($data['about'])) $where[] = '`about` LIKE "%'.$data['about'].'%"';
$page = max(0, intval($data['page']));
$params = array
(
'table' => 'auctions',
'order' => ( $data['sort']=='date' ? '`start` '.$data['order'].', `finish` '.$data['order'] : '`'.$data['sort'].'` '.$data['order']),
'limit' => array('offset'=>($page * $parameters['items_on_page']), 'limit'=>$parameters['items_on_page']),
'count' => true,
);
if(!empty($where))
{
$params['where'] = implode(' AND ', $where);
}
$mau = new MAu();
$items = $mau->get($params);
// общий вид строки с GET - запросом
$link = 'index.php?option='.$option.'&amp;Itemid='.$Itemid;
foreach(array('method', 'status', 'title', 'about', 'use_date') as $el)
{
if(!empty($data[$el]))
{
$link .= '&amp;'.$el.'='.$data[$el];
}
}
!empty($data['use_date']) ? $link .= '&amp;start='.$data['start'].'&amp;finish='.$data['finish'] : null;
// получаем листер
$lister = MAu::get_lister($items['count'], $parameters['items_on_page'], $page);
//var_dump($lister);
?>
<h1><?php print $parameters['pageTitle'];?></h1>
<div class="contentpane">
<form name="filters" action="<?php print sefRelToAbs('index.php?option='.$option.'&amp;Itemid='.$Itemid);?>" method="get">
<input type="hidden" name="option" value="<?php print $option;?>" />
<input type="hidden" name="Itemid" value="<?php print $Itemid;?>" />
<div align="center">
<table width="50%" border="0" cellspacing="2" cellpadding="3">
<tr>
<td>Способ размещения:</td>
<td align="left">
<select name="method">
<option value="0">все</option>
<?php foreach($methods as $id=>$val):?>
<option value="<?php print $id;?>" <?php print ($data['method']==$id?'selected="selected"':'');?>><?php print $val['title'];?></option>
<?php endforeach;?>
</select>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Статус:</td>
<td align="left">
<select name="status">
<option value="0">все</option>
<?php foreach($statuses as $id=>$val):?>
<option value="<?php print $id;?>" <?php print ($data['status']==$id?'selected="selected"':'');?>><?php print $val['title'];?></option>
<?php endforeach;?>
</select>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Дата проведения:</td>
<td align="left" id="date">
<input type="checkbox" name="use_date" value="1" <?php print (!empty($data['use_date'])?'checked="checked"':'');?> onclick="javascript: toggle_check('date');" />
с <input type="text" name="start" value="<?php print $data['start'];?>" <?php print (!empty($data['use_date'])?'':'disabled="disabled"');?> size="9"/>
по <input type="text" name="finish" value="<?php print $data['finish'];?>" <?php print (!empty($data['use_date'])?'':'disabled="disabled"');?> size="9"/>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Предмет контракта:</td>
<td align="left"><input type="text" name="title" value="<?php print $_GET['title'];?>" style="width:100%;" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Номер извещения:</td>
<td align="left"><input type="text" name="about" value="<?php print $_GET['about'];?>" style="width:100%;" /></td>
<td><input type="submit" value="Найти"/></td>
</tr>
</table>
</div>
</form>
<div>Всего найдено закупок: <span><?php print $items['count'];?></span>.</div><br>
<?php
ob_start();
?>
<div class="pager">
Страницы (<?php print ceil($items['count'] / $parameters['items_on_page']);?>):
<?php
foreach($lister['text'] as $el):
if(!empty($el['link'])):
?>
<a href="<?php print $link.'&amp;sort='.$data['sort'].'&amp;order='.$data['order'].'&amp;'.$el['link'];?>"><?php print $el['title'];?></a>
<?php else:?>
<span><?php print $el['title'];?></span>
<?php
endif;
endforeach;?>
<div class="pages">
<?php
foreach($lister['digit'] as $el):
if(!empty($el['link'])):
?>
<a href="<?php print $link.'&amp;sort='.$data['sort'].'&amp;order='.$data['order'].'&amp;'.$el['link'];?>"><?php print $el['title'];?></a>
<?php else:?>
<span><?php print $el['title'];?></span>
<?php
endif;
endforeach;?>
</div>
</div><br>
<?php
$pager = ob_get_clean();
print $pager;
?>
<table class="orders" width="100%">
<tr>
<th><nobr>&nbsp;</nobr></th>
<th><nobr><a href="<?php print $link.'&amp;sort=about&amp;order='.($data['order']=='asc'?'desc':'asc');?>"><br>Номер<br>извещения</a><?php ($data['sort']=='about') ? print ($data['order']=='asc' ? '&uarr;' : '&darr;') : null;?></nobr></th>
<th><nobr><a href="<?php print $link.'&amp;sort=title&amp;order='.($data['order']=='asc'?'desc':'asc');?>">Предмет контракта,начальная (максимальная) цена</a>&nbsp;<?php ($data['sort']=='title') ? print ($data['order']=='asc' ? '&uarr;' : '&darr;') : null;?></nobr></th>
<th><nobr><a href="<?php print $link.'&amp;sort=date&amp;order='.($data['order']=='asc'?'desc':'asc');?>"><br>Дата начала<br> подачи заявок </a>&nbsp;<?php ($data['sort']=='date') ? print ($data['order']=='asc' ? '&uarr;' : '&darr;') : null;?></nobr></th>
<th><nobr><a href="<?php print $link.'&amp;sort=date&amp;order='.($data['order']=='asc'?'desc':'asc');?>"><br>Дата окончания<br> приема заявок</a>&nbsp;<?php ($data['sort']=='date') ? print ($data['order']=='asc' ? '&uarr;' : '&darr;') : null;?></nobr></th>
<th><br>Форма<br>торгов</th>
</tr>
<?php foreach(array_values($items['rows']) as $key=>$item):
if ($key%2==0) {?>
<tr style=background-color:#7cd5ff>
<td><center></center></td>
<td><center><?php print $item['about'];?></center></td>
<td><center><a href="<?php print sefRelToAbs('index.php?option='.$option.'&amp;Itemid='.$Itemid.'&amp;id=' . $item['id']);?>"><?php print $item['title'];?></a><center></td>
<td><center><?php print date('d.m.Y', strtotime($item['start']));?></center></td>
<td><center><?php print date('d.m.Y', strtotime($item['finish']));?></center></td>
<td><center><?php print $methods[$item['method']]['title'];?></center></td>
</tr>
<?php
}
else {?>
<tr>
<td><center></center></td>
<td><center><?php print $item['about'];?></center></td>
<td><center><a href="<?php print sefRelToAbs('index.php?option='.$option.'&amp;Itemid='.$Itemid.'&amp;id=' . $item['id']);?>"><?php print $item['title'];?></a><center></td>
<td><center><?php print date('d.m.Y', strtotime($item['start']));?></center></td>
<td><center><?php print date('d.m.Y', strtotime($item['finish']));?></center></td>
<td><center><?php print $methods[$item['method']]['title'];?></center></td>
</tr>
<?php
}
endforeach;?>
</table><br>
</div>
<?php
print $pager;
}
?>