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/indolok.id/application/views/admin/products/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <a href="<?= base_url('admin/products'); ?>"> <i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke Produk </a><br><br> <h4><?= empty($products->id_products) ? 'Tambah produk baru' : 'Edit Produk: ' . $products->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(); ?> <p style="text-align:right;"><?= form_submit('submit', 'Simpan Produk', 'class="btn btn-primary btn-success button-brown"'); ?> <?= anchor('admin/products', 'batal'); ?></p><br> <input type="hidden" name="product_id" value="<?= $products->id_products; ?>"> <div class="row"> <div class="col-sm-3"> <!-- <p>Kode Produk*</p> --> <p>Item Number*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'product_code', 'value' => set_value('product_code', $products->product_code), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('product_code'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>SKU*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'sku', 'value' => set_value('sku', $products->sku), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('sku'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Nama Produk*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'product_name', 'value' => set_value('product_name', $products->title, FALSE), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('product_name'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Nama Produk (Pabrik)*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'product_name2', 'value' => set_value('product_name2', $products->title2, FALSE), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('product_name2'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Merek*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="brand_id" class="form-control" required> <option value="" disabled selected>choose brand...</option> <?php foreach($brands as $brand) : ?> <option value="<?= $brand->id_brands; ?>" <?= set_select('brand_id', $brand->id_brands); ?> <?php if (isset($brand_id)): ?> <?php if ($brand_id == $brand->id_brands) : ?> selected="selected" <?php endif; ?> <?php endif ?> > <?= $brand->brand; ?> </option> <?php endforeach; ?> </select> <?= form_error('brand_id'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Kategori Produk*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div style="height: 200px; overflow-y: scroll; padding: 20px; border:1px solid #ccc;"> <?php foreach($parent_categories as $category) : ?> <input style="position:relative; bottom:3px; margin-right: 10px;" type="checkbox" name="category_id[]" value="<?= $category->id_categories; ?>" <?= set_checkbox('category_id[]', $category->id_categories); ?> <?php if (isset($chosen_categories)) : ?> <?php //checked item foreach ($chosen_categories as $chosen_category) : ?> <?php if ($chosen_category->id_category == $category->id_categories) : ?> checked <?php endif; ?> <?php endforeach; ?> <?php endif; ?> > <?= ucfirst($category->category); ?><br> <?php //check if this parent categories does have sub categories $this->db->select('id_categories')->from('categories')->where('parent', $category->id_categories); $count_child = $this->db->get()->num_rows(); ?> <?php if ($count_child > 0) : //this category does have childen ?> <?php //get all child categories $this->db->select('*')->from('categories')->where('parent', $category->id_categories)->order_by('priority', 'ASC'); $child_categories = $this->db->get()->result(); ?> <?php foreach ($child_categories as $child) : ?> -- <input style="position:relative; bottom:3px; margin-right: 10px; margin-left:10px;" type="checkbox" name="category_id[]" value="<?= $child->id_categories; ?>" <?= set_checkbox('category_id[]', $child->id_categories); ?> <?php if (isset($chosen_categories)) : ?> <?php //checked item foreach ($chosen_categories as $chosen_category) : ?> <?php if ($chosen_category->id_category == $child->id_categories) : ?> checked <?php endif; ?> <?php endforeach; ?> <?php endif; ?> > <?= ucfirst($child->category); ?> <br> <?php //check if this parent categories does have sub categories $this->db->select('id_categories')->from('categories')->where('parent', $child->id_categories); $count_grandchild = $this->db->get()->num_rows(); ?> <?php if ($count_grandchild > 0) : //this category does have childen ?> <?php //get all child categories $this->db->select('*')->from('categories')->where('parent', $child->id_categories)->order_by('priority', 'ASC'); $grandchild_categories = $this->db->get()->result(); ?> <?php foreach ($grandchild_categories as $grandchild) : ?> ------- <input style="position:relative; bottom:3px; margin-right: 10px; margin-left:10px;" type="checkbox" name="category_id[]" value="<?= $grandchild->id_categories; ?>" <?= set_checkbox('category_id[]', $grandchild->id_categories); ?> <?php if (isset($chosen_categories)) : ?> <?php //checked item foreach ($chosen_categories as $chosen_category) : ?> <?php if ($chosen_category->id_category == $grandchild->id_categories) : ?> checked <?php endif; ?> <?php endforeach; ?> <?php endif; ?> > <?= ucfirst($grandchild->category); ?> <br> <?php endforeach; ?> <?php endif; ?> <?php endforeach; ?> <?php endif; ?> <?php endforeach; ?> </div> <?= form_error('category_id[]'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <h4>Deskripsi Produk</h4> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Deskripsi Singkat</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="tabbable"> <ul class="nav nav-tabs"> <li class="active"><a href="#description_id" data-toggle="tab">Text</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', $products->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', $products->description_en, FALSE)); ?> <?php echo form_error('description_en'); ?> </div><!-- end id="#description_id" --> </div><!-- end class tab-content--> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <!-- <p>Deskripsi Lengkap (kosongkan bila tidak ada)</p> --> <p>Spesifikasi Lainnya</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="tabbable"> <ul class="nav nav-tabs"> <li class="active"><a href="#longdescription_id" data-toggle="tab">Text</a></li> <!-- <li><a href="#longdescription_en" data-toggle="tab">English</a></li> --> </ul> <div class="tab-content"> <div class="tab-pane active" id="longdescription_id"> <?php echo form_textarea('long_description', set_value('long_description', $products->long_description, FALSE)); ?> <?php echo form_error('long_description'); ?> </div><!-- end id="#description_id" --> <div class="tab-pane" id="longdescription_en"> <?php echo form_textarea('long_description_en', set_value('long_description_en', $products->long_description_en, FALSE)); ?> <?php echo form_error('long_description_en'); ?> </div><!-- end id="#description_id" --> </div><!-- end class tab-content--> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display:none"> <div class="col-sm-3"> <!-- <p>Info Lainnya (kosongkan bila tidak ada)</p> --> <p>Sertifikasi</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="tabbable"> <ul class="nav nav-tabs"> <li class="active"><a href="#additional_information_id" data-toggle="tab">Indonesian</a></li> <li><a href="#additional_information_en" data-toggle="tab">English</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="additional_information_id"> <?php echo form_textarea('additional_information', set_value('additional_information', $products->additional_information, FALSE)); ?> <?php echo form_error('additional_information'); ?> </div><!-- end id="#description_id" --> <div class="tab-pane" id="additional_information_en"> <?php echo form_textarea('additional_information_en', set_value('additional_information_en', $products->additional_information_en, FALSE)); ?> <?php echo form_error('additional_information_en'); ?> </div><!-- end id="#description_id" --> </div><!-- end class tab-content--> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display:none;"> <div class="col-sm-3"> <p>Informasi Pengiriman</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="tabbable"> <ul class="nav nav-tabs"> <li class="active"><a href="#payment_information_id" data-toggle="tab">Indonesian</a></li> <li><a href="#payment_information_en" data-toggle="tab">English</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="payment_information_id"> <?php echo form_textarea('payment_information', set_value('payment_information', $products->payment_information, FALSE)); ?> <?php echo form_error('payment_information'); ?> </div><!-- end id="#description_id" --> <div class="tab-pane" id="payment_information_en"> <?php echo form_textarea('payment_information_en', set_value('payment_information_en', $products->payment_information_en, FALSE)); ?> <?php echo form_error('payment_information_en'); ?> </div><!-- end id="#description_id" --> </div><!-- end class tab-content--> </div><!-- end tabbable --> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <h4>Foto Produk (s/d 5 foto)</h4> <?php //get product image width and height setting from configuration table $this->db->select('product_image_width, product_image_height')->from('configuration')->where('id_configuration', 1); $product_dimensions = $this->db->get()->row(); ?> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Foto Produk 1 (Foto Cover)<br> <?php if ($products->image1 != NULL): ?> Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' . $products->image1; ?>" style="width:50px; height:auto;"><br> <i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image1'; ?>">Hapus</a> <?php endif ?> </p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <input class="form-control" type="file" name="image1" size="20" /><br> <span style="font-size:12px; font-style: italic;"> Ukuran foto <?= $product_dimensions->product_image_width; ?> (lebar) x <?= $product_dimensions->product_image_height; ?> (tinggi) pixel, jpg/png, maks. 300KB </span> <span style="color:#F7931E;"><?php echo form_error('image1'); ?></span> <?php echo $this->session->flashdata('image1-error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Foto Produk 2<br> <?php if ($products->image2 != NULL): ?> Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' . $products->image2; ?>" style="width:50px; height:auto;"><br> <i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image2'; ?>">Hapus</a> <?php endif ?> </p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <input class="form-control" type="file" name="image2" size="20" /><br> <span style="font-size:12px; font-style: italic;"> Ukuran foto <?= $product_dimensions->product_image_width; ?> (lebar) x <?= $product_dimensions->product_image_height; ?> (tinggi) pixel, jpg/png, max 300KB </span> <span style="color:#F7931E;"><?php echo form_error('image2'); ?></span> <?php echo $this->session->flashdata('image2-error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Foto Produk 3<br> <?php if ($products->image3 != NULL): ?> Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' . $products->image3; ?>" style="width:50px; height:auto;"><br> <i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image3'; ?>">Hapus</a> <?php endif ?> </p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <input class="form-control" type="file" name="image3" size="20" /><br> <span style="font-size:12px; font-style: italic;"> Ukuran foto <?= $product_dimensions->product_image_width; ?> (lebar) x <?= $product_dimensions->product_image_height; ?> (tinggi) pixel, jpg/png, max 300KB </span> <span style="color:#F7931E;"><?php echo form_error('image3'); ?></span> <?php echo $this->session->flashdata('image3-error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Foto Produk 4<br> <?php if ($products->image4 != NULL): ?> Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' . $products->image4; ?>" style="width:50px; height:auto;"><br> <i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image4'; ?>">Hapus</a> <?php endif ?> </p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <input class="form-control" type="file" name="image4" size="20" /><br> <span style="font-size:12px; font-style: italic;"> Ukuran foto <?= $product_dimensions->product_image_width; ?> (lebar) x <?= $product_dimensions->product_image_height; ?> (tinggi) pixel, jpg/png, max 300KB </span> <span style="color:#F7931E;"><?php echo form_error('image4'); ?></span> <?php echo $this->session->flashdata('image4-error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Foto Produk 5<br> <?php if ($products->image5 != NULL): ?> Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' . $products->image5; ?>" style="width:50px; height:auto;"><br> <i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image5'; ?>">Hapus</a> <?php endif ?> </p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <input class="form-control" type="file" name="image5" size="20" /><br> <span style="font-size:12px; font-style: italic;"> Ukuran foto <?= $product_dimensions->product_image_width; ?> (lebar) x <?= $product_dimensions->product_image_height; ?> (tinggi) pixel, jpg/png, max 300KB </span> <span style="color:#F7931E;"><?php echo form_error('image5'); ?></span> <?php echo $this->session->flashdata('image5-error'); //to display error message ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Harga Jual Normal*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'sale_price', 'value' => set_value('sale_price', $products->sale_price), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('sale_price'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>sedang Sale ?<br> (Tampilkan icon SALE & aktifkan harga jual diskon)</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="is_sale" class="form-control"> <option value="no" <?= set_select('is_sale', 'no'); ?> <?php if ($products->is_sale == 'no') : ?> selected="selected" <?php endif; ?> >No</option> <option value="yes" <?= set_select('is_sale', 'yes'); ?> <?php if ($products->is_sale == 'yes') : ?> selected="selected" <?php endif; ?> >Yes</option> </select> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Harga Jual Diskon</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'discounted_price', 'value' => set_value('discounted_price', $products->discounted_price), 'class' => 'form-control', ); echo form_input($data); ?> <?= form_error('discounted_price'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <?php if($role =='super admin') : ?> <?php if($new_product == 'yes') :?> <div class="row" style="display: none;"> <div class="col-sm-3"> <p>Stok</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th>Gudang</th> <th>Stok</th> </tr> </thead> <tbody> <?php foreach ($stock as $stock_item):?> <tr> <td style="width: 50%"><?= $stock_item->name; ?></td> <input type="hidden" name="warehouse_id[]" value="<?= $stock_item->id;?>"> <?php if ($new_product == 'yes'): ?> <td><input type="text" value="0" style="padding: 5px;" disabled></td> <?php else: ?> <?php $product_stock = 0; $get_stock = $this->db->select('stock')->from('stock')->where('id_product',$products->id_products)->where('Warehouse_id',$stock_item->id)->get()->row(); if($get_stock!=null){ $product_stock = $get_stock->stock; } ?> <td><input type="number" min="0" name="warehouse_stock[]" value="<?= $product_stock; ?>" style="padding: 5px;"></td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> </div><!-- end class responsive--> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <?php else :?> <div class="row"> <div class="col-sm-3"> <p>Stok</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th>Gudang</th> <th>Stok</th> </tr> </thead> <tbody> <?php foreach ($stock as $stock_item):?> <tr> <td style="width: 50%"><?= $stock_item->name; ?></td> <input type="hidden" name="warehouse_id[]" value="<?= $stock_item->id;?>"> <?php if ($new_product == 'yes'): ?> <td><input type="text" value="0" style="padding: 5px;" disabled></td> <?php else: ?> <?php $product_stock = 0; $get_stock = $this->db->select('stock')->from('stock')->where('id_product',$products->id_products)->where('Warehouse_id',$stock_item->id)->get()->row(); if($get_stock!=null){ $product_stock = $get_stock->stock; } ?> <td><input type="number" min="0" name="warehouse_stock[]" value="<?= $product_stock; ?>" style="padding: 5px;"></td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> </div><!-- end class responsive--> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <?php endif;?> <?php else : ?> <div class="row"> <div class="col-sm-3"> <p>Stok</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th>Gudang</th> <th>Stok</th> </tr> </thead> <tbody> <?php foreach ($stock as $stock_item):?> <tr> <td style="width: 50%"><?= $stock_item->name; ?></td> <?php if ($new_product == 'yes'): ?> <td><input type="text" value="0" style="padding: 5px;" disabled></td> <?php else: ?> <?php $product_stock = 0; $get_stock = $this->db->select('stock')->from('stock')->where('id_product',$products->id_products)->where('Warehouse_id',$stock_item->id)->get()->row()->stock; if($get_stock!=null){ $product_stock = $get_stock; } ?> <td><input type="text" value="<?= $product_stock; ?>" style="padding: 5px;" disabled></td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> </div><!-- end class responsive--> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <?php endif; ?> <div class="row"> <div class="col-sm-3"> <p>Minimum Stok*<br>(muncul warning di admin)</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'minimum_stock', 'value' => set_value('minimum_stock', $products->minimum_stock), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('minimum_stock'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Product Warranty*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'warranty', 'value' => set_value('warranty', $products->warranty, FALSE), 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('warranty'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display:none;"> <div class="col-sm-3"> <p>Kurir Pengiriman*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div style="height: 200px; overflow-y: scroll; padding: 20px; border:1px solid #ccc;"> <?php foreach($shipment as $item_shipment) : ?> <input style="position:relative; bottom:3px; margin-right: 10px;" type="checkbox" name="shipment_id[]" value="<?= $item_shipment->id; ?>" <?= set_checkbox('shipment_id[]', $item_shipment->id); ?> <?php if (isset($chosen_shipments)) : ?> <?php //checked item foreach ($chosen_shipments as $chosen_shipment) : ?> <?php if ($chosen_shipment->shipment_method_id == $item_shipment->id) : ?> checked <?php endif; ?> <?php endforeach; ?> <?php endif; ?> <?php if($item_shipment->id == 3): ?> checked <?php endif; ?> ><?= ucfirst($item_shipment->name); ?><br> <?php endforeach; ?> </div> <?= form_error('shipment_id[]'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <h4>Berat dan dimensi kemasan produk</h4> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Berat Kirim (grams)*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'dimension_weight', 'value' => set_value('dimension_weight', $products->dimension_weight), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('dimension_weight'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Panjang (cm)*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'dimension_length', 'value' => set_value('dimension_length', $products->dimension_length), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('dimension_length'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Lebar (cm)*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'dimension_width', 'value' => set_value('dimension_width', $products->dimension_width), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('dimension_width'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Tinggi (cm)*</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'dimension_height', 'value' => set_value('dimension_height', $products->dimension_height), 'class' => 'form-control', 'required' => 'required' ); echo form_input($data); ?> <?= form_error('dimension_height'); ?> </p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display: none;"> <div class="col-sm-3"> <p>Event</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <div style="height: 200px; overflow-y: scroll; padding: 20px; border:1px solid #ccc;"> <?php foreach($event as $item_event) : ?> <input style="position:relative; bottom:3px; margin-right: 10px;" type="checkbox" name="event_id[]" value="<?= $item_event->id; ?>" <?= set_checkbox('event_id[]', $item_event->id); ?> <?php if (isset($chosen_events)) : ?> <?php //checked item foreach ($chosen_events as $chosen_event) : ?> <?php if ($chosen_event->event_id == $item_event->id) : ?> checked <?php endif; ?> <?php endforeach; ?> <?php endif; ?> ><?= ucfirst($item_event->event); ?><br> <?php endforeach; ?> </div> <?= form_error('event_id'); ?> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <h4>Produk Status & Ordering</h4> </div><!-- end class="col-sm-12" --> </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"> <select name="product_status" class="form-control"> <option value="0" <?php echo set_select('product_status', '0'); ?> <?php if($products->product_status == 0) : ?> selected <?php endif; ?> >No</option> <option value="1" <?php echo set_select('product_status', '1'); ?> <?php if($products->product_status == 1) : ?> selected <?php endif; ?> >Yes</option> </select> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Ordering (masukan angka)</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'priority', 'value' => $products->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>Terjual<br>Masukan angka terjual. Bila 0 maka tidak ditampillkan.</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'sold', 'value' => set_value('sold', $products->sold), 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('sold'); ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>set Produk Terbaru ?</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="new_arrival" class="form-control"> <option value="no" <?= set_select('new_arrival', 'no'); ?> <?php if ($products->new_arrival == 'no') : ?> selected="selected" <?php endif; ?> >No</option> <option value="yes" <?= set_select('new_arrival', 'yes'); ?> <?php if ($products->new_arrival == 'yes') : ?> selected="selected" <?php endif; ?> >Yes</option> </select> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display:none"> <div class="col-sm-3"> <p>Set Produk Unggulan ?</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="popular_product" class="form-control"> <option value="no" <?= set_select('popular_product', 'no'); ?> <?php if ($products->popular_product == 'no') : ?> selected="selected" <?php endif; ?> >No</option> <option value="yes" <?= set_select('popular_product', 'yes'); ?> <?php if ($products->popular_product == 'yes') : ?> selected="selected" <?php endif; ?> >Yes</option> </select> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display:none"> <div class="col-sm-3"> <p>Set produk Terlaris ?</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="best_seller" class="form-control"> <option value="no" <?= set_select('best_seller', 'no'); ?> <?php if ($products->best_seller == 'no') : ?> selected="selected" <?php endif; ?> >No</option> <option value="yes" <?= set_select('best_seller', 'yes'); ?> <?php if ($products->best_seller == 'yes') : ?> selected="selected" <?php endif; ?> >Yes</option> </select> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Bisa Indent ?</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="is_backorder" class="form-control"> <option value="yes" <?= set_select('is_backorder', 'yes'); ?> <?php if ($products->is_backorder == 'yes') : ?> selected="selected" <?php endif; ?> >Yes</option> <option value="no" <?= set_select('is_backorder', 'no'); ?> <?php if ($products->is_backorder == 'no') : ?> selected="selected" <?php endif; ?> >No</option> </select> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Durasi Indent</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'indent_duration', 'value' => set_value('indent_duration', $products->indent_duration), 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('indent_duration'); ?></p> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row" style="display:none"> <div class="col-sm-3"> <p>Produk Diskontinue ?</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <select name="is_discontinue" class="form-control"> <option value="no" <?= set_select('is_discontinue', 'no'); ?> <?php if ($products->is_discontinue == 'no') : ?> selected="selected" <?php endif; ?> >Tidak</option> <option value="yes" <?= set_select('is_discontinue', 'yes'); ?> <?php if ($products->is_discontinue == 'yes') : ?> selected="selected" <?php endif; ?> >Ya</option> </select> </div><!-- end class="col-sm-9" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <h4>SEO (Search Engine Optimization)</h4> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-3"> <p>Deskripsi Meta</p> </div><!-- end class="col-sm-3" --> <div class="col-sm-9"> <p> <?php $data = array( 'name' => 'meta_description', 'value' => set_value('meta_description', $products->meta_description), 'class' => 'form-control' ); echo form_input($data); ?> <?= form_error('meta_description'); ?></p> </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"> <?php if($allowed == true) : ?> <?= form_submit('submit', 'Simpan Produk', 'class="btn btn-primary btn-success button-brown"'); ?> <?= anchor('admin/products', 'batal'); ?> <?php endif; ?> </div><!-- end class="col-sm-9" --> </div><!--end row --> <?= form_close(); ?> <script> $(document).ready(function() { $('form').submit(function(e){ for (var i=1; i<=3; i++) { if($('#checkbox_satuanbeli' + i).is(':checked')) { //check if #input_satuanbeli has value if($('#input_satuanbeli' + i).val() == '' || $('#input_satuanbeli' + i).val() == '0') { alert ('Satuan beli yang dicentang tidak boleh kosong atau 0. Cek kembali Satuan beli.'); $('#input_satuanbeli' + i).focus(); e.preventDefault(); return false; } } } }); }); $("[name='sku']").blur(function(){ var sku = $(this).val(); $.ajax({ url: '<?=base_url("admin/products/cek_existing_sku/")?>', data:{sku: sku, '<?=$this->security->get_csrf_token_name()?>':'<?=$this->security->get_csrf_hash()?>'}, type: 'post', dataType: 'json', success:function(result){ if(result.sku==1) { alert('SKU already exist.'); $("[name='sku']").val(''); $("[name='sku']").focus(); } } }) }) $("[name='product_code']").blur(function(){ var product_code = $(this).val(); $.ajax({ url: '<?=base_url("admin/products/cek_existing_product_code/")?>', data:{product_code: product_code, '<?=$this->security->get_csrf_token_name()?>':'<?=$this->security->get_csrf_hash()?>'}, type: 'post', dataType: 'json', success:function(result){ if(result.product_code==1) { alert('Product Code already exist.'); $("[name='product_code']").val(''); $("[name='product_code']").focus(); } } }) }) </script>