<?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);
$query2job = "select * from check_month";
$resultjob = mysql_query($query2job,$conn);
while($rowmonth=mysql_fetch_array($resultjob))
{
$check_month = $rowmonth['check_month'];
}


?>
<?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'];
													  //echo $Branch;
													  }	
													   ?>	
													   
													   <?php
$sql = mysql_query("select * from customer_master where customer_id = '".$_REQUEST['customer_id']."' and id='".$_REQUEST['id']."'"); 
while($row = mysql_fetch_array($sql))
{
$customer_name = $row['customer_name'];

$comptype = $row['comptype'];
$category = $row['category'];
$paccname = $row['paccname'];
$industry = $row['industry'];
$subindustry = $row['subindustry'];

$turnover = $row['turnover'];
$website = $row['website'];
$credittime = $row['credittime'];
$creditlimit = $row['creditlimit'];
$last_modified = $row['last_modified'];
$created_by = $row['created_by'];

$billing_address = $row['billing_address'];
$bcity = $row['bcity'];
$bstate = $row['bstate'];
$bcountry = $row['bcountry'];
$bpin = $row['bpin'];
$bphone = $row['bphone'];
$bfax = $row['bfax'];
$bemail = $row['bemail'];
$description = $row['description'];
$acccode= $row['acccode'];
$dispname = $row['dispname'];
$lsrc = $row['lsrc'];
$assigned_to = $row['assigned_to'];
$last_year_turnover = $row['last_year_turnover'];
$Outstanding = $row['Outstanding'];
$bgst_no = $row['bgst_no'];
$sgst_no = $row['sgst_no'];
$pan_no = $row['pan_no'];

$shipping_address = $row['shipping_address'];
$scity = $row['scity'];
$sstate = $row['sstate'];
$scountry = $row['scountry'];
$spin = $row['spin'];
$sphone = $row['sphone'];
$sfax = $row['sfax'];
$semail = $row['semail'];
$sdistrict = $row['sdistrict'];
$bdistrict = $row['bdistrict'];
$tertiary=$row['tertiary'];
$segment=$row['segment'];
$bstate_code=$row['bstate_code'];
}
?>
<!DOCTYPE html>
<html>
<head><? include('sahavas_dropdown_function.php');?>
  <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">
    <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">
  <!-- 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">
  <!-- jvectormap -->
  <link rel="stylesheet" href="plugins/jvectormap/jquery-jvectormap-1.2.2.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
  <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
  <style>
  table {
  border: 1px solid #ccc;
  border-collapse: collapse;
  margin: 0;
  padding: 0;
  
}
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="jquery.min.js"></script>
   <script src="jquery-ui.js"></script>
   <link rel="stylesheet" href="jquery-ui.css">

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<? depat_check($department_name,$designation);?>

<script src="jquery.min.js"></script>
   <script src="jquery-ui.js"></script>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Dashboard &nbsp; &nbsp; &nbsp; &nbsp;<a href="view_account.php?customer_id=<?php echo $_REQUEST['customer_id']?>&&id=<? echo $_REQUEST['id']?>" title="Click To Edit" class="btn btn-success"><span class="glyphicon glyphicon glyphicon-edit"></span>&nbsp;Go Back</a>
        
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Edit Account</li>
      </ol>
    </section>

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

<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>
			<div class="col-xs-12" id="squareboxcontent1" style="">
		<table   class="table table-bordered">
						    <tbody>
						      <tr>
							  <td width="91%"><h6 style="width: 100%;">
							<input id="collapsefg" name="collapsefg" value="0" type="hidden">
							<span class="glyphicon glyphicon-search"></span>&nbsp;Account Details
						 </h6></td>
							  <td width="9%"> <input type="submit" name="Submit" value="Save" class="btn btn-success"/></td>
							  </tr></tbody></table></div>
			<div class="col-sm-12">
				<div class="filter-view">
					<div class="table-responsive">
						<table  class="table table-bordered">
							<tbody>
								<tr>
						        <td >
						        	<div class="form-group">
								        <label for="acccode">Customer Id</label>
								        <input class="form-control" id="acccode" value="<?php echo $_REQUEST['customer_id']?>" type="text" readonly="readonly">
								    </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" id="customer_name" value="<?php echo $customer_name?>" type="text">
											</li>
										</ul>
						            </div>								</td>
						        <td ><div class="form-group">
								        <label for="comptype">Company Type</label>
											  <select class="form-control" name="comptype" id="comptype">
									        <option selected="selected" value="<? echo $comptype ?>"><? echo $comptype?></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" value="<? echo $pan_no?>">
											</div>
										</td></tr>
										<tr>
										<td>
						        	<?php 
						 $query14 = "select * from users where id = '$assigned_to' ";
						 //echo $query14;
		                 $result14 = mysql_query($query14,$conn);	
						  while($row=mysql_fetch_array($result14))
	                                              	{
													  $full_name1 = $row['full_name'];
													    $id1 = $row['id'];	
													   }?>
						        	<div class="form-group">
								        <label for="category">Assigned to</label>
										 
										<select name="assigned_to" id="assigned_to" class="form-control" required>
										
			<option  value="">Select Assigned to</option>
			<option value="<?php echo $id1 ?>" selected="selected"><?php echo $full_name1 ?></option>
			
			
			 <?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: 30%;">
						      				<div class="form-group">
								        		<label for="credittime">Credit Time (in Days)</label>
								        		<input class="form-control" name="credittime" id="credittime" type="text" value="<?php echo $credittime ?>">
								    		</div>
						      			</li>
						      			<li style="width: 35%;">
						      				<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" value="<?php echo $creditlimit ?>" type="text">
								    		</div>
						      			</li>
						      		</ul>
						        	<script>
    								document.getElementById('basecur').innerHTML='INR';
									</script>						        </td>
						        <td><div class="form-group">
								       <? 								  
$month1=date("m");
if($month1>$check_month)
  {
  $currentyear = date("Y");
 $curr_full_year=date("Y");
$curr_short_year=date("y");
$future=$curr_short_year+1;
} else {
$currentyear1 = date("Y");
$currentyear = $currentyear1-1;
$curr_full_year1=date("Y");
 $curr_full_year=$curr_full_year1-1;
 $curr_short_year1=date("y");

$curr_short_year=$curr_short_year1-1;
$future=$curr_short_year+1;
}
?>
<?   $curr_fy=$currentyear .'-'. $future;?>


 <label for="turnover">Turn Over <?   echo $curr_fy=$currentyear .'-'. $future;?>: </label>
          <?php $queryls = "select * from tax_invoice where customer_id ='".$_REQUEST['customer_id']."'and id='".$_REQUEST['id']."' and year='$curr_fy'";
		 // echo $queryls;
                   $resultls = mysql_query($queryls,$conn);  
               while($row=mysql_fetch_array($resultls))
                                                {
             $amount = $row['amount'];
             $tot_amt=$tot_amt+$amount;
             
             }
               ?>
									     <input class="form-control" name="turnover" id="turnover" type="text" value="<?php echo $tot_amt?>">
								    </div>
									
						        			        </td>
						    
							 <td>
									<div class="form-group">
								        <label for="lsrc">Last year Turn over</label>
				<input class="form-control" name="last_year_turnover" style="text-align:right;background-color:#FFFFFF;" value="<?php echo $last_year_turnover ?>" type="text">
								    </div>				
						        							        </td>
						        
						     
						        
						       
						       
											<?php /*?><td><div class="form-group">
								        <label for="comptype">Outstanding</label>
											  <input class="form-control" name="Outstanding" id="Outstanding" type="text" value="<?php echo $Outstanding?>">
								    </div>
											
											
											
											
											</td><?php */?>
						     </tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		
		 <!--  Address Information  -->
		 
		<div>
			<div  class="col-xs-12" id="squareboxcontent1" style="">
				<div class="search-list">
					<div class="search-header">
						<div class="col-xs-12" style="background:#3C8DBC;">
							<h5 style="color:#FFFFFF"><span class="glyphicon glyphicon-map-marker"></span>&nbsp;Address Information&nbsp;</h5>
					  </div>
						</div>
					<div>
						<div>
							<table  class="table table-bordered">
								<tbody>
									<tr>
										<th class="left" colspan="5">Billing Addresss</th>
											
<? 
$qry9 = "select * from factory_address where customer_id='".$_REQUEST['customer_id']."'and id='".$_REQUEST['id']."' and biil_address='YES'";
$re9 = mysql_query($qry9);while($row=mysql_fetch_array($re9))
		{  
		
		$bill_factory_id=$row['factory_id'];
}?>
<input type="hidden" name="bill_factory_id" value="<? echo $bill_factory_id?>">
									</tr>
								</tbody>
						     	<tbody>
						        	<tr>
						        		<td rowspan="2">
						        			<div class="form-group">
												<label for="baddrl1"><span class="glyphicon glyphicon-map-marker"></span>&nbsp;Address:&nbsp;</label>
			<textarea class="form-control" rows="4" style="resize:vertical;" name="baddrl1" id="baddrl1" maxlength="250"><?php echo $billing_address?></textarea>
											</div>
						        		</td>
						        		<td>
						        			<input name="accbcountry" id="accbcountry" value="" type="hidden">
											<div class="form-group">
												<label for="bcountry"><span class="glyphicon glyphicon-road"></span>&nbsp;Country:&nbsp;</label>
												<select class="form-control" name="bcountry" id="bcountry" onChange="acttypefun();">
									            	<option selected="selected" value="<?php echo $bcountry ?>"><?php echo $bcountry ?></option>
										          	
													<? echo country(); ?>
													
													
												</select>
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="bstate"><span class="glyphicon glyphicon-road"></span>&nbsp;State:&nbsp;</label>
												<select style="" class="form-control" name="bstate" id="bstate" onChange="getDistrict('0');">
												<option selected="selected" value="<?php echo $bstate ?>"><?php echo $bstate ?></option>
									            <? echo state(); ?></select>
												<input style="display: none;" class="form-control" id="ostate" name="ostate" type="text">
												
											</div>
						        		</td>
						        		
						        		<td>
						        			<div class="form-group">
												<label for="bdistrict"><span class="glyphicon glyphicon-road"></span>&nbsp;District:&nbsp;</label>
										<input class="form-control" name="bdistrict" id="bdistrict" value="<?php echo $bdistrict?>" type="text">
											</div>
						        		</td>
						        		
						        		<td>
						        			<div class="form-group">
												<label for="bcity"><span class="glyphicon glyphicon-road"></span>&nbsp;City:&nbsp;</label>
												<input class="form-control" name="bcity" id="bcity" value="<?php echo $bcity?>" type="text">
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="bpin"><span class="glyphicon glyphicon-pushpin"></span>&nbsp;State Code:&nbsp;</label>
												<input class="form-control" id="bpin" name="bstate_code"  onChange="isnumericbpin('bpin');" type="text" value="<? echo $bstate_code;?>" >
												
											</div>
						        		</td>
						       		</tr>
						        	<tr>
						        		<td>
						        			<div class="form-group">
												<label for="bpin"><span class="glyphicon glyphicon-pushpin"></span>&nbsp;PinCode:&nbsp;</label>
						<input class="form-control" id="bpin" name="bpin" value="<?php echo $bpin?>" onChange="isnumericbpin('bpin');" type="text">
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="bemail"><span class="glyphicon glyphicon-envelope"></span>&nbsp;Email:&nbsp;</label>
												<input class="form-control" id="bemail" name="bemail" value="<?php echo $bemail?>" onChange="getFieldValues('bemail');" type="text">
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="bphone"><span class="glyphicon glyphicon-phone-alt"></span>&nbsp;Phone No:&nbsp;</label>
												<input class="form-control" id="bphone" name="bphone" value="<?php echo $bphone?>" onChange="getFieldValues('bphone');" type="text">
											</div>
						       			</td>
						        		<td>
						        			<div class="form-group">
												<label for="bfax"><span class="glyphicon glyphicon-print"></span>&nbsp;Fax:&nbsp;</label>
												<input class="form-control" id="bfax" name="bfax" value="<?php echo $bfax?>" onChange="getFieldValues('bfax');" type="text">
											</div>
						        		</td><td>
						        			<div class="form-group">
												<label for="bfax"><span class="glyphicon glyphicon-pushpin"></span>&nbsp;GST No:&nbsp;</label>
												<input class="form-control" id="bgst_no" name="bgst_no" value="<? echo $bgst_no?>" onChange="getFieldValues('bgst_no');" type="text">
											</div>
										
											
						        		</td>
						        	</tr>
						   		</tbody>
						  	</table>
						  	
						  	<table class="table table-bordered">
								<tbody>
									<tr>
<?   
$qry9 = "select * from factory_address where customer_id='".$_REQUEST['customer_id']."' and id='".$_REQUEST['id']."' and biil_address!='YES'";
$re9 = mysql_query($qry9);
$num_rows=mysql_num_rows($re9)?>
										<th class="left" colspan="5">Shipping Addresss&nbsp; </th>
										<th class="left" colspan="1"><? if($num_rows>='1' OR $num_rows=='0') { ?><a class="btn btn-success" href="more_factory_address.php?customer_id=<?php echo $_REQUEST['customer_id']?>&&id=<?php echo $_REQUEST['id']?>"> Add Factory Address</a> <? } ?></th>
									</tr>
								</tbody>
						     	<tbody>
	<?   $qry9 = "select * from factory_address where customer_id='".$_REQUEST['customer_id']."' and id='".$_REQUEST['id']."' and biil_address!='YES' ";
$re9 = mysql_query($qry9);
while($row=mysql_fetch_array($re9))
		{  
		
		$factory_id=$row['factory_id'];
		$address=$row['address'];
		$country=$row['country'];
		$sstate=$row['state'];
		$district=$row['district'];
		$city=$row['city'];
		$pincode=$row['pincode'];
		$email=$row['email'];
		$phone=$row['phone'];
		$fax=$row['fax'];
		$suburb=$row['suburb'];
		$sstate_code=$row['sstate_code'];
		$sgst_no=$row['gst_no'];
		
		
		?>							
								
								
								
						        	<tr>
						        		<td rowspan="2">
						        			<div class="form-group">
												<label for="saddrl1"><span class="glyphicon glyphicon-map-marker"></span>&nbsp;Address:&nbsp;</label>
				<input name="factory_id<? echo $factory_id ?>" id="" value="<? echo $factory_id ?>" type="hidden">
				<textarea class="form-control" rows="4" style="resize:vertical;" name="address<? echo $factory_id?>" id="saddrl1" maxlength="250"><?php echo $address ?></textarea>
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<input name="accscountry" id="accscountry" value="" type="hidden">
												<label for="bcountry"><span class="glyphicon glyphicon-road"></span>&nbsp;Country:&nbsp;</label>
												<select class="form-control" name="country<? echo $factory_id?>">
									            	<option value="<?php echo $country ?>"><?php echo $country ?></option>
										        	
													<? echo country();?>
												</select>
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="sstate"><span class="glyphicon glyphicon-road"></span>&nbsp;State:&nbsp;</label>
													
															<select style="" class="form-control" name="state<? echo $factory_id?>" onChange="if (this.value=='Other'){this.form['otherstate<? echo $factory_id?>'].style.visibility='visible';  }else {this.form['otherstate<? echo $factory_id?>'].style.visibility='hidden'; };" >
															<option value="<?php echo $sstate ?>"><?php echo $sstate ?></option>
									                 		
															<? echo state();?>
															
														</select>
														
														
											
 <input type="text" name="otherstate<? echo $factory_id?>" class="form-control"  style="visibility:hidden;  margin-top:3px;  border-color:#0099FF; " placeholder="State"  ></textarea>
												
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="bdistrict"><span class="glyphicon glyphicon-road"></span>&nbsp;District:&nbsp;</label>
						<input class="form-control" name="district<? echo $factory_id?>" id="district" value="<?php echo $district ?>" type="text">
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="scity"><span class="glyphicon glyphicon-road"></span>&nbsp;City:&nbsp;</label>
												<input class="form-control" id="city" name="city<? echo $factory_id?>" value="<?php echo $city ?>" onChange="getFieldValues('sdistrict');" type="text">
											</div>
						        		</td><td>
						        			<div class="form-group">
												<label for="bpin"><span class="glyphicon glyphicon-pushpin"></span>&nbsp;State Code:&nbsp;</label>
												<input class="form-control" id="bpin" name="sstate_code<? echo $factory_id?>"  onChange="isnumericbpin('bpin');" type="text" value="<? echo $sstate_code;?>">
												
											</div>
						        		</td>
						       		</tr>
						        	<tr>
						        		<td>
						        			<div class="form-group">
												<label for="spin"><span class="glyphicon glyphicon-pushpin"></span>&nbsp;PinCode:&nbsp;</label>
								<input class="form-control" id="spin" name="pincode<? echo $factory_id?>" value="<?php echo $pincode ?>" onChange="isnumericbpin('spin');" type="text">
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="semail"><span class="glyphicon glyphicon-envelope"></span>&nbsp;Email:&nbsp;</label>
												<input class="form-control" id="email" name="email<? echo $factory_id?>" value="<?php echo $email ?>"  type="text">
											</div>
						        		</td>
						        		<td>
						        			<div class="form-group">
												<label for="bphone"><span class="glyphicon glyphicon-phone-alt"></span>&nbsp;Phone No:&nbsp;</label>
												<input class="form-control" id="phone" name="phone<? echo $factory_id?>" value="<?php echo $phone ?>"  type="text">
											</div>
						       			</td>
						        		<td>
						        			<div class="form-group">
												<label for="sfax"><span class="glyphicon glyphicon-print"></span>&nbsp;Fax:&nbsp;</label>
												<input class="form-control" id="fax" name="fax<? echo $factory_id?>" value="<?php echo $fax ?>"  type="text">
											</div>
						        		</td><td>
						        			<div class="form-group">
												<label for="bfax"><span class="glyphicon glyphicon-pushpin"></span>&nbsp;GST No:&nbsp;</label>
												<input class="form-control" id="sgst_no" name="sgst_no<? echo $factory_id?>" value="<? echo $sgst_no?>" onChange="getFieldValues('sgst_no');" type="text">
											</div>
											
						        		</td>
						        	</tr>
										<? } ?>
						   		</tbody>
						  	</table>
							
							 
						</div>	
					</div>
				</div>
			</div>
		</div>
		
		<!--  Statutory Information -->
		<div>
		
		</div>
		
		<!-- Start Annual Consumption-->
		
			<table style="float:right">
								<tbody>
									<tr><td><a href="contact_details.php?customer_id=<?php echo $_REQUEST['customer_id'];?>&&id=<?php echo $_REQUEST['id']?>&&newcontact=New" target="_blank"><button type="button" class="btn btn-success" style="float:right">
									<span class="glyphicon glyphicon-plus"></span>&nbsp;New Contact</button></a></td></tr></tbody></table>
		
		
		<!-- Account Product Mapping -->
		
		<div class="row">
			<div class="col-sm-12">
				<div class="search-list">
					<div class="search-header">
						<div class="col-sm-12 left">
							<div class="col-xs-12" style="background:#3C8DBC;">
								<h5 style="color:#FFFFFF">
								<span class="glyphicon glyphicon-phone-alt"></span>&nbsp;Contact Details</h5>
							</div>
							
						</div>
					</div>
					 <div  class="col-xs-12" id="squareboxcontent1" style="">
						<div class="table-responsive">
		<table class="table table-striped table-bordered table-hover">
							<thead>
								   
								<tr>
							        <th>Name</th>
							        <th>Gender</th>
							        <th>Desg/Dept</th>
							        <th>Social Media</th>
									<th>Mobile No.</th>
							        <th>Phone No.</th>
							  		<th>Email</th>
							    	<th>Contact Type</th>
							        <th>B'Day</th>
									 <th></th>
								     <th></th>
								</tr>
							</thead>
							<tbody>
							 <? 
$query1 = "select * from contact_person where customer_id = '".$_REQUEST['customer_id']."'";
$result1 = mysql_query($query1) or die(mysql_error());
while($row=mysql_fetch_array($result1))
		{
$saul = $row['saul'];  
$name = $row['name'];
$gender = $row['gender'];
$designation = $row['designation'];
$department = $row['department'];
$mobile_no = $row['mobile_no'];
$office_phone = $row['office_phone'];
$email = $row['email'];
$contact_types = $row['contact_types'];
$bday = $row['bday'];
$contact_id = $row['contact_id'];	
?>
 								<tr>
							        <td><?php echo $saul ?>&nbsp;<?php echo $name ?></td>
							        <td><?php echo $gender ?></td>
							        <td><?php echo $designation ?> / <?php echo $department ?></td>
							        <td></td>
							        <td><?php echo $mobile_no ?></td>
							        <td><?php echo $office_phone ?></td>
							        <td><?php echo $email ?></td>
							        <td><?php echo $contact_types ?></td>
							        <td><?php echo $bday ?></td>
									<td> <script>
function confirmDelete(delUrl) {
  if (confirm("Are you sure you want to delete")) {
    document.location = delUrl;
  }
}
</script>

<a href="javascript:confirmDelete('delete_contact.php?contact_id=<?php echo $contact_id;?>&&customer_id=<?php echo $_REQUEST['customer_id']?>&&id=<?php echo $_REQUEST['id']?>')" target="_blank">Delete</a>								                                    
					<td><a href="contact_details.php?customer_id=<?php echo $_REQUEST['customer_id'];?>&&contact_id=<?php echo $contact_id;?>&&id=<?php echo $_REQUEST['id']?>" target="_blank">Edit</a>                                    							  
 								</tr>
								<?php } ?>
							</tbody>
						</table>
		
		</div>	
					</div>
				</div>
			</div>
		</div>
		<!-- Flexi Fields -->
		
	 
		<!--  Contact List  -->
		
		
		
	
		
		
		
		
		<!--  Email List  -->
		<div class="row">
			<div class="col-sm-12">
				<div class="filter-header">
					<div class="col-sm-12 right">
						
	          			<input type="submit" name="Submit" value="Save" class="btn btn-success"/>
	          			
          				
					
						 
					</div>
				</div>
			</div>
		</div>		 
		
	
</form>
	
		
		</div>
    </section></div>
    <!-- /.content -->
  <!-- /.content-wrapper -->
<script type="text/javascript" src="js/date-time-picker.js"></script>

     <? include'footer.php'; ?>
