Example #1
0
function getGallary()
{
    global $PHOTO_BOL_PhotoService;
    global $language;
    $app = \Slim\Slim::getInstance();
    $app->response->headers->set('Content-Type', 'application/json');
    $app->response->setStatus(200);
    //Lang Call Start
    $hammu_lang_id = $app->request()->params("lang_id");
    if (!empty($hammu_lang_id)) {
        getCurrentLanguages($hammu_lang_id);
    }
    //Lang Call end
    $user_id = $app->request()->params('user_id');
    $userId = $user_id;
    $photoService = $PHOTO_BOL_PhotoService;
    $photos = $photoService->findPhotoListByUserId($userId, 1, 500);
    $photos = generatePhotoList($photos);
    if (!empty($photos) && !empty($photos['data'])) {
        $photoCount = count($photos['data']);
        $photos['response_status'] = "1";
        $photos['response_message'] = "";
        $photos['photo_count'] = "{$photoCount}";
        //$return_data = array("response_status" => "1", "response_message" => "", $photos);
        $app->response->setBody(json_encode($photos));
    } else {
        $message = $language->text("hammu", "empty_gallary");
        //"You have no photo in your gallery. Please upload photo!!"
        $return_data = array("response_status" => "0", "response_message" => $message);
        $app->response->setBody(json_encode($return_data));
    }
}
Example #2
0
function getGallary()
{
    global $PHOTO_BOL_PhotoService;
    $app = \Slim\Slim::getInstance();
    $app->response->headers->set('Content-Type', 'application/json');
    $app->response->setStatus(200);
    $user_id = $app->request()->params('user_id');
    $userId = $user_id;
    $photoService = $PHOTO_BOL_PhotoService;
    $photos = $photoService->findPhotoListByUserId($userId, 1, 500);
    $photos = generatePhotoList($photos);
    $return_data = array("response_status" => "1", "data" => $photos);
    $app->response->setBody(json_encode($return_data));
}