-
Notifications
You must be signed in to change notification settings - Fork 19
/
batch_query.php
57 lines (48 loc) · 1.31 KB
/
batch_query.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
<?php
/***
*
* This file is part of the fnacMarketPlace API Client GUI.
* (c) 2013 Fnac
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* ------------------------------------
* Fnac Api Gui : Batch Query Component
*
* @desc This page displays the current seller's offers update batches
*
* @author Somaninn Prok <[email protected]>
*
*/
require_once __DIR__.'/autoload.php';
use FnacApiClient\Client\SimpleClient;
use Symfony\Component\HttpFoundation\Request;
use FnacApiGui\Controller\BatchController;
use FnacApiGui\Model\BatchQueryModel;
use FnacApiGui\View\BatchQueryView;
$client = new SimpleClient();
$client->init(__DIR__.'/config/config.yml');
$m = new BatchQueryModel();
$c = new BatchController($m, $client);
$v = new BatchQueryView($c, $m);
$request = Request::createFromGlobals();
$query = $request->query;
// Display batch details of a given batch_id
if($query->get('batch_id') != null)
{
$c->loadBatchStatusData($query->get('batch_id'));
}
// Display currently running or enqueued (active) batches
else
{
if($query->get('show_recent') != null)
{
$c->loadRecentBatchQueryData();
}
else {
$c->loadBatchQueryData();
}
}
echo $v->output();
?>