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/home_slideshow/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <p><a href="<?= base_url('admin/home_slideshow'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to Slideshow List</a></p><br> <h4><?= empty($home_slideshow->id_home_slideshow) ? 'Add a new home slideshow' : 'Edit home slideshow: ' . $home_slideshow->title; ?></h4> <?= $this->session->flashdata('success'); //to display success message ?> <?= $this->session->flashdata('result'); //to display result message ?> </div> </div> <?= form_open_multipart(); ?> <div class="row"> <div class="col-sm-3"> <p>Slideshow Title</p> </div> <div class="col-sm-9"> <div class="tabbable"> <ul class="nav nav-tabs"> <li class="active"><a href="#slideshow_id" data-toggle="tab">Title</a></li> <!-- <li><a href="#slideshow_en" data-toggle="tab">English</a></li> --> </ul> <div class="tab-content"> <div class="tab-pane active" id="slideshow_id"> <p> <?php $data = array( 'name' => 'title', 'value' => $home_slideshow->title, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('title'); ?></p> </div><!-- end --> <div class="tab-pane" id="slideshow_en"> <p> <?php $data = array( 'name' => 'title_en', 'value' => $home_slideshow->title_en, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('title_en'); ?></p> </div><!-- end --> </div><!-- end class tab-content--> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <div class="row"> <div class="col-sm-3"> <p>Banner Type</p> </div> <div class="col-sm-9"> <select name="slide_type" id="select_menu_type" class="form-control"> <!-- <option value="">select slide type...</option> --> <option value="homepage" <?php if ($home_slideshow->slide_type == 'homepage'): ?> selected="selected" <?php endif ?> >Website Homepage</option> <option value="store homepage" <?php if ($home_slideshow->slide_type == 'store homepage'): ?> selected="selected" <?php endif ?> >Store Homepage</option> <!-- <option value="home_banner" <?php if ($home_slideshow->slide_type == 'home_banner'): ?> selected="selected" <?php endif ?> >Home Promo</option> <option value="category" <?php if ($home_slideshow->slide_type == 'category'): ?> selected="selected" <?php endif ; ?> >Category</option> --> </select> <?= form_error('slide_type'); ?> </div> </div> <div id="container"></div> <div class="row" id="desktop"> <div class="col-sm-3"> <p>Slideshow Image (Homepage) <?php if (!empty($home_slideshow->image)) : ?> <img style="width:150px; height:auto;" src="<?= base_url() . 'uploads/banners/' . $home_slideshow->image; ?>" alt="" /> <?php endif; ?> </p> </div> <div class="col-sm-9"> <input type="file" name="image1" size="20"class="form-control" /><br> <?php //get slideshow size from configuration table $this->db->select('home_slideshow_width, home_slideshow_height')->from('configuration')->where('id_configuration', 1); $slideshow_dimensions = $this->db->get()->row(); ?> <span>Image size must be: <br> Website: 1920 pixel width. 978 pixel height, jpg/jpeg/png/gif/webp, max 600KB</span><br> Store: 1920 pixel width. 660 pixel height, jpg/jpeg/png/gif/webp, max 600KB</span><br> <span style="color:#F7931E;"><?php echo form_error('image1'); ?></span> <?php echo $this->session->flashdata('error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <div class="row" id="image" style="display:none;"> <div class="col-sm-3"> <p>Slideshow Image (Category) <?php if (!empty($home_slideshow->image_mobile)) : ?> <img style="width:150px; height:auto;" src="<?= base_url() . 'uploads/banners/' . $home_slideshow->image_mobile; ?>" alt="" /> <?php endif; ?> </p> </div> <div class="col-sm-9"> <input type="file" name="image2" size="20"class="form-control" /><br> <span style="font-size:12px; font-style: italic;">Image size must be 900 pixel width. 300 pixel height, jpg/png, max 600KB</span> <span style="color:#F7931E;"><?php echo form_error('image2'); ?></span> <?php echo $this->session->flashdata('error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <div class="row" style="display:none;"> <div class="col-sm-3"> <p>Text Content</p> </div> <div class="col-sm-9"> <div class="tabbable"> <ul class="nav nav-tabs"> <li class="active"><a href="#text_id" data-toggle="tab">Text</a></li> <!-- <li><a href="#text_en" data-toggle="tab">English</a></li> --> </ul> <div class="tab-content"> <div class="tab-pane active" id="text_id"> <p> <?php $data = array( 'name' => 'text_content', 'value' => $home_slideshow->text_content, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('title'); ?></p> </div><!-- end --> <div class="tab-pane" id="text_en"> <?php $data = array( 'name' => 'text_content_en', 'class' => 'form-control', 'value' => $home_slideshow->text_content_en, ); ?> <p><?php echo form_textarea($data); ?> <?php echo form_error('text_content_en'); ?></p> </div><!-- end --> </div><!-- end class tab-content--> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <div class="row"> <div class="col-sm-3"> <p>Banner Link<br> (full URL. Eg: https://angkasapuraretail/xxx)</p> </div> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'banner_link', 'value' => $home_slideshow->banner_link, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('banner_link'); ?></p> </div><!-- end class="col-sm-9" --> </div> <div class="row"> <div class="col-sm-3"> <p>Ordering (number only)</p> </div> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'priority', 'value' => $home_slideshow->priority, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('priority'); ?></p> </div><!-- end class="col-sm-9" --> </div> <div class="row"> <div class="col-sm-3"> <p>Banner Active ?</p> </div> <div class="col-sm-9"> <?php $options = array( 1 => 'Yes', 0 => 'No' ); echo form_dropdown('status', $options, $home_slideshow->status, 'class="form-control"'); ?> </div><!-- end class="col-sm-9" --> </div> <div class="row"> <div class="col-sm-3"> </div> <div class="col-sm-9"> <?php if($allowed == true) : ?> <?= form_submit('submit', 'Update', 'class="btn btn-primary btn-success button-brown"'); ?> <?= anchor('admin/home_slideshow', 'cancel'); ?> <?php endif; ?> </div><!-- end class="col-sm-9" --> </div> <?= form_close(); ?> <script> $(document).ready(function() { var slide_type = $('#select_menu_type').val(); <?php if (!empty($home_slideshow->id_home_slideshow)) : ?> var current_slide_id = '<?= $home_slideshow->id_home_slideshow; ?>'; <?php else : ?> var current_slide_id = null; <?php endif; ?> if (slide_type != '') { load_data_ajax(slide_type,current_slide_id); } $('#select_menu_type').on('change', function() { var slide_type = $(this).val(); if($('#select_menu_type').val() != 'homepage' && $('#select_menu_type').val() != 'store homepage') { load_data_ajax(slide_type); $('#container').removeClass('hidden'); $('#image').css({'display' : 'block'}); $('#desktop').css({'display':'none'}); } else { $('#container').addClass('hidden'); $('#image').css({'display' : 'none'}); $('#desktop').css({'display' : 'block'}); } }); function load_data_ajax(slide_type,current_slide_id) { $.ajax({ 'url' : '<?php echo site_url(); ?>' + 'admin/home_slideshow/ajax_get_category', 'type' : 'POST', 'data' : { 'slide_type' : slide_type, 'current_slide_id' : current_slide_id, '<?= $this->security->get_csrf_token_name(); ?>' : '<?= $this->security->get_csrf_hash(); ?>' }, 'success' : function(data) { var container = $('#container'); if (data) { container.html(data); }; } }); } }); </script>