|
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/angkasapuraretail.com/public_html/application/views/admin/categories/ |
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>Category Administration</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 -->
<?= form_open_multipart(); ?>
<div class="row" style="display: none;">
<div class="col-sm-3">
<h4>Landing Page Banner</h4>
<p>Banner Image<br>
<?php if (!empty($category_landingpage->category_landingpage_image)) : ?>
<img style="width:200px; height:auto;" src="<?= base_url() . 'uploads/category/' . $category_landingpage->category_landingpage_image; ?>" alt="" />
<br><i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/categories/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('category_image_width, category_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->category_image_width;?> pixel width. <?= $image_dimension->category_image_height;?> pixel height, jpg/png, max 300KB</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' => $category_landingpage->category_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>Category Description</p>
</div><!-- end class="col-sm-4" -->
<div class="col-sm-9">
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#description_id" data-toggle="tab">Indonesian</a></li>
<li><a href="#description_en" data-toggle="tab">English</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="description_id">
<?php echo form_textarea('description', set_value('description',
$category_landingpage->category_landingpage_description, FALSE)); ?>
<?php echo form_error('description'); ?>
</div><!-- end id="#description_id" -->
<div class="tab-pane" id="description_en">
<?php echo form_textarea('description_en', set_value('description_en',
$category_landingpage->category_landingpage_description_en, FALSE)); ?>
<?php echo form_error('description_en'); ?>
</div><!-- end id="#description_id" -->
</div><!-- end class tab-content-->
</div><!-- end tabbable -->
<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 -->
<?= form_close(); ?>
<div class="row">
<div class="col-sm-12">
<br>
<?php if($allowed == true) : ?>
<p><?= anchor('admin/categories/add', '<i class="fa fa-plus" aria-hidden="true"></i> ADD A NEW CATEGORY'); ?></p>
<?php endif; ?>
</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>Category Name</th>
<!-- <th>Parent Category</th> -->
<th>Ordering</th>
<th>Display</th>
<th>View</th>
<?php if($allowed == true && $role != 'admin') : ?>
<th>Delete</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php if(count($parent_categories)) : ?>
<?php foreach($parent_categories as $category): ?>
<tr>
<td><?= ucfirst($category->category); ?></td>
<!-- <td><?php
if ($category->parent == NULL) {
echo 'No Parent';
} else {
//get category name from category table
$this->db->select('category, category_en')->from('categories')->where('id_categories', $category->parent);
$category_name = $this->db->get()->row();
echo ucfirst($category_name->category);
} ?>
</td> -->
<td><?= $category->priority; ?></td>
<td>
<?php
if ($category->status == 1) {
echo 'Yes';
}
else {
echo 'No';
}
?>
</td>
<td><?= bt_edit('admin/categories/edit/' . $category->id_categories); ?></td>
<?php if($allowed == true && $role != 'admin') : ?>
<td><?= bt_delete('admin/categories/delete/' . $category->id_categories); ?></td>
<?php endif; ?>
</tr>
<?php
//GET CATEGORY LEVEL 2
$this->db->select('id_categories, category, category_en, parent, priority, status')->from('categories')->where('parent', $category->id_categories)->order_by('priority', 'ASC');
$categories_level2 = $this->db->get()->result();
?>
<?php foreach($categories_level2 as $category2): ?>
<tr>
<td>- <?= ucfirst($category2->category); ?></td>
<td><?php
//get category name from category table
$this->db->select('category, category_en')->from('categories')->where('id_categories', $category2->parent);
$category_name = $this->db->get()->row();
echo ucfirst($category_name->category);
?>
</td>
<td><?= $category2->priority; ?></td>
<td>
<?php
if ($category2->status == 1) {
echo 'Yes';
}
else {
echo 'No';
}
?>
</td>
<td><?= bt_edit('admin/categories/edit/' . $category2->id_categories); ?></td>
<?php if($allowed == true && $role != 'admin') : ?>
<td><?= bt_delete('admin/categories/delete/' . $category2->id_categories); ?></td>
<?php endif; ?>
</tr>
<?php
//GET CATEGORY LEVEL 3
$this->db->select('id_categories, category, category_en, parent, priority, status')->from('categories')->where('parent', $category2->id_categories)->order_by('priority', 'ASC');
$categories_level3 = $this->db->get()->result();
?>
<?php foreach($categories_level3 as $category3): ?>
<tr>
<td>-- <?= ucfirst($category3->category); ?></td>
<td><?php
//get category name from category table
$this->db->select('category, category_en')->from('categories')->where('id_categories', $category3->parent);
$category_name = $this->db->get()->row();
echo ucfirst($category_name->category);
?>
</td>
<td><?= $category3->priority; ?></td>
<td>
<?php
if ($category3->status == 1) {
echo 'Yes';
}
else {
echo 'No';
}
?>
</td>
<td><?= bt_edit('admin/categories/edit/' . $category3->id_categories); ?></td>
<?php if($allowed == true && $role != 'admin') : ?>
<td><?= bt_delete('admin/categories/delete/' . $category3->id_categories); ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="3">We could not find any category.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div><!-- end table class responsive -->
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-12">
<?php
//create pagination...
echo '<p style="text-align:center;">' . $this->pagination->create_links() . '</p>';
?>
</div><!-- end class="col-sm-12" -->
</div> <!-- end row -->