Current File : /home/pacjaorg/public_html/kmm/plugins/djclassifieds/offers/layouts/item.php |
<?php
/**
* @package DJ-Classifieds
* @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email contact@dj-extensions.com
*/
defined('_JEXEC') or die;
JHtml::_('jquery.framework');
$item = $displayData['item'];
$params = $displayData['params'];
$par = $displayData['par'];
$user = JFactory::getUser();
echo '<div id="offer_outer" class="offer_outer">';
echo '<button id="offer_button" class="button" type="button"'.($user->id && $user->id == $item->user_id ? ' disabled style="cursor: not-allowed"' : '').'>'.JText::_('COM_DJCLASSIFIEDS_MAKE_OFFER_BUTTON').'</button>';
echo '<div class="clear_both"></div>';
echo '<div class="offer_box" id="offer_box" style="display:none;">';
if($user->id && $user->id != $item->user_id){
echo '<div class="offer_title">'.JText::_('COM_DJCLASSIFIEDS_MAKE_YOUR_OFFER').'</div>';
echo '<form action="'.JRoute::_('index.php').'" method="post" name="offerForm" id="offerForm" class="form-validate" enctype="multipart/form-data">';
if($item->quantity>1){
echo '<div class="offer_quantity_line"><input type="text" class="buynow_quantity required validate-numeric inputbox" name="offer_quantity" id="offer_quantity" value="1" />';
echo '<span class="offer_unit">'.$item->unit_name.' '.JText::_('COM_DJCLASSIFIEDS_FOR').'</span></div>';
}
if($params->get('show_price', '1')){
echo '<div class="offer_price_line">';
echo '<label class="label" for="offer_price" style="display:none">'.JText::_('COM_DJCLASSIFIEDS_OFFER_PRICE').'</label>';
if($par->get('unit_price_position','0') == '1'){
echo '<span class="offer_currency">'.($item->currency ? $item->currency : $par->get('unit_price','EUR')).'</span>';
}
echo '<input type="text" class="buynow_quantity required validate-numeric inputbox" name="offer_price" id="offer_price" value="'.$item->price.'" placeholder="'.JText::_('COM_DJCLASSIFIEDS_OFFER_PRICE_PLACEHOLDER').'" />';
if($par->get('unit_price_position','0') == '0'){
echo '<span class="offer_currency">'.($item->currency ? $item->currency : $par->get('unit_price','EUR')).'</span>';
}
echo '</div>';
}
echo '<textarea name="offer_msg" class="inputbox" id="offer_msg" placeholder="'.JText::_('COM_DJCLASSIFIEDS_MESSAGE_FOR_AUTHOR').'"></textarea>';
echo '<div class="clear_both"></div>';
echo '<button class="button validate" type="submit" id="offer_submit_b">'.JText::_('COM_DJCLASSIFIEDS_POST_OFFER').'</button>';
echo '<div class="clear_both"></div>';
echo '<input type="hidden" name="item_id" value="'.$item->id.'">';
echo '<input type="hidden" name="cid" id="cid" value="'.$item->cat_id.'">';
echo '<input type="hidden" name="option" value="com_djclassifieds" />';
echo '<input type="hidden" name="view" value="checkout" />';
echo '<input type="hidden" name="task" value="saveOffer" />';
echo '</form>';
}elseif(!$user->id){
echo '<div class="bids_login_info log_in_msg">'.JText::sprintf('COM_DJCLASSIFIEDS_LOG_IN_TO_MAKE_OFFER', '<a href="'.JRoute::_('index.php?option=com_users&view=login&return='.base64_encode(JUri::getInstance()), false).'">'.JText::_('COM_DJCLASSIFIEDS_LOG_IN_LINK').'</a>').'</div>';
}
echo '</div>';
echo '</div>';
?>
<script>
jQuery(function($){
if($('#offer_button').length && $('#offer_box').length){
$('#offer_button').on('click', function(){
$('#offer_box').stop(true, false).slideToggle();
$('#offer_outer').toggleClass('offer_open');
});
}
});
</script>