$package_id = filter_var($_REQUEST['package_id'], FILTER_VALIDATE_INT);
if ( $package_id ) {
$package = Toolkit_Packages_Package::fetchById(
- Toolkit_Database::getInstance(),
+ Toolkit_Database::getInstance(),
$package_id
);
- $output = '<div id="pDetailContainer" class="row">'
- . '<div class="small-12 columns">';
- $output .='<h1>' . $package->getTitle() . '</h1>';
- if ( $package->getImage() ) {
- $output .= '<img class="pDetailImg" src=" ' . ROTATING_IMAGE_RESIZED . $package->getImage() . '">';
+ if ( is_object( $package ) && $package instanceof Toolkit_Packages_Package ) {
+ $output = '<div id="pDetailContainer" class="row">'
+ . '<div class="small-12 columns">';
+ $output .='<h1>' . $package->getTitle() . '</h1>';
+ if ( $package->getImage() ) {
+ $output .= '<img class="pDetailImg" src=" ' . ROTATING_IMAGE_RESIZED . $package->getImage() . '">';
+ }
+ $output .= '</div><div class="pBanners small-centered small-12 columns">';
+ $output .= '<div class="pSavings">'.$package->getSavings().'</div>';
+ $output .= '<div class="pDates">'.$package->getDateRange().'</div>';
+ $output .= '</div><div class="small-12 columns">';
+ $output .= $package->getDescription();
+ $output .= '</div>';
+ $output .= '</div>';
}
- $output .= '</div><div class="pBanners small-centered small-12 columns">';
- $output .= '<div class="pSavings">'.$package->getSavings().'</div>';
- $output .= '<div class="pDates">'.$package->getDateRange().'</div>';
- $output .= '</div><div class="small-12 columns">';
- $output .= $package->getDescription();
- $output .= '</div>';
- $output .= '</div>';
}
echo $output;
?>
-</div>
\ No newline at end of file
+</div>