|
Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/ptbos.biz/public_html/application/views/admin/products/ |
Upload File : |
<div class="row">
<div class="col-sm-12">
<p><a href="<?= base_url('admin/dashboard'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to Dashboard</a></p><br>
<h2>Manage Projects</h2>
<?= $this->session->flashdata('success'); //to display success message ?>
<?= $this->session->flashdata('result'); //to display result message ?>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div>
<?= form_open_multipart(); ?>
<div class="row">
<div class="col-sm-3">
<h4>Projects Landing Page Banner</h4>
<p>Banner Image<br>
<?php if (!empty($brand_landingpage->brand_landingpage_image)) : ?>
<img style="width:200px; height:auto;" src="<?= base_url() . 'uploads/brand/' . $brand_landingpage->brand_landingpage_image; ?>" alt="" />
<br><i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/products/delete_landingpage_image'; ?>">Delete</a>
<?php endif; ?></p>
</div><!-- end class="col-sm-4" -->
<div class="col-sm-9">
<input type="file" name="userfile" size="20" class="btn btn-default btn-file form-control" />
<?php
//get max image width and height from configuration table
$this->db->select('blog_image_width, blog_image_height')->from('configuration')->where('id_configuration', 1);
$image_dimension = $this->db->get()->row();
?>
<span style="font-size:12px; font-style: italic;">Image size must be max of <?= $image_dimension->blog_image_width;?> pixel width. <?= $image_dimension->blog_image_height;?> pixel height, jpg/png, max 1MB</span>
<span style="color:#F7931E;"><?php echo form_error('userfile'); ?></span>
<?php echo $this->session->flashdata('banner_error'); //to display error message ?>
</div><!-- end class="col-sm-8" -->
</div> <!-- end row -->
<div class="row" style="display: none;">
<div class="col-sm-3">
<p>Banner Link<br>
(full URL. Eg: http://www.myshop.com/category/running)</p>
</div><!-- end class="col-sm-4" -->
<div class="col-sm-9">
<p>
<?php
$data = array(
'name' => 'banner_link',
'value' => $brand_landingpage->brand_landingpage_link,
'class' => 'form-control'
);
echo form_input($data); ?>
<?php echo form_error('banner_link'); ?></p>
</div><!-- end class="col-sm-8" -->
</div> <!-- end row -->
<div class="row" style="display:none;">
<div class="col-sm-3">
<p>Blog Description</p>
</div><!-- end class="col-sm-4" -->
<div class="col-sm-9">
<?php $data = array(
'name' => 'description',
'class' => 'form-control',
'value' => $brand_landingpage->brand_landingpage_description,
);
?>
<p><?php echo form_textarea($data); ?>
<?php echo form_error('description'); ?></p>
<br>
<p> <!-- <?= form_submit('submit', 'Update Banner', 'class="btn btn-primary btn-success button-brown"'); ?></p> -->
</div><!-- end class="col-sm-8" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-3">
</div><!-- end class="col-sm-4" -->
<div class="col-sm-9">
<p> <?= form_submit('updateBanner', 'Update Banner', 'class="btn btn-primary btn-success button-brown"'); ?></p>
</div><!-- end class="col-sm-8" -->
</div> <!-- end row -->
<?= form_close(); ?>
</div>
<div style="display: none;">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a aria-controls="search" href="#search" role="tab" data-toggle="tab">Search Products</a></li>
<li role="presentation"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Quick Edit Product</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Category Discount</a></li>
<li role="presentation"><a href="#productordering" aria-controls="productordering" role="tab" data-toggle="tab">Product Ordering</a></li>
<li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Import Product Photo</a></li>
<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Import Product Data</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="search">
<h3>Search Product</h3>
<div class="row">
<?= form_open('admin/products'); ?>
<div class="col-sm-5 col-xs-6">
<input class="form-control" type="text" placeholder="Enter Product Name" name="product" required
<?php if (isset($keyword)) : ?>
value="<?= ucwords($keyword); ?>"
<?php endif; ?>>
</div><!-- end class="col-sm-8" -->
<div class="col-sm-3 col-xs-6">
<input class="btn btn-primary form-control" type="submit" name="search_product" value="SEARCH PRODUCT">
</div><!-- end class="col-sm-6" -->
<?= form_close(); ?>
</div> <!-- end row -->
<div class="row">
<?= form_open('admin/products/search_category'); ?>
<div class="col-sm-5 col-xs-6">
<?php
//get parent category id and name and parent from categories table
$this->db->select('id_categories, category')->from('categories')->where('parent', NULL)->order_by('priority', 'ASC');
$categories = $this->db->get()->result();
?>
<select name="category" class="form-control">
<option value="">Select Category ...</option>
<?php foreach ($categories as $category) : ?>
<option value="<?= $category->id_categories; ?>"
<?php if (isset($category_id)) : ?>
<?php if ($category->id_categories == $category_id) : ?>
selected
<?php endif; ?>
<?php endif; ?>
><?= ucwords($category->category); ?></option>
<?php
//check if the current id does have child
$this->db->select('*')->from('categories')->where('parent', $category->id_categories);
$count_child_category = $this->db->get()->num_rows();
?>
<?php if ($count_child_category > 0): ?>
<?php
//get all existing child categories
$this->db->select('id_categories, category')->from('categories')->where('parent', $category->id_categories)->order_by('priority', 'ASC');
$child_categories = $this->db->get()->result();
?>
<?php foreach ($child_categories as $child_category) : ?>
<option style="margin-left: 10px;"value="<?= $child_category->id_categories; ?>"
<?php if (isset($category_id)) : ?>
<?php if ($child_category->id_categories == $category_id) : ?>
selected
<?php endif; ?>
<?php endif; ?>
>- <?= ucwords($child_category->category); ?></option>
<?php
//check if the current id does have child
$this->db->select('*')->from('categories')->where('parent', $child_category->id_categories);
$count_child2_category = $this->db->get()->num_rows();
?>
<?php if ($count_child2_category > 0): ?>
<?php
//get all existing child categories
$this->db->select('id_categories, category')->from('categories')->where('parent', $child_category->id_categories)->order_by('priority', 'ASC');
$child2_categories = $this->db->get()->result();
?>
<?php foreach ($child2_categories as $child2_category) : ?>
<option style="margin-left: 10px;"value="<?= $child2_category->id_categories; ?>"
<?php if (isset($category_id)) : ?>
<?php if ($child2_category->id_categories == $category_id) : ?>
selected
<?php endif; ?>
<?php endif; ?>
>-- <?= ucwords($child2_category->category); ?></option>
<?php endforeach; ?>
<?php endif ?>
<?php endforeach; ?>
<?php endif ?>
<?php endforeach; ?>
</select>
</div><!-- end class="col-sm-5" -->
<div class="col-sm-3 col-xs-6">
<input class="btn btn-primary form-control" type="submit" name="search_category" value="SEARCH BY CATEGORY">
</div><!-- end class="col-sm-3" -->
<?= form_close(); ?>
</div> <!-- end row -->
<div class="row">
<?= form_open('admin/products/search_brand'); ?>
<div class="col-sm-5 col-xs-6">
<select name="brand" class="form-control">
<?php
//get brands id and name from brandsa table
$this->db->select('id_brands, brand')->from('brands')->order_by('brand', 'ASC');
$brands = $this->db->get()->result();
?>
<option value="">Select Brand ...</option>
<?php foreach ($brands as $brand) : ?>
<?php if ($brand->id_brands != 0) : ?>
<option value="<?= $brand->id_brands; ?>"
<?php if (isset($brand_id)) : ?>
<?php if ($brand->id_brands == $brand_id) : ?>
selected
<?php endif; ?>
<?php endif; ?>
><?= ucwords($brand->brand); ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div><!-- end class="col-sm-8" -->
<div class="col-sm-3 col-xs-6">
<input class="btn btn-primary form-control" type="submit" name="search_brand" value="SEARCH BY BRAND">
</div><!-- end class="col-sm-6" -->
<?= form_close(); ?>
</div> <!-- end row -->
</div>
<div role="tabpanel" class="tab-pane" id="home">
<div class="row" style="border:1px solid #ddd;">
<div class="col-sm-12">
<h3>Quick Edit Product Price & Stock</h3>
<p><a href="<?= base_url('admin/products/quick_edit'); ?>"><button class="btn btn-primary">CLICK HERE TO EDIT</button></a></p>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
</div>
<div role="tabpanel" class="tab-pane" id="profile">
<div class="row" style="border:1px solid #ddd;">
<div class="col-sm-12">
<h3>Edit Category Discount</h3>
<p><a href="<?= base_url('admin/category_discount'); ?>"><button class="btn btn-primary">CLICK HERE TO EDIT</button></a></p>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
</div>
<div role="tabpanel" class="tab-pane" id="productordering">
<div class="row" style="border:1px solid #ddd;">
<div class="col-sm-12">
<h3>Website Product ordering</h3>
<?= form_open('admin/products/change_product_ordering'); ?>
<div class="row">
<div class="col-sm-8">
<select class="form-control" name="change_product_ordering">
<option value="random"
<?php if($website_product_ordering == 'random') : ?>
selected
<?php endif; ?>
>Random</option>
<option value="manual-order"
<?php if($website_product_ordering == 'manual-order') : ?>
selected
<?php endif; ?>
>Manual Order</option>
<option value="input-date-desc"
<?php if($website_product_ordering == 'input-date-desc') : ?>
selected
<?php endif; ?>
>Input Date (Descending)</option>
<option value="input-date-asc"
<?php if($website_product_ordering == 'input-date-asc') : ?>
selected
<?php endif; ?>
>Input Date (Ascending)</option>
</select>
</div>
<div class="col-sm-4">
<input class="btn btn-primary" type="submit" name="change_ordering" value="CHANGE ORDERING">
</div>
</div>
<?= form_close(); ?>
<br>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
</div>
<div role="tabpanel" class="tab-pane" id="messages">
<div class="row" style="border:1px solid #ddd;">
<div class="col-sm-12">
<h3>Import Product Photos</h3>
<p>UPLOAD PRODUCTS PHOTOS. ACCEPT ONLY ZIP FILE.</p>
<?php
$attributes = array(
'name' => 'uploadphotos',
'id' => 'uploadphotos'
);
?>
<?= form_open_multipart('admin/products/upload_product_photos', $attributes); ?>
<table>
<tr>
<td>ULPLOAD PRODUCTS PHOTOS ZIP (MAX 20MB PER ZIP FILE):</td>
<td>
<div class="form-group">
<input style="float:left; width:60%;" type="file" class="form-control" name="userfile" id="userfile" align="center"/><input type="submit" name="upload_photos" class="btn btn-info" value="UPLOAD">
</div>
</td>
</tr>
</table>
</form>
<p>Note: Same file name will be replaced. During Upload, please wait until process finish. Do not close current window.</p>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
</div>
<div role="tabpanel" class="tab-pane" id="settings">
<div class="row" style="border:1px solid #ddd;">
<div class="col-sm-12">
<h3>Import Products Data</h3>
<p>UPLOAD PRODUCTS DATA. ACCEPT ONLY CSV. PLEASE SAVE EXCEL AS CSV. DOWNLOAD EXCEL SAMPLE <a style="color:blue;" href="<?= base_url('uploads/products.xls'); ?>">HERE</a>.</p>
<p>PS: Products data with same SKU will not be uploaded.</p>
<?php
$attributes = array(
'name' => 'uploadcsv',
'id' => 'uploadcsv'
);
?>
<?= form_open_multipart('admin/products/upload_csv', $attributes); ?>
<table>
<tr>
<td> ULPLOAD PRODUCTS DATA CSV: </td>
<td>
<div class="form-group">
<input style="float:left; width:60%;" type="file" class="form-control" name="userfile" id="userfile" align="center"/><input type="submit" name="upload_csv" class="btn btn-info" value="UPLOAD">
</div>
</td>
</tr>
</table>
</form>
<p>Note: During Upload, please wait until process finish. Do not close current window.</p>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<br>
<p><?= anchor('admin/products/add', '<i class="fa fa-plus" aria-hidden="true"></i> ADD A NEW PROJECT'); ?></p>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Project Name</th>
<th>Display</th>
<th>Ordering</th>
<!-- <th>Quick Edit</th> -->
<th>Edit</th>
<!-- <th>Duplicate</th> -->
<!-- <th>Preview</th> -->
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php if(count($products)) : ?>
<?php foreach($products as $product): ?>
<tr>
<td style="display: no"><!-- <img style="width:50px;" src="<?= base_url() . 'uploads/product/thumbnail/' . $product->image1; ?>"> --> <?= ucfirst($product->title); ?></td>
<td>
<?php
if ($product->product_status == 1) {
echo 'Yes';
}
else {
echo 'No';
}
?>
</td>
<td><?= $product->priority; ?></td>
<!-- <td><a class="quickedit" href="<?= $product->id_products; ?>"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a></td> -->
<td><?= bt_edit('admin/products/edit/' . $product->id_products); ?></td>
<!-- <td><a href="<?= base_url() . 'admin/products/duplicate_product/' . $product->id_products; ?>"><i class="fa fa-files-o" aria-hidden="true"></i></a></td> -->
<td style="display: none;"><a href="<?= base_url() . 'product/' . $product->alias; ?>" target="_blank"><i class="fa fa-eye" aria-hidden="true"></i></a></td>
<td><?= bt_delete('admin/products/delete/' . $product->id_products); ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="6">We could not find any product.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div><!-- end class responsive-->
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-12">
<?php if(isset($use_pagination)) : ?>
<div style="text-align:center;"><?= $this->pagination->create_links(); ?></div>
<?php endif; ?>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div id="getProductDetail"></div>
<script>
$(document).ready(function() {
var controller = 'admin/products';
var base_url = '<?php echo base_url(); ?>';
$('a.quickedit').click(function(event) {
event.preventDefault();
var id_product = $(this).attr('href');
ajax_getproductdetails(id_product);
});
function ajax_getproductdetails(id_product) {
$.ajax({
'url' : base_url + controller + '/ajax_getproductdetails',
'type' : 'POST',
'data' : {'id_product' : id_product},
'success' :
function(data) {
var container = $('#getProductDetail');
if (data) {
/*---success----*/
$('#getProductDetail').html(data);
$('#showModal').trigger('click');
};
}
});
}
});
</script>