static function getList(&$params) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('a.*')->from('#__hp_albums a')->where('a.state = 1')->order('a.id DESC'); $db->setQuery($query, 0, 12); $rs = $db->loadObjectList(); $thumb = true; if ($thumb) { foreach ($rs as &$item) { $tmp = explode('/', $item->images); $image_name = end($tmp); $imagePath = JPATH_ROOT . DS . 'images' . DS . 'albums' . DS . $item->id; // shift an el (image folder) in $tmp array_shift($tmp); // remove last el (file name) in $tmp array_pop($tmp); $image_path = $imagePath; $thumb_path = $imagePath . '/thumbs/'; $thumb_image_path = $thumb_path . DS . $image_name; @unlink($thumb_path); @JFolder::create($thumb_path); $thumbW = 100; $thumbH = 100; // create thumb if not exist //if (!file_exists($thumb_image_path) && file_exists($image_path . DS . $image_name)) JEUtil::thumbnail($image_path, $thumb_path, $image_name, $thumbW, $thumbH); $item->thumb = JURI::root() . 'images/albums/' . $item->id . '/thumbs/' . 't-' . $thumbW . 'x' . $thumbH . '-' . $image_name; } } // var_dump($rs); return $rs; }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ public function getOptions() { // Initialize variables. $options = array(); $arrBedrooms = JEUtil::getBedrooms(); foreach ($arrBedrooms as $key => $bedroom) { $option = new stdClass(); $option->value = $key; $option->text = $bedroom; $options[] = $option; } //array_unshift($options, JHtml::_('select.option', '', JText::_('COM_RENTAL_SELECT'))); return $options; }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ public function getOptions() { // Initialize variables. $options = array(); $arr = JEUtil::getCreditScore(); foreach ($arr as $key => $score) { $option = new stdClass(); $option->value = $key; $option->text = $score[0] . ' ' . $score[1]; $options[] = $option; } array_unshift($options, JHtml::_('select.option', '', JText::_('COM_RENTAL_SELECT'))); return $options; }
private function _getAparmtents($id) { $db = $this->getDbo(); $query = $db->getQuery(true); $bedrooms = JEUtil::getBedrooms(); $query->select('a.*')->from('`#__rental_apartments` a')->where('a.agent_id = ' . $id)->order('a.id DESC')->select('location.title AS location')->join('INNER', '#__retal_location location ON a.location_id = location.id'); $db->setQuery($query, 0, 5); $objs = $db->loadObjectList(); foreach ($objs as &$obj) { $tmp = intval($obj->bedrooms); $obj->bedrooms = $bedrooms[$tmp]; } if ($db->getErrorMsg()) { die($db->getErrorMsg()); } return $objs; }
static function getList(&$params) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('a.*')->from('#__hp_albums a')->where('a.state = 1')->order('a.id DESC'); $arrViews = array('services', 'service'); $userId = JRequest::getInt('user', 0); $view = JRequest::getString('view'); if ($userId && in_array($view, $arrViews)) { $query->where('a.created_by = ' . (int) $userId); } else { return false; } $db->setQuery($query, 0, 15); $rs = $db->loadObjectList(); $thumb = true; if ($thumb) { foreach ($rs as &$item) { $tmp = explode('/', $item->images); $image_name = end($tmp); $imagePath = JPATH_ROOT . DS . 'images' . DS . 'albums' . DS . $item->id; // shift an el (image folder) in $tmp array_shift($tmp); // remove last el (file name) in $tmp array_pop($tmp); $image_path = $imagePath; $thumb_path = $imagePath . '/thumbs/'; $thumb_image_path = $thumb_path . DS . $image_name; @JFolder::create($thumb_path); $thumbW = CFG_THUMBNAIL_WIDTH; $thumbH = CFG_THUMBNAIL_HEIGHT; // create thumb if not exist if (!file_exists($thumb_image_path) && file_exists($image_path . DS . $image_name)) { JEUtil::thumbnail($image_path, $thumb_path, $image_name, $thumbW, $thumbH); } $item->thumb = JURI::root() . 'images/albums/' . $item->id . '/thumbs/' . 't-' . $thumbW . 'x' . $thumbH . '-' . $image_name; } } // var_dump($rs); return $rs; }
public function getOtherImages($type = 'albums') { if (!$type) { $type = $this->itemType; } $item = $this->getItem($type, false); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*')->from('#__hp_images')->where('item_type = "' . $type . '"')->where('item_id = ' . (int) $item->id)->order('id ASC'); $db->setQuery($query); $rs = $db->loadObjectList(); if ($db->getErrorMsg()) { die($db->getErrorMsg()); } $thumb = true; if ($thumb) { foreach ($rs as &$item) { //$tmp = explode('/', $item->images); $image_name = $item->images; $imagePath = JPATH_ROOT . DS . 'images' . DS . 'albums' . DS . $item->item_id; // shift an el (image folder) in $tmp // array_shift($tmp); // remove last el (file name) in $tmp // array_pop($tmp); $image_path = $imagePath; $thumb_path = $imagePath . '/thumbs/'; $thumb_image_path = $thumb_path . DS . $image_name; @JFolder::create($thumb_path); $thumbW = CFG_THUMBNAIL_WIDTH; $thumbH = CFG_THUMBNAIL_HEIGHT; // create thumb if not exist if (!file_exists($thumb_image_path) && file_exists($image_path . DS . $image_name)) { JEUtil::thumbnail($image_path, $thumb_path, $image_name, $thumbW, $thumbH); } $item->thumb = JURI::root() . 'images/albums/' . $item->item_id . '/thumbs/' . 't-' . $thumbW . 'x' . $thumbH . '-' . $image_name; } } return $rs; }
</td> </tr> <?php } ?> <tr> <td colspan="5"> </td> </tr> </table> <div class="clear"> <div class="pagination fltleft" style="background: #fff;"><?php echo $this->pagination->getPagesLinks(); //$this->pagination->getListFooter(); ?> </div> <div class="clear"></div> </div> </form> </div> </div> </div> <div class="float-right right-side"> <?php echo JEUtil::loadModule('right', 'module-padding'); ?> </div> </div> <div class="clear"></div>
// if ($module->showtitle) // { // echo '<div class="module-title">' . $module->title . '</div>'; // echo '<div class="line-break-news"></div>'; // } // // echo JModuleHelper::renderModule($module); // } ?> </div> </div> </div> <div class="float-right right-side"> <?php echo JEUtil::loadModule('right', 'module-padding'); ?> </div> </div> <div class="clr"></div> <div class="business-blogger"> <?php echo JEUtil::loadModule('business_blog'); ?> </div> <div class="clr"></div>
" name="nids" id="nids"> </div> </div> <div class="searchBox wide"> <label>Size</label> <div id="apartmentSizeDropdown" rel="#aids" class="fancyDropdownMultiple"> <span class="selected"> </span> <div class="clear"></div> <div style="display: none;" class="fancyDropdownMultiplePane"> <div class="fancyDropdownOptions"> <div class="buttons"> <span class="closeDropdown"><a href="#">Done/Close</a></span> <div class="clear"></div> </div> <div class="clear"></div> <ul> <?php $arrBedrooms = JEUtil::getBedrooms(); $getBedrooms = explode(',', JRequest::getVar('aids')); foreach ($arrBedrooms as $key => $bedroom) { $checked = in_array($key, $getBedrooms) ? 'checked="checked"' : ''; ?> <li><input type="checkbox" value="<?php echo $key; ?> " <?php echo $checked; ?> ><?php echo $bedroom; ?> </li> <?php
<li><?php echo $this->form->getLabel('title'); ?> <?php echo $this->form->getInput('title'); ?></li> <li><?php echo $this->form->getLabel('alias'); ?> <?php echo $this->form->getInput('alias'); ?></li> */ ?> <li><?php echo $this->form->getLabel('location_id'); ?> <?php echo $this->form->getInput('location_id'); ?> <?php if ($this->item->images && JEUtil::is_serialized($this->item->images)) { ?> <div style="float:right; background: #FAFAFA; padding: 5px;"> <?php $images = unserialize($this->item->images); ?> <table cellpadding="3" cellspacing="0"> <tr> <th width="50" style="padding-bottom: 10px;">Type</th> <th style="padding-bottom: 10px;" nowrap="nowrap">Uploaded</th> <th style="padding-bottom: 10px;">Del</th> </tr> <?php foreach ($images as $key => $img) { ?> <tr>
<?php $post = JRequest::get('post'); $user = $post['user']; $renter = $post['renter']; $arrBedrooms = JEUtil::getBedrooms(); $creditScore = JEUtil::getCreditScore(); ?> <form method="post" id="new_renter" data-remote="true" class="new_renter" action="<?php echo JRoute::_('index.php?option=com_rental&view=renter&layout=create-profile&format=raw'); ?> " accept-charset="UTF-8"> <div style="margin:0;padding:0;display:inline"> <input type="hidden" value="✓" name="utf8"> <input type="hidden" value="FMMkutNs1Rl3JU3ZLjwl+l5+EYNdHqoqS95L8NSndUQ=" name="authenticity_token"> </div> <?php if (!empty($this->checkErrors)) { ?> <div class="errorExplanation" id="errorExplanation"> <h2>oops! There are some errors</h2> <ul> <?php foreach ($this->checkErrors as $error) { ?> <li><?php echo $error; ?> </li> <?php }