|
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/categories/ |
Upload File : |
<div class="row">
<div class="col-sm-12">
<a href="<?= base_url('admin/categories'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to Service List Page</a><br><br>
<h4><?= empty($categories->id_categories) ? 'Add a new service' : 'Edit service: '
. $categories->category; ?></h4>
<?= $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">
<div class="col-sm-3">
<p>Service Name</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<p>
<?php
$data = array(
'name' => 'category_name',
'value' => $categories->category,
'class' => 'form-control'
);
echo form_input($data); ?>
<?= form_error('category_name'); ?></p>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-3">
<p>Short Description</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<p>
<?php
$data = array(
'name' => 'short_description',
'value' => $categories->short_description,
'class' => 'form-control'
);
echo form_input($data); ?>
<?= form_error('short_description'); ?></p>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-3">
<p>Thumbnail Picture<br>
<?php if (!empty($categories->thumbnail)) : ?>
<img style="width:100px; height:auto;" src="<?= base_url() . 'uploads/category/' . $categories->thumbnail; ?>" alt="" />
<i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/categories/delete_thumbnail/' . $categories->id_categories; ?>">Delete</a>
<?php endif; ?>
</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<p><input type="file" name="userfile2" size="20" class="btn btn-default btn-file form-control" />
<?php
//get max thumbnail width and height from configuration table
$this->db->select('category_thumbnail_width, category_thumbnail_height')->from('configuration')->where('id_configuration', 1);
$thumbnail_dimension = $this->db->get()->row();
?>
<span style="font-size:12px; font-style: italic;">Image size must be 650 pixel width. 448 pixel height, jpg/png, max 500KB</span>
<span style="color:#F7931E;"><?php echo form_error('userfile2'); ?></span>
<?php echo $this->session->flashdata('thumbnail_error'); //to display error message ?></p>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-3">
<p>Top Banner Image
<?php if (!empty($categories->image)) : ?>
<img style="width:100px; height:auto;" src="<?= base_url() . 'uploads/category/' . $categories->image; ?>" alt="" /><br>
<i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/categories/delete_image/' . $categories->id_categories; ?>">Delete</a>
<?php endif; ?>
</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<p><input type="file" name="userfile" size="20" class="form-control" /><br>
<?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 1600 pixel width. 640 pixel height, png/jpg, max 600KB</span>
<span style="color:#F7931E;"><?php echo form_error('userfile'); ?></span></p>
<p><?php echo $this->session->flashdata('error'); //to display error message ?></p>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div>
<div class="row">
<div class="col-sm-3">
<p>Full Description</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<?php echo form_textarea('description', set_value('description',
$categories->description, FALSE)); ?>
<?php echo form_error('description'); ?>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-3">
<p>Ordering (must be number only)</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<p><?php
$data = array(
'name' => 'priority',
'value' => $categories->priority,
'class' => 'form-control',
'id' => 'categoryOrdering'
);
echo form_input($data); ?></p>
<p><?= form_error('priority'); ?></p>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-3">
<p>Display</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<?php
$options = array(
1 => 'Yes',
0 => 'No'
);
echo form_dropdown('status', $options, $categories->status, 'class="form-control"');
?>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div style="display: none;">
<div class="row">
<div class="col-sm-3">
<p><strong>SEO (Search Engine Optimization)</strong></p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-3">
<p>Page Meta Description</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<p><?php
$data = array(
'name' => 'meta_description',
'value' => $categories->meta_description,
'class' => 'form-control'
);
echo form_input($data); ?></p>
<p><?= form_error('meta_description'); ?></p>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
<div class="row">
<div class="col-sm-3">
<p>Page Meta Keywords<br>(separated with comma)</p>
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<p><?php
$data = array(
'name' => 'meta_keywords',
'value' => $categories->meta_keywords,
'class' => 'form-control'
);
echo form_input($data); ?></p>
<p><?= form_error('meta_keywords'); ?></p>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
</div>
<div class="row">
<div class="col-sm-3">
</div><!-- end class="col-sm-3" -->
<div class="col-sm-9">
<?= form_submit('submit', 'Update', 'class="btn btn-primary btn-success button-brown"'); ?> <?= anchor('admin/categories', 'cancel'); ?>
</div><!-- end class="col-sm-9" -->
</div> <!-- end row -->
</div>
<?= form_close(); ?>
<script>
$( document ).ready(function() {
//to get ordering dynamically, when choosing categories
$('#chooseCategory').change(function() {
var id_parentcategory = $(this).val();
load_data_ajax(id_parentcategory);
});
var base_url = '<?= base_url(); ?>';
var controller = 'admin/categories/';
function load_data_ajax(id_parentcategory) {
$.ajax({
'url' : base_url + controller + 'ajax_get_ordering',
'type' : 'POST',
'data' : {
'id_parentcategory' : id_parentcategory,
'<?= $this->security->get_csrf_token_name(); ?>' : '<?= $this->security->get_csrf_hash(); ?>'
},
'success' : function(data) {
var container = $('#categoryOrdering');
if (data) {
container.val(data); //use val because insert into input form
};
}
});
}
});
</script>