public function action_get() { try { if (is_numeric($id_ad = $this->request->param('id'))) { $ad = new Model_Ad($id_ad); if ($ad->loaded()) { if ($ad->id_user == $this->user->id_user) { $a = $ad->as_array(); $a['price'] = i18n::money_format($ad->price); $a['images'] = array_values($ad->get_images()); $a['category'] = $ad->category->as_array(); $a['location'] = $ad->location->as_array(); $a['customfields'] = Model_Field::get_by_category($ad->id_category); $this->rest_output(array('ad' => $a)); } else { $this->_error(__('Not your advertisement'), 401); } } else { $this->_error(__('Advertisement not found'), 404); } } else { $this->_error(__('Advertisement not found'), 404); } } catch (Kohana_HTTP_Exception $khe) { $this->_error($khe); return; } }
public function action_get() { try { if (is_numeric($id_category = $this->request->param('id'))) { $cat = array(); $category = new Model_Category($id_category); if ($category->loaded()) { $cat = $category->as_array(); $cat['price'] = i18n::money_format($category->price); $cat['parents'] = $category->get_parents_ids(); $cat['siblings'] = $category->get_siblings_ids(); $cat['customfields'] = Model_Field::get_by_category($category->id_category); $cat['icon'] = $category->get_icon(); $this->rest_output(array('category' => $cat)); } else { $this->_error(__('Category not found'), 404); } } else { $this->_error(__('Category not found'), 404); } } catch (Kohana_HTTP_Exception $khe) { $this->_error($khe); return; } }
public function action_get() { try { if (is_numeric($id_ad = $this->request->param('id'))) { $ad = new Model_Ad(); //get distance to the ad if (isset($this->_params['latitude']) and isset($this->_params['longitude'])) { $ad->select(array(DB::expr('degrees(acos(sin(radians(' . $this->_params['latitude'] . ')) * sin(radians(`latitude`)) + cos(radians(' . $this->_params['latitude'] . ')) * cos(radians(`latitude`)) * cos(radians(abs(' . $this->_params['longitude'] . ' - `longitude`))))) * 69.172'), 'distance')); } $ad->where('id_ad', '=', $id_ad)->where('status', '=', Model_Ad::STATUS_PUBLISHED)->cached()->find(); if ($ad->loaded()) { $a = $ad->as_array(); $a['price'] = i18n::money_format($ad->price); $a['images'] = array_values($ad->get_images()); $a['category'] = $ad->category->as_array(); $a['location'] = $ad->location->as_array(); $a['user'] = Controller_Api_Users::get_user_array($ad->user); $a['customfields'] = Model_Field::get_by_category($ad->id_category); //sorting by distance, lets add it! if (isset($ad->distance)) { $a['distance'] = i18n::format_measurement($ad->distance); } $a['url'] = Route::url('ad', array('category' => $ad->category->seoname, 'seotitle' => $ad->seotitle)); $this->rest_output(array('ad' => $a)); } else { $this->_error(__('Advertisement not found'), 404); } } else { $this->_error(__('Advertisement not found'), 404); } } catch (Kohana_HTTP_Exception $khe) { $this->_error($khe); return; } }
<td class="text-right"><h4><strong><?php echo __('Total'); ?> : </strong></h4></td> <?php if ($order->id_product == Model_Order::PRODUCT_AD_SELL and isset($order->ad->cf_shipping) and Valid::numeric($order->ad->cf_shipping) and $order->ad->cf_shipping > 0) { ?> <td class="text-center text-danger"><h4><strong><?php echo i18n::money_format($order->amount + $order->ad->cf_shipping, $order->currency); ?> </strong></h4></td> <?php } else { ?> <td class="text-center text-danger"><h4><strong><?php echo $order->id_product == Model_Order::PRODUCT_AD_SELL ? i18n::money_format($order->amount, $order->currency) : i18n::format_currency($order->amount, $order->currency); ?> </strong></h4></td> <?php } ?> </tr> <tr> <td></td> <td class="text-right"> <?php if (!core::get('print')) { ?> <div class="pull-right"> <a target="_blank" class="btn btn-xs btn-success" title="<?php echo __('Print this');
<?php echo FORM::input('affiliate_percentage', Request::current()->post('affiliate_percentage'), array('placeholder' => i18n::money_format(1), 'class' => 'form-control', 'id' => 'affiliate_percentage', 'type' => 'text')); ?> </div> </div> <?php } ?> <div class="form-group"> <?php echo FORM::label('price_offer', __('Price Offer'), array('class' => 'col-md-12 ', 'for' => 'price_offer')); ?> <div class="col-md-12"> <?php echo FORM::input('price_offer', Request::current()->post('price_offer'), array('placeholder' => i18n::money_format(1), 'class' => 'form-control', 'id' => 'price_offer', 'type' => 'text')); ?> </div> </div> <div class="form-group"> <?php echo FORM::label('offer_valid', __('Offer Valid'), array('class' => 'col-md-12', 'for' => 'offer_valid')); ?> <div class="col-md-8"> <div class="input-group"> <input type="text" size="16" id="offer_valid" name="offer_valid" value="" class="form-control " data-date="" data-date-format="yyyy-mm-dd"> <div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div> </div> </div> </div>
<li> <a href="<?php echo Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)); ?> ?featured_days=<?php echo $days; ?> "> <small><?php echo $days; ?> <?php echo __('Days'); ?> - <?php echo i18n::money_format($price); ?> </small> </a> </li> <?php } ?> <?php } ?> </ul> <?php } ?> </td>
?> </div> </div> <?php } ?> <?php if (core::config('advertisement.price') != FALSE) { ?> <div class="col-xs-6"> <?php echo FORM::label('price', _e('Price'), array('class' => '', 'for' => 'price')); ?> <div class="input-prepend"> <?php echo FORM::input('price', i18n::format_currency_without_symbol($ad->price), array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control fc-small', 'id' => 'price', 'data-error' => __('Please enter only numbers.'))); ?> </div> </div> <?php } ?> </div> <?php } ?> <!-- END PRICE AND STOCK --> <!-- START DESCRIPTION --> <?php if (core::config('advertisement.description') != FALSE) {
</div> </div> <?php } ?> <?php if (core::config('advertisement.price') != FALSE) { ?> <div class="form-group"> <div class="col-sm-8"> <?php echo FORM::label('price', __('Price'), array('class' => '', 'for' => 'price')); ?> <div class="input-prepend"> <?php echo FORM::input('price', $ad->price, array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control', 'id' => 'price', 'data-error' => __('Please enter only numbers.'))); ?> </div> </div> </div> <?php } ?> <?php if (core::config('advertisement.website') != FALSE) { ?> <div class="form-group"> <div class="col-sm-8"> <?php echo FORM::label('website', __('Website'), array('class' => '', 'for' => 'website')); ?>
function lili3($item, $key, $cats) { ?> <div class="accordion-group"> <div class="accordion-heading"> <?php if (count($item) > 0) { ?> <label class="radio"> <a class="btn btn-primary btn-xs" data-toggle="collapse" type="button" data-target="#acc_<?php echo $cats['categories'][$key]['seoname']; ?> "> <i class=" glyphicon glyphicon-plus"></i> <?php echo $cats['categories'][$key]['name']; ?> </a> <input <?php echo $cats['categories'][$key]['seoname'] == $cats['cat_selected'] ? 'checked' : ''; ?> type="radio" id="radio_<?php echo $cats['categories'][$key]['seoname']; ?> " name="category" value="<?php echo $cats['categories'][$key]['id']; ?> " required > <?php if ($cats['categories'][$key]['price'] > 0) { ?> <span class="label label-success"> <?php echo i18n::money_format($cats['categories'][$key]['price']); ?> </span> <?php } ?> </label> <?php } else { ?> <label class="radio"> <input class="ml-10" <?php echo $cats['categories'][$key]['seoname'] == $cats['cat_selected'] ? 'checked' : ''; ?> type="radio" id="radio_<?php echo $cats['categories'][$key]['seoname']; ?> " name="category" value="<?php echo $cats['categories'][$key]['id']; ?> " required > <a class="btn btn-xs btn-primary ml-10" data-toggle="collapse" type="button" data-target="#acc_<?php echo $cats['categories'][$key]['seoname']; ?> "> <?php echo $cats['categories'][$key]['name']; ?> </a> <?php if ($cats['categories'][$key]['price'] > 0) { ?> <span class="label label-success"> <?php echo i18n::money_format($cats['categories'][$key]['price']); ?> </span> <?php } ?> </label> <?php } ?> </div> <?php if (count($item) > 0) { ?> <div id="acc_<?php echo $cats['categories'][$key]['seoname']; ?> " class="accordion-body collapse <?php echo $cats['categories'][$key]['seoname'] == $cats['cat_selected'] ? 'in' : ''; ?> "> <div class="accordion-inner"> <?php if (is_array($item)) { array_walk($item, 'lili3', $cats); } ?> </div> </div> <?php } ?> </div> <?php }
?> <?php } ?> <?php if ($form_show['price'] != FALSE) { ?> <div class="form-group"> <div class="col-md-4"> <?php echo FORM::label('price', __('Price'), array('for' => 'price')); ?> <div class="input-prepend"> <?php echo FORM::input('price', Request::current()->post('price'), array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control', 'id' => 'price', 'type' => 'text', 'data-error' => __('Please enter only numbers.'))); ?> </div> </div> </div> <?php } ?> <?php if (core::config('payment.stock')) { ?> <div class="form-group"> <div class="col-md-4"> <?php echo FORM::label('stock', __('In Stock'), array('for' => 'stock'));
<?php echo FORM::input('affiliate_percentage', $product->affiliate_percentage, array('placeholder' => i18n::money_format(1), 'class' => 'form-control', 'id' => 'affiliate_percentage', 'type' => 'text')); ?> </div> </div> <?php } ?> <div class="form-group"> <?php echo FORM::label('price_offer', __('Price Offer'), array('class' => 'col-md-12', 'for' => 'price_offer')); ?> <div class="col-md-12"> <?php echo FORM::input('price_offer', $product->price_offer, array('placeholder' => i18n::money_format(1), 'class' => 'form-control', 'id' => 'price_offer', 'type' => 'text')); ?> </div> </div> <div class="form-group"> <?php echo FORM::label('offer_valid', __('Offer Valid'), array('class' => 'col-md-12', 'for' => 'offer_valid')); ?> <div class="col-md-8"> <div class="input-group"> <input type="text" size="16" id="offer_valid" name="offer_valid" value="<?php echo $product->offer_valid != NULL ? Date::format($product->offer_valid, 'Y-m-d') : ''; ?> " class="form-control" data-date="" data-date-format="yyyy-mm-dd"> <div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>
<?php if (Model_Coupon::current()->loaded()) { ?> <?php echo Form::hidden('coupon_delete', Model_Coupon::current()->name); ?> <button type="submit" class="btn btn-warning"><?php echo _e('Delete'); ?> <?php echo Model_Coupon::current()->name; ?> </button> <p> <?php echo sprintf(__('Discount off %s'), Model_Coupon::current()->discount_amount == 0 ? round(Model_Coupon::current()->discount_percentage, 0) . '%' : i18n::money_format(Model_Coupon::current()->discount_amount)); ?> <br> <?php echo sprintf(__('%s coupons left'), Model_Coupon::current()->number_coupons); ?> , <?php echo sprintf(__('valid until %s'), Date::format(Model_Coupon::current()->valid_date, core::config('general.date_format'))); ?> . <?php if (Model_Coupon::current()->id_product != NULL) { ?> <?php echo sprintf(__('only valid for %s'), Model_Order::product_desc(Model_Coupon::current()->id_product)); ?>
</option> <?php } ?> </select> </div> </div> <div class="form-group "> <div class="col-sm-12"> <label for="discount_amount" class="control-label"><?php echo __('Discount Amount'); ?> </label> <input type="text" id="discount_amount" name="discount_amount" value="" placeholder="<?php echo html_entity_decode(i18n::money_format(1)); ?> " /> </div> </div> <div class="form-group hidden"> <div class="col-sm-12"> <label for="discount_percentage" class="control-label"><?php echo __('Discount Percentage'); ?> </label> <input type="text" id="discount_percentage" name="discount_percentage" value="" /> </div> </div> <div class="form-group ">
?> <?php echo FORM::input('website', $ad->website, array('class' => 'form-control', 'id' => 'website', 'placeholder' => __('Website'))); ?> </div> </div> <?endif?> <?if(core::config('advertisement.price') != FALSE):?> <div class="form-group"> <div class="col-sm-8"> <?php echo FORM::label('price', __('Price'), array('class' => '', 'for' => 'price')); ?> <div class="input-prepend"> <?php echo FORM::input('price', $ad->price, array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control', 'id' => 'price')); ?> </div> </div> </div> <?endif?> <!-- Fields coming from custom fields feature --> <?if (Theme::get('premium')==1):?> <div id="custom-fields" data-customfield-values='<?php echo json_encode($ad->custom_columns()); ?> '> <div id="custom-field-template" class="form-group hidden"> <div class="col-sm-8"> <div data-label></div> <div data-input></div>
<?php echo ($product_desc = Model_Order::product_desc($element->id_product)) == '' ? __('Any') : $product_desc; ?> <?php } else { ?> <?php echo $element->id_product; ?> <?php } ?> </td> <td> <?php echo $element->discount_amount == 0 ? round($element->discount_percentage, 0) . '%' : i18n::money_format($element->discount_amount); ?> </td> <td><?php echo $element->number_coupons; ?> </td> <td><?php echo Date::format($element->valid_date, core::config('general.date_format')); ?> </td> <td><?php echo Date::format($element->created, core::config('general.date_format')); ?> </td>
?> N/A <?php } ?> </td> <td class="vertical-center"> <!-- Min price --> <span class="badge min-price"><?php echo i18n::money_format($l['min_price']); ?> </span> - <!-- Max Price --> <span class="badge max-price"><?php echo i18n::money_format($l['max_price']); ?> </span> </td> <td class="vertical-align:middle;" class="hidden-xs "> <!-- Created --> <?php echo substr($l['created'], 0, 11); ?> </td> <td class="text-center"> <!-- unsubscribe one entry button --> <a href="<?php echo Route::url('oc-panel', array('controller' => 'profile', 'action' => 'unsubscribe', 'id' => $l['id'])); ?>
echo $order->product->title; ?> <?php echo $order->product->version; ?> </td> <td><?php echo Date::format($order->pay_date); ?> </td> <td><?php echo $order->support_date != NULL ? Date::format($order->support_date) : __('Without support'); ?> </td> <td><?php echo i18n::money_format($order->amount) . ' ' . $order->currency; ?> </td> <td> <?php if (core::config('product.reviews') == 1 and Theme::get('premium') == 1) { ?> <a title="<?php echo __('Product Review'); ?> " href="<?php echo Route::url('oc-panel', array('controller' => 'profile', 'action' => 'review', 'id' => $order->id_order)); ?> " class="btn btn-mini btn-warning"> <i class="glyphicon glyphicon-star-empty"></i></a>
<?php echo FORM::textarea('message', "", array('class' => 'form-control', 'placeholder' => __('Message'), 'name' => 'message', 'id' => 'message', 'rows' => 2, 'required')); ?> </div> </div> <?php if (core::config('general.messaging') and core::config('advertisement.price') and core::config('advertisement.contact_price')) { ?> <div class="form-group"> <div class="col-xs-12"> <?php echo FORM::label('price', _e('Price'), array('class' => 'control-label', 'for' => 'price')); ?> <?php echo FORM::input('price', Core::post('price'), array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control', 'id' => 'price', 'type' => 'text')); ?> </div> </div> <?php } ?> <!-- file to be sent--> <?php if (core::config('advertisement.upload_file') and core::config('general.messaging') != TRUE) { ?> <div class="form-group"> <div class="col-xs-12"> <?php echo FORM::label('file', _e('File'), array('class' => 'control-label', 'for' => 'file')); ?>
<?php } ?> <?php if (core::config('payment.to_featured') != FALSE and $widget->ad->featured < Date::unix2mysql()) { ?> <a class="btn btn-danger center-block" type="button" href="<?php echo Route::url('default', array('action' => 'to_featured', 'controller' => 'ad', 'id' => $widget->ad->id_ad)); ?> "> <?php echo _e('Go Featured!'); ?> <?php echo i18n::money_format(Model_Order::get_featured_price(), core::config('payment.paypal_currency')); ?> </a> <?php } ?> <div class="clearfix"></div><br> <a class="btn btn-primary" href="<?php echo Route::url('oc-panel', array('controller' => 'myads', 'action' => 'update', 'id' => $widget->ad->id_ad)); ?> "> <i class="glyphicon glyphicon-edit"></i> <?php echo _e("Edit"); ?>
} ?> <br> <?php echo Text::bb2html($message->message, TRUE); ?> <?php if ($message->price > 0) { ?> <p> <strong><?php echo __('Price'); ?> </strong>: <?php echo i18n::money_format($message->price); ?> </p> <?php } ?> </div> </div> <div class="text-right mess-date"><small><?php echo Date::fuzzy_span(Date::mysql2unix($message->created)); ?> - <?php echo $message->created; ?> </small></div>
?> "/> <meta property="logbee:addr" content="<?php echo Model_Ad::current()->address; ?> "/> <meta property="logbee:email" content="<?php echo Model_Ad::current()->user->email; ?> "/> <meta property="logbee:phone" content="<?php echo Model_Ad::current()->phone; ?> "/> <meta property="logbee:price" content="<?php echo i18n::money_format(Model_Ad::current()->price); ?> "/> <meta property="logbee:imgurl" content="<?php echo Controller::$image; ?> "/> <?php } ?> <link rel="shortcut icon" href="<?php echo Theme::get('favicon_url') != '' ? Theme::get('favicon_url') : core::config('general.base_url') . 'images/favicon.ico'; ?> ">
function lili3($item, $key, $cats) { ?> <div class="accordion-group"> <div class="accordion-heading"> <?php if (count($item) > 0) { ?> <label class="radio"> <a class="btn btn-primary btn-xs" data-toggle="collapse" type="button" data-target="#acc_<?php echo $cats[$key]['seoname']; ?> "> <i class=" glyphicon glyphicon-plus glyphicon"></i> <?php echo $cats[$key]['name']; ?> </a> <?php if (core::config('advertisement.parent_category')) { ?> <input <?php echo ($cats[$key]['seoname'] == Core::get('category') or Request::current()->post('category') == $cats[$key]['id']) ? 'checked' : ''; ?> type="radio" id="radio_<?php echo $cats[$key]['seoname']; ?> " name="category" value="<?php echo $cats[$key]['id']; ?> " required > <?php } ?> <?php if ($cats[$key]['price'] > 0) { ?> <span class="label label-success"> <?php echo i18n::money_format($cats[$key]['price']); ?> </span> <?php } ?> </label> <?php } else { ?> <label class="radio"> <input <?php echo ($cats[$key]['seoname'] == Core::get('category') or Request::current()->post('category') == $cats[$key]['id']) ? 'checked' : ''; ?> type="radio" id="radio_<?php echo $cats[$key]['seoname']; ?> " name="category" value="<?php echo $cats[$key]['id']; ?> " required > <a class="btn btn-xs btn-primary" data-toggle="collapse" type="button" data-target="#acc_<?php echo $cats[$key]['seoname']; ?> "> <?php echo $cats[$key]['name']; ?> </a> <?php if ($cats[$key]['price'] > 0) { ?> <span class="label label-success pull-right"> <?php echo i18n::money_format($cats[$key]['price']); ?> </span> <?php } ?> </label> <?php } ?> </div> <?php if (count($item) > 0) { ?> <div id="acc_<?php echo $cats[$key]['seoname']; ?> " class="accordion-body collapse <?php echo $cats[$key]['seoname'] == Core::get('category') ? 'in' : ''; ?> "> <div class="accordion-inner"> <?php if (is_array($item)) { array_walk($item, 'lili3', $cats); } ?> </div> </div> <?php } ?> </div> <?php }
?> ?<?php echo str_replace('+', ' ', http_build_query(array('text' => $ad->category->name, 'size' => 14, 'auto' => 'yes'))); ?> " alt="<?php echo HTML::chars($ad->title); ?> "> <?php } ?> <?php if ($ad->price > 0) { ?> <span class="ad_price"> <?php echo i18n::money_format($ad->price); ?> </span> <?php } elseif (($ad->price == 0 or $ad->price == NULL) and core::config('advertisement.free') == 1) { ?> <span class="ad_price"><?php echo __('Free'); ?> </span> <?php } else { ?> <span class="ad_price"><?php echo __('Check Listing'); ?>
<?php echo Form::hidden('coupon_delete', Model_Coupon::current()->name); ?> <button type="submit" class="btn btn-warning"><?php echo __('Delete'); ?> <?php echo Model_Coupon::current()->name; ?> </button> <p> <?php echo __('Discount off'); ?> <?php echo Model_Coupon::current()->discount_amount == 0 ? round(Model_Coupon::current()->discount_percentage, 0) . '%' : i18n::money_format(Model_Coupon::current()->discount_amount); ?> <br> <?php echo Model_Coupon::current()->number_coupons; ?> <?php echo __('coupons left'); ?> , <?php echo __('valid until'); ?> <?php echo Date::format(Model_Coupon::current()->valid_date); ?> .