~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Controller/Stats.php

  • Committer: Dan Garner
  • Date: 2015-08-14 08:10:12 UTC
  • mfrom: (447.1.48)
  • Revision ID: git-v1:11ef90e0c8e85375d5f62b0f987a1e02b808f6ea
Merge pull request #97 from dasgarner/feature/playlists

First test fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
            // List of Media this user has permission for
43
43
            'media' => MediaFactory::query(),
44
44
            'defaults' => [
45
 
                'fromDate' => Date::getLocalDate(time() - (86400 * 35), 'Y-m-d'),
46
 
                'fromDateOneDay' => Date::getLocalDate(time() - 86400, 'Y-m-d'),
47
 
                'toDate' => Date::getLocalDate(null, 'Y-m-d')
 
45
                'fromDate' => Date::getLocalDate(time() - (86400 * 35)),
 
46
                'fromDateOneDay' => Date::getLocalDate(time() - 86400),
 
47
                'toDate' => Date::getLocalDate()
48
48
            ]
49
49
        ];
50
50
 
85
85
     */
86
86
    public function grid()
87
87
    {
88
 
        $fromDt = Date::getTimestampFromString(Sanitize::getString('fromdt'));
89
 
        $toDt = Date::getTimestampFromString(Sanitize::getString('todt'));
90
 
        $displayId = Sanitize::getInt('displayid');
91
 
        $mediaId = Sanitize::getInt('mediaid');
 
88
        $fromDt = Date::getTimestampFromString(Sanitize::getString('fromDt'));
 
89
        $toDt = Date::getTimestampFromString(Sanitize::getString('toDt'));
 
90
        $displayId = Sanitize::getInt('displayId');
 
91
        $mediaId = Sanitize::getInt('mediaId');
92
92
 
93
93
        // What if the fromdt and todt are exactly the same?
94
94
        // in this case assume an entire day from midnight on the fromdt to midnight on the todt (i.e. add a day to the todt)
176
176
 
177
177
    public function availabilityData()
178
178
    {
179
 
        $fromDt = Date::getTimestampFromString(Sanitize::getString('fromdt'));
180
 
        $toDt = Date::getTimestampFromString(Sanitize::getString('todt'));
181
 
        $displayId = Sanitize::getInt('displayid');
 
179
        $fromDt = Date::getTimestampFromString(Sanitize::getString('fromDt'));
 
180
        $toDt = Date::getTimestampFromString(Sanitize::getString('toDt'));
 
181
        $displayId = Sanitize::getInt('displayId');
182
182
 
183
183
        // Get an array of display id this user has access to.
184
184
        $displayIds = array();
247
247
     */
248
248
    public function bandwidthData()
249
249
    {
250
 
        $fromDt = Date::getTimestampFromString(Sanitize::getString('fromdt'));
251
 
        $toDt = Date::getTimestampFromString(Sanitize::getString('todt'));
 
250
        $fromDt = Date::getTimestampFromString(Sanitize::getString('fromDt'));
 
251
        $toDt = Date::getTimestampFromString(Sanitize::getString('toDt'));
252
252
 
253
253
        // Get an array of display id this user has access to.
254
254
        $displayIds = array();
359
359
        // We are expecting some parameters
360
360
        $fromDt = Date::getIsoDateFromString(Sanitize::getString('fromDt'));
361
361
        $toDt = Date::getIsoDateFromString(Sanitize::getString('toDt'));
362
 
        $displayId = Sanitize::getInt('displayid');
 
362
        $displayId = Sanitize::getInt('displayId');
363
363
 
364
364
        if ($fromDt == $toDt) {
365
365
            $toDt = date("Y-m-d", strtotime($toDt) + 86399);