php payroll info source code

by barkkathulla 2012-09-14 18:45:04

<?php
$check=mysql_connect("localhost","root","");
if(!$check)
echo "welcome".$nam.$cty;
else
{
$db=mysql_select_db("as", $check);

if(!$db)
echo "error";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
<script type="text/javascript">
var ajax;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
ajax=new XMLHttpRequest();
}
else
{// code for IE6, IE5
ajax=new ActiveXObject("Microsoft.XMLHTTP");
}


function add()
{
alert("Done");
var nam=document.getElementById("name").value;
var city=document.getElementById("city").value;
ajax.onreadystatechange=function()
{
if (ajax.readyState==4 && ajax.status==200)
{
document.getElementById("run").innerHTML=ajax.responseText;
alert("...Inserted successfully...");
}
}
ajax.open("GET","insert.php?name="+nam+"&cty="+city,true);
ajax.send();
}
function update()
{
var nam=document.getElementById("name").value;
var city=document.getElementById("city").value;
ajax.onreadystatechange=function()
{
if (ajax.readyState==4 && ajax.status==200)
{
document.getElementById("run").innerHTML=ajax.responseText;
alert("...Updated successfully...");
}
}
ajax.open("GET","update.php?name="+nam+"&cty="+city,true);
ajax.send();

}
function del()
{
var nam=document.getElementById("name").value;
ajax.onreadystatechange=function()
{
if (ajax.readyState==4 && ajax.status==200)
{
document.getElementById("run").innerHTML=ajax.responseText;
alert("...Deleted successfully...");
}
}
ajax.open("GET","del.php?id="+nam,true);
ajax.send();
}
function getval(a)
{
//alert(a);
ajax.onreadystatechange=function()
{
if (ajax.readyState==4 && ajax.status==200)
{
document.getElementById("dcus").innerHTML=ajax.responseText;
}
}
ajax.open("GET","click.php?s="+a,true);
ajax.send();
}
function suggetion(a)
{
var ide=document.getElementById("bbc").value;
ajax.onreadystatechange=function()
{
if (ajax.readyState==4 && ajax.status==200)
{
document.getElementById("ndiv").innerHTML=ajax.responseText;

}
}
ajax.open("GET","sug.php?s="+a,true);
ajax.send();

}

function display(a)
{
//alert(a);
ajax.onreadystatechange=function()
{
if (ajax.readyState==4 && ajax.status==200)
{
document.getElementById("ndiv").innerHTML=ajax.responseText;
}
}
ajax.open("GET","totaldb.php?s="+a,true);
ajax.send();
}
function updat(a)
{
alert(a);
var edat=document.getElementById("edate").value;
var am=document.getElementById("amt").value;
alert(a+"."+edat+"."+am);
ajax.onreadystatechange=function()
{
if (ajax.readyState==4 && ajax.status==200)
{
document.getElementById("ndiv").innerHTML=ajax.responseText;
}
}
ajax.open("GET","update2.php?s="+a+"&edate="+edat+"&amt="+am,true);
ajax.send();
}

</script>
<style type="text/css">
#table1{
width:20%;
margin:auto;
border:3px solid green;
}

#dcus,#res,#ndiv{
width:20%;
margin:auto;

}
</style>
</head>
<body>
<form>

<fieldset id="table1">
<legend>User Form</legend>

Name<input type="text" id="name" /><br />
City&nbsp;&nbsp;&nbsp;<input type="text" id="city" /><br />
<button type="button" onclick="add();">Add</button>
<button type="button" onclick="update();">Update</button>
<button type="button" onclick="del();">Delete</button>
<div id="report"></div></fieldset>
<br/>
<select id="run" style="position:relative;left:399px;width:18%;" >
<option>..Select name..</option>
<?php
$query="select * from bs ";
$ok=mysql_query($query,$check);

//$query="select u_id from merge where name='$nam' && city='$cty'";
//$id=mysql_query($query,$check);
//echo "";
while($row = mysql_fetch_array($ok))
{

echo "<option value=".$row['userid']." onclick='getval(this.value);'>".$row['userid'].",Name=".$row['name']."</option>";
}
//echo "";
?>
</select>
<div id="dcus"></div>

<br/>
<br/>
<br/>
<textarea id="run"></textarea>
<div>
<input type="button" id=a value="More"></div>
<div id="a1">

<?php
$query="select * from bs ";
$ok=mysql_query($query,$check);
while($row = mysql_fetch_array($ok))
{
//echo "<value=".$row['name']." onclick='getval(this.value);'/>".$row['name']."<br />";
?>
<br />
<?php
}
?>

</div>
<div id="res">
Enter customer Name:<br/>
<input type="textarea" name="bbc" id="bbc" style="width:205px" onKeyUp="suggetion(this.value);">

</div>
<div id="ndiv"></div>
</form>

</body>
</html>
941
like
0
dislike
0
mail
flag

You must LOGIN to add comments