本文整理匯總了PHP中DbHandler::getTrainingAttendees方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbHandler::getTrainingAttendees方法的具體用法?PHP DbHandler::getTrainingAttendees怎麽用?PHP DbHandler::getTrainingAttendees使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DbHandler
的用法示例。
在下文中一共展示了DbHandler::getTrainingAttendees方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: echoRespnse
$response["Training"]["Attendees"] = $attendees;
echoRespnse(200, $response);
});
/**
* Gets the details of a particular training
* method GET
* url /trainings
*/
$app->get('/trainings/:trainingID', function ($trainingID) {
global $user_id;
$response = array();
$db = new DbHandler();
// fetch training details
$trainingResult = $db->getTraining($user_id, $trainingID);
// fetch all training attendees
$attendeesResult = $db->getTrainingAttendees($trainingID);
$response["Error"] = false;
$response["Training"] = array();
$training = $trainingResult->fetch_assoc();
$attendees = array();
while ($attendee = $attendeesResult->fetch_assoc()) {
$attendee["HasAttended"] = (bool) $attendee["HasAttended"];
array_push($attendees, $attendee);
}
$response["Training"]["TrainingID"] = $training["TrainingID"];
$response["Training"]["TrainingDate"] = $training["TrainingDate"];
$response["Training"]["IsBonus"] = (bool) $training["IsBonus"];
$response["Training"]["TeamID"] = $training["TeamID"];
$response["Training"]["Attendees"] = $attendees;
echoRespnse(200, $response);
});