https://t.me/RX1948
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/kanvakanva.com/public_html/application/views/admin/products/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/kanvakanva.com/public_html/application/views/admin/products/edit.php
<div class="modal-header">
<a href="<?= base_url('admin/products'); ?>">&lt;&lt; Back to Product List Page</a><br><br>
    <h4><?= empty($products->id_products) ? 'Add a new product' : 'Edit Product: '
  . $products->title; ?></h4>
  <?= $this->session->flashdata('success'); //to display success message ?>
  <?= $this->session->flashdata('result'); //to display result message ?>
</div>

<div class="modal-body">

<div><?= validation_errors(); ?></div>

  <?= form_open_multipart(); ?>

    <input type="hidden" name="product_id" value="<?= $products->id_products; ?>">

    <table class="table">
    <tr>
        <td>Product Name</td>
        <td><?= form_input('product_name' , set_value('product_name', $products->title)); ?>
        <?= form_error('product_name'); ?>
        </td>
    </tr>

    <tr>
        <td>Is Gift Voucher ?</td>
        <td>
			<select name="is_voucher">
                <option value="no"
	                <?php if ($products->is_voucher == 'no') : ?>
	                    selected="selected"
	                <?php endif; ?>
	            >No</option>
	            <option value="yes"
	                <?php if ($products->is_voucher == 'yes') : ?>
	                    selected="selected"
	                <?php endif; ?>
	            >Yes</option>
              </select>
              <?= form_error('is_voucher'); ?>
        </td>
    </tr>
    <tr>
        <td>Is New Arrival?</td>
        <td>
        <?php
            $options = array(
              'no'   => 'No',
              'yes'  => 'Yes',
            );
            echo form_dropdown('new_arrival', $options, $products->new_arrival);
          ?>
        </td>
    </tr>

    <tr>
        <td>Is New Sale?</td>
        <td>
        <?php
            $options = array(
              'no'   => 'No',
              'yes'  => 'Yes',
            );
            echo form_dropdown('new_sale', $options, $products->new_sale);
          ?>
        </td>
    </tr>
    <?php
      $this->db->select('*')
        ->from('promotion')
        ->where('id_promotion', '1');
      $promo = $this->db->get()->row();
    ?>
    <tr>
        <td>In Promo ?<br>
          <a href="<?= base_url() . 'uploads/promotion/' . $promo->banner1; ?>" target="_blank">
          <img style="width:300px; height:auto;" src="<?= base_url() . 'uploads/promotion/' . $promo->banner1; ?>"  alt="" />
          </a>
        </td>
        <td valign="middle">
        <?php
            $options = array(
              'no'   => 'No',
              'yes'  => 'Yes',
            );
            echo form_dropdown('in_promo1', $options, $products->in_promo1);
          ?>
        </td>
    </tr>
    <tr>
        <td>In Promo (<?=$promo->title?>)?</td>
        <td>
        <?php
            $options = array(
              'no'   => 'No',
              'yes'  => 'Yes',
            );
            echo form_dropdown('in_promo2', $options, $products->in_promo2);
          ?>
        </td>
    </tr>

     <tr>
    

            <td>Choose Category</td>
            <td>

                <?php foreach($parent_categories as $category) : ?>

                  <input style="position:relative; bottom:3px; margin-right: 10px;" type="checkbox" name="category_id[]" value="<?= $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; ?>"

                        <?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_child3 = $this->db->get()->num_rows();
                      ?>
                      <?php if ($count_child3 > 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');
                           $child_categories3 = $this->db->get()->result();
                        ?>

                        <?php foreach ($child_categories3 as $child3) : ?>

                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- <input style="position:relative; bottom:3px; margin-right: 10px; margin-left:10px;" type="checkbox" name="category_id[]" value="<?= $child3->id_categories; ?>"

                            <?php if (isset($chosen_categories)) : ?>

                              <?php
                              //checked item
                              foreach ($chosen_categories as $chosen_category) : ?>

                                <?php if ($chosen_category->id_category == $child3->id_categories) : ?>
                                  checked

                                <?php endif; ?>

                              <?php endforeach; ?>

                            <?php endif; ?>

                          > <?= ucfirst($child3->category); ?> <br>



                        <?php endforeach; ?>

                      <?php endif; ?>
                      <!-- ///////////////////// -->

                    <?php endforeach; ?>

                  <?php endif; ?>


                <?php endforeach; ?>
              <?= form_error('category_id'); ?>
            </td>
     </tr>

     <tr>
            <td>Brand</td>
            <td>
              <select name="brand_id">
                <?php foreach($brands as $brand) : ?>
                <option value="<?= $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'); ?>
            </td>
     </tr>


     <tr>
            <td>Product Theme
            <td>
              <?php
                //get all themes
                $this->db->select('*')->from('themes')->order_by('priority', 'ASC');
                $themes = $this->db->get()->result();
              ?>

              <select name="themes">

                <option value="0">choose theme...</option>

                <?php foreach ($themes as $theme) : ?>

                    <option value="<?= $theme->id_themes; ?>"
                      <?php if ($products->theme_id == $theme->id_themes) : ?>
                        selected
                      <?php endif; ?>
                  ><?= ucfirst($theme->themes); ?></option>

                <?php endforeach; ?>

              </select>

            </td>
     </tr>

     <tr>
            <td>Price (Rp)<br/>
                <span style="font-size:12px; font-style: italic;">without comma or dot (Eg. 1400000)</span></td>
            <td><?= form_input('price' , set_value('price', $products->price)); ?>
            <?= form_error('price'); ?>
            </td>
     </tr>

     <tr style="">
            <td>Discounted Price (Rp)<br/>
                <span style="font-size:12px; font-style: italic;">leave blank to disable discount. without comma or dot</span></td>
            <td><?= form_input('discount_price' , set_value('discount_price', $products->discount_price)); ?>
            <?= form_error('discount_price'); ?>
            </td>
     </tr>

     <tr style="display:none">
            <td>Gross Weight (Gram)<br/>
                <span style="font-size:12px; font-style: italic;">To calculate shipping. without comma or dot</span></td>
            <td><?= form_input('weight' , set_value('weight', $products->weight)); ?>
            <?= form_error('weight'); ?>
            </td>
     </tr>

     <tr>
          <td><h4>Product Specific Prices and Stocks</td>
          <td></td>
        </tr>

         <tr>
            <td>Input / Edit Product Stock. Number only.<br>
            <span style="font-size:12px; font-style: italic;">leave blank if a size does not have stock.</span></td>
            <td>
              <table style="border:1px solid #b5b5b5;">
                <tr>
                  <th>Size</th>
                  <th>Price (Rp)</th>
                  <th>Discounted Price (Rp)</th>
                  <th>Stock</th>
                  <th>Weight (gram)</th>
                </tr>
                <?php foreach ($stocks as $item) : ?>
                    <tr>
                      <td><?= $item->product_size; ?></td>

                      <td><input style="width:50%;" type="text" name="price<?= $item->id_product_size; ?>"

                      <?php if (empty($products->id_products)): ?>
                         value=""
                      <?php else : ?>
                         value="<?= $item->price; ?>"
                      <?php endif ?>

                      ></td>

                      <td><input style="width:50%;" type="text" name="discounted_price<?= $item->id_product_size; ?>"

                      <?php if (empty($products->id_products)): ?>
                         value=""
                      <?php else : ?>
                         value="<?= $item->discounted_price; ?>"
                      <?php endif ?>

                      ></td>


                      <td><input style="width:50%;" type="text" name="size<?= $item->id_product_size; ?>"

                      <?php if (empty($products->id_products)): ?>
                         value=""
                      <?php else : ?>
                         value="<?= $item->stock; ?>"

                            <?php if ($item->stock > 0): ?>
                              style="background:#bdfaf4;"
                            <?php endif; ?>

                      <?php endif ?>

                      ></td>

                      <td><input style="width:50%;" type="text" name="weight<?= $item->id_product_size; ?>"

                      <?php if (empty($products->id_products)): ?>
                         value=""
                      <?php else : ?>
                         value="<?= $item->weight; ?>"
                      <?php endif ?>

                      ></td>
                    </tr>
                <?php endforeach; ?>
              </table>
            </td>
         </tr>

        <tr>
          <td>Short Description</td>
          <td><?php echo form_textarea('description', set_value('description',
          $products->description, FALSE)); ?>
          <?php echo form_error('description'); ?>
        </tr>

        <tr>
          <td>Long Description</td>
          <td><?php echo form_textarea('long_description', set_value('long_description',
          $products->long_description, FALSE)); ?>
          <?php echo form_error('long_description'); ?>
        </tr>

        <tr>
          <td>Additional Information</td>
          <td><?php echo form_textarea('additional_information', set_value('additional_information',
          $products->additional_information, FALSE)); ?>
          <?php echo form_error('additional_information'); ?>
        </tr>

        <tr>
          <td>Editor notes</td>
          <td><?php echo form_textarea('editor_notes', set_value('editor_notes',
          $products->editor_notes, FALSE)); ?>
          <?php echo form_error('editor_notes'); ?>
        </tr>

        <tr>
          <td>Dimensions</td>
          <td><?php echo form_textarea('dimensions', set_value('dimensions',
          $products->dimensions, FALSE)); ?>
          <?php echo form_error('dimensions'); ?>
        </tr>

        <tr>
          <td>Material</td>
          <td><?php echo form_textarea('material', set_value('material',
          $products->material, FALSE)); ?>
          <?php echo form_error('material'); ?>
        </tr>

        <tr>
          <td>Good to know</td>
          <td><?php echo form_textarea('good_to_know', set_value('good_to_know',
          $products->good_to_know, FALSE)); ?>
          <?php echo form_error('good_to_know'); ?>
        </tr>

        <tr>
          <td><h4>Product Images (Up to 5 images)</td>
          <td></td>
        </tr>

         <tr>
          <td>Product Image 1 (Cover Image)<br>

          <?php if ($products->image1 != NULL): ?>
             Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' .
          $products->image1; ?>" style="width:50px; height:auto;">

          <i class="icon-trash"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image1'; ?>">Delete</a>
          <?php endif ?>

          </td>
          <td>
            <input type="file" name="image1" size="20" /><br>
            <span style="font-size:12px; font-style: italic;">Image size must be 1000 (width) x 1000 (height) pixel, jpg, max 300KB</span>
            <span style="color:#F7931E;"><?php echo form_error('image1'); ?></span>
            <?php echo $this->session->flashdata('image1-error'); //to display error message ?>

          </td>
        </tr>

         <tr>
          <td>Product Image 2<br>
          <?php if ($products->image2 != NULL): ?>
             Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' .
          $products->image2; ?>" style="width:50px; height:auto;">

          <i class="icon-trash"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image2'; ?>">Delete</a>

          <?php endif ?></td>
          <td>
            <input type="file" name="image2" size="20" /><br>
            <span style="font-size:12px; font-style: italic;">Image size must be 1000 (width) x 1000 (height) pixel, jpg, max 300KB</span>
            <span style="color:#F7931E;"><?php echo form_error('image2'); ?></span>
            <?php echo $this->session->flashdata('image2-error'); //to display error message ?>

          </td>
        </tr>

         <tr>
          <td>Product Image 3<br>
          <?php if ($products->image3 != NULL): ?>
             Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' .
          $products->image3; ?>" style="width:50px; height:auto;">

          <i class="icon-trash"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image3'; ?>">Delete</a>

          <?php endif ?></td>
          <td>
            <input type="file" name="image3" size="20" /><br>
            <span style="font-size:12px; font-style: italic;">Image size must be 1000 (width) x 1000 (height) pixel, jpg, max 300KB</span>
            <span style="color:#F7931E;"><?php echo form_error('image3'); ?></span>
            <?php echo $this->session->flashdata('image3-error'); //to display error message ?>

          </td>
        </tr>

         <tr>
          <td>Product Image 4<br>
          <?php if ($products->image4 != NULL): ?>
             Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' .
          $products->image4; ?>" style="width:50px; height:auto;">

          <i class="icon-trash"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image4'; ?>">Delete</a>

          <?php endif ?></td>
          <td>
            <input type="file" name="image4" size="20" /><br>
            <span style="font-size:12px; font-style: italic;">Image size must be 1000 (width) x 1000 (height) pixel, jpg, max 300KB</span>
            <span style="color:#F7931E;"><?php echo form_error('image4'); ?></span>
            <?php echo $this->session->flashdata('image4-error'); //to display error message ?>

          </td>
        </tr>

         <tr>
          <td>Product Image 5<br>
          <?php if ($products->image5 != NULL): ?>
             Image Preview: <img src="<?= base_url() . 'uploads/product/thumbnail/' .
          $products->image5; ?>" style="width:50px; height:auto;">

          <i class="icon-trash"></i> <a href="<?= base_url() . 'admin/products/delete_image/' . $products->id_products . '/image5'; ?>">Delete</a>

          <?php endif ?>
          </td>
          <td>
            <input type="file" name="image5" size="20" /><br>
            <span style="font-size:12px; font-style: italic;">Image size must be 1000 (width) x 1000 (height) pixel, jpg, max 300KB</span>
            <span style="color:#F7931E;"><?php echo form_error('image5'); ?></span>
            <?php echo $this->session->flashdata('image5-error'); //to display error message ?>

          </td>
        </tr>



        <tr>
            <td>Display</td>
            <td>
            <?php
                $options = array(
                  '1'  => 'Yes',
                  '0'    => 'No'
                );
                echo form_dropdown('product_status', $options, $products->product_status);
             ?>
            </td>
        </tr>

        <tr>
            <td>Preorder when out of stock</td>
            <td>
            <?php
                $options = array(
                  '0'  => 'No',
                  '1'    => 'Yes'
                );
                echo form_dropdown('preorder', $options, $products->preorder);
             ?>
            </td>
        </tr>

        <tr>
            <td>Ordering priority</td>
            <td><?= form_input('priority' , set_value('priority', $products->priority)); ?>
            <?= form_error('priority'); ?>
            </td>
     </tr>



        <tr>
            <td><strong>SEO (Search Engine Optimization)</strong></td>
            <td></td>
        </tr>

        <tr>
            <td>Page Meta Description</td>
            <td><?= form_input('meta_description' , set_value('meta_description', $products->meta_description)); ?>
            <?= form_error('meta_description'); ?>
            </td>
        </tr>

        <tr>
            <td>Page Meta Keywords<br>(separated with comma)</td>
            <td><?= form_input('meta_keywords' , set_value('meta_keywords', $products->meta_keywords)); ?>
            <?= form_error('meta_keywords'); ?>
            </td>
        </tr>

        <tr>
            <td></td>
            <td>
      <?= form_submit('submit', 'Save Product', 'class="btn btn-primary btn-success button-brown"'); ?>
            &nbsp;&nbsp;&nbsp;<?= anchor('admin/products', 'cancel'); ?>
            </td>
        </tr>
    </table>
    <?= form_close(); ?>
</div>

https://t.me/RX1948 - 2025