<? include("header.php");


//session_start();
//error_reporting(0);

include "checksession.php";

include ("include/db-connect.php");


if(isset($_REQUEST['submit']))
 {
	 $adm_name=$_REQUEST['adm_name'];
	 $adm_pass=$_REQUEST['adm_pass'];
	 
	 $system=$_REQUEST['system'];
	 $customer=$_REQUEST['customer'];
	 $products=$_REQUEST['products'];
	 $sales=$_REQUEST['sales'];
	 $payment=$_REQUEST['payment'];
	 $reports=$_REQUEST['reports'];
	 $purchase=$_REQUEST['purchase'];
	 
	
      $insert=mysql_query("insert into ".$ADMIN."(utype,adm_name,adm_pass,code,system,customer,products,sales,payment,reports,purchase) values('subuser','$adm_name','$adm_pass','1','$system','$customer','$products','$sales','$payment','$reports','$purchase')");
 
 
 
     $exce=mysql_query($insert);
     //header("location:view_user.php?add=success"); 
      ?>
      <script>
	  window.location='view_users.php?add=success';
	  </script>
      <?
	 // header("location:view_offer.php?edit=success"); 
}
?>
<div id="content">
  <div class="breadcrumb">
       <!-- <a href="http://amarasudhan.com/admin/index.php?route=common/home&amp;token=b735cc089ec2d51abb9a8e1901f501fb">Home</a>-->
      </div>
              <div class="box">
    <div class="heading">
      <h1><img src="view/image/home.png" alt="" />Add Users</h1>
    </div>
    <div class="content">
      <div class="overview" style="width:50%; margin-left:300px;">
        <div class="dashboard-heading"> Users Permission</div>
        <div class="dashboard-content">
        
 
   <?php 
 $sel="select * from ".$MAIL_CON." where id=1";
 $run=mysql_query($sel);
 $array=mysql_fetch_array($run);
 $name=$array['image_name'];
  
 ?>
 
 <?php if($_REQUEST['ed']=='su'){ echo "<div class='alert_succes'>Contact Edited Successfully</div>"; } else { echo "";}?>

 <form method="post" id="client" enctype="multipart/form-data">
  <!--<script type="text/javascript" src="../prototype.js"></script> 
  <script type="text/javascript" src="../validation.js"></script>
  -->
  
  
  

            <div class="mainrow" style="margin-left:100px;">

                <div class="maintext">User Name <font color="#FF0000"><b> *</b></font> </div>

                <div class="maintextbox"><input type="text" name="adm_name" size="36" class="required"></div>
               

            </div>

<br />

            <div class="mainrow" style="margin-left:100px;">

                <div class="maintext">Password<font color="#FF0000"><b> *</b></font> </div>

                <div class="maintextbox"><input type="text" name="adm_pass" size="36" class="required"></div>
               

            </div>
            
            
            <!----USER PERMISSION START----->
            <div style="width:830px; height:330px;">
            
            
            <div  style="width:230px; height:220px; border:ridge; float:left; margin-top:30px; margin-left:100px;">
            <div style="margin-top:10px; margin-left:10px;">MENUS</div>
            <div style="margin-left:10px; margin-top:20px;"><input type="checkbox" name="system" value="1">System</div>
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="customer" value="1">Customer</div>
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="products" value="1">Products</div>
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="purchase" value="1">Purchase</div>
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="sales" value="1">Sales</div>
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="payment" value="1">Payment</div>
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="reports" value="1">Reports</div>
            </div>
            
           <!---- <div  style="width:230px; height:190px; border:ridge; float:left; margin-top:30px;">
            <div style="margin-top:10px; margin-left:10px;">Admin Management</div>
            <div style="margin-left:10px; margin-top:20px;"><input type="checkbox" name="signup" value="1">Sign Up</div>
            
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="stock" value="1">Stock Management</div>
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="purchase" value="1">Purchase management</div>
            <div style="margin-left:10px; margin-top:5px;"><input type="checkbox" name="payment" value="1">Payment Management</div>
            </div>---->
            
            </div>
            <!----USER PERMISSION END----->
           

              <div style="margin-left:100px; "><input  id="Submit" type="submit" value="Submit" name="submit" /></div>


   </form>
        </div>
      </div>
      
      
    </div>
  </div>
</div>
<!--[if IE]>
<script type="text/javascript" src="view/javascript/jquery/flot/excanvas.js"></script>
<![endif]--> 
<script type="text/javascript" src="view/javascript/jquery/flot/jquery.flot.js"></script> 
<script type="text/javascript"><!--
function getSalesChart(range) {
	$.ajax({
		type: 'get',
		url: 'index.php?route=common/home/chart&token=b735cc089ec2d51abb9a8e1901f501fb&range=' + range,
		dataType: 'json',
		async: false,
		success: function(json) {
			var option = {	
				shadowSize: 0,
				lines: { 
					show: true,
					fill: true,
					lineWidth: 1
				},
				grid: {
					backgroundColor: '#FFFFFF'
				},	
				xaxis: {
            		ticks: json.xaxis
				}
			}

			$.plot($('#report'), [json.order, json.customer], option);
		}
	});
}

getSalesChart($('#range').val());
//--></script> 
</div>
<?php include("footer.php"); ?>