Example #1
0
    ?>

                        <input type="hidden" name="quantity" value="1"  />
                        <div class="col-xs-12">
                            <div class="product-col list clearfix">
								<div class="col-sm-3">
									 <div class="image">
										<a href="/<?php 
    echo $category->url;
    ?>
/<?php 
    echo $prod->url;
    ?>
">
											<img src="<?php 
    echo Lib_Image::resize_bg($prod->main_image, 'product', $prod->id, 250, 250);
    ?>
" alt="product" class="img-responsive" />
										</a>
									</div>
								</div>
								<div class="col-sm-6">
									 <div class="caption">
										<h4><a href="/<?php 
    echo $category->url;
    ?>
/<?php 
    echo $prod->url;
    ?>
"><?php 
    echo $prod->name;
Example #2
0
    $category = ORM::factory('Category')->where('id', '=', $item->category_id)->find();
    if ($item->new_price) {
        $price = $item->new_price;
    } else {
        $price = $item->price;
    }
    ?>
    <div class="item">
        <div class="image"><a href="/<?php 
    echo $category->url;
    ?>
/<?php 
    echo $item->url;
    ?>
"><img src="<?php 
    echo Lib_Image::resize_bg($item->main_image, 'product', $item->id, 150, 150);
    ?>
"></a></div>
        <div class="name"><a href="/<?php 
    echo $category->url;
    ?>
/<?php 
    echo $item->url;
    ?>
"><?php 
    echo $item->name;
    ?>
</a></div>
        <div class="price two">
                <span class="new-price"><?php 
    echo number_format($price, 0, '', ' ');
Example #3
0
                <?php 
foreach ($related as $related_prod) {
    $price = ORM::factory('Product')->getPriceValue($related_prod->id);
    ?>
                <div class="col-md-3 col-sm-6">
                    <div class="product-col">
                        <div class="image">
                            <a href="/<?php 
    echo $category->url;
    ?>
/<?php 
    echo $related_prod->url;
    ?>
">
                                <img src="<?php 
    echo Lib_Image::resize_bg($related_prod->main_image, '$related', $related_prod->id, 250, 250);
    ?>
"  alt="product" class="img-responsive" />
                            </a>
                        </div>
                        <div class="caption">
                            <br>
                            <div class="price">
                                <span class="price-new"><?php 
    echo number_format($price, 0, ' ', ' ');
    ?>
руб.</span>
                            </div>
                            <?php 
    if ($related_prod->new_price) {
        ?>
Example #4
0
        $crt = ORM::factory('Certificate')->fetchCertificateById($certificate->id);
        $price = $crt->price;
        $resprice = $price * $certificate->quantity;
        $lastprice += $price * $certificate->quantity;
        ?>
                <tr data-cert-id="<?php 
        echo $key;
        ?>
">
                    <td class="text-center">
                        <a href="/sertificate/<?php 
        echo $crt->url;
        ?>
">
                            <img src="<?php 
        echo Lib_Image::resize_width($crt->image, 'certificate', $crt->id, 128, null);
        ?>
" alt="<?php 
        echo $crt->name;
        ?>
"  title="image" class="img-thumbnail img-responsive" />
                        </a>
                    </td>
                    <td class="text-left">
                        <a data-name="prod_name" href="/sertificate/<?php 
        echo $crt->url;
        ?>
">
                            <?php 
        echo $crt->name;
        ?>
Example #5
0
            <h3 class="side-heading">Спецпредложение</h3>
            <?php 
    foreach ($specialProduct as $topprod) {
        $price = ORM::factory('Product')->getPriceValue($topprod->id);
        ?>
            <div class="product-col">
                <div class="image">
                    <a href="<?php 
        echo $category->url;
        ?>
/<?php 
        echo $topprod->url;
        ?>
">
                        <img src="<?php 
        echo Lib_Image::resize_width($topprod->main_image, 'product', $topprod->id, 250, 250);
        ?>
" alt="product" class="img-responsive" />
                    </a>
                </div>
                <div class="caption">
                    <div class="price">
                        <span class="price-new"><?php 
        echo number_format($price, 0, ' ', ' ');
        ?>
 руб.</span>
                    </div>
                    <?php 
        if ($topprod->new_price) {
            ?>
                        <div class="price">
Example #6
0
 private function replace_images()
 {
     $model_name = get_class($this->_model);
     $content = preg_replace_callback('%(\\[.*\\])%isU', function ($match) {
         $more_images = json_decode($this->_model->more_images);
         if (!strstr($match[1], '|')) {
             $match[1] = str_replace(']', '|]', $match[1]);
         }
         $parts = explode('|', $match[1]);
         $image_num = str_replace('[image_', '', $parts[0]) - 1;
         $image_alt = str_replace(']', '', $parts[1]);
         if (isset($more_images[$image_num]) && ($image = $more_images[$image_num])) {
             return '<img src="' . Lib_Image::resize_width($image, mb_strtolower($this->_object_name), $this->_model->id, $model_name::BIG_WIDTH) . '" class="img-rounded" alt="' . $image_alt . '" />';
         }
     }, $this->_model->content);
     return $content;
 }
Example #7
0
 public function get_image_thumb()
 {
     return HTML::image(Lib_Image::crop($this->image, 'slider', $this->id, 220, 120));
 }
Example #8
0
        <!-- Products Row Starts -->
        <div class="row">
            <!-- Product #1 Starts -->
            <?php 
foreach ($certificate as $product) {
    ?>
                <input type="hidden" name="quantity" value="1"/>
                <div class="col-md-3 col-sm-6">
                    <div class="product-col">
                        <div class="image">
                            <a href="certificate_product/<?php 
    echo $product->url;
    ?>
">
                                <img src="<?php 
    echo Lib_Image::resize_bg($product->image, 'certificate', $product->id, 250, 250);
    ?>
" alt="product" class="img-responsive" />
                            </a>
                        </div>
                        <div class="caption">
                            <div class="price">
                                <span class="price-new" ><?php 
    echo number_format($product->price, 0, ' ', ' ');
    ?>
руб.</span>
                            </div>
                            <h4><a href="certificate_product/<?php 
    echo $product->url;
    ?>
 "> <?php 
Example #9
0
<div class="container">	<div class="row">		<div class="breadcrumbs col-xs-12" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">			<strong>Вы здесь:</strong> <div><a href="/" itemprop="url"><span itemprop="title">Главная</span></a></div><div><span>Акции</span></div>		</div>	</div></div>
<div class="clear"></div><div class="container">	<div class="row">		<div class="col-xs-12">
			<h1>Акции</h1>		</div>	</div></div><div class="col-xs-12">	<?php 
echo $pagination;
?>
</div><div class="container contant">	<div class="row">		<div class="polka">
		<?php 
$discount = ORM::factory('Discount')->fetchActive();
foreach ($discount as $item) {
    ?>
		<div class="discount col-xs-4">
			<div class="col-xs-12 image"><a href="/discount/<?php 
    echo $item->url;
    ?>
"><img src="<?php 
    echo Lib_Image::resize_width($item->image, 'discount', $item->id, 290, null);
    ?>
" alt="Акция - <?php 
    echo $item->name;
    ?>
" /></a></div>
			<div class="col-xs-12"><span class="from_to"><?php 
    echo $item->from_to;
    ?>
</span></div>			<div class="col-xs-12 h1"><a href="/discount/<?php 
    echo $item->url;
    ?>
"><?php 
    echo $item->name;
    ?>
</a></div>			<div class="col-xs-12"><?php 
Example #10
0
			for($i=0;$i<80;$i++)//生成干扰像素
			{
				$dis_color=imagecolorallocate($image,rand(0,2555),rand(0,255),rand(0,255));
				imagesetpixel($image,rand(1,$this->width),rand(1,$this->height),$dis_color);
			}		
		}
		
		public function veryCode()
		{
			
			$image=imagecreate($this->width,$this->height);
			imagecolorallocate($image,255,255,255);
			//$this->genOther($image);
			
			$num = 4;
			$code = $this->genCode($num);
			for($i=0;$i<$num;$i++)//打印字符到图像
			{
				$char_color=imagecolorallocate($image,rand(0,2555),rand(0,255),rand(0,255));
				imagechar($image,60,($this->width/$num)*$i,rand(0,5),$code[$i],$char_color);
			}
			
			header("Content-type:image/png");
			imagepng($image);//输出图像到浏览器
			imagedestroy($image);//释放资源
		}
	}
	
	$image = new Lib_Image(25, 65);
	$image->veryCode();
?>