예제 #1
0
 public static function getCrossfitRank($barcode)
 {
     $pdo = Database::getInstance();
     AdminRecordManage::getExercises(date("Y-m-d"));
     // 오늘한 운동들
 }
예제 #2
0
<?php

require_once __DIR__ . '/../../framework/framework.php';
$msg = array('status' => 'ok');
try {
    // if (!Utility::isManager()) throw new Exception('no previlege'); // 관리자 권한 있는지 확인
    // print_r($_POST['members']);
    // print_r($_POST['exerciseNo']);
    AdminRecordManage::insertRecord($_POST['members'], $_POST['exercise'], date('Y-m-d'));
} catch (Exception $exception) {
    $msg['status'] = 'error';
    $msg['message'] = $exception->getMessage();
    header("HTTP/1.1 410 Gone");
}
header('Content-Type: application/json');
print json_encode($msg);
예제 #3
0
<?php

require_once __DIR__ . '/../../framework/framework.php';
$msg = array('status' => 'ok');
try {
    if (!isset($_GET['requestType'])) {
        throw new Exception('no request');
    }
    if ($_GET['requestType'] === 'exercise') {
        // 오늘의 운동종류... 추후 다른 날짜를 보여줄 수 있도록 발전시키는 것이 좋지 않을까
        $msg['exercises'] = AdminRecordManage::getExercises(date("Y-m-d"));
    } else {
        if ($_GET['requestType'] === 'ranking') {
            $exercise = array('no' => $_GET['exerciseNo'], 'type' => $_GET['type']);
            $msg['rankers'] = MemberCrossfitManagement::getCrossfitRankers($exercise);
        } else {
            if ($_GET['requestType'] === 'userRecord') {
                $exercise = array('no' => $_GET['exerciseNo'], 'type' => $_GET['type']);
                $msg['recordPercent'] = MemberCrossfitManagement::getUserRecordPercent($_SESSION['barcode'], $exercise);
            } else {
                new Exception('no request');
            }
        }
    }
} catch (Exception $exception) {
    $msg['status'] = 'error';
    $msg['message'] = $exception->getMessage();
    header("HTTP/1.1 410 Gone");
}
header('Content-Type: application/json');
print json_encode($msg);
예제 #4
0
<?php

require_once __DIR__ . '/../../framework/framework.php';
$msg = array('status' => 'ok');
try {
    if (!isset($_GET['requestType'])) {
        throw new Exception('no request');
    }
    if ($_GET['requestType'] === 'exercise') {
        // 오늘의 운동종류... 추후 다른 날짜를 보여줄 수 있도록 발전시키는 것이 좋지 않을까
        $msg['exercises'] = AdminRecordManage::getExercises(date("Y-m-d"));
    } else {
        if ($_GET['requestType'] === 'member') {
            $msg['members'] = AdminRecordManage::getMembers(date("Y-m-d"), $_GET['exerciseNo'], $_GET['branch']);
        } else {
            if ($_GET['requestType'] === 'filledMember') {
                $msg['members'] = AdminRecordManage::getFilledMemebers(date("Y-m-d"), $_GET['exerciseNo'], $_GET['branch']);
            } else {
                new Exception('no request');
            }
        }
    }
} catch (Exception $exception) {
    $msg['status'] = 'error';
    $msg['message'] = $exception->getMessage();
    header("HTTP/1.1 410 Gone");
}
header('Content-Type: application/json');
print json_encode($msg);