| Current Path : /var/www/html/mmishra/iws8/html/ialumni/ |
| Current File : /var/www/html/mmishra/iws8/html/ialumni/updation.inc |
<h1>Record Updation</h1>
<?php
if ($_POST["submit"] == 'SUBMIT') {
$rollno = $_POST["rollno"];
$batch = $_POST["batch"];
$fullname = $_POST["fullname"];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$country = $_POST["country"];
$pin = $_POST["pin"];
$contact = $_POST["contact"];
$email = $_POST["email"];
$organization = $_POST["organization"];
$position = $_POST["position"];
$location = $_POST["location"];
$workplace = $_POST["workplace"];
mysql_query("update registrations set batch=$batch,fullname='$fullname',address='$address',
city='$city',state='$state',country='$country',pin=$pin,contact='$contact',email='$email',
organization='$organization',position='$position',location='$location',workplace='$workplace',
flag=2 where rollno='$user'");
}
$rs = mysql_query("select * from registrations where rollno='$user'");
while ($o = mysql_fetch_object($rs)) {
$flag = $o->flag;
}
if ($flag == 1) {
$ds = ldap_connect("172.31.1.42");
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$a = ldap_search($ds, 'ou=alumni,dc=iiita,dc=ac,dc=in',"(&(uid=$user)(objectclass=posixAccount))");
$info = ldap_get_entries($ds, $a);
$dn = $info[0]["dn"];
//$ou = explode(",", $dn);
//$batch = $info["description"][0];
ldap_close($ds);
echo "LDAP Entry: $dn";
}
?>
<table border='0' >
<?php
$rs = mysql_query("select * from registrations where rollno='$user'");
while ($o = mysql_fetch_object($rs)) {
echo "<tr><td width='30%'>Enrolment No. *</td>
<td width='70%'><input type='text' name='rollno' maxlength='10' size='20' value='$o->rollno' readonly></td></tr>
<tr><td>Batch</td>
<td><input type='text' name='batch' maxlength='10' size='20' value='$o->batch'></td></tr>
<tr><td>Name *</td>
<td><input type='text' name='fullname' maxlength='50' size='50' value='$o->fullname'></td></tr>
<tr valign='top'><td>Address *</td>
<td><textarea name='address' rows='4' cols='50' value='$o->address'>$o->address</textarea></td></tr>
<tr><td>City</td>
<td><input type='text' name='city' maxlength='50' size='50' value='$o->city'></td></tr>
<tr><td>State</td>
<td><input type='text' name='state' maxlength='50' size='50' value='$o->state'></td></tr>
<tr><td>Country</td>
<td><input type='text' name='country' maxlength='50' size='50' value='$o->country'></td></tr>
<tr><td>Pin</td>
<td><input type='text' name='pin' maxlength='10' size='50' value='$o->pin'></td></tr>
<tr><td>Contact *</td>
<td><input type='text' name='contact' maxlength='50' size='50' value='$o->contact'></td></tr>
<tr><td>Email *</td>
<td><input type='text' name='email' maxlength='50' size='50' value='$o->email'></td></tr>
<tr><td>Organization</td>
<td><input type='text' name='organization' maxlength='50' size='50' value='$o->organization'></td></tr>
<tr><td>Position</td>
<td><input type='text' name='position' maxlength='50' size='50' value='$o->position'></td></tr>
";
if ($o->location == 'India')
$icheck='checked';
else
$acheck='checked';
echo "<tr><td>Location</td>
<td><input type='radio' name='location' value='India' $icheck><b>India</b>
<input type='radio' name='location' value='Abroad' $acheck><b>Abroad</b></td><tr>
<tr><td>Work Place</td>
<td><input type='text' name='workplace' maxvalue='50' size='50' value='$o->workplace'></td></tr>";
}
?>
<tr><td></td><td><input type='submit' name='submit' value='SUBMIT'></td></tr>
</table>
* - Mandatory Fields