<?php
    /*
     *      Osclass – software for creating and publishing online classified
     *                           advertising platforms
     *
     *                        Copyright (C) 2012 OSCLASS
     *
     *       This program is free software: you can redistribute it and/or
     *     modify it under the terms of the GNU Affero General Public License
     *     as published by the Free Software Foundation, either version 3 of
     *            the License, or (at your option) any later version.
     *
     *     This program is distributed in the hope that it will be useful, but
     *         WITHOUT ANY WARRANTY; without even the implied warranty of
     *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *             GNU Affero General Public License for more details.
     *
     *      You should have received a copy of the GNU Affero General Public
     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */

  osc_get_premiums(3);
    if(osc_count_premiums() > 0) {
?>
        <?php $class = "even"; ?>
        <?php while(osc_has_premiums()) { ?>
		<?php  $index = 0;
				         
                ?>
            <div class="next_item" >
	<div class="item_box" ><div class="item" ><div class="next_revo" ><div class="next_revo2" style="background:#F6EBCB">
	<div class="title"><h2><a href="<?php echo osc_premium_url(); ?>"><?php if(strlen(osc_premium_title()) > 51){ echo mb_substr(osc_premium_title(), 0, 50,'UTF-8').'...'; } else { echo osc_premium_title(); } ?></a></h2></div>
	<div class="next_revo_detail">
	<div class="item_img_premium"><?php if( osc_count_premium_resources() ) { ?><a href="<?php echo osc_premium_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" width="196" height="110" alt="<?php echo osc_premium_title(); ?>"/></a><?php } else { ?>
                                                <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" width="196" height="110" alt="" title="" />
                                            <?php } ?></div>
											<div class="region">&nbsp;<i class="fa fa-map-marker-v fa-lm"></i>&nbsp;&nbsp;&nbsp;<?php echo osc_premium_city();?></div>
											<div class="price">&nbsp;<i class="fa fa-tag-v fa-lm"></i>&nbsp;&nbsp;<?php echo osc_premium_formated_price(); ?></div>
											<div class="revo_bottom"></div><div class="see_details_box_p"><a class="see_details" href="<?php echo osc_premium_url(); ?>" ><?php _e('More', 'next_revo') ; ?></a></div></div></div></div></div></div></div>
            <?php $class = ($class == 'even') ? 'odd' : 'even'; ?>
			 <?php
                            $index++;
                            if($index == 3){
                                break; 
                            }
                        }
                    ?>  

<?php } ?>

        <?php $class = "even"; ?>
        <?php while(osc_has_items()) { ?>
           <div class="next_item">
	<div class="item_box" ><div class="item"><div class="next_revo"><div class="next_revo2">
	<div class="title"><h2><a href="<?php echo osc_item_url(); ?>"><?php if(strlen(osc_item_title()) > 51){ echo mb_substr(osc_item_title(), 0, 50,'UTF-8').'...'; } else { echo osc_item_title(); } ?></a></h2></div>
	<div class="next_revo_detail">
	<div class="item_img"><?php if( osc_count_item_resources() ) { ?><a href="<?php echo osc_item_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" width="196" height="110" alt="<?php echo osc_item_title(); ?>"/></a><?php } else { ?>
                                                <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" width="196" height="110" alt="" title="" />
                                            <?php } ?></div>
											<div class="region">&nbsp;<i class="fa fa-map-marker fa-lm"></i>&nbsp;&nbsp;&nbsp;<?php echo osc_item_city();?></div>
											<div class="price">&nbsp;<i class="fa fa-tag fa-lm"></i>&nbsp;&nbsp;<?php echo osc_item_formated_price(); ?></div>
											<div class="revo_bottom"></div><div class="see_details_box"><a class="see_details" href="<?php echo osc_item_url(); ?>" ><?php _e('More', 'next_revo') ; ?></a></div></div></div></div></div></div></div>
            <?php $class = ($class == 'even') ? 'odd' : 'even'; ?>
        <?php } ?>

