Skip to content
Permalink
Browse files

listing with bages for location.. and in edit_ad there is minor fix r…

…elated to price
  • Loading branch information
josifovics committed Jun 27, 2013
1 parent ce2fd9e commit d0f08bbaf08f48b169b0022d00d57b9aa3934a9b
@@ -353,7 +353,7 @@ public function action_update()
'cat' => $category = core::post('category'),
'loc' => $loc = core::post('location'),
'description' => $description = core::post('description'),
'price' => $price = core::post('price'),
'price' => $price = floatval(str_replace(',', '.', core::post('price'))),
'status' => $status = core::post('status'),
'address' => $address = core::post('address'),
'website' => $website = core::post('website'),
@@ -121,6 +121,19 @@ public static function get_all()
return array($locs_arr,$locs_m);
}

/**
* we get the locations in an array and a multidimensional array to know the deep
* @param int ID of location
* @param string needed attribute to be returned
* @return string
*/

public static function get_location($id, $attr)
{
$location = new self($id);
return $location->$attr;
}

/**
* gets a multidimensional array wit the locations
* @param array $locs_s id_location->array(id_siblings)
@@ -163,7 +163,7 @@
<div class="controls">
<div class="input-prepend">
<span class="add-on"><?=core::config('general.global_currency')?></span>
<?= FORM::input('price', number_format($ad->price, 2), array('class' => '', 'id' => 'price', 'type'=>'number'))?>
<?= FORM::input('price', number_format($ad->price, 2), array('class' => '', 'id' => 'price', 'data-validation-regex-regex'=>"^[0-9]{1,18}([,.]{1}[0-9]{1,3})?$", "data-validation-regex-message"=>__('Incorect price, not more than 3 decimals')))?>
</div>
</div>
</div>
@@ -16,8 +16,17 @@
</div><!--end of advise-->

<?if(count($ads)):?>

<?foreach($ads as $ad ):?>

<?
if (Controller::$location!==NULL)
{
if (Controller::$location->loaded())
$location = Controller::$location->name;
}
else
$location = Model_Location::get_location($ad->id_location, 'name');
?>
<?if($ad->featured >= Date::unix2mysql(time())):?>
<article class="list well clearfix featured">
<span class="label label-important"><?=__('Featured')?></span>
@@ -27,6 +36,7 @@
<h2>
<? $cat_name = $ad->category->seoname; ?>
<a title="<?= $ad->title;?>" href="<?=Route::url('ad', array('controller'=>'ad','category'=>$cat_name,'seotitle'=>$ad->seotitle))?>"> <?=$ad->title; ?></a>
<span class="label"><?=$location?></span>
</h2>

<?if($ad->get_first_image() !== NULL):?>

0 comments on commit d0f08bb

Please sign in to comment.
You can’t perform that action at this time.