public function getImageInfo() { $id = (int) $_POST['id']; if (!isset($id) || empty($id)) { echo json_encode(array('success' => false, 'message' => 'Invalid or empty ID')); exit; } //get image info $model = new GalleryModel(); $imageInfo = $model->getTempById($id); if ($imageInfo) { $this->jsonResponseOutput(array('success' => true, 'image' => $imageInfo)); } else { $this->jsonResponseOutput(array('success' => false, 'message' => 'Could not get the image info')); } }