<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Xpress</title>
    <script src=" rightclick_deactive.js"></script> 
    <script type="text/javascript" src="scripts/jquery-latest.js"></script>
	<link type="text/css" href="includes/style1.css" rel="stylesheet" />
      <link type="text/css" href="css/form.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>

    <script type="text/javascript">
        $(function() {
          if ($.browser.msie && $.browser.version.substr(0,1)<7)
          {
			$('li').has('ul').mouseover(function(){
				$(this).children('ul').show();
				}).mouseout(function(){
				$(this).children('ul').hide();
				})
          }
        });        
    </script>
	<script type="text/javascript">
    $(document).ready(function() {
        var cont_left = $("#container").position().left;
        $("a img").hover(function() {
            // hover in
            //$(this).parent().parent().css("z-index", 1);
            $(this).animate({
               height: "110",
               width: "110",
              
            }, "fast");
        }, function() {
            // hover out
         //   $(this).parent().parent().css("z-index", 0);
            $(this).animate({
                height: "80",
                width: "80",
                
            }, "fast");
        });
        
        $(".img").each(function(index) {
            var left = (index * 160) + cont_left;
            $(this).css("left", left + "px");
        });
    });




    </script>

<!-- js code below for active enter with textfield-->


<script type="text/javascript">

/***********************************************
* Disable "Enter" key in Form script
* This notice must stay intact for use
***********************************************/
                
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      

</script>


<style>
.cont
	{


       background-color:#3b5998;

	//background:url(images/bg-inner.jpg) #e9e0c3 repeat-x;
  	width: 100%;position: absolute ;
	height:99%;
    	/* Optional - just for DIV)*/
    	//border: solid 1px #000000;
	-moz-box-shadow: 0px 5px 5px #888;
	-webkit-box-shadow: 0px 5px 5px #888;
	box-shadow: 0px 5px 10px #888;
    
	}
</style>


<link href="css/form.css" type="text/css" rel="stylesheet" media="screen"  />
<body bgcolor="#0033FF">
<div class='cont'>



<?
session_start();
include("opendb.php");
include("test.php");
include('includes/top.php');
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}
?>
<font style="font-family: 'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:15px; color:white;">  &nbsp;&nbsp;Master >> Payment mode Master</font>
<?
if($save)
{
$ch=mysqli_query($db,"select * from newpartmaster where partcode='$pcode'");

if(mysqli_num_rows($ch)>0)
{
print "<script> alert('Duplicate Part code'); document.location='partmaster.php'</script>";
return;
}


$dt=date("Y-m-d");
$code=substr($mode,0,3).date('his');


$sql="insert into payment_mode values('$code','$mode','$dt','$brcode','yes')";
mysqli_query($db,$sql) or die('Insert Err:'.mysqli_error($db));



print "<script>alert('data has been saved');document.location='paymentmode_mast.php';</script>";




return;
} // end save


?>
<style>
th{background-color:steelblue;color:white}
</style>
<script>
function valid()
{
 
 if(document.f1.pcode.value.length<=0)
 {
   alert("Invalid Partcode.");
   document.f1.pcode.focus();
   return false;
 }

if(document.f1.pname.value.length<=0)
 {
   alert("Invalid Name.");
   document.f1.pname.focus();
   return false;
 }

if(document.f1.srate.value.length<=0)
 {
   alert("Invalid SaleRate.");
   document.f1.srate.focus();
   return false;
 }
if(document.f1.prate.value.length<=0)
 {
   alert("Invalid Purchase Rate.");
   document.f1.prate.focus();
   return false;
 }



}
</script>
<script type="text/javascript">

/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      

</script>
<style>
th{background-color:steelblue;color:white}
</style>
<center>
<table cellspacing=1 cellpadding=1 bgcolor=black>
<tr><td align=center bgcolor='white'>
<form name='f1' action='<?print $PHP_SELF?>' method='post' onSubmit="return valid()">
<table cellspacing=1 cellpadding=3 >
<th colspan=4><font size=3>PAYMENT_MODE MASTER</th>
<tr><td>mode</td><td><input type=text name='mode'  size=20 ></td></tr>
 <tr><th colspan='2'>
<input type=submit value='Save' name='save'>
</th></tr>
</table>
</form>
</td></tr>
</table>

<?
?>
<br>
<table cellspacing=1 cellpadding=2 class='report' style='width:30%;'>
<th>No <th>Mode <th>Del
<?
$i=1;
$res=mysqli_query($db,"select * from payment_mode  where brcode='$brcode' and status='yes' order by mode");
while($row=mysqli_fetch_array($res))
{



print "<tr><td>".$i."</td><td >$row[1]</td>";

 ?>
<td align='center'><a href='#' onClick="delfun('<? echo $row[0];?>')"  style="text-decoration:none;"><input type=button value='Del' name='del' ></a></td>

</form>
</tr>
<?
$i++;
}
?>
</form>

</table>
<script>
function delfun(str)
 {
  if (confirm('do you want to delete '))
   document.location="delpmode.php?code="+str;
 }
</script>
