<?php include 'connection.php';
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
date_default_timezone_set('Asia/Calcutta');
$today = date("d/m/Y");
$today1 = date("d/m");
$currentmonth = date(m);

?>
<? include('sahavas_dropdown_function.php');?>

<?php 

$query = "select * from users where username = '". $_SESSION["LOGIN_NAME"]."' AND password = '".$_SESSION["EMPLOYEE_PASSWORD"]."'";
//echo $query;
		                 $result = mysql_query($query,$conn);
						 while($row=mysql_fetch_array($result))
	                                              	{
													  $staff_name = $row['full_name'];
													  $full_name = $row['full_name'];
													  $avatar = $row['avatar'];
													   $department_name = $row['department_name'];
													  $staff_id  = $row['id'];
													  $username = $row['username'];
													  $our_company = $row['our_company'];
													  $designation = $row['designation'];
													  $sales_group = $row['sales_group'];
													  $head = $row['head'];
													  $region = $row['region'];
													  $district = $row['district'];
													  $email = $row['email'];
													  $mobile_no = $row['mobile_no'];
													  $staff_id_self  = $row['id'];
													  $back_office_region=$row['back_office_region'];
													   	$back_office_login=$row['back_office_login'];

													  //echo $Branch;
													  }	
													   ?>	
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>THREESTAR - CRM</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
  <!-- daterange picker -->
  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">
  <!-- bootstrap datepicker -->
  <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="plugins/iCheck/all.css">
  <!-- Bootstrap Color Picker -->
  <link rel="stylesheet" href="plugins/colorpicker/bootstrap-colorpicker.min.css">
  <!-- Bootstrap time Picker -->
  <link rel="stylesheet" href="plugins/timepicker/bootstrap-timepicker.min.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="plugins/select2/select2.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
 <link rel="stylesheet" href="public/css/default.css" type="text/css">
 <script src="jquery.min.js"></script>
<script src="jquery-ui.js"></script>

<link rel="stylesheet" href="jquery-ui.css">

<link rel="stylesheet" href="jquery-ui.css">
  <style>
  table {
  border: 1px solid #ccc;
  border-collapse: collapse;
  margin: 0;
  padding: 0;
  table-layout: fixed;
}
table caption {
  font-size: 1.2em;
  margin: .5em 0 .75em;
}
table tr {
  
  border: 1px solid #ddd;
  padding: .35em;
}
table th,
table td {
  padding: .625em;
  
}
table th {
  font-size: .9em;
  letter-spacing: .0em;
  text-transform: uppercase;
}
@media screen and (max-width: 600px) {
  table {
    border: 0;
  }
  table caption {
    font-size: 1.8em;
  }
  table thead {
    border: none;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }
  table tr {
    border-bottom: 3px solid #ddd;
    display: block;
    margin-bottom: .625em;
  }
  table td {
    border-bottom: 1px solid #ddd;
    display: block;
    font-size: .9em;
    
  }
  table td:before {
    /*
    * aria-label has no advantage, it won't be read inside a table
    content: attr(aria-label);
    */
    content: attr(data-label);
    float: left;
    font-weight: bold;
    text-transform: uppercase;
  }
  table td:last-child {
    border-bottom: 0;
  }
}

</style>	
											   
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#name").keyup(function() {
var name = $('#name').val();
if(name=="")
{
$("#disp").html("");
}
else
{
$.ajax({
type: "POST",
url: "user_check.php",
data: "name="+ name ,
success: function(html){
$("#disp").html(html);
}
});
return false;
}
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$("#name1").keyup(function() {
var name1 = $('#name1').val();
if(name1=="")
{
$("#disp1").html("");
}
else
{
$.ajax({
type: "POST",
url: "user_check1.php",
data: "name="+ name1 ,
success: function(html){
$("#disp1").html(html);
}
});
return false;
}
});
});
</script>		
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<? depat_check($department_name,$designation);?>
<script type="text/javascript" src="jquery.min.js"></script>
   <script src="jquery-ui.js"></script>
   <link rel="stylesheet" href="jquery-ui.css">
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        New Account &nbsp;&nbsp;&nbsp;&nbsp; <? back_toindex($department_name,$designation);?>
       
      </h1>
      <ol class="breadcrumb">
        <li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Dashboard</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <!-- Info boxes -->
      <div class="row">
        
		<form name="frmdetail" action="insert_accounts.php" method="post">
		<input type="hidden" value="<? echo $_REQUEST['created_dept']?>" name="created_dept">
<input name="app_db" id="app_db" value="" type="hidden">




<input name="type" id="type" value="1" type="hidden">
<input name="jsmenu" id="jsmenu" value="0" type="hidden">


<div>
		

<!-- Details -->

<!-- Details -->

			
			<div class="col-sm-12">
				<div class="filter-view">
					<div>
						<table class="table table-bordered">
							<tbody>
							<div style="float:right; margin-bottom:5px;">
							<input type="submit" name="Submit" value="Save" class="btn bg-btn-save"/>
					  </div>
							<div class="col-xs-12" style="background:#3C8DBC;">
							<h5 style="color:#FFFFFF"><span class="glyphicon glyphicon-list"></span>&nbsp;&nbsp;Account Details&nbsp; <? echo $_REQUEST['msg'];?></h5>
					  </div>
								<tr>
						        <td><div class="form-group">
								        <label for="dispname">Customer ID</label>
<input class="form-control" name="customer_id" type="text" id="name1"  required><div id="disp1">
								    </div>	
						        		</td>
								<td  colspan="2">
									<div class="form-group">
						        		<label for="aname">Account  Name</label>
										<ul class="list-inline">
											<li style="width: 80%;">
<input class="form-control" name="customer_name"  type="text"id="name"><div id="disp"></div>
											</li>
										</ul>
						            </div>								</td>
						      
						        <td>
						        	<div class="form-group">
								        <label for="comptype">Company Type</label>
											  <select class="form-control" name="comptype" id="comptype" required>
									        <option selected="selected"></option>
											<option value="Direct"> Direct</option>
											<option value="3rd Party agents">3rd Party agents </option>
											
											
									      </select>
								    </div>								</td>
								
								<td>
											<div class="form-group">
												<label for="panno">PAN No:&nbsp;</label>
												<input class="form-control" name="pan_no" id="pan_no" type="text">
											</div>
										</td>
						      </tr>
						      
						     <tr>
							
						     	<td>
						        	<div class="form-group">
								        <label for="Assign to">Assign to</label>
										
				 	 
						 <select name="assigned_to" id="assigned_to" class="form-control" >
							 
										 <?php $query1 = "select * from users  ORDER BY username asc";
		                 $result1 = mysql_query($query1,$conn);		?>
						 
			<option selected="selected" value="">Select Assigned to</option>
			<?php
													  while($row=mysql_fetch_array($result1))
	                                              	{
													  $full_name = $row['full_name'];
													  $id = $row['id'];
													  ?>
			 <option value="<?php echo $id ?>"><?php echo $full_name ?></option>
			 
                                                      <?php
														
														 } ?>
														 
                  </select>
										
								    </div>						        </td>
						      	<td colspan="2">
						      		<ul class="list-inline">
						      			<li style="width: 48%;">
						      				<div class="form-group">
								        		<label for="credittime">Credit Time (in Days)</label>
								        		<input class="form-control" name="credittime" id="credittime" type="text">
								    		</div>
						      			</li>
						      			<li style="width: 48%;">
						      				<div class="form-group">
								        		<label for="creditlimit">Amt (in <span id="basecur">INR</span>)</label>
								        		<input class="form-control" name="creditlimit" style="text-align:right;background-color:#FFFFFF;" id="creditlimit" onBlur="isnumericf('creditlimit');" type="text">
								    		</div>
						      			</li>
						      		</ul>
						        	<script>
    								document.getElementById('basecur').innerHTML='INR';
									</script>						        </td>
						       
						     
						     	<td>
									
						        	<div class="form-group">
								        <label for="turnover">Turn Over</label>
									     <input class="form-control" name="turnover" id="turnover" type="text">
								    </div>						        </td>
						        
						     <td></td>
											
						     </tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		
		 <!--  Address Information  -->
		 
		
		
		<!--  Statutory Information -->
	
		
		<!-- Start Annual Consumption-->
		
		
		<!-- Account Product Mapping -->
		
		
		
		
		
		<!-- Flexi Fields -->
		
	 
		<!--  Contact List  -->
		
		<div class="row" style="float:right; margin-bottom:5px;">
			<div class="col-sm-12">
				<div >
					<div class="col-sm-12" style="float:right; margin-bottom:5px;">
						
	          			<input type="submit" name="Submit" value="Save" class="btn bg-btn-save"/>
	          			
          				
					
						 
					</div>
				</div>
			</div>
		</div>
		
		</form>
		</div>
		
		</section>
		</div>
		
		<!--  Email List  -->
				 
		
	
  
    <!-- /.content -->
  <!-- /.content-wrapper -->
<script type="text/javascript" src="js/date-time-picker.js"></script>

    <? include'footer.php'; ?>

