<?php $oRoom = new Room(); $oRoomImage = new RoomImage(); $roomAll = $oRoom->findAllFrom("Room", "1=1 order by sequence"); $idx = 1; $index = 90; $count = 1; $title = 1; if ($oRoom->countFrom('Room', "1=1") > 0) { foreach ($roomAll as $room) { $roomgalleries = $oRoomImage->findByRoomId($room->id); $index--; if ($title == 1) { $title_m = 'first-content'; } else { $title_m = ''; } ?> <div class="col-full-room <?php echo $title_m; ?> col<?php echo $idx; ?> " id="" style="background-size:100% 100%;z-index:<?php echo $index; ?> ;"> <?php
public function edit($id) { if (!($room = Room::findById($id))) { Flash::set('error', __('Room not found!')); redirect(get_url('room')); } // check if trying to save if (get_request_method() == 'POST') { return $this->_edit($id); } $roomgalleries = RoomImage::findByRoomId($id); $features = FeatureImage::findByRoomId($id); $this->display('room/edit', array('action' => 'edit', 'csrf_token' => SecureToken::generateToken(BASE_URL . 'room/edit/' . $id), 'room' => $room, 'roomgalleries' => $roomgalleries, 'features' => $features, 'id' => $id, 'pages' => Record::findAllFrom('Page', 'parent_id=1 order by parent_id,position'))); }