<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
             <?php
               echo isset($title) ? $title : NULL;
             ?>
          </h1>
        </section>
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <form method="post" enctype="multipart/form-data">
                <div class="col-lg-6">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                          <h3 class="box-title">Add a New Product</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->

                        <?php
                        if(isset($message))
                        {
                            echo $message;
                        }
                        ?>

                            <div  class="box-body">
                            <div class="form-group">
                                <label class="set-block">Main Category</label>
                                <select name="id_category" class="form-control chosen main_category_select">
                                    <option value="0"> Choose Main Category</option>
                                    <?php

                                        if(isset($allCategories) && is_array($allCategories))
                                        {
                                            foreach($allCategories as $key=>$data)
                                            {
                                                echo '<option value='.$data['id'].'>'.$allCategoriesEn[$key]['title']."-".$allCategoriesAr[$key]['title'].'</option>';
                                            }
                                        }else{
                                            echo '<option value="0">No Data Found</option>';
                                        }
                                      ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>Product Title</label>
                                <input id="" value="<?php if(isset($_POST['title'])) echo $_POST['title']; ?>"  name="title" type="text" class="form-control" placeholder="Product Title">
                            </div>
                            <div class="form-group">
                                <label>Product Slug</label>
                                <textarea name="slug" class="form-control"><?php if(isset($_POST['slug'])) echo $_POST['slug']; ?></textarea>
                            </div>
                            <div class="form-group">
                                <label>Product Description</label>
                                <textarea name="description" rows="8" class="form-control"><?php if(isset($_POST['description'])) echo $_POST['description']; ?></textarea>

                                <script>
                                    CKEDITOR.replace( 'description' );
                                </script>
                            </div>


                            <div class="form-group">
                                <label>Main Image</label>
                                <input id="" name="image" type="file" class="form-control" >
                            </div>
                           <div class="form-group">
                                <label>Product Album Image</label>
                                <input id="" name="album[]" type="file" multiple class="form-control" >
                            </div>




                            <div class="form-group">
                              <label for="availability" class="set-block">Status</label>
                              <div class="radio radio-info  radio-inline">
                                 <input type="radio" id="inlineRadio1" value="1" name="status" checked="">
                                 <label for="inlineRadio1"> Active </label>
                              </div>
                              <div class="radio radio-info  radio-inline">
                                 <input type="radio" id="inlineRadio2" value="2" name="status">
                                 <label for="inlineRadio2"> Not Active </label>
                              </div>
                           </div>

                            </div>
                          <!-- /.box-body -->
                            <div class="box-footer">
                            <button type="submit" name="add" class="btn btn-primary">Add</button>
                          </div>

                      </div>
                      <!-- /.box -->
                </div>
                <div class="col-lg-6 arab_dir">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                          <h3 class="box-title">أضافة منتج جديد</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->

                            <div  class="box-body">

                            <div class="form-group">
                                <label>عنوان المنتج</label>
                                <input id="" value="<?php if(isset($_POST['title_ar'])) echo $_POST['title_ar']; ?>"  name="title_ar" type="text" class="form-control" placeholder="عنوان المنتج">
                            </div>
                            <div class="form-group">
                                <label>مختصر المنتج</label>
                                <textarea name="slug_ar" class="form-control"><?php if(isset($_POST['slug_ar'])) echo $_POST['slug_ar']; ?></textarea>
                            </div>
                            <div class="form-group">
                                <label>وصف المنتج</label>
                                <textarea name="description_ar" rows="8" class="form-control"><?php if(isset($_POST['description_ar'])) echo $_POST['description_ar']; ?></textarea>

                                <script>
                                    CKEDITOR.replace( 'description_ar' );
                                </script>
                            </div>
                            </div>
                          <!-- /.box-body -->

                      </div>
                      <!-- /.box -->
                </div>
                </form>
            </div>
      </section><!-- /.content -->
</div><!-- /.content-wrapper -->
<script>
$(document).ready(function(){


	// start add more inputs code

    var counter = 0;
    var html = '';
    $(".data_added").on("click",".add_more_inputs",function(){

        if(counter == 0)
        {
            html += $(".data_added").html();
        }
        $(".data_added").last().append(html);

        counter++;
    });
    // end add more inputs code


});
</script>
