<?php $oOffer = new Offer(); $oOfferImage = new OfferImage(); $offerAll = $oOffer->findAllFrom("Offer", "1=1 order by sequence"); //1st Room //8th Room $idx = 1; if ($oOffer->countFrom('Offer', "1=1") > 0) { foreach ($offerAll as $offer) { $offergalleries = $oOfferImage->findByOfferId($offer->id); ?> <div class="col-full-room" id="room-full-0<?php echo $idx; ?> "> <div class="col-room-half slider offer-slick room-gallery <?php if ($idx == 2 || $idx == 4) { echo 'even'; } ?> " id=""> <div><img src="<?php echo URL_PUBLIC; ?> public/offer/images/<?php echo $offer->filename; ?> " /></div>
public function edit($id) { if (!($offer = Offer::findById($id))) { Flash::set('error', __('Offer not found!')); redirect(get_url('offer')); } // check if trying to save if (get_request_method() == 'POST') { return $this->_edit($id); } $offergalleries = OfferImage::findByOfferId($id); //$features = FeatureImage::findByOfferId($id); $this->display('offer/edit', array('action' => 'edit', 'csrf_token' => SecureToken::generateToken(BASE_URL . 'offer/edit/' . $id), 'offer' => $offer, 'offergalleries' => $offergalleries, 'id' => $id, 'pages' => Record::findAllFrom('Page', 'parent_id=1 order by parent_id,position'))); }