echo '<span class="type_button' . $bt_class . '" ' . $style . ' >' . $item->t_name . '</span>'; } else { echo '<span class="type_label' . $bt_class . '" >' . $item->t_name . '</span>'; } } if ($item->price || $item->price_negotiable) { ?> <div class="price_in_gd"> <div class="price_wrap"> <?php if ($item->price) { ?> <span class="row_value"> <?php echo DJClassifiedsTheme::priceFormat($item->price, $item->currency); ?> </span> <?php } if ($item->price_negotiable) { ?> <span class="row_negotiable"> <?php echo JText::_('COM_DJCLASSIFIEDS_PRICE_IS_NEGOTIABLE'); ?> </span> <?php } ?>
</div> <?php } ?> </div> <div class="additem_djform_in"> <?php foreach ($this->promotions as $prom) { ?> <div class="djform_row"> <label class="label" > <?php echo JText::_($prom->label) . '<br /><span>' . JText::_('COM_DJCLASSIFIEDS_PRICE') . ' '; echo DJClassifiedsTheme::priceFormat($prom->price, $par->get('unit_price')); if ($points_a && $prom->points > 0) { echo ' - ' . $prom->points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span>'; ?> </label> <div class="djform_field"> <div class="djform_prom_v" > <div class="djform_prom_v_in" > <input type="radio" name="<?php echo $prom->name; ?> " value="1" <?php if (strstr($this->item->promotions, $prom->name)) {
echo JText::_('COM_DJCLASSIFIEDS_PAYMENT_DETAILS'); ?> </h2> </td> </tr> <tr> <td class="td_pdetails"> <?php echo '<div class="pd_row"><span>' . JText::_('COM_DJCLASSIFIEDS_POINTS_PACKAGE') . '</span>'; echo '<span class="price">' . $this->points->name . '</span></div>'; echo '<div class="pd_row"><span>' . JText::_('COM_DJCLASSIFIEDS_POINTS') . '</span>'; echo '<span class="price">' . $this->points->points . '</span></div>'; echo '<div class="pd_row"><span>' . JText::_('COM_DJCLASSIFIEDS_COST_PER_POINT') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat(round($this->points->price / $this->points->points, 2), $par->get('unit_price', '')) . '</span></div>'; echo '<div class="pd_row_total"><span>' . JText::_('COM_DJCLASSIFIEDS_PRICE') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($this->points->price, $par->get('unit_price', '')) . '</span></div>'; ?> </td> </tr> </table> <table cellpadding="0" cellspacing="0" width="98%" border="0" class="paymentdetails"> <tr> <td class="td_title"> <h2><?php echo JText::_("COM_DJCLASSIFIEDS_PAYMENT_METHODS"); ?> </h2> </td> </tr> <tr> <td class="table_payment">
<h3><?php echo $point->name; ?> </h3> <?php echo JText::_("COM_DJCLASSIFIEDS_POINTS") . ': ' . $point->points; ?> <br /> <?php echo JText::_("COM_DJCLASSIFIEDS_COST_PER_POINT") . ': ' . DJClassifiedsTheme::priceFormat(round($point->price / $point->points, 2), $par->get('unit_price', '')); ?> </td> <td width="100" align="center" class="td3"> <div class="pp_price"><?php echo DJClassifiedsTheme::priceFormat($point->price, $par->get('unit_price', '')); ?> </div> <a class="button" href="index.php?option=com_djclassifieds&view=payment&type=points&id=<?php echo $point->id; ?> " style="text-decoration:none;"> <?php echo JText::_('COM_DJCLASSIFIEDS_BUY_NOW'); ?> </a> </td> </tr> </table> </tr> <?php
/** * Plugin that returns the object list for DJ-Mediatools album * * Each object must contain following properties (mandatory): title, description, image * Optional properties: link, target (_blank or _self), alt (alt attribute for image) * * @param object The album params */ public function onAlbumPrepare(&$source, &$params) { // Lets check the requirements $check = $this->onCheckRequirements($source); if (is_null($check) || is_string($check)) { return null; } $app = JFactory::getApplication(); $default_image = $params->get('plg_classifieds_image'); require_once JPATH_BASE . '/modules/mod_djclassifieds_items/helper.php'; require_once JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_djclassifieds' . DS . 'lib' . DS . 'djtheme.php'; require_once JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_djclassifieds' . DS . 'lib' . DS . 'djseo.php'; $mparams = new JRegistry(); foreach ($params->toArray() as $key => $value) { if (strpos($key, 'plg_classifieds_') !== FALSE) { $nkey = substr($key, 16); switch ($nkey) { case 'catid': $mparams->set('cat_id', $value); break; case 'follow_category': $mparams->set('fallow_category', $value); break; case 'follow_region': $mparams->set('fallow_region', $value); break; case 'only_promoted': foreach ($value as $promo) { $mparams->set('only_' . $promo, 1); } break; default: $mparams->set($nkey, $value); break; } } } // override number of items $mparams->set('items_nr', $params->get('max_images')); // we need ads only with images if (empty($default_image)) { $mparams->set('only_with_img', 1); } //$this->debug($mparams); $items = modDjClassifiedsItems::getItems($mparams); $types = modDjClassifiedsItems::getTypes(); $slides = array(); if ($items) { foreach ($items as $i) { $slide = (object) array(); if (!empty($i->img_path) && !empty($i->img_name) && !empty($i->img_ext)) { // DJ-Classifieds 3.2+ $slide->image = $i->img_path . $i->img_name . '_thb.' . $i->img_ext; } else { if (!empty($i->image_url)) { // DJ-Classifieds version < 3.2 $images = explode(';', $i->image_url); $slide->image = 'components/com_djclassifieds/images/' . $images[0]; } else { if (!empty($default_image)) { $slide->image = $default_image; } else { continue; } } } // we got image now take extra information $slide->extra = ''; if ($mparams->get('show_date') == 1) { $slide->extra .= '<div class="date">'; if (method_exists('DJClassifiedsTheme', 'formatDate')) { $slide->extra .= DJClassifiedsTheme::formatDate(strtotime($i->date_start)); } else { $slide->extra .= DJClassifiedsTheme::dateFormatFromTo(strtotime($i->date_start)); } $slide->extra .= '</div>'; } if ($mparams->get('show_cat') == 1) { $slide->extra .= '<div class="category">'; if ($mparams->get('cat_link') == 1) { $slide->extra .= '<a class="title_cat" href="' . JRoute::_(DJClassifiedsSEO::getCategoryRoute($i->cat_id . ':' . $i->c_alias)) . '">' . $i->c_name . '</a>'; } else { $slide->extra .= $i->c_name; } $slide->extra .= '</div>'; } if ($mparams->get('show_type') && $i->type_id > 0) { if (isset($types[$i->type_id])) { $slide->extra .= '<div class="type">'; $type = $types[$i->type_id]; if ($type->params->bt_class) { $bt_class = ' ' . $type->params->bt_class; } else { $bt_class = ''; } if ($type->params->bt_use_styles) { if ($mparams->get('show_type') == 2) { $style = 'style="display:inline-block;' . 'border:' . (int) $type->params->bt_border_size . 'px solid ' . $type->params->bt_border_color . ';' . 'background:' . $type->params->bt_bg . ';' . 'color:' . $type->params->bt_color . ';' . $type->params->bt_style . '"'; $slide->extra .= '<div class="type_button' . $bt_class . '" ' . $style . ' >' . $type->name . '</div>'; } else { $slide->extra .= '<div class="type_label' . $bt_class . '" >' . $type->name . '</div>'; } } else { $slide->extra .= '<div class="type_label' . $bt_class . '" >' . $type->name . '</div>'; } $slide->extra .= '</div>'; } } if ($mparams->get('show_region') == 1) { $slide->extra .= '<div class="region">'; $slide->extra .= $i->r_name; $slide->extra .= '</div>'; } if ($mparams->get('show_price') == 1 && $i->price) { $slide->extra .= '<div class="price">'; $slide->extra .= DJClassifiedsTheme::priceFormat($i->price, $i->currency); $slide->extra .= '</div>'; } // finish getting extra information $slide->title = $i->name; $slide->description = $i->intro_desc; if (empty($slide->description)) { $slide->description = $i->description; } $slide->full_desc = $i->description; $slide->link = JRoute::_(DJClassifiedsSEO::getItemRoute($i->id . ':' . $i->alias, $i->cat_id . ':' . $i->c_alias)); $slides[] = $slide; } } return $slides; }
function process($id) { $db = JFactory::getDBO(); $app = JFactory::getApplication(); $Itemid = JRequest::getInt("Itemid", '0'); $par = JComponentHelper::getParams('com_djclassifieds'); $user = JFactory::getUser(); $config = JFactory::getConfig(); $ptype = JRequest::getVar('ptype'); $type = JRequest::getVar('type', ''); $row = JTable::getInstance('Payments', 'DJClassifiedsTable'); if ($type == 'prom_top') { $query = "SELECT i.* FROM #__djcf_items i " . "WHERE i.id=" . $id . " LIMIT 1"; $db->setQuery($query); $item = $db->loadObject(); if (!isset($item)) { $message = JText::_('COM_DJCLASSIFIEDS_WRONG_AD'); $redirect = "index.php?option=com_djclassifieds&view=items&cid=0"; } $row->item_id = $id; $row->user_id = $user->id; $row->method = $ptype; $row->status = 'Start'; $row->ip_address = $_SERVER['REMOTE_ADDR']; $row->price = $par->get('promotion_move_top_price', 0); $row->type = 2; $row->store(); $amount = $par->get('promotion_move_top_price', 0); $itemname = $item->name; $item_id = $row->id; $item_cid = '&cid=' . $item->cat_id; } else { if ($type == 'points') { $query = "SELECT p.* FROM #__djcf_points p " . "WHERE p.id=" . $id . " LIMIT 1"; $db->setQuery($query); $points = $db->loadObject(); if (!isset($item)) { $message = JText::_('COM_DJCLASSIFIEDS_WRONG_POINTS_PACKAGE'); $redirect = "index.php?option=com_djclassifieds&view=items&cid=0"; } $row->item_id = $id; $row->user_id = $user->id; $row->method = $ptype; $row->status = 'Start'; $row->ip_address = $_SERVER['REMOTE_ADDR']; $row->price = $points->price; $row->type = 1; $row->store(); $amount = $points->price; $itemname = $points->name; $item_id = $row->id; $item_cid = ''; } else { if ($type == 'plan') { $query = "SELECT p.* FROM #__djcf_plans p " . "WHERE p.id=" . $id . " LIMIT 1"; $db->setQuery($query); $plan = $db->loadObject(); if (!isset($plan)) { $message = JText::_('COM_DJCLASSIFIEDS_SUBSCRIPTION_PLAN'); $redirect = "index.php?option=com_djclassifieds&view=plans"; } $row->item_id = $id; $row->user_id = $user->id; $row->method = $ptype; $row->status = 'Start'; $row->ip_address = $_SERVER['REMOTE_ADDR']; $row->price = $plan->price; $row->type = 3; $row->store(); $amount = $plan->price; $itemname = $plan->name; $item_id = $row->id; $item_cid = ''; } else { $query = "SELECT i.*, c.price as c_price, c.alias as c_alias FROM #__djcf_items i " . "LEFT JOIN #__djcf_categories c ON c.id=i.cat_id " . "WHERE i.id=" . $id . " LIMIT 1"; $db->setQuery($query); $item = $db->loadObject(); if (!isset($item)) { $message = JText::_('COM_DJCLASSIFIEDS_WRONG_AD'); $redirect = "index.php?option=com_djclassifieds&view=items&cid=0"; } $amount = 0; if (strstr($item->pay_type, 'cat')) { $amount += $item->c_price / 100; } $query = "SELECT * FROM #__djcf_days d " . "WHERE d.days=" . $item->exp_days . " LIMIT 1"; $db->setQuery($query); $day = $db->loadObject(); if (strstr($item->pay_type, 'duration_renew')) { $amount += $day->price_renew; } else { if (strstr($item->pay_type, 'duration')) { $amount += $day->price; } } if (strstr($item->pay_type, 'extra_img_renew')) { if ($day->img_price_default) { $amount += $par->get('img_price_renew', '0') * $item->extra_images_to_pay; } else { $amount += $day->img_price_renew * $item->extra_images_to_pay; } } else { if (strstr($item->pay_type, 'extra_img')) { if ($day->img_price_default) { $amount += $par->get('img_price', '0') * $item->extra_images_to_pay; } else { $amount += $day->img_price * $item->extra_images_to_pay; } } } if (strstr($item->pay_type, 'extra_chars_renew')) { if ($day->char_price_default) { $amount += $par->get('desc_char_price_renew', '0') * $item->extra_chars_to_pay; } else { $amount += $day->char_price_renew * $item->extra_chars_to_pay; } } else { if (strstr($item->pay_type, 'extra_chars')) { if ($day->char_price_default) { $amount += $par->get('desc_char_price', '0') * $item->extra_chars_to_pay; } else { $amount += $day->char_price * $item->extra_chars_to_pay; } } } $query = "SELECT p.* FROM #__djcf_promotions p " . "WHERE p.published=1 ORDER BY p.id "; $db->setQuery($query); $promotions = $db->loadObjectList(); foreach ($promotions as $prom) { if (strstr($item->pay_type, $prom->name)) { $amount += $prom->price; } } /*$query = 'DELETE FROM #__djcf_payments WHERE item_id= "'.$id.'" '; $db->setQuery($query); $db->query(); $query = 'INSERT INTO #__djcf_payments ( item_id,user_id,method, status)' . ' VALUES ( "'.$id.'" ,"'.$user->id.'","'.$ptype.'" ,"Start" )' ; $db->setQuery($query); $db->query();*/ $row->item_id = $id; $row->user_id = $user->id; $row->method = $ptype; $row->status = 'Start'; $row->ip_address = $_SERVER['REMOTE_ADDR']; $row->price = $amount; $row->type = 0; $row->store(); $itemname = $item->name; $item_id = $row->id; $item_cid = '&cid=' . $item->cat_id; $item_slug = $item->id . ':' . $item->alias; $cat_slug = $item->cat_id . ':' . $item->c_alias; } } } /* $query ="SELECT i.*, c.price as c_price, c.alias as c_alias FROM #__djcf_items i " ."LEFT JOIN #__djcf_categories c ON c.id=i.cat_id " ."WHERE i.id=".$id." LIMIT 1"; $db->setQuery($query); $item = $db->loadObject(); if(!isset($item)){ $message = JText::_('COM_DJCLASSIFIEDS_WRONG_AD'); $redirect="index.php?option=com_djclassifieds&view=items&cid=0"; } $query = 'DELETE FROM #__djcf_payments WHERE item_id= "'.$id.'" '; $db->setQuery($query); $db->query(); $query = 'INSERT INTO #__djcf_payments ( item_id,user_id,method, status)' . ' VALUES ( "'.$id.'" ,"'.$user->id.'","'.$ptype.'" ,"Start" )' ; $db->setQuery($query); $db->query(); $amount = 0; if(strstr($item->pay_type, 'cat')){ $amount += $item->c_price/100; } if(strstr($item->pay_type, 'duration_renew')){ $query = "SELECT d.price_renew FROM #__djcf_days d " ."WHERE d.days=".$item->exp_days; $db->setQuery($query); $amount += $db->loadResult(); }else if(strstr($item->pay_type, 'duration')){ $query = "SELECT d.price FROM #__djcf_days d " ."WHERE d.days=".$item->exp_days; $db->setQuery($query); $amount += $db->loadResult(); } $query = "SELECT p.* FROM #__djcf_promotions p " ."WHERE p.published=1 ORDER BY p.id "; $db->setQuery($query); $promotions=$db->loadObjectList(); foreach($promotions as $prom){ if(strstr($item->pay_type, $prom->name)){ $amount += $prom->price; } } */ if ($user->id) { /*$mailto = $user->email; $mailfrom = $app->getCfg( 'mailfrom' ); $fromname=$config->get('config.sitename').' - '.str_ireplace('administrator/', '', JURI::base()); $subject = JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_INFRORMATIONS').' '.$config->get('config.sitename'); $m_message = JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_INFRORMATIONS').' '.$config->get('config.sitename')."<br /><br />"; if($type=='points'){ $m_message .= JText::_('PLG_DJCFBANKTRANSFER_POINTS_PACKAGE').': '.$itemname."<br /><br />"; }else{ $m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_NAME').': '.$itemname."<br /><br />"; } $m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_PRICE_TO_PAY').': '.$amount.' '.$par->get('unit_price','')."<br /><br />"; $m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_PAY_INFORMATION').': <br /><br />'.JHTML::_('content.prepare',nl2br($this->params["pay_info"]))."<br /><br />"; if($type==''){ $u = JURI::getInstance( JURI::base() ); $link= $u->getHost().JRoute::_(DJClassifiedsSEO::getItemRoute($item_slug,$cat_slug)); $m_message .=JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_LINK').': <a href="'.$link.'">'.$link.'</a><br /><br />'; $m_message .=JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_ID').': '.$id.'<br /><br />'; } $m_message .=JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_ID').': '.$item_id; $mailer = JFactory::getMailer(); $mailer->sendMail($mailfrom, $fromname, $mailto, $subject, $m_message,$mode=1);*/ $payment_info = array(); $payment_info['id'] = $item_id; $payment_info['itemname'] = $itemname; $payment_info['amount'] = DJClassifiedsTheme::priceFormat($amount, $par->get('unit_price', '')); $payment_info['info'] = $this->params["pay_info"]; DJClassifiedsNotify::notifyUserPayment($type, $id, $payment_info); } echo '<div id="dj-classifieds" class="clearfix">'; echo '<table width="98%" cellspacing="0" cellpadding="0" border="0" class="paymentdetails first">'; echo '<tr><td class="td_title"><h2>' . $this->params["payment_method"] . '</h2></td></tr>'; echo '<tr><td class="td_pdetails">'; echo '<div class="pd_row">'; if ($type == 'points') { echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_POINTS_PACKAGE') . ':</span>'; } else { echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_NAME') . ':</span>'; } echo '<span class="djcfpay_value">' . $itemname . '</span>'; echo '</div>'; echo '<div class="pd_row">'; echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_PRICE_TO_PAY') . ':</span>'; echo '<span class="djcfpay_value">' . $amount . ' ' . $par->get('unit_price', '') . '</span>'; echo '</div>'; echo '<div class="pd_row">'; if ($type == 'points') { echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_POINTS_ID') . ':</span>'; } else { echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_ID') . ':</span>'; } echo '<span class="djcfpay_value">' . $id . '</span>'; echo '</div>'; echo '<div class="pd_row">'; echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_PAY_INFORMATION') . ': </span><br /><br />'; echo '<span class="djcfpay_value">' . JHTML::_('content.prepare', nl2br($this->params["pay_info"])) . '</span>'; echo '</div>'; echo '</td></tr>'; echo '</table>'; echo '</div>'; }
echo '<span class="price">' . DJClassifiedsTheme::priceFormat($par->get('promotion_move_top_price', 0), $par->get('unit_price', 'EUR')); if ($par->get('promotion_move_top_points', 0) && $points_a) { echo ' - ' . $par->get('promotion_move_top_points', 0) . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; if ($par->get('vat_value', '-1') > -1) { $p_net = round($par->get('promotion_move_top_price', 0) / (1 + $par->get('vat_value', '-1') * 0.01), 2); echo '<div class="pd_row_net"><span>' . JText::_('COM_DJCLASSIFIEDS_NET_COST') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($p_net, $par->get('unit_price', '')) . '</span>'; echo '</div>'; echo '<div class="pd_row_tax"><span>' . JText::_('COM_DJCLASSIFIEDS_TAX') . ' (' . $par->get('vat_value', '-1') . '%)</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($par->get('promotion_move_top_price', 0) - $p_net, $par->get('unit_price', '')) . '</span>'; echo '</div>'; } echo '<div class="pd_row_total"><span>' . JText::_('COM_DJCLASSIFIEDS_PRICE') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($par->get('promotion_move_top_price', 0), $par->get('unit_price', 'EUR')); if ($par->get('promotion_move_top_points', 0) && $points_a) { echo ' - ' . $par->get('promotion_move_top_points', 0) . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; ?> </td> </tr> </table> <?php $modules_djcf =& JModuleHelper::getModules('djcf-payment-middle'); if (count($modules_djcf) > 0) { echo '<div class="djcf-payment-middle clearfix">'; foreach (array_keys($modules_djcf) as $m) { echo JModuleHelper::renderModule($modules_djcf[$m], $mod_attribs); }
} <?php if ($imgfreelimit > -1 && $par->get('durations_list', '') && $id == 0 && count($this->days)) { ?> var img_prices = []; document.id('exp_days').addEvent('change', function(){ document.id('extra_img_price').innerHTML = img_prices[document.id('exp_days').value]; }); <?php foreach ($this->days as $day) { if ($day->img_price_default == 0) { $img_price = DJClassifiedsTheme::priceFormat($day->img_price, $par->get('unit_price')); if ($points_a && $day->img_points > 0) { $img_price .= ' - ' . $day->img_points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo 'img_prices[' . $day->days . ']="' . addslashes($img_price) . '"; '; } else { $img_price = DJClassifiedsTheme::priceFormat($par->get('img_price', '0'), $par->get('unit_price')); if ($points_a && $par->get('img_price_points', '0') > 0) { $img_price .= ' - ' . $par->get('img_price_points', '0') . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo 'img_prices[' . $day->days . ']="' . addslashes($img_price) . '"; '; } } ?> <?php } ?> </script> </div>
public function getCategorySelect() { header("Content-type: text/html; charset=utf-8"); $id = JRequest::getInt('cat_id', '0'); $par = JComponentHelper::getParams('com_djclassifieds'); $db = JFactory::getDBO(); $user = JFactory::getUser(); $unit_price = $par->get('unit_price', ''); $points_a = $par->get('points', 0); if ($id > 0) { $query = "SELECT * FROM #__djcf_categories WHERE id='" . $id . "' AND published=1 "; $db->setQuery($query); $parent_cat = $db->loadObject(); $query = "SELECT * FROM #__djcf_categories WHERE parent_id='" . $id . "' AND published=1 "; $db->setQuery($query); $cats = $db->loadObjectList(); if ($cats) { $cl_select = ''; if ($parent_cat->ads_disabled) { $cl_select = ' class="cat_sel required validate-djcat" '; } echo '<div class="clear_both"></div>'; echo '<select ' . $cl_select . ' style="width:210px" name="cats[]" id="cat_' . $id . '" onchange="new_cat(' . $id . ',this.value,new Array());getFields(this.value);">'; echo '<option value="p' . $id . '">' . JTEXT::_('COM_DJCLASSIFIEDS_CATEGORY_SELECTOR_EMPTY_VALUE') . '</option>'; foreach ($cats as $cat) { if ($cat->price > 0) { $cat->price = $cat->price / 100; $cat->name .= ' (' . DJClassifiedsTheme::priceFormat($cat->price, $unit_price); if ($cat->points > 0 && $points_a) { $cat->name .= ' - ' . $cat->points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } $cat->name .= ')'; } echo '<option value="' . $cat->id . '">' . str_ireplace("'", "'", $cat->name) . '</option>'; } echo '</select>'; echo "<div id=\"after_cat_{$id}\"></div>"; } } die; }
document.id('extra_char_price').innerHTML = char_label_prices[document.id('exp_days').value]; descCharsLimit(); }); <?php } foreach ($this->days as $day) { if ($day->char_price_default == 0) { $char_price = DJClassifiedsTheme::priceFormat($day->char_price, $par->get('unit_price')); if ($points_a && $day->char_points > 0) { $char_price .= ' - ' . $day->char_points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo 'char_label_prices[' . $day->days . ']="' . addslashes($char_price) . '"; '; echo 'char_prices[' . $day->days . ']="' . addslashes($day->char_price) . '"; '; echo 'char_points[' . $day->days . ']="' . addslashes($day->char_points) . '"; '; } else { $char_price = DJClassifiedsTheme::priceFormat($par->get('desc_char_price', '0'), $par->get('unit_price')); if ($points_a && $par->get('desc_char_price_points', '0') > 0) { $char_price .= ' - ' . $par->get('desc_char_price_points', '0') . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo 'char_label_prices[' . $day->days . ']="' . addslashes($char_price) . '"; '; echo 'char_prices[' . $day->days . ']="' . addslashes($par->get('desc_char_price', '0')) . '"; '; echo 'char_points[' . $day->days . ']="' . addslashes($par->get('desc_char_price_points', '0')) . '"; '; } } ?> var desc_chars_limit = <?php echo $par->get('pay_desc_chars_limit', 0); ?> ; var desc_chars_free_limit = <?php
foreach ($this->promotions as $prom) { if (strstr($this->item->pay_type, $prom->name)) { echo '<div class="pd_row"><span>' . JText::_($prom->label) . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($prom->price, $par->get('unit_price', '')); if ($points_a && $prom->points) { echo ' / ' . $prom->points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; $p_total += $prom->price; $points_total += $prom->points; $p_count++; } } if ($p_count > 1) { echo '<div class="pd_row_total"><span>' . JText::_('COM_DJCLASSIFIEDS_TOTAL') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($p_total, $par->get('unit_price', '')); if ($points_a && $points_total) { echo ' / ' . $points_total . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS'); } echo '</span></div>'; } ?> </td> </tr> </table> <table cellpadding="0" cellspacing="0" width="98%" border="0" class="paymentdetails"> <tr> <td class="td_title"> <h2><?php echo JText::_("COM_DJCLASSIFIEDS_PAYMENT_METHODS"); ?>
function saveBid() { header("Content-type: text/html; charset=utf-8"); $app = JFactory::getApplication(); $id = JRequest::getInt('id', 0); $bid = JRequest::getFloat('bid', 0); $db = JFactory::getDBO(); $user = JFactory::getUser(); $itemid = JRequest::getVar('Itemid'); $par = JComponentHelper::getParams('com_djclassifieds'); $bid_error = 0; $error_show_form = 0; $error_price = 0; $bid_message = JText::_('COM_DJCLASSIFIEDS_OFFER_PUBLISHED'); if ($user->id > 0) { $date_now = date("Y-m-d H:i:s"); $query = "SELECT * FROM #__djcf_items i " . "WHERE i.id = " . $id . " AND i.published=1 AND i.date_start <= '" . $date_now . "' AND i.date_exp >= '" . $date_now . "' "; $db->setQuery($query); $item = $db->loadObject(); if ($item) { if ($bid > 0) { $query = "SELECT a.*, u.name as u_name FROM #__djcf_auctions a, #__users u " . " WHERE a.user_id=u.id AND a.item_id=" . $id . " ORDER BY a.date DESC LIMIT 1"; $db->setQuery($query); $last_bid = $db->loadObject(); if ($item->buynow) { $min_bid = $item->price_start; } else { $min_bid = $item->price; } if ($last_bid) { if ($last_bid->user_id == $user->id) { $bid_error = 1; $bid_message = JText::_('COM_DJCLASSIFIEDS_YOUR_OFFER_IS_LAST_YOU_CAN_BID_ONLY_OTHER_USERS'); } $min_bid = $last_bid->price; } if ($item->user_id == $user->id) { $bid_error = 1; $bid_message = JText::_('COM_DJCLASSIFIEDS_YOU_CANT_BID_YOUR_ADVERT'); } if ($bid_error == 0) { if (!$item->bid_min) { $item->bid_min = 1; } $min_bid = $min_bid + $item->bid_min; if ($bid < $min_bid) { $bid_error = 1; $error_show_form = 1; $error_price = $min_bid; $bid_message = JText::_('COM_DJCLASSIFIEDS_OFFER_SMALLER_THAN_LIMIT') . ' ' . DJClassifiedsTheme::priceFormat($error_price, $item->currency); } if ($bid_error == 0) { if ($item->bid_max > 0) { $max_bid = $min_bid + $item->bid_max; if ($item->bid_max && $bid > $max_bid) { $bid_error = 1; $error_show_form = 1; $error_price = $max_bid; $bid_message = JText::_('COM_DJCLASSIFIEDS_OFFER_BIGGER_THAN_LIMIT') . ' ' . DJClassifiedsTheme::priceFormat($error_price, $item->currency); } } } if ($bid_error == 0) { $user_ip = $_SERVER['REMOTE_ADDR']; $win = 0; if ($bid >= $item->price_reserve && $item->bid_autoclose == 1) { $win = 1; } $query = "INSERT INTO #__djcf_auctions (`item_id`, `user_id`, `ip_address`, `price`,`win`)" . " VALUES ( '" . $id . "', '" . $user->id . "','" . $user_ip . "', '" . $bid . "', '" . $win . "' )"; $db->setQuery($query); $db->query(); $price_start = ''; if (!$last_bid) { $price_start = " price_start='" . $item->price . "' "; } $win_notifi = ''; if ($win) { if ($price_start || $item->buynow) { $win_notifi = ", "; } $win_notifi .= "notify=2 "; } $price_new = ''; if ($item->buynow == 0) { $price_new = " price='" . $bid . "' "; if ($price_start) { $price_start = ',' . $price_start; } } if ($price_start || $win_notifi || $price_new) { $query = "UPDATE #__djcf_items SET " . $price_new . $price_start . $win_notifi . " WHERE id=" . $item->id; $db->setQuery($query); $db->query(); } DJClassifiedsNotify::notifyAuctionsBidAuthor($id, $user, $bid); DJClassifiedsNotify::notifyAuctionsBidBidder($id, $user, $bid); if ($last_bid) { DJClassifiedsNotify::notifyAuctionsBidOutbid($id, $user, $bid, $last_bid); } if ($win) { DJClassifiedsNotify::notifyAuctionsWinAuthor($id, $user, $bid); DJClassifiedsNotify::notifyAuctionsWinBidder($id, $user, $bid); } } } } else { $bid_error = 1; $bid_message = JText::_('COM_DJCLASSIFIEDS_PLEASE_ENTER_PRICE_VALUE'); } $query = "SELECT a.*, u.name as u_name FROM #__djcf_auctions a, #__users u " . " WHERE a.user_id=u.id AND a.item_id=" . $id . " ORDER BY a.date DESC LIMIT " . $par->get('bids_displayed', 5); $db->setQuery($query); $bids = $db->loadObjectList(); ?> <div class="auction" id="djauctions"> <div class="auction_bids"> <div class="bids_title"><h2><?php echo JText::_('COM_DJCLASSIFIEDS_CURRENT_BIDS'); ?> </h2></div> <?php if (isset($bids[0]) && $item->price_reserve) { if ($bids[0]->price < $item->price_reserve) { ?> <div class="bids_subtitle"><?php echo JText::_('COM_DJCLASSIFIEDS_RESERVE_PRICE_NOT_REACHED'); ?> </div> <?php } } ?> <div class="bids_list"> <?php if ($bids) { ?> <div class="bids_row bids_row_title"> <div class="bids_col bids_col_name"><?php echo JText::_('COM_DJCLASSIFIEDS_NAME'); ?> :</div> <div class="bids_col bids_col_date"><?php echo JText::_('COM_DJCLASSIFIEDS_DATE'); ?> :</div> <div class="bids_col bids_col_bid"><?php echo JText::_('COM_DJCLASSIFIEDS_BID'); ?> :</div> <div class="clear_both"></div> </div> <?php foreach ($bids as $bid) { if ($bid->price > $min_bid) { $min_bid = $bid->price; } if ($par->get('mask_bidder_name', '0') == 1) { $bid->u_name = substr($bid->u_name, 0, 1) . '.....' . substr($bid->u_name, -1, 1); } ?> <div class="bids_row"> <div class="bids_col bids_col_name"><?php echo $bid->u_name; ?> </div> <div class="bids_col bids_col_date"><?php echo DJClassifiedsTheme::formatDate(strtotime($bid->date)); ?> </div> <div class="bids_col bids_col_bid"><?php echo DJClassifiedsTheme::priceFormat($bid->price, $item->currency); ?> </div> <div class="clear_both"></div> </div> <?php } ?> <?php } else { ?> <div class="bids_row no_bids_row"><?php echo JText::_('COM_DJCLASSIFIEDS_NO_SUBMITTED_BIDS'); ?> </div> <?php } ?> <div class="clear_both"></div> </div> </div> <?php if ($error_show_form) { ?> <div class="bids_form" id="djbids_form"> <div class="bids_box"> <div class="bids_info"> <span class="bid_label"><?php echo JText::_('COM_DJCLASSIFIEDS_PLACE_BID'); ?> </span> </div> <div class="bids_input"> <?php if ($par->get('unit_price_position', '0') == 1) { echo $item->currency ? $item->currency : $par->get('unit_price'); } ?> <input class="inputbox" id="djbid_value" type="text" name="bid_max" id="bid_max" size="30" maxlength="250" value="<?php echo $error_price; ?> " /> <?php if ($par->get('unit_price_position', '0') == 0) { echo $item->currency ? $item->currency : $par->get('unit_price'); } ?> </div> <div class="bids_button"> <button class="button" id="bid_submit"><?php echo JText::_('COM_DJCLASSIFIEDS_PLACE_BID'); ?> </button> </div> <div class="clear_both"></div> </div> <div class="clear_both"></div> </div> <?php } ?> <div id="djbid_alert"> <?php if ($bid_error) { echo $bid_message; } ?> </div> <div id="djbid_message"> <?php if (!$bid_error) { echo $bid_message; } ?> </div> </div> <?php } else { echo '<div class="auction" id="djauctions"><div id="djbid_alert" >'; echo JText::_('COM_DJCLASSIFIEDS_WRONG_AD'); echo '</div></div>'; } } else { echo '<div class="auction" id="djauctions"><div id="djbid_alert" >'; echo JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN'); echo '</div></div>'; } die; }
if ($user->id) { if ($item->bid_min > 0) { $bid_v = $min_bid + $item->bid_min; } else { $bid_v = $min_bid + 1; } ?> <div class="bids_box"> <div class="bids_info"> <span class="bid_label"><?php echo JText::_('COM_DJCLASSIFIEDS_PLACE_BID'); ?> </span> <?php if ($item->bid_max) { echo '<span class="bid_max">' . JText::_('COM_DJCLASSIFIEDS_MAX_BIDDING') . ' ' . DJClassifiedsTheme::priceFormat($item->bid_max, $item->currency) . '</span>'; } ?> </div> <div class="bids_input"> <?php if ($par->get('unit_price_position', '0') == 1) { echo $item->currency ? $item->currency : $par->get('unit_price'); } ?> <input class="inputbox input-small" id="djbid_value" type="text" name="bid_max" id="bid_max" size="30" maxlength="250" value="<?php echo $bid_v; ?> " />
echo '<span class="price">' . DJClassifiedsTheme::priceFormat($this->plan->price, $par->get('unit_price', 'EUR')); if ($this->plan->points && $points_a) { echo ' - ' . $this->plan->points . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; if ($par->get('vat_value', '-1') > -1) { $p_net = round($this->plan->price / (1 + $par->get('vat_value', '-1') * 0.01), 2); echo '<div class="pd_row_net"><span>' . JText::_('COM_DJCLASSIFIEDS_NET_COST') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($p_net, $par->get('unit_price', '')) . '</span>'; echo '</div>'; echo '<div class="pd_row_tax"><span>' . JText::_('COM_DJCLASSIFIEDS_TAX') . ' (' . $par->get('vat_value', '-1') . '%)</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($this->plan->price - $p_net, $par->get('unit_price', '')) . '</span>'; echo '</div>'; } echo '<div class="pd_row_total"><span>' . JText::_('COM_DJCLASSIFIEDS_PRICE') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($this->plan->price, $par->get('unit_price', 'EUR')); if ($this->plan->points && $points_a) { echo ' - ' . $this->plan->points . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; ?> </td> </tr> </table> <?php $modules_djcf =& JModuleHelper::getModules('djcf-payment-middle'); if (count($modules_djcf) > 0) { echo '<div class="djcf-payment-middle clearfix">'; foreach (array_keys($modules_djcf) as $m) { echo JModuleHelper::renderModule($modules_djcf[$m], $mod_attribs); }
$r = !$r; echo '<div class="item_row row' . $row . '">'; echo '<div class="item_col first">'; $uid_slug = $iorder->user_id . ':' . DJClassifiedsSEO::getAliasName($iorder->username); echo '<a class="profile_name" href="index.php?option=com_djclassifieds&view=profile&uid=' . $uid_slug . DJClassifiedsSEO::getMainAdvertsItemid() . '">' . $iorder->username . '</a><br/>'; echo '<a class="profile_email" href="mailto:' . $iorder->email . '">' . $iorder->email . '</a>'; echo '</div>'; ?> <div class="item_col"> <div class="djcf_prow_desc_row"> <span class="djcf_prow_desc_label" ><?php echo JText::_("COM_DJCLASSIFIEDS_PRICE"); ?> :</span> <span class="djcf_prow_desc_value" ><?php echo DJClassifiedsTheme::priceFormat($iorder->price, $i->currency); ?> </span> <div class="clear_both"></div> </div> <div class="djcf_prow_desc_row"> <span class="djcf_prow_desc_label" ><?php echo JText::_("COM_DJCLASSIFIEDS_QUANTITY"); ?> :</span> <span class="djcf_prow_desc_value" ><?php echo $iorder->quantity; ?> </span> <div class="clear_both"></div> </div>
echo ' - ' . $plan->points . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT') . ''; } ?> </span> <div class="clear_both"></div> </div> <div class="djcf_prow_desc_row"> <span class="djcf_prow_desc_label" ><?php echo JText::_("COM_DJCLASSIFIEDS_COST_PER_ADVERT"); ?> :</span> <span class="djcf_prow_desc_value" > <?php $price_per_ad = round($plan->price / $plan_params->ad_limit, 2); echo DJClassifiedsTheme::priceFormat($price_per_ad, $par->get('unit_price', '')); ?> <?php if ($plan->points > 0 && $points_a) { $points_per_ad = round($plan->points / $plan_params->ad_limit, 2); echo ' - ' . $points_per_ad . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT') . ''; } ?> </span> <div class="clear_both"></div> </div> <div class="djcf_prow_desc_row djcf_prow_main_desc"> <?php echo $plan->description; ?>