<?php
ob_start();
error_reporting(0);
include("connect.php");
session_start();
$ver = $_SESSION['distributor_user_id'];
$user_role= $_SESSION['user_role']; 
if(!isset($_SESSION["distributor_user_id"])){
   header('location:https://tarkashcorp.appexperts.net/index.php');
}

if(isset($_POST['sub']))
{   
//	$brand_id=$_POST['brand_id'];
//	$category_id=$_POST['category_id'];
	$brand_name=$_POST['brand_name'];
//	$product_price=$_POST['product_price'];
//	$warranty=$_POST['warranty'];
//	$warranty_description=$_POST['warranty_description'];
}

?>
<!DOCTYPE html>
<html lang="en">
    <head>
      <?php include("link_head.php");?>  
    <!-- END HEAD -->
			<script>
			function myFunction() {
				var txt;
				var r = confirm("Are you sure to cancel!");
				if (r == true) {
					window.location.href="bank-master.php";
				} 
			}
			</script>

	<style>
	::-webkit-scrollbar {
		display: none;
		overflow: hidden;
	}
	</style>
	<script>
	window.onscroll = function () {
	window.scrollTo(0,0);
	}
	</script>			
	</head>
	
    <body class="" onload="changecolor12();">
        <!-- BEGIN HEADER -->
		<?php include("header.php");?>
        <!-- END HEADER -->
		
        <!-- BEGIN CONTAINER -->
        <div class="container-fluid">
            <div class="page-content page-content-popup">
                <div class="page-content-fixed-header">
                    <!-- BEGIN BREADCRUMBS 
                    <ul class="page-breadcrumb">
                        <li>
                            <a href="#">Dashboard</a>
                        </li>
                        <li>Admin Dashboard</li>
                    </ul>
                    <!-- END BREADCRUMBS -->  
                </div>
                <div class="page-sidebar-wrapper">
                    <!-- BEGIN SIDEBAR -->
                    <?php include("menu.php");?> 
				    <!-- END SIDEBAR -->
                </div>
                <div class="page-fixed-main-content">
                        <div class="row">
                            <div class="col-md-12">
                                <!-- BEGIN SAMPLE TABLE PORTLET-->
                                <div class="portlet">
                                    <div class="portlet-title">
                                        <div class="caption">
                                            <i class="fa fa-bell-o"></i>Add Brand Confirmation
										</div>
                                    </div>
									
                                    <div class="portlet-body form" >
                                        <form method="post" name="form1"  enctype="multipart/form-data">
                                            <div class="form-body">
											<div class="form-group">
											<div class="col-md-4">
											<label>BRAND NAME</label>
                                             <input type="text" value="<?php if(isset($_POST['sub'])){ echo $brand_name; }?>" readonly class="form-control" placeholder="BRAND NAME" name="brand_name"> 
											</div>
											</div>
											<br clear="all"><br>
											</div>
                                            <div class="form-actions">
											   <p>Are you sure to add new product</p> 
											   <button type="submit" name="sub1" class="btn blue">Ok</button>
											   <button type="submit" name="sub11" class="btn blue">Back</button>
											   <button type="submit" name="subcancel" class="btn blue" onClick="return confirm('Are you sure to cancel!')">Cancel</button>
											</div>
                                        </form>
										
										<?php
										if(isset($_POST['sub11']))
										{ header("location:add-brand.php"); }
										if(isset($_POST['subcancel']))
										{ header("location:brand-master.php");}
										 
										if(isset($_POST['sub1']))
										{
											$distributor_id=$ver;
											$brand_name=$_POST['brand_name'];
											$status='Active';
											
											date_default_timezone_set('Asia/Calcutta');
											$scro=date("Y-m-d");
											$scri=date('H:i:s');
											
											$insert_date=$scro;
											$insert_time=$scri;

											echo "INSERT INTO `tbl_master_brand`(distributor_id,brand_name,status,insert_date,insert_time) VALUES ('$distributor_id','$brand_name','$status','$insert_date','$insert_time')";
											
											$insert_brand=mysqli_query($con,"INSERT INTO `tbl_master_brand`(distributor_id,brand_name,status,insert_date,insert_time) VALUES ('$distributor_id','$brand_name','$status','$insert_date','$insert_time')");
											
											if($insert_brand)
											{
											   header("location:brand-master.php");
											}
										}
										?>
										
                                    </div>
									
                                </div>
                                <!-- END SAMPLE TABLE PORTLET-->
                            </div>
						</div>
                    </div>
                    <div class="clearfix"></div>
                    <!-- END DASHBOARD STATS 1-->
                    <!-- END PAGE BASE CONTENT -->
                </div>		
		    <!-- END CONTAINER -->
			<div class="copyright-v2" style="padding:3px; margin-top:-18px;"> 
		    <?=date("Y")?> &copy; Tarkashcorp Developed By <a target="_blank" href="http://www.belltechnology.in">Bell Technology</a>
           </div>
            <!-- BEGIN FOOTER 
			<a href="#index" class="go2top">
                    <i class="icon-arrow-up"></i>
                </a>
                <!-- END FOOTER -->
            </div>
        </div>
        <!-- END CONTAINER -->
        <!-- BEGIN QUICK SIDEBAR -->
        <a href="javascript:;" class="page-quick-sidebar-toggler">
            <i class="icon-login"></i>
        </a>
        
        <!-- END QUICK SIDEBAR -->
        <!-- BEGIN QUICK NAV -->
        
        <div class="quick-nav-overlay"></div>
        <!-- END QUICK NAV -->
        
        <!-- BEGIN CORE PLUGINS -->
        <?php include("link_script.php");?>  
        <!-- END THEME LAYOUT SCRIPTS -->
        <script>
            $(document).ready(function()
            {
                $('#clickmewow').click(function()
                {
                    $('#radio1003').attr('checked', 'checked');
                });
            })
        </script>
    </body>
</html>
            