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

?>
<?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;
													  }	
													   ?>	
													
<!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="edit_accounts.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="insert_contact_details.php" method="post">
<input name="customer_id" id="customer_id" value="<?php echo $_REQUEST['customer_id']?>" type="hidden">  
<input name="newcontact" id="newcontact" value="<?php echo $_REQUEST['newcontact']?>" type="hidden">  
<input name="contact_id" id="contact_id" value="<?php echo $_REQUEST['contact_id']?>" type="hidden">  
<input name="id" id="id" value="<?php echo $_REQUEST['id']?>" type="hidden">  


<table width="100%">
  <tr>
    <td><table width="100%" class="table table-striped table-bordered table-hover">
      <tbody>
        <tr>
          <td class="col-sm-9">
		  
		  <div class="panel-body">
                <ul class="list-group">
                  <li class="list-group-item">
                    <div class="row">
                      <div class="col-sm-3">
                        <div class="form-group">
                          <?php $sql3 = mysql_query("select * from contact_person where customer_id = '".$_REQUEST['customer_id']."' AND contact_id = '".$_REQUEST['contact_id']."'"); 
while($row = mysql_fetch_array($sql3))
{
$name1 = $row['name'];
$saul1 = $row['saul'];
$bday = $row['bday'];
$remark = $row['remark'];
$gender = $row['gender'];
$contact_types = $row['contact_types'];
$mobile_no = $row['mobile_no'];
$office_phone = $row['office_phone'];
$email = $row['email'];
$department = $row['department'];
$designation = $row['designation'];
$twitterid = $row['twitterid'];
$linkedinid = $row['linkedinid'];
}
?>
                          <label for="firstname">Name</label>
                          <ul class="list-inline">
                            <li style="width: 25%;">
                              <select class="form-control" name="saul" id="saul" onchange="setGenderNew()">
                                <option selected="selected" value="<?php echo $saul1 ?>"><?php echo $saul1 ?></option>
                                <option value="Mr.">Mr.</option>
                                <option value="Ms.">Ms.</option>
                                <option value="Mrs.">Mrs.</option>
                                <option value="Dr.">Dr.</option>
                                <option value="Prof.">Prof.</option>
                              </select>
                            </li>
                            <li style="width: 70%;">
                              <input id="contact_id" name="contact_id" value="<?php echo $_REQUEST['contact_id']?>" type="hidden" />
                              <input id="newcontact" name="newcontact" value="<?php echo $_REQUEST['newcontact']?>" type="hidden" />
                              <input class="form-control" id="name" name="name" type="text" value="<?php echo $name1 ?>" />
                            </li>
                          </ul>
                        </div>
                      </div>
                      <div class="col-sm-3">
                        <ul class="list-inline">
                          <li style="width: 35%;">
                            <div class="form-group">
                              <label for="gender">Gender</label>
                              <select class="form-control" id="gender" name="gender" style="width:70px;">
                                <option selected="selected" value="<?php echo $gender ?>"><?php echo $gender ?></option>
                                <option value="Male">Male</option>
                                <option value="Female">Female</option>
                              </select>
                            </div>
                          </li>
                          <li style="width: 40%;">
                            <div class="form-group">
                              <label for="bday">B'day</label>
                              <div class="right-inner-addon input-group-date"> <i class="glyphicon glyphicon-calendar"></i>
                                  <input type="text" id="datepicker" class="form-control date-picker" name="bday" value="<?php echo $bday ?>" />
                              </div>
                            </div>
                          </li>
                        </ul>
                      </div>
                      <div class="col-sm-3">
                        <div class="form-group">
                          <label for="dept">Department</label>
                          <input class="form-control" id="department" name="department" type="text" value="<?php echo $department ?>" />
                        </div>
                      </div>
                      <div class="col-sm-3">
                        <div class="form-group">
                          <label for="desg">Designation</label>
                          <input class="form-control" id="designation" name="designation" type="text" value="<?php echo $designation ?>" />
                        </div>
                      </div>
                    </div>
                  </li>
                  <li class="list-group-item">
                    <div class="row">
                      <div class="col-sm-3">
                        <div class="form-group">
                          <label for="contacttype">Contact Types</label>
                          <select class="form-control" name="contact_types" id="contact_types">
                            <option selected="selected" value="<?php echo $contact_types ?>"><?php echo $contact_types ?></option>
                            <option value="Decision Maker">Decision Maker</option>
                            <option value="Influencer">Influencer</option>
                            <option value="Recommender">Recommender</option>
                            <option value="User">User</option>
                            <option value="Purchase Officer">Purchase Officer</option>
                          </select>
                        </div>
                      </div>
                      <div class="col-sm-3">
                        <div class="form-group">
                          <label for="cemail">Email</label>
                          <input class="form-control" id="email" name="email" value="<?php echo $email ?>" type="text" />
                        </div>
                      </div>
                      <div class="col-sm-3">
                        <div class="form-group">
                          <label for="cphone">Office Phone</label>
                          <input class="form-control" id="office_phone" name="office_phone" value="<?php echo $office_phone ?>" type="text" />
                        </div>
                      </div>
                      <div class="col-sm-3">
                        <div class="form-group">
                          <label for="mobile">Mobile No</label>
                          <input class="form-control" id="mobile_no" name="mobile_no" value="<?php echo $mobile_no ?>" type="text" />
                        </div>
                      </div>
                    </div>
                  </li>
                  <li class="list-group-item">
                    <div class="row">
                      <div class="col-sm-6">
                        <div class="form-group">
                          <label for="linkedinid">LinkedIn</label>
                          <input class="form-control" id="linkedinid" name="linkedinid" value="<?php echo $linkedinid ?>" type="text" />
                        </div>
                      </div>
                      <div class="col-sm-6">
                        <div class="form-group">
                          <label for="twitterid">Twitter</label>
                          <input class="form-control" id="twitterid" name="twitterid" value="<?php echo $twitterid ?>" type="text" />
                        </div>
                      </div>
                    </div>
                  </li>
                  <li class="list-group-item">
                    <div class="row">
                      <div class="col-sm-12">
                        <div class="form-group">
                          <label for="remark">Remark </label>
                          <textarea class="form-control" rows="2" id="remark" name="remark" style="resize: vertical;"><?php echo $remark ?></textarea>
                        </div>
                      </div>
                    </div>
                  </li>
				  
				   <li class="list-group-item">
                    <div class="row">
                      <div class="col-sm-12">
                        <div class="form-group">
                          <input type="submit" name="Submit" value="Save" class="btn bg-btn-save"/>
                        </div>
                      </div>
                    </div>
                  </li>
				  
				  
                </ul>
            </div>
		  
		  
		  
		  </td>
        </tr>
      </tbody>
    </table></td>
  </tr>
</table></form>
	
		
		</div>
    </section></div>
    <!-- /.content -->
  <!-- /.content-wrapper -->
<script type="text/javascript" src="js/date-time-picker.js"></script>

     <? include'footer.php'; ?>
