<?
$rez=include("setup.php");
if (! $rez) //if can't find setup.php or not chmod'ed 
 {
  echo "<font color=red>Check Your setup.php file !</font>";
	exit;
 }

//-------------- ADD new dir ---------------------
if (isset($updateme))		
{
       $result=0;
       if((check_if_exist($nameofcompanyzz_nes,"garant","NameOfCompany")) >=1)
       {
	print "This warranty service company exists";
       }
       else
       {	
       $result=mysql_query("
  update garant set
  NameOfCompany='$nameofcompanyzz_nes',
  Tel='$telofcompanyzz',
  Cell='$cellofcompanyzz',
  Fax='$faxofcompanyzz',
  Address='$addresscompanyzz_nes',
  ContactPerson='$contactpersonzz'
  where ID=$id
         ") or die (mysql_error(). " : ".mysql_errno());

         if (! $result )
          print "Sorry,You are trying to enter invalid data ";
         else
          print "Your data was modified";

       }
       exit;
}
//----------------------- and update  ----------------



	$sql = "SELECT * FROM garant where ID=$loginis";	
        $result = mysql_query($sql) or  die (mysql_error(). " : ".mysql_errno());
        $row=mysql_fetch_object($result);

?>
<br>
<form action=<?=$PHP_SELF?> method=post name=garantmodify>
<input type="hidden" name=updateme><BR>
<input type=hidden name=id value='<?=$row->ID?>'>
<table>
<tr>
       <td>*Name of company </td>
       <td><input type=text name=nameofcompanyzz_nes value='<?=$row->NameOfCompany;?>'></td>
<tr>
       <td>Tel of company </td>
       <td><input type=text name=telofcompanyzz value='<?=$row->Tel;?>'></td>
</tr>
<tr>
       <td>Cell of company </td>
       <td><input type=text name=cellofcompanyzz value='<?=$row->Cell;?>'></td>
</tr>
<tr>
       <td>Fax of company </td>
       <td><input type=text name=faxofcompanyzz value='<?=$row->Fax;?>'></td>
</tr>
<tr>
       <td>*Address of company </td>
       <td><input type=text name=addresscompanyzz_nes value='<?=$row->Address;?>'></td>
</tr>
<tr>
       <td>Contact person</td>
       <td><input type=text name=contactpersonzz value='<?=$row->ContactPerson;?>'></td>
</tr>
<tr>
        <td align=center><br><input type=reset value=Reset></td>
	<td align=center><br><input type=submit name=submit value=Submit onclick="return validate_form_no_email('garantmodify ')"></td>
</tr>
</table>
</form>
