public function get_project($project_id, $member_id = "") { try { $sql = "SELECT * FROM project WHERE id = :id limit 1"; $stmh = $this->pdo->prepare($sql); $stmh->bindValue(':id', $project_id, PDO::PARAM_INT); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); $row['action'] = 0; if ($member_id != "") { $ActionModel = new ActionModel(); if ($ActionModel->check_member_action($member_id, $project_id)) { $row['action'] = 1; } } $ViewModel = new ViewModel(); $project = $ViewModel->get_project_type(); $area = $ViewModel->get_area_type(); $company = $ViewModel->get_company_name(); $row['project_type'] = $project[$row['project_type']]; $row['area_type'] = $area[$row['area_type']]; $row['company_name'] = $company[$row['company_id']]; } catch (PDOException $Exception) { print "エラー" . $Exception->getMessage(); } return $row; }