Пример #1
0
function js_asset_url($asset_name, $module_name = NULL, $user = NULL)
{
    if ($user == NULL) {
        return other_asset_url($asset_name, $module_name, 'js');
    } else {
        return other_asset_url($asset_name, $module_name, $user);
    }
}
Пример #2
0
    public function create_product_html($products)
    {
        $product_html = "";
        if ($products) {
            foreach ($products as $products) {
                $image_path_original = other_asset_url($products['product_image'] . '_m.' . $products['product_ext'], '', 'uploads/images/products');
                $iarr = @getimagesize($image_path_original);
                if (!is_array($iarr)) {
                    $image_path_original = image_asset_url('no_image.gif');
                }
                $img_featue = 'header.jpg';
                if ($products['is_featured']) {
                    $img_featue = 'heart_red.jpg';
                }
                $sale_tag = '';
                if ($products['sale_type_id'] == '1') {
                    $sale_tag = '<span style="float:left;"> Before: ' . round($products['product_price']) . ' kr
								<br>
								<label style="color:red">Now: ' . round($products['sale_value']) . ' kr</label> </span>
								<div class="persentage_imgs">
									-' . round(100 - $products['sale_value'] / $products['product_price'] * 100) . '%
								</div>';
                } elseif ($products['sale_type_id'] == '2') {
                    $now_price = $products['product_price'] * ($products['sale_value'] / 100);
                    $sale_tag = '<span style="float:left;"> Before: ' . round($products['product_price']) . ' kr
								<br>
								<label style="color:red">Now: ' . round($products['product_price'] - $now_price) . ' kr</label> </span>
								<div class="persentage_imgs">
									-' . round($products['sale_value']) . '%
								</div><!--persentage_img-->';
                } else {
                    $sale_tag = '<span style="float:left;"> 
								<label style="color:red">Now:' . round($products['product_price']) . ' kr</label> </span>';
                    if ($products['sale_type_id'] == '3') {
                        $sale_tag .= '<br /><span style="float:left;"><label> Buy 1 get ' . $products['sale_value'] . ' free</label></span>';
                    }
                    if ($products['sale_type_id'] == '4') {
                        $deals = explode('_', $products['sale_value']);
                        $sale_tag .= '<span style="float:left;"><label >Buy ' . $deals[0] . ' and pay for ' . $deals[1] . '</label></span>';
                    }
                }
                $product_html .= '<div class="cata_pro">
									<a href="' . base_url() . 'product/product_detail/' . $products['id'] . '" class="product_detail"><img height="256" width="200" src="' . $image_path_original . '"/></a>
									<!-- <div class="heart">
										' . image_asset($img_featue) . '
									</div> -->
									<p>
										' . $products['product_name'] . '
									</p>
									<div class="clear"></div>									
									' . $sale_tag . '
								</div><!--cata_pro-->';
            }
        } else {
            $product_html .= '<div class="cata_pro"><p>Kommer snart! </p></div>';
        }
        return $product_html;
    }
Пример #3
0
?>
"},
							width         : 108,
							fileObjName   : 'userfile',
							queueID  	  : 'some_file_queue',
							fileTypeDesc  : 'Image Files',
				        	fileTypeExts  : '*.jpg; *.png',
					        'onUploadSuccess' : function(file, data, response) {
					        	var myobj = JSON.parse(data);
					            //alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data);
					            proimgs.push(myobj.name);
					            proimgsext.push(myobj.ext);
					            $('#product_moreimages').val(proimgs.join(','));
					            $('#product_moreimagesext').val(proimgsext.join(','));
					            $('.uploadedimages').append('<li><img src="<?php 
echo other_asset_url("'+myobj.name+'_s.'+myobj.ext+'", "", "uploads/images/products");
?>
" width="32" height="32" alt="image" />'+
						                    				'<div class="clr"></div><a href="#" class="delproductimg" rel="'+myobj.name+'_'+myobj.ext+'">Delete</a> </li>');
					        },
					        'onUploadError' : function(file, errorCode, errorMsg, errorString) {
					            alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
					        }
						});
						$('.delproductimg').live('click',function(){
							var timg = $(this).attr('rel');
							$.post('<?php 
echo base_url();
?>
user/unlink_promoreimage',{img:timg},function(data){});
							$(this).parent().remove();
Пример #4
0
		<meta content="" name="author" />
		<!-- end: META -->
		<!-- start: MAIN CSS -->
		<?php 
echo plugin_css_asset("admin/bootstrap/css/bootstrap.min.css");
echo plugin_css_asset("admin/font-awesome/css/font-awesome.min.css");
echo css_asset("admin/main.css");
echo css_asset("admin/main-responsive.css");
echo plugin_css_asset("admin/iCheck/skins/all.css");
echo plugin_css_asset("admin/bootstrap-colorpalette/css/bootstrap-colorpalette.css");
echo plugin_css_asset("admin/perfect-scrollbar/src/perfect-scrollbar.css");
echo css_asset("admin/theme_light.css");
echo css_asset("admin/print.css", null, array("media" => "print"));
?>
		<link rel="stylesheet" href="<?php 
echo other_asset_url("fonts/style.css");
?>
">
		
		<!--[if IE 7]>
		<?php 
echo plugin_css_asset("admin/font-awesome/css/font-awesome-ie7.min.css");
?>
		<![endif]-->
		<!-- end: MAIN CSS -->
		<!-- start: CSS REQUIRED FOR THIS PAGE ONLY -->
		<?php 
echo plugin_css_asset("admin/fullcalendar/fullcalendar/fullcalendar.css");
?>
		<!-- end: CSS REQUIRED FOR THIS PAGE ONLY -->
		
Пример #5
0
										<tr>
											<td height="25" width="185" colspan="2">
												<input type="file" id="fileupload" />
												<span id="uploadmsg"></span>
												<input type="hidden" name="logo_image" id="logo_image" value="<?php 
echo $user['logo_image'];
?>
" />
									            <input type="hidden" name="logo_ext" id="logo_ext" value="<?php 
echo $user['logo_ext'];
?>
" />
											</td>
											<td height="20" width="165">
												<img id="proimage" src="<?php 
echo other_asset_url($user['logo_image'] . '_s.' . $user['logo_ext'], '', 'uploads/images/retailer');
?>
" />
											</td>
										</tr>
										<tr>
											<td height="20" width="165">&nbsp;</td>
											<td height="20" width="20">&nbsp;</td>
											<td height="20" width="165">&nbsp;</td>
										</tr>
										<tr>
											<td height="20" width="165" colspan="3"><span style="font-weight: 700"> <font style="font-size: 10px" face="Tahoma"> Välj din prisplan</font> </span></td>
										</tr>
										<tr>
											<td height="25" width="185" colspan="3">
											<?php 
Пример #6
0
/**
 * Generate html with filters
 * $Query: sql query for required result
 * $Where: option where condition
 * $aColumns: column names to use in filteration
 * $filteraColumns: column names to fetch data from result set
 * $get_request should contain an array of anything to be passed in the url query paramters as GET
 * $action_link: action link for particular entry such as View, Delete, Approve etc
 */
function ajax_admin_html($Query, $Where = '', $group_by = '', $aColumns, $filteraColumns, $whereColumns, $get_request, $is_view, $view_link, $is_edit, $edit_link, $is_delete, $delete_link = '')
{
    $ci =& get_instance();
    $sIndexColumn = "id";
    /*
     * Paging
     */
    $sLimit = "";
    if (isset($get_request['iDisplayStart']) && $get_request['iDisplayLength'] != '-1') {
        $sLimit = "LIMIT " . $get_request['iDisplayStart'] . "," . $get_request['iDisplayLength'];
    }
    /*
     * Ordering
     */
    $sOrder = "";
    if (isset($get_request['iSortCol_0'])) {
        $sOrder = "ORDER BY  ";
        for ($i = 0; $i < intval($get_request['iSortingCols']); $i++) {
            if ($get_request['bSortable_' . intval($get_request['iSortCol_' . $i])] == "true") {
                $sOrder .= "" . $aColumns[intval($get_request['iSortCol_' . $i])] . " " . $get_request['sSortDir_' . $i] . ", ";
            }
        }
        $sOrder = substr_replace($sOrder, "", -2);
        if ($sOrder == "ORDER BY") {
            $sOrder = "";
        }
    }
    /*
     * Filtering
     * NOTE this does not match the built-in DataTables filtering which does it
     * word by word on any field. It's possible to do here, but concerned about efficiency
     * on very large tables, and MySQL's regex functionality is very limited
     */
    $sWhere = "";
    if (isset($get_request['sSearch']) && $get_request['sSearch'] != "") {
        $sWhere = "WHERE (";
        for ($i = 0; $i < count($whereColumns); $i++) {
            $sWhere .= $whereColumns[$i] . " LIKE '%" . $ci->db->escape_like_str($get_request['sSearch']) . "%' OR ";
        }
        $sWhere = substr_replace($sWhere, "", -3);
        $sWhere .= ')';
    }
    /* Individual column filtering */
    for ($i = 0; $i < count($whereColumns); $i++) {
        if (isset($get_request['bSearchable_' . $i]) && $get_request['bSearchable_' . $i] == "true" && $get_request['sSearch_' . $i] != '') {
            if ($sWhere == "") {
                $sWhere = "WHERE ";
            } else {
                $sWhere .= " AND ";
            }
            $sWhere .= $whereColumns[$i] . " LIKE %" . $ci->db->escape_like_str($get_request['sSearch_' . $i]) . "% ";
        }
    }
    if ($Where != '') {
        if ($sWhere == "") {
            $sWhere = "WHERE  {$Where} ";
        } else {
            $sWhere .= " AND  {$Where} ";
        }
    }
    /*
     * SQL queries
     * Get data to display
     */
    $asQuery = "{$Query}\n\t{$sWhere}\n\t{$group_by}\n\t{$sOrder}\n\t{$sLimit}\n\t";
    //log_message('debug','pagination_helper asQuery: '.$asQuery);
    $rResult = $ci->db->query($asQuery);
    /* Data set length after filtering */
    $bsQuery = "{$Query}\n\t{$sWhere}\n\t{$group_by}\n\t{$sOrder}";
    //log_message('debug','pagination_helper bsQuery: '.$bsQuery);
    $rResultFilterTotal = $ci->db->query($bsQuery);
    $aResultFilterTotal = $rResultFilterTotal->num_rows();
    /*
     * Output
     */
    $output = array("sEcho" => intval($get_request['sEcho']), "iTotalRecords" => $aResultFilterTotal, "iTotalDisplayRecords" => $aResultFilterTotal, "aaData" => array());
    $aRows = $rResult->result_array();
    foreach ($aRows as $aRow) {
        $row = array();
        for ($i = 0; $i < count($filteraColumns); $i++) {
            if ($filteraColumns[$i] == "image") {
                $image_path = other_asset_url($aRow['product_image'] . '_s.' . $aRow['product_ext'], '', 'uploads/images/products');
                $row[] = '<img src="' . $image_path . '" width="100" />';
            } elseif ($filteraColumns[$i] == "is_featured") {
                $row[] = $aRow['is_featured'] == 1 ? 'Yes' : 'No';
            } elseif ($filteraColumns[$i] == "action") {
                /* Special output formatting for 'action' column */
                $action_link = '';
                if ($is_view == TRUE) {
                    $action_link .= ' <a href="' . base_url() . 'admin/' . $view_link . '/' . $aRow['id'] . '">View</a> ';
                }
                if ($is_edit == TRUE) {
                    $action_link .= ' <a href="' . base_url() . 'admin/' . $edit_link . '/' . $aRow['id'] . '">Edit</a>';
                }
                if ($is_delete == TRUE) {
                    if ($delete_link == '') {
                        $action_link .= ' <a href="#" rel="' . $aRow['id'] . '" class="deleteproduct">Delete</a>';
                    } else {
                        $action_link .= ' <a href="' . base_url() . 'admin/' . $delete_link . '/' . $aRow['id'] . '">Delete</a>';
                    }
                }
                $row[] = $action_link;
            } elseif ($filteraColumns[$i] == "is_redeem") {
                $checked = $aRow['redeem'] ? 'checked="checked"' : '';
                $row[] = '<input type="checkbox" name="is_redeem" class="is_redeem" rel="' . $aRow['user_reward_id'] . '" ' . $checked . ' />';
            } else {
                /* General output */
                $row[] = $aRow[$filteraColumns[$i]];
            }
        }
        $output['aaData'][] = $row;
    }
    return $output;
}
Пример #7
0
/**
 * JavaScript Asset URL Helper
 *
 * Helps generate JavaScript asset locations.
 *
 * @access		public
 * @param		string    the name of the file or asset
 * @param		string    optional, module name
 * @return		string    full url to JavaScript asset
 */
function js_asset_url($asset_name, $module_name = NULL)
{
    return other_asset_url($asset_name, $module_name, 'js');
}
Пример #8
0
            <ul>
              <?php 
$popular_sales = get_pro_by_price(0, $detail['sale_price'], $cat_id);
if ($popular_sales) {
    foreach ($popular_sales as $sale) {
        ?>
              <li class="pro_slider"> <a class="image_container" href="<?php 
        echo base_url();
        ?>
product/product_detail/<?php 
        echo $sale['pro_id'];
        ?>
" >
                <?php 
        if ($sale['from_api'] == 0) {
            $image_path_original = other_asset_url($sale['product_image'] . '_m.' . $sale['product_ext'], '', 'uploads/images/products');
        } else {
            $image_path_original = str_replace('160', '440', $sale['product_image']);
        }
        ?>
                <img src="<?php 
        echo $image_path_original;
        ?>
"  alt=""> </a>
                <div class="clear"></div>
                <p>
                  <?php 
        echo trim_text(strip_tags($sale['product_name']), 25);
        ?>
                </p>
                <span class="clear"></span>
Пример #9
0
    public function wishlist()
    {
        $this->load->library('pagination');
        $config['base_url'] = base_url() . 'category/whishlist_product';
        $config['total_rows'] = $this->wishlist_model->get_all_wishedproducts_count();
        $config['per_page'] = 24;
        $config['uri_segment'] = $this->uri->segment(3);
        $this->pagination->initialize($config);
        $offset = $config['uri_segment'];
        $limit = $config['per_page'];
        $this->pagination->initialize($config);
        $wishlist_products = $this->wishlist_model->get_all_wishedproducts($limit, $offset);
        $pro_html = '';
        if ($wishlist_products) {
            foreach ($wishlist_products as $wishlist_product) {
                $products = $this->product_model->get_product_detail($wishlist_product['product_id']);
                if ($products) {
                    if ($products['from_api'] == 0) {
                        $image_path_original = other_asset_url($products['product_image'] . '_m.' . $products['product_ext'], '', 'uploads/images/products');
                        $iarr = getimagesize($image_path_original);
                        if (!is_array($iarr)) {
                            $image_path_original = image_asset_url('no_image.gif');
                        }
                    } else {
                        //$image_path_original = $products['product_image'];
                        $image_path_original = str_replace('440', '220', $products['product_image']);
                    }
                    $img_featue = 'heart_red.jpg';
                    $heart_class = '<div class="remove_wish" rel="' . $wishlist_product['wish_id'] . '" id="wish_heart_' . $wishlist_product['wish_id'] . '" style="display:none">
									' . image_asset($img_featue) . '
								</div>';
                    $sale_tag = '';
                    if ($products['sale_type_id'] == '1') {
                        $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
								<br>
								<label style="color:red">Nu: ' . makeCurrency($products['sale_value']) . ' kr</label> </span>
								<div class="persentage_imgs">
									-' . makeCurrency(100 - $products['sale_value'] / $products['product_price'] * 100) . '%
								</div>';
                    } elseif ($products['sale_type_id'] == '2') {
                        $now_price = $products['product_price'] * ($products['sale_value'] / 100);
                        $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
								<br>
								<label style="color:red">Nu: ' . makeCurrency($products['product_price'] - $now_price) . ' kr</label> </span>
								<div class="persentage_imgs">
									-' . makeCurrency($products['sale_value']) . '%
								</div><!--persentage_img-->';
                    } elseif ($products['sale_type_id'] == '5') {
                        $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
							<br>
							<label style="color:red">Nu: ' . makeCurrency($products['sale_price']) . ' kr</label> </span>
							<div class="persentage_imgs">
								-' . $products['api_reduction_percent'] . '%
							</div>';
                    }
                    $pro_html .= '<div class="cata_pro product_detail"  rel="' . $wishlist_product['wish_id'] . '">
										<a id="product_' . $products['pro_id'] . '" href="' . base_url() . 'product/product_detail/' . $products['pro_id'] . '" ><img src="' . $image_path_original . '"/></a>
										
										' . $heart_class . '
										<p>
											' . $products['product_name'] . '
										</p>
										<div class="clear"></div>									
										' . $sale_tag . '
									</div>';
                }
            }
        } else {
            $pro_html .= '
                            Det finns inga produkter i önskelistan.
                            <h2 style="margin-top:10px;">
                                Fördelar med SaleFinder önskelista
                            </h2>
                            <ul>
                               <li> 
                                Du kan spara produkter till nästa gång du loggar in
                               </li>
                               <li>
                                Du kan enkelt jämföra produkterna du har i önskelistan
                               </li>
                               <li>
                                Det blir lätt att ha alla dina favorit reavaror på ett ställe
                               </li>
                            </ul>
                ';
        }
        // $data['category_name']     = get_categroy_name(149);
        // $data['product_category']  = get_product_oncategory(149);
        // //$data['product_category']  = '';
        // $data['other_choice']      = other_choice_category();
        // $data['related_categories']= related_categories(149);
        // $data['sales_to_missed']   = sales_not_missed();
        $data['products'] = $pro_html;
        $data['pagination'] = $this->pagination->create_links();
        $this->template->load('responsive/default', 'responsive/wishlist', $data);
    }
Пример #10
0
 public function add_retailer_image()
 {
     $time = time() . rand();
     $logo = array('file' => $_FILES["userfile"], 'new_name' => $time . '_o', 'dst_path' => $this->config->item('retailer_image_path'));
     $logo_response = upload_original($logo);
     $src_path = $this->config->item('retailer_image_path') . $logo_response['file_name'];
     $logo_thumbs = array(array('src_path' => $src_path, 'dst_path' => $this->config->item('retailer_image_path'), 'image_x' => $this->config->item('retailer_image_large_x'), 'image_y' => $this->config->item('retailer_image_large_y'), 'image_ratio' => TRUE, 'image_ratio_fill' => TRUE, 'new_name' => $time . '_l'), array('src_path' => $src_path, 'dst_path' => $this->config->item('retailer_image_path'), 'image_x' => $this->config->item('retailer_image_medium_x'), 'image_y' => $this->config->item('retailer_image_medium_y'), 'image_ratio' => TRUE, 'image_ratio_fill' => TRUE, 'new_name' => $time . '_m'), array('src_path' => $src_path, 'dst_path' => $this->config->item('retailer_image_path'), 'image_x' => $this->config->item('retailer_image_small_x'), 'image_y' => $this->config->item('retailer_image_small_y'), 'image_ratio' => TRUE, 'image_ratio_fill' => TRUE, 'new_name' => $time . '_s'));
     foreach ($logo_thumbs as $logo_thumb) {
         upload_resized_images($logo_thumb);
     }
     echo json_encode(array('name' => $time, 'ext' => $logo_response['file_ext'], 'imagename' => other_asset_url($time . '_s.' . $logo_response['file_ext'], '', 'uploads/images/retailer')));
 }
Пример #11
0
<html>
<head>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<?php 
echo css_asset('easyhotspot.css', $this->config->item('EASYHOTSPOT_THEME'));
?>
	<?php 
echo css_asset('admin.css', $this->config->item('EASYHOTSPOT_THEME'));
?>
	<?php 
echo css_asset('billing.css', $this->config->item('EASYHOTSPOT_THEME'));
?>
	<link rel="shortcut icon" href="<?php 
echo other_asset_url('favicon.ico', 'default', 'image');
?>
" />
	<?php 
echo js_asset('jquery.js');
?>
	<?php 
echo js_asset('flash.js	');
?>
	<title>EasyHotspot : <?php 
echo $title;
?>
</title>
</head>

<body>
Пример #12
0
    public function index()
    {
        $cat_id = $_GET['cat_id'];
        $config['base_url'] = base_url() . 'category/?cat_id=' . $_GET['cat_id'];
        $config['total_rows'] = $this->product_model->total_product_by_category($_GET['cat_id']);
        $config['per_page'] = 20;
        $config['uri_segment'] = isset($_GET['per_page']) ? $_GET['per_page'] : 9;
        $this->pagination->initialize($config);
        $offset = $config['uri_segment'];
        $limit = $config['per_page'];
        $config['enable_query_strings'] = TRUE;
        $config['page_query_string'] = TRUE;
        $this->pagination->initialize($config);
        $products = $this->product_model->product_by_category($cat_id, $limit, $offset);
        $pro_html = '';
        if ($products) {
            foreach ($products as $products) {
                if ($products['product_image']) {
                    $image_path_original = other_asset_url($products['product_image'] . '_m.' . $products['product_ext'], '', 'uploads/images/products');
                }
                $iarr = @getimagesize($image_path_original);
                if (!is_array($iarr)) {
                    $image_path_original = image_asset_url('no_image.gif');
                }
                $img_featue = 'header.jpg';
                $heart_class = '<div class="heart" rel="' . $products['pro_id'] . '" id="wish_heart_' . $products['pro_id'] . '" style="display:none">
										' . image_asset($img_featue) . '
									</div>';
                $whislist_detail = $this->wishlist_model->get_wishlist_detail_product($products['pro_id']);
                if ($this->wishlist_model->get_wishlist_detail_product($products['pro_id'])) {
                    $img_featue = 'heart_red.jpg';
                    $heart_class = '<div class="heartred" rel="' . $products['pro_id'] . '" id="wish_heart_' . $products['pro_id'] . '">
										' . image_asset($img_featue) . '
									</div>';
                }
                $sale_tag = '';
                if ($products['sale_type_id'] == '1') {
                    $sale_tag = '<span style="float:left;"> Before: ' . round($products['product_price']) . ' kr
							<br>
							<label style="color:red">Now: ' . round($products['sale_value']) . ' kr</label> </span>
							<div class="persentage_imgs">
								-' . round(100 - $products['sale_value'] / $products['product_price'] * 100) . '%
							</div>';
                } elseif ($products['sale_type_id'] == '2') {
                    $now_price = $products['product_price'] * ($products['sale_value'] / 100);
                    $sale_tag = '<span style="float:left;"> Before: ' . round($products['product_price']) . ' kr
							<br>
							<label style="color:red">Now: ' . round($products['product_price'] - $now_price) . ' kr</label> </span>
							<div class="persentage_imgs">
										-' . round($products['sale_value']) . '%
							</div><!--persentage_img-->';
                } else {
                    $sale_tag = '<span style="float:left;"> 
							<label style="color:red">Now:' . round($products['product_price']) . ' kr</label> </span>';
                    if ($products['sale_type_id'] == '3') {
                        $sale_tag .= '<br /><span style="float:left;"><label> Buy 1 get ' . $products['sale_value'] . ' free</label></span>';
                    }
                    if ($products['sale_type_id'] == '4') {
                        $deals = explode('_', $products['sale_value']);
                        $sale_tag .= '<span style="float:left;"><label >Buy ' . $deals[0] . ' and pay for ' . $deals[1] . '</label></span>';
                    }
                }
                $pro_html .= '<div class="cata_pro product_detail" rel="' . $products['pro_id'] . '">
									<a id="product_' . $products['pro_id'] . '" href="' . base_url() . 'product/product_detail/' . $products['pro_id'] . '" ><img height="256" width="200" src="' . $image_path_original . '"/></a>
									
									' . $heart_class . '
									<p>
										' . trim_text(strip_tags($products['product_name']), 30) . '
									</p>
									<div class="clear"></div>									
									' . $sale_tag . '
								</div><!--cata_pro-->';
            }
        } else {
            $pro_html .= '<div class="cata_pro"><p>Sorry No Record Yet!</p></div>';
        }
        $cat_id = $this->input->get("cat_id");
        $data['category_name'] = get_categroy_name($cat_id);
        $data['category_detail'] = $this->categories_model->get_category_detail($cat_id);
        $data['product_category'] = get_product_oncategory($cat_id);
        //$data['product_category']  = '';
        $data['other_choice'] = other_choice_category();
        $data['related_categories'] = related_categories($cat_id);
        $data['sales_to_missed'] = sales_not_missed();
        $data['products'] = $pro_html;
        $data['pagination'] = $this->pagination->create_links();
        $data['query_params'] = $this->input->get();
        $data['total_records'] = $config['base_url'];
        $this->load->view('main/category.html', $data);
    }
function image_upload_url($asset_name, $module_name = NULL)
{
    return other_asset_url($asset_name, $module_name, 'upload');
}
Пример #14
0
    public function index()
    {
        $query_params = $this->input->get();
        $tmp_url = '';
        if (isset($query_params['brand'])) {
            $tmp_url .= "&brand=" . $query_params['brand'];
        }
        if (isset($query_params['min_price'])) {
            $tmp_url .= "&min_price=" . $query_params['min_price'];
        }
        if (isset($query_params['max_price'])) {
            $tmp_url .= "&max_price=" . $query_params['max_price'];
        }
        $cat_id = $_GET['cat_id'];
        $config['base_url'] = base_url() . 'category/?cat_id=' . $_GET['cat_id'] . $tmp_url;
        $config['total_rows'] = $this->product_model->total_product_by_category($_GET['cat_id']);
        $config['per_page'] = 24;
        $config['prev_link'] = '&lt; Föregående';
        $config['next_link'] = 'Nästa &gt;';
        $config['uri_segment'] = isset($_GET['per_page']) ? $_GET['per_page'] : 0;
        //$this->pagination->initialize($config);
        $offset = $config['uri_segment'];
        $limit = $config['per_page'];
        $config['enable_query_strings'] = TRUE;
        $config['page_query_string'] = TRUE;
        $this->pagination->initialize($config);
        $products = $this->product_model->product_by_category($cat_id, $limit, $offset);
        $pro_html = '';
        if ($products) {
            foreach ($products as $products) {
                if ($products['from_api'] == 0) {
                    $image_path_original = other_asset_url($products['product_image'] . '_m.' . $products['product_ext'], '', 'uploads/images/products');
                } else {
                    $image_path_original = str_replace('440', '220', $products['product_image']);
                }
                //        echo $image_path_original ;
                //$iarr = @getimagesize($image_path_original);
                //if(!is_array($iarr)){
                //$image_path_original = image_asset_url('no_image.gif');
                //      }
                $img_featue = 'header.jpg';
                $heart_class = '<div class="heart" rel="' . $products['pro_id'] . '" id="wish_heart_' . $products['pro_id'] . '" style="display:none">
										' . image_asset($img_featue) . '
									</div>';
                $whislist_detail = $this->wishlist_model->get_wishlist_detail_product($products['pro_id']);
                if ($this->wishlist_model->get_wishlist_detail_product($products['pro_id'])) {
                    $img_featue = 'heart_red.jpg';
                    $heart_class = '<div class="heartred" rel="' . $products['pro_id'] . '" id="wish_heart_' . $products['pro_id'] . '">
										' . image_asset($img_featue) . '
									</div>';
                }
                $sale_tag = '';
                if ($products['sale_type_id'] == '1') {
                    $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
							<br>
							<label style="color:red">Nu: ' . makeCurrency($products['sale_value']) . ' kr</label> </span>
							<div class="persentage_imgs">
								-' . makeCurrency(100 - $products['sale_value'] / $products['product_price'] * 100) . '%
							</div>';
                } elseif ($products['sale_type_id'] == '5') {
                    $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
							<br>
							<label style="color:red">Nu: ' . makeCurrency($products['sale_price']) . ' kr</label> </span>
							<div class="persentage_imgs">
								-' . $products['api_reduction_percent'] . '%
							</div>';
                } elseif ($products['sale_type_id'] == '2') {
                    $now_price = $products['product_price'] * ($products['sale_value'] / 100);
                    $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
							<br>
							<label style="color:red">Nu: ' . makeCurrency($products['product_price'] - $now_price) . ' kr</label> </span>
							<div class="persentage_imgs">
										-' . makeCurrency($products['sale_value']) . '%
							</div><!--persentage_img-->';
                } else {
                    $sale_tag = '<span style="float:left;"> 
							<label style="color:red">Nu:' . makeCurrency($products['product_price']) . ' kr</label> </span>';
                    if ($products['sale_type_id'] == '3') {
                        $sale_tag .= '<br /><span style="float:left;"><label> Buy 1 get ' . $products['sale_value'] . ' free</label></span>';
                    }
                    if ($products['sale_type_id'] == '4') {
                        $deals = explode('_', $products['sale_value']);
                        $sale_tag .= '<span style="float:left;"><label >Buy ' . $deals[0] . ' and pay for ' . $deals[1] . '</label></span>';
                    }
                }
                $pro_html .= '<div class="cata_pro product_detail" rel="' . $products['pro_id'] . '">
									<a id="product_' . $products['pro_id'] . '" href="' . base_url() . 'product/product_detail/' . $products['pro_id'] . '" ><img src="' . $image_path_original . '"/></a>
									
									' . $heart_class . '
									<p>
										' . trim_text(strip_tags($products['product_name']), 32) . '
									</p>
									<div class="clear"></div>									
									' . $sale_tag . '
								</div><!--cata_pro-->';
            }
        } else {
            $pro_html .= '<div class="cata_pro"><p>Kommer snart! </p></div>';
        }
        $cat_id = $this->input->get("cat_id");
        $data['category_name'] = get_categroy_name($cat_id);
        $data['category_detail'] = $this->categories_model->get_category_detail($cat_id);
        $data['product_category'] = get_product_oncategory($cat_id);
        //$data['product_category']  = '';
        $data['other_choice'] = other_choice_category();
        $data['related_categories'] = related_categories($cat_id);
        $data['sales_to_missed'] = sales_not_missed();
        $data['products'] = $pro_html;
        $data['pagination'] = $this->pagination->create_links();
        $data['query_params'] = $this->input->get();
        $data['total_records'] = $config['total_rows'];
        $this->template->load('responsive/default', 'responsive/category', $data);
        //$this->output->enable_profiler(TRUE);
    }
Пример #15
0
    public function viewproduct()
    {
        $products = $this->product_model->get_all_products_by_user($this->session->userdata('user_id'));
        $data['product_html'] = "";
        if ($products) {
            foreach ($products as $product) {
                $image_path = other_asset_url($product['product_image'] . '_s.' . $product['product_ext'], '', 'uploads/images/products');
                $data['product_html'] .= '<tr>
										<td style="border-bottom: 1px solid #EEEEEE;">' . $product['product_name'] . '</td>
										<td style="border-bottom: 1px solid #EEEEEE;"><img src="' . $image_path . '" /></td>
										<td style="border-bottom: 1px solid #EEEEEE;">' . $product['product_price'] . '</td>
										<td style="border-bottom: 1px solid #EEEEEE;">' . date('Y-m-d', strtotime($product['product_date'])) . '</td>
										<td style="border-bottom: 1px solid #EEEEEE;" class="delete">
											<a href="' . base_url() . 'user/editproduct/' . $product['pro_id'] . '" class="editcategories">Edit</a> |  
											<a href="#" class="deleteproduct" rel="' . $product['pro_id'] . '">Delete</a>
										</td>
									  </tr>';
            }
        }
        $this->load->view('responsive/viewproduct', $data);
    }