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/rabbithabit.com/public_html/application/views/admin/home_featureproducts/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <p><a href="<?= base_url('admin/home_featureproducts'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to Feature Products List Page</a></p><br> <h4><?= empty($home_featureproducts->id_home_featureproducts) ? 'Add a new home feature block' : 'Edit home feature block: ' . $home_featureproducts->title; ?></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>Block Title</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'title', 'value' => $home_featureproducts->title, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('title'); ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Choose Category</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="category_id" class="form-control"> <?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(); ?> <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 endforeach; ?> <?php endif ?> <?php endforeach; ?> </select> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Image Banner <?php if (!empty($home_featureproducts->image)) : ?> <img style="width:150px; height:auto;" src="<?= base_url() . 'uploads/banners/' . $home_featureproducts->image; ?>" alt="" /> <?php endif; ?></p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <input type="file" name="userfile" size="20" class="form-control "/><br> <?php //get image dimension $this->db->select('featuredproduct_image_width, featuredproduct_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 <?= $image_dimension->featuredproduct_image_width; ?> pixel width. <?= $image_dimension->featuredproduct_image_height; ?> pixel height, jpg, max 200KB</span> <span style="color:#F7931E;"><?php echo form_error('userfile'); ?></span> <?php echo $this->session->flashdata('error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Banner Text</p> </div><!-- end class="col-sm-4" --> <div class="col-sm-9"> <?php $data = array( 'name' => 'banner_text', 'class' => 'form-control', 'value' => $home_featureproducts->banner_text, ); ?> <p><?php echo form_textarea($data); ?> <?php echo form_error('banner_text'); ?></p> </div><!-- end class="col-sm-8" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Banner Link<br> (full URL. Eg: http://www.xxx.com/category/running)</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'banner_link', 'value' => $home_featureproducts->banner_link, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('banner_link'); ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Priority (must be numeric)</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'priority', 'value' => $home_featureproducts->priority, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('priority'); ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Banner Active ?</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $options = array( 1 => 'Yes', 0 => 'No' ); echo form_dropdown('status', $options, $home_featureproducts->status, 'class="form-control"'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <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/home_featureproducts', 'cancel'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <?= form_close(); ?>