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/products/ |
Upload File : |
<?php if (isset($case_addnew)): ?> <?php if ($case_addnew == 'addnew'): ?> <?php $get_product_details_bysku = $this->db->select('*') ->from('product_details') ->where('id', $product_image_id) ->where('product_id', $product_id) ->order_by('id', 'ASC') ->get(); $all_product_images_bysku = []; $nm_sku = ''; $cntr = -1; foreach ($get_product_details_bysku->result() as $key_pd) { $nm_sku = $key_pd->sku; $correct_product_details_id = $key_pd->id; $get_product_images_bysku = $this->db->select('*') ->from('product_images') ->where('product_id', $product_id) ->where('product_details_id', $key_pd->id) ->order_by('product_details_id', 'ASC') ->order_by('priority', 'ASC') ->get(); if ($get_product_images_bysku->num_rows() > 0 ) { foreach ($get_product_images_bysku->result() as $key) { $cntr++; $all_product_images_bysku[$cntr] = array( "sku" =>$key_pd->sku, "title" =>$key->title, "title_en" =>$key->title_en, "image" =>$key->image, "product_id" =>$key->product_id, "product_details_id" =>$key->product_details_id, "product_img_id" =>$key->id, "status" =>$key->status, "priority" =>$key->priority, ); } } } //get slideshow size from configuration table $this->db->select('product_image_width, product_image_height')->from('configuration')->where('id_configuration', 1); $image_dimensions = $this->db->get()->row(); ?> <div class="row"> <div class="col-sm-12"> <p> <a href="<?= base_url('admin/products/product_images/' . $product_id); ?>"> <i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali Foto Produk </a> </p> <br> <h4><?= 'Tambah foto baru : <br>SKU:['.$nm_sku.'] - ' . ucwords($product_name); ?></h4> <?= $this->session->flashdata('success'); ?> </div> </div> <?= form_open_multipart(); ?> <input type="hidden" name="correct_product_details_id" value="<?= $correct_product_details_id; ?>"> <div style="display:none;" class="row"> <div class="col-sm-3"> <p>Judul Foto</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">Indonesia</a></li> <li><a href="#slideshow_en" data-toggle="tab">Inggris</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="slideshow_id"> <p> <?php $data = array( 'name' => 'title', 'value' => $product_name, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('title'); ?></p> </div> <div class="tab-pane" id="slideshow_en"> <p> <?php $data = array( 'name' => 'title_en', 'value' => $product_name, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('title_en'); ?></p> </div> </div> </div> </div> </div> <div style="display:none;" class="row"> <div class="col-sm-3"> <p>SKU / Varian</p> </div> <div class="col-sm-9"> <input name="product_detail_id" class="form-control" type="text" value="<?= $nm_sku; ?>"> <?= form_error('product_detail_id'); ?> </div> </div> <div class="div_parent_all_img"> <div class="row"> <div class="col-sm-6"> <p> Foto Produk </p> <div> <input multiple="multiple" type="file" name="image[]" size="20" class="form-control" /> <br> <span style="font-size:12px; font-style: italic;">Ukuran maks lebar <?= $image_dimensions->product_image_width; ?> pixel. Tinggi <?= $image_dimensions->product_image_height; ?> pixel, jpg/png/gif, maks 600KB</span> <span style="color:#F7931E;"><?php echo form_error('image[]'); ?></span> <?php echo $this->session->flashdata('image_error'); //to display error message ?> </div> <div> </div> </div> <div class="col-sm-3"> <p>Urutan Tampilan (isi dengan angka)</p> <p> <?php $data = array( 'name' => 'priority[]', 'value' => '', 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('priority[]'); ?> </p> </div> <div class="col-sm-3"> <p>Aktif ?</p> <div class="col-sm-10" style="padding:0;"> <?php $options = array( 1 => 'Ya', 0 => 'Tidak' ); echo form_dropdown('status[]', $options, 1, 'class="form-control"'); ?> </div> <div class="col-sm-2"> <button onclick="add_new_rowimg();" type="button" class="btn btn-sm btn-primary"> <i class="fa fa-plus"></i> </button> </div> </div> </div> <!-- end row --> <!-- <br> --> </div> <!-- <?php foreach ($all_product_images_bysku as $key_pi_bysku): ?> <?php endforeach ?> --> <div class="row"> <div class="col-sm-12" style="text-align: center;"> <p> <input type="hidden" name="case_save" value="addnew"> <?= form_submit('submit', 'Simpan', 'class="btn btn-primary btn-success"'); ?> <?= anchor('admin/products/product_images/' . $product_id, 'Batal', array('class' => 'btn btn-default')); ?> </p> </div> <!-- end class="col-sm-9" --> </div> <!-- end row --> <?= form_close(); ?> <script> function add_new_rowimg(){ $("div.div_parent_all_img").append( "<div class='row'>"+ "<div class='col-sm-6'>"+ '<p>Foto Produk</p>'+ '<div>'+ '<input type="file" name="image[]" size="20" multiple="multiple" class="form-control">'+ '<br> '+ '<span style="font-size:12px; font-style: italic;">Ukuran maks lebar <?= $image_dimensions->product_image_width; ?> pixel. Tinggi <?= $image_dimensions->product_image_height; ?> pixel, jpg/png/gif, maks 600KB</span>'+ '<span style="color:#F7931E;"><?= form_error('image'); ?></span>'+ '<?= $this->session->flashdata('image_error'); ?>'+ '</div>'+ "</div>"+ "<div class='col-sm-3'>"+ '<p>Urutan Tampilan (isi dengan angka)</p>'+ '<p>'+ '<input type="text" name="priority[]" value="" class="form-control">'+ '<?= form_error('priority'); ?>'+ '</p>'+ "</div>"+ "<div class='col-sm-3'>"+ '<p>Aktif ?</p>'+ '<div class="col-sm-10" style="padding:0;">'+ '<select name="status[]" class="form-control">'+ '<option value="1" selected="selected">Ya</option>'+ '<option value="0">Tidak</option>'+ '</select>'+ '</div>'+ '<div class="col-sm-2">'+ '<button onclick="add_new_rowimg();" type="button" class="btn btn-sm btn-primary">'+ '<i class="fa fa-plus"></i>'+ '</button>'+ '</div>'+ "</div>"+ "</div>" ); } </script> <?php endif ?> <?php else: ?> <div class="row"> <div class="col-sm-12"> <p><a href="<?= base_url('admin/products/product_images/' . $product_id); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali Foto Produk</a></p><br> <h4><?= empty($product_image->id) ? 'Tambah foto baru: ' . ucwords($product_name) : 'Edit foto: ' . ucwords($product_name); ?></h4> <?= $this->session->flashdata('success'); ?> </div> </div> <?= form_open_multipart(); ?> <div class="row" style="display: none;"> <div class="col-sm-3"> <p>Judul Foto</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">Indonesia</a></li> <li><a href="#slideshow_en" data-toggle="tab">Inggris</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="slideshow_id"> <p> <?php $data = array( 'name' => 'title', 'value' => $product_image->title, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('title'); ?></p> </div> <div class="tab-pane" id="slideshow_en"> <p> <?php $data = array( 'name' => 'title_en', 'value' => $product_image->title_en, 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('title_en'); ?></p> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-3"> <p>SKU / Varian</p> </div> <div class="col-sm-9"> <select name="product_detail_id" class="form-control" required> <option value="" disabled selected>Pilih SKU/Varian...</option> <?php foreach($product_details as $detail) : ?> <option value="<?= $detail->id; ?>" <?= set_select('product_detail_id', $detail->id); ?> <?php if ($product_image->product_details_id == $detail->id) : ?> selected="selected" <?php endif; ?> > <?php //get variant $this->db->select('attribute_detail_id')->from('product_combination')->where('product_details_id', $detail->id); $attributes = $this->db->get()->result(); $attributes_name = ''; foreach($attributes as $attribute) { //get atrribute detail name $this->db->select('attribute_detail')->from('product_attributes_detail')->where('id', $attribute->attribute_detail_id); $attribute_detail_name = $this->db->get()->row()->attribute_detail; $attributes_name = $attributes_name . '-' . $attribute_detail_name; } ?> <?= $detail->sku . ' ' . ucwords($attributes_name); ?> </option> <?php endforeach; ?> </select> <?= form_error('product_detail_id'); ?> </div> </div> <div class="row"> <div class="col-sm-3"> <p>Foto Produk <?php if (!empty( $product_image->image)) : ?> <img style="width:150px; height:auto;" src="<?= base_url() . 'uploads/product/small/' . $product_image->image; ?>" alt="" /> <?php endif; ?> </p> </div> <div class="col-sm-9"> <input type="file" name="image" size="20"class="form-control" /><br> <?php //get slideshow size from configuration table $this->db->select('product_image_width, product_image_height')->from('configuration')->where('id_configuration', 1); $image_dimensions = $this->db->get()->row(); ?> <span style="font-size:12px; font-style: italic;">Ukuran maks lebar <?= $image_dimensions->product_image_width; ?> pixel. Tinggi <?= $image_dimensions->product_image_height; ?> pixel, jpg/png/gif, maks 600KB</span> <span style="color:#F7931E;"><?php echo form_error('image'); ?></span> <?php echo $this->session->flashdata('image_error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Urutan Tampilan (isi dengan angka)</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'priority', 'value' => $product_image->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>Aktif ?</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <?php $options = array( 1 => 'Ya', 0 => 'Tidak' ); echo form_dropdown('status', $options, $product_image->status, 'class="form-control"'); ?> </div> </div> <div class="row"> <div class="col-sm-3"> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <?php if(empty($product_image->id)) : ?> <p><?= form_submit('submit', 'Simpan', 'class="btn btn-primary btn-success"'); ?> <?php else : ?> <p><?= form_submit('submit', 'Update', 'class="btn btn-primary btn-success"'); ?> <?php endif; ?> <?= anchor('admin/products/product_images/' . $product_id, 'Batal', array('class' => 'btn btn-default')); ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <?= form_close(); ?> <?php endif ?>