Staff List - TheFrozenFire/PHP-Mindbody-API-Library GitHub Wiki
A simple Staff List with CSS Classes for Bootstrap Thumbnails
Requirements TimThumb
Getting Started This should be a near drop perfect drop in if you already have the API up and running
- Update Require path to fit your needs
- Insert Your Mindbody API Credentials
- Update the See Schedule Link with the correct Studio ID. TODO Make this pull from the request
Tricks You can hide a Staff Member by Prepending the word HIDE in all caps as the first word of their bio! **TODO Make this seamless? Filter? **
require("services/Staff_Service.php");
$service = new Staff_Service();
$parameters = new GetStaff();
$parameters->Request = new GetStaffRequest();
$parameters->Request->SourceCredentials = new SourceCredentials();
$parameters->Request->SourceCredentials->SourceName = "IAMAYOGASTUDIO";
$parameters->Request->SourceCredentials->Password = "IAMAPASSWORD";
$parameters->Request->SourceCredentials->SiteIDs = array(
IAMASTUDIOID // Your Site ID(s)
);
$staff = $service->GetStaff($parameters);
$staff = $staff->GetStaffResult;
$staff = $staff->StaffMembers;
$staff = $staff->Staff;
echo '<ul class="thumbnails">';
foreach ($staff as $employee) {
$bio = explode(" ", $employee->Bio);
if (!empty($employee->Bio) && !empty($employee->ImageURL) && ($bio[0] != "HIDE")){
echo '<li class="span3"><div class="thumbnail white" >';
echo "<img src=\"timthumb.php?src=$employee->ImageURL&h=220&a=t&w=260\" alt=\"\">";
echo "<div class=\"caption\">";
echo "<h3>$employee->Name<a href='#' class='pull-right'><i class='icon-plus'></i></a></h3>";
echo "<div class='desc hide'>";
echo "<p>$employee->Bio</p>";
echo "<p><a href=\"http://clients.mindbodyonline.com/ws.asp?studioid=****IAMASTUDIOID***&stype=-7&sView=week&sTrn=$employee->ID\" class=\"btn btn-primary\">See Schedule</a></p>";
echo "</div></div></div>";
echo "</li>";
}
}
echo '</ul>';```