Viewing file: addemployee.php (7.52 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include('session.php'); ?> <?php include ('employeecode.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Add Member Form </title> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <style type="text/css"> a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } body { background-color: #306; } </style> </head> <center> <body>
<table width="979" border="0" bgcolor="#FFFFFF"> <tr> <td width="973" height="100"><?php include('header.php'); ?></td> </tr> <tr> <td><table width="976" border="0"> <tr> <td colspan="3" bgcolor="#CCCCCC"><?php include('menubar.php'); ?></td> </tr> <tr> <td width="218" bgcolor="#6699CC">Welcome <?php echo $user ?></td> <td width="349" bgcolor="#6699CC"><a href="logout.php">Logout</a></td> <td width="395" bgcolor="#6699CC"><?php echo "Today is " . date("d/m/y") . "<br>";?></td> </tr> </table></td> </tr> <tr> <td align="center" valign="middle" bgcolor="#999999"> <form action="" method="get" name="form"> Enter Reference No : <input type="text" name="q" /> <input type="submit" name="Submit" value="Search" /> </form> <form id="form1" name="form1" method="post" action="employee_print.php"> <?php
// Get the search variable from URL
$var = @$_GET['q'] ; $trimmed = trim($var); //trim whitespace from the stored variable
// rows to return $limit=10;
// check for an empty string and display a message. if ($trimmed == "") { exit; }
// check for a search parameter if (!isset($var)) { echo "<p>We dont seem to have a search parameter!</p>"; exit; }
mysql_connect("localhost","aadhar_user","aadhar_pass"); //(host, username, password)
//specify database ** EDIT REQUIRED HERE ** mysql_select_db("aadhar_baserain_db838") or die("Unable to select database"); //select which database we're using
$field = 'empid'; // Build SQL Query $query = "select * from empreg where $field like \"$trimmed\" order by $field"; // EDIT HERE and specify your table and field names for the SQL query
$numresults=mysql_query($query); $numrows=mysql_num_rows($numresults);
// If we have no results, offer a google search as an alternative
if ($numrows == 0) { echo " Sorry, $trimmed this Number is not found";
}
// next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; }
// get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query");
// begin to show results set $count = 1 + $s ;
// now you can display the results returned while ($row= mysql_fetch_array($result)) {
echo " <table width=\"844\" border=\"0\">\n"; echo " <tr bgcolor='#66CCFF'>\n"; echo " <td width=\"111\">Agent Name</td>\n";
echo " <td width='165' bgcolor='#66CCFF' ><input name='agent_name' value='$row[name] ' type='text' required='required' readonly size='40' maxlength='50' /></td>\n"; echo " <td width=\"83\">Member Code</td>\n";
echo " <td width=\"144\">\n"; echo " <input type=\"text\" bgcolor='#66CCFF' name='agent_code' value='$row[empid]' readonly id='agent_code' />\n"; echo " <input type=\"text\" bgcolor='#66CCFF' name='network_code' value='$row[networkcode]' readonly id='agent_code' />\n"; echo " </td>\n"; echo " <td> </td>\n"; echo " <td width=\"83\" bgcolor='#66CCFF'> </td>\n"; echo " <td width=\"12\">:</td>\n"; echo " <td width=\"144\">\n"; echo " <input type=\"text\" bgcolor='#66CCFF' name='agent_rank' id='agent_rank' />\n"; echo " </td>\n"; echo " <td> </td>\n";
echo " </tr>\n"; echo "</table>\n"; echo " \n";
$count++ ; }
$currPage = (($s/$limit) + 1);
//break before paging echo "";
// next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print "<a href=\"$PHP_SELF?s=$prevs&q=$var\"><< Prev 10</a> "; }
// calculate number of pages needing links $pages=intval($numrows/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
?> <table width="878" border="0"> <tr> <td width="98" height="22">Employee Code</td> <td width="9"> </td> <td width="150"><label for="textfield"> <input name="empid" type="text" required="required" id="empid" value="<?php echo $nmembercode; ?>" readonly /> </label></td> <td width="152">Qualification</td> <td width="167"><input type="text" name="qualification" id="qualification" /></td> <td width="131">Branch</td> <td width="141"><input type="text" name="branch" id="branch" /> </td> </tr> <tr> <td>Name</td> <td> </td> <td><input type="text" name="name" id="name" required="required" tabindex="2"/></td> <td>Middle Name</td> <td><input type="text" name="mmidname" id="mmidname" /></td> <td>Surname</td> <td><input type="text" name="msurname" id="msurname" /></td> </tr> <tr> <td>Email</td> <td> </td> <td><input type="text" name="email" id="email" /></td> <td>Father/Hus./Wif.</td> <td><input type="text" name="f_name" id="f_name" required="required" tabindex="3"/></td> <td>Date of Birth</td> <td><input name="dob" type="text" required="required" id="dob" tabindex="5"/></td> </tr> <tr> <td>Post</td> <td> </td> <td><input type="text" name="post" id="post" /></td> <td>Address</td> <td><textarea name="address" required id="address" tabindex="7"></textarea></td> <td>Mobile No.</td> <td><input type="text" name="mobile" id="mobile" required="required" tabindex="8"/></td> </tr> <tr> <td>PAN/GIR No.</td> <td> </td> <td><input name="pan" type="text" required="required" id="pan" tabindex="9"/></td> <td>Experience</td> <td><input type="text" name="experience" id="experience" required="required" tabindex="10"/></td> <td>Nationality</td> <td><input name="nationality" type="text" required="required" id="nationality" tabindex="11" value="indian"/></td> </tr> <tr> <td>Religion</td> <td> </td> <td><input name="religion" type="text" required id="religion" tabindex="12" value="Hindu"/></td> <td>Sallary</td> <td><input type="text" name="salary" id="salary" /></td> <td>Occupation</td> <td><input type="text" name="occupation" id="occupation" /></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td><input type="submit" name="button" id="button" value="ADD" tabindex="21"/></td> <td></td> </tr> </table> </form> </td> </tr> <tr> <td bgcolor="#CCCCCC"><?php include('footer.php'); ?></td> </tr> </table>
</body></center> </html>
|