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 : /proc/self/root/var/www/smbparts.co.id/public_html/application/views/admin/products/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <p><a href="<?= base_url('admin/dashboard'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to Dashboard</a></p><br> <h2>Manage Products</h2> <?= $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 --> <div> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a aria-controls="search" href="#search" role="tab" data-toggle="tab">Search Products</a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="search"> <h3>Search Product</h3> <div class="row"> <?= form_open('admin/products'); ?> <div class="col-sm-5 col-xs-6"> <input class="form-control" type="text" placeholder="Enter Product Name" name="product" required <?php if (isset($keyword)) : ?> value="<?= ucwords($keyword); ?>" <?php endif; ?>> </div><!-- end class="col-sm-8" --> <div class="col-sm-3 col-xs-6"> <input class="btn btn-primary form-control" type="submit" name="search_product" value="SEARCH PRODUCT"> </div><!-- end class="col-sm-6" --> <?= form_close(); ?> </div> <!-- end row --> <div class="row"> <?= form_open('admin/products/search_category'); ?> <div class="col-sm-5 col-xs-6"> <?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(); ?> <select name="category" class="form-control"> <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 //check if the current id does have child $this->db->select('*')->from('categories')->where('parent', $child_category->id_categories); $count_child2_category = $this->db->get()->num_rows(); ?> <?php if ($count_child2_category > 0): ?> <?php //get all existing child categories $this->db->select('id_categories, category')->from('categories')->where('parent', $child_category->id_categories)->order_by('priority', 'ASC'); $child2_categories = $this->db->get()->result(); ?> <?php foreach ($child2_categories as $child2_category) : ?> <option style="margin-left: 10px;"value="<?= $child2_category->id_categories; ?>" <?php if (isset($category_id)) : ?> <?php if ($child2_category->id_categories == $category_id) : ?> selected <?php endif; ?> <?php endif; ?> >-- <?= ucwords($child2_category->category); ?></option> <?php endforeach; ?> <?php endif ?> <?php endforeach; ?> <?php endif ?> <?php endforeach; ?> </select> </div><!-- end class="col-sm-5" --> <div class="col-sm-3 col-xs-6"> <input class="btn btn-primary form-control" type="submit" name="search_category" value="SEARCH BY CATEGORY"> </div><!-- end class="col-sm-3" --> <?= form_close(); ?> </div> <!-- end row --> <div class="row"> <?= form_open('admin/products/search_brand'); ?> <div class="col-sm-5 col-xs-6"> <select name="brand" class="form-control"> <?php //get brands id and name from brandsa table $this->db->select('id_brands, brand')->from('brands')->order_by('brand', 'ASC'); $brands = $this->db->get()->result(); ?> <option value="">Select Brand ...</option> <?php foreach ($brands as $brand) : ?> <?php if ($brand->id_brands != 0) : ?> <option value="<?= $brand->id_brands; ?>" <?php if (isset($brand_id)) : ?> <?php if ($brand->id_brands == $brand_id) : ?> selected <?php endif; ?> <?php endif; ?> ><?= ucwords($brand->brand); ?></option> <?php endif; ?> <?php endforeach; ?> </select> </div><!-- end class="col-sm-8" --> <div class="col-sm-3 col-xs-6"> <input class="btn btn-primary form-control" type="submit" name="search_brand" value="SEARCH BY BRAND"> </div><!-- end class="col-sm-6" --> <?= form_close(); ?> </div> <!-- end row --> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <br> <p><?= anchor('admin/products/add', '<i class="fa fa-plus" aria-hidden="true"></i> ADD A NEW PRODUCT'); ?></p> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th>Product Name</th> <th>Display</th> <th>Ordering</th> <!-- <th>Quick Edit</th> --> <th>Edit</th> <!-- <th>Duplicate</th> --> <!-- <th>Preview</th> --> <th>Delete</th> </tr> </thead> <tbody> <?php if(count($products)) : ?> <?php foreach($products as $product): ?> <tr> <td> <?php if($product->image1 != null): ?> <img style="width:100px;" src="<?= base_url() . 'uploads/product/' . $product->image1; ?>"> <?php endif; ?> <?= ucfirst($product->title); ?> </td> <td> <?php if ($product->product_status == 1) { echo 'Yes'; } else { echo 'No'; } ?> </td> <td><?= $product->priority; ?></td> <!-- <td><a class="quickedit" href="<?= $product->id_products; ?>"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a></td> --> <td><?= bt_edit('admin/products/edit/' . $product->id_products); ?></td> <!-- <td><a href="<?= base_url() . 'admin/products/duplicate_product/' . $product->id_products; ?>"><i class="fa fa-files-o" aria-hidden="true"></i></a></td> --> <!-- <td><a href="<?= base_url() . 'product/' . $product->alias; ?>" target="_blank"><i class="fa fa-eye" aria-hidden="true"></i></a></td> --> <td><?= bt_delete('admin/products/delete/' . $product->id_products); ?></td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="3">We could not find any product.</td> </tr> <?php endif; ?> </tbody> </table> </div><!-- end class responsive--> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <?php if(isset($use_pagination)) : ?> <div style="text-align:center;"><?= $this->pagination->create_links(); ?></div> <?php endif; ?> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div id="getProductDetail"></div> <script> $(document).ready(function() { var controller = 'admin/products'; var base_url = '<?php echo base_url(); ?>'; $('a.quickedit').click(function(event) { event.preventDefault(); var id_product = $(this).attr('href'); ajax_getproductdetails(id_product); }); function ajax_getproductdetails(id_product) { $.ajax({ 'url' : base_url + controller + '/ajax_getproductdetails', 'type' : 'POST', 'data' : {'id_product' : id_product}, 'success' : function(data) { var container = $('#getProductDetail'); if (data) { /*---success----*/ $('#getProductDetail').html(data); $('#showModal').trigger('click'); }; } }); } }); </script>