<html>
<head>
<link href="../../css/pop_up style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../css/jquery-ui.css" />
<link rel="stylesheet" href="../../css/jquery.autocomplete.css" type="text/css" />
<script src="../../js/jquery/jquery.js" type="text/javascript"></script>
<script src="../../js/jquery/jquery-1.8.2.js"></script>
<script src="../../js/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="../../js/jquery/autocomplete_jquery_plugin.js"></script>
<script src="../../js/company_name_creation.js" type="text/javascript"></script>
<script src="../../js/shortcut.js"  type="text/javascript"></script>
<script src="../../js/enter_event_ajax.js" type="text/javascript"></script>

<script>
shortcut.add("Alt+u",function() 
{
	document.getElementById("user_type").focus();
});
shortcut.add("Alt+s",function() 
{
	document.getElementById("active_status").focus();
});


</script>
</head>
<?php
error_reporting(0);
$edit_id=$_GET['edit_id'];
include("../../include/db.php");
//session start
ob_start();
session_start();

$session_user_name=$_SESSION['login_user_name'];
$session_password=$_SESSION['login_pass_word'];

/****************** Get Branch ID*********************************************************/
function session_territory_id2_comp($session_user_name,$session_password)
{
	$sql_user="select * from user_creation where user_name='$session_user_name' and password='$session_password' ";
	$rs_user=mysql_query($sql_user);
	while($rsdata_user=mysql_fetch_object($rs_user))
	{ 
	$user_type_id=$rsdata_user->user_type;
	}
	return $user_type_id;
}

$session_territory_id=session_territory_id2_comp($session_user_name,$session_password);  //Territory ID

if($_GET['edit_id']!='')
{
$user_table_display_style='style="display:inline;"';
} 
else
{
$user_table_display_styles='style="display:none;"';
}
 $id=$_GET[edit_id];
  $sql="select * from company_name where c_id='$_GET[edit_id]'";
  $rs=mysql_query($sql);
  $rscount=mysql_num_rows($rs);
 
  while($rsdata=mysql_fetch_array($rs))
  {
	  $company_name=$rsdata['company_name'];
	  $address_1=$rsdata['address_1'];
	  $address_2=$rsdata['address_2'];
	  $address_3=$rsdata['address_3'];
	  $tin_no=$rsdata['tin_no'];
	  $cst_no=$rsdata['cst_no'];
	  $cin_no=$rsdata['cin_no'];
	  
	  
  }
?>

<style type="text/css">
.txt{ font-family: Verdana, Arial, Helvetica, sans-serif; font-size:13px;}

.style2 {color: #FF0000}
.style7{font-family: Tahoma, Arial, Helvetica, sans-serif;font-size: 13px;}
.headings{ font-family:verdana; font-size:10px;}
.types_class { 
    height: 25px; 
    width: 200px; 
    background-color: transparent;  
    border-style: solid;  
    border-width: 0px 0px 1px 0px;  
    border-color:#CCC; 
    outline:0;
	font-size:14px;
  } 

.style9 {color: #FF0000; font-weight: bold; }
input:focus {  border-color:#87BB07; }
select:focus {  border-color:#87BB07; } 
textarea:focus {  border-color:#87BB07; } 
</style>

    <table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td height="32" colspan="9" class="txt"  style="font-size:14px;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;Company Name Creation</strong></td>
  </tr>
  <tr>
    <td width="91" height="32" align="left" class="txt">&nbsp;</td>
    <td width="157" align="left" class="txt"><span class="style2"><strong>C</strong></span>ompany Name<span class="style2 style1">*</span></td>
    <td colspan="3" align="left" class="style7">
    <input type="text" name="company_name" id="company_name" class="types_class" tabindex="1" style="width:270px; height:26px;" autofocus onKeyUp="company_clear_validation(this.value)" value="<?php if($_GET['edit_id']!='') { echo $company_name; } ?>" onKeyPress="enterevent(event,'address1','company_name')"><div id="company_name_validation_div" style="color:#FF0000;"></div></td>
    <td width="188" align="left" class="txt"><span class="style9">A</span>ddress1<span class="style2 style1">*</span></td>
    <td colspan="3" align="left" class="style7">
   <textarea name="address1" id="address1" cols="40" style="width:270px;" rows="4" tabindex="2" class="types_class" onKeyUp="customer_clear_validation(this.value)" onKeyPress="enterevent(event,'address2','address1')"><?php if($_GET['edit_id']!='') { echo $address_1; } ?></textarea><div id="address1_validation_div" style="color:#FF0000;"></div></td>
    <td width="1" align="left" class="txt">&nbsp;</td>
  </tr>
   <tr>
    <td height="32" align="left" class="txt">&nbsp;   </td>
     <td height="32" align="left" class="txt"><span class="style2"><strong>A</strong></span>ddress2   &nbsp;</td>

 <td colspan="3" align="left" class="style7">
   <textarea name="address2" id="address2" cols="40" style="width:270px;" rows="4" tabindex="3" class="types_class" onKeyUp="customer_clear_validation(this.value)" onKeypress="enterevent(event,'address3','address2')"><?php if($_GET['edit_id']!='') { echo $address_2; } ?></textarea><div id="address_validation_div" style="color:#FF0000;"></div></td>
    <td width="188" align="left" class="txt"><span class="style2"><strong>P</strong></span>hone No</td>
    <td colspan="3" align="left" class="style7"><input type="text" name="address3" id="address3"  class="types_class"cols="40" style="width:270px; height:26px;" maxlength="10" rows="4" tabindex="4" onKeyPress="enterevent(event,'cinno','address3')" onKeyUp="customer_clear_validation(this.value)" value="<?php if($_GET['edit_id']!='') { echo $address_3; } ?>"/></td>
    <td width="1" align="left" class="txt">&nbsp;</td>
  </tr>
    <tr>
    <td height="32" align="left" class="txt"></td>
        <td height="32" align="left" class="txt"><span class="style9">C</span>IN No</td>

    <td colspan="3" align="left" class="style7">
    <input type="text" name="cinno" id="cinno"  class="types_class" tabindex="5" style="width:270px; height:26px;"  value="<?php if($_GET['edit_id']!='') { echo $cin_no; } ?>" onKeyUp="company_clear_validation(this.value)" onKeyPress="enterevent(event,'cstno','cinno')" ><div id="cinno_validation_div" style="color:#FF0000;"></div></td>
    <td width="188" align="left" class="txt"><span class="style2"><strong>C</strong></span>st No</td>
    <td colspan="3" align="left" class="style7"><input type="text" name="cstno" id="cstno"  class="types_class"tabindex="6" onKeyPress="enterevent(event,'tinno','cstno')"  style="width:270px; height:26px;"  value="<?php if($_GET['edit_id']!='') { echo $cst_no; } ?>"   ></td>
    <td width="1" align="left" class="txt">&nbsp;</td>
  </tr>
 <tr>
    <td height="32" align="left" class="txt">&nbsp;</td>
    <td align="left" class="txt"><span class="style9">T</span>in No</td>
    <td colspan="3" align="left" class="style7"><input type="text" name="tinno" id="tinno"  onKeyPress="enterevent(event,'action','tinno')" class="types_class" tabindex="7" style="width:270px; height:26px;"  value="<?php if($_GET['edit_id']!='') { echo $tin_no; } ?>"   ></td>
    <td width="188" align="left" class="txt">&nbsp;</td>
    <td colspan="3" align="left" class="style7">&nbsp;</td>
    <td width="1" align="left" class="txt">&nbsp;</td>
  </tr>
        <tr>
          <td colspan="10" class="style7"   align="center">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="10" class="style7"   align="center">&nbsp;</td>
        </tr>
        <tr>  
    <td colspan="10" class="style7"   align="center"> <input type="button" name="action"  id="action" tabindex="8" value="<?php if($_GET['edit_id']!='') { echo "EDIT";  } else { echo "ADD"; } ?>" class="add_button" style="height:30px; width:60px; background-color: #87BB07;color: #fff;border: 0px;" onClick="company_creation_add(company_name.value,address1.value,address2.value,address3.value,cinno.value,cstno.value,tinno.value,'<?php echo $id;?>',this.value)"/></td>
            </tr>
  </table>   
<!--Design End--></td>
  </tr>
</table>
</html>