<?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');
	}
}	

if(isset($_GET['message']))
{
    $msg = $_GET['message'];
}
$obj = new product();
if(isset($_POST['data']))
{
    $data = $_POST['data'];
    $count = $data['count'];
    if($count != '' && is_numeric($count) && $count > 0)
    {
        header('Location: export_product?count=' . $count);
        exit;
    }
    else
    {
        $msg = 'Count is required and should be a number ';
    }
}
include '../header.php';
?>

<script src="../../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">Export 1000 Products</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" cluster-url="../ajax/product/add_ajax" cluster-redirect="edit" >
                                           
                                            <input type="text" class="form-control" name="data[count]" placeholder="Enter the count(1,2,3 etc)"/>
                                            <button type="submit" class="btn btn-success">Export</button>
                                        </form>
                                    </div>
                                </div>
                            </div>
                          
                        </div>
                        
                    <script>
							$(document).ready(function(){
								$('.active').removeClass('active');
								$('#cat-menu').addClass('active');

                                
							}); 

                            
						</script>   

                       

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