<?php
session_start();
include_once "../config.php";
require_once '../database1.php';
require_once "../check_admin.php";

class product extends database
{

	public function GetCategory()
    {
		return $this->fetchAll('tb_product_category');
	}
	public function GetBrand()
    {
		return $this->fetchAll('tb_brands');
	}
}	
$obj = new product();
$productCategories = $obj->GetCategory();

$brands=$obj->GetBrand();
include '../header.php';
?>

<script src="<?php echo MAIN_DOMAIN ?>/ckeditor/ckeditor.js"></script>
            <!-- MAIN CONTENT-->
            <div class="main-content">
                <div class="section__content section__content--p30">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="overview-wrap">
                                    <h2 class="title-1">Add Product</h2>
                                    
                                </div>
								<?php if($msg !=''){echo '<span class="col-md-6 alert alert-danger pull-left">' . $msg .  '</span>';}?>
                            </div>
                        </div>
                        
                        <div class="row m-t-25 m-row">
					
                            <div class="col-lg-10">
                                <div class="card">
                                    
                                    <div class="card-body card-block">
    									<form method="post" class="form" cluster-url="../ajax/product/add_ajax" cluster-redirect="edit" >
                                            <?php include_once "template/product_form.php" ?>
                                        
                                        </form>
                                    </div>
                                </div>
                            </div>
                          
                        </div>
                        
                    <script>
							$(document).ready(function(){
								$('.active').removeClass('active');
								$('#cat-menu').addClass('active');

                                
							}); 

                            
						</script>   

                        <script>
                                  CKEDITOR.replace( 'small_specification');
                                  CKEDITOR.replace( 'big_specification');
                                  CKEDITOR.replace( 'big_specification_english');
                                  CKEDITOR.replace( 'description');
                        </script>  

                        <SCRIPT>
                            $('#name').change(function(){
                                var name = $(this).val();
                                name = name.replace(/ /g,"-");
                                name = name.replace("'","-");
                                name = name.replace('"',"-");
                                name = name.replace(',',"-");
                                name = name.replace(';',"-");
                                name = name.replace('/',"-");
                                name = name.replace('?',"-");
                                $('#slug').val(name);
                            })
                        </SCRIPT> 
                       

  <?php
  include '../footer.php';
  ?>