Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/ialumni/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/ialumni/registration.inc

<h1>New Registration </h1>

<?php

if ($_POST["submit"] == 'SUBMIT') { 
	$id = $_POST["id"];
	$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"];

	if (mysql_num_rows(mysql_query("select * from registrations where rollno='$rollno'"))) {
		echo "<font color='red'>Alumni with this roll no. has already been registered.</font>";
	} else {

        	$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"];
		ldap_close($ds);
		
		if (!$dn) 
			echo "<font color='red'>Alumni with this roll no. has already been registered.</font>";
		else {
			$no = rand(111, 999); 
			mysql_query("insert into registrations(rollno,passwd,fullname,email,dated)
			values('$rollno',password('aap$no'),'$fullname','$email',now())");
	
			$id = mysql_insert_id();
			$str = "Hello $fullname<br><br>
			Please 
			<a href='https://irp.iiita.ac.in/ialumni/?pg=registration&confirmid=$id'>activate</a>
			your registration on IIITA Alumni Association Portal.<br>
			On this portal your loginID is your enrolment no. and password is 'aap$no'
			without quotes.<br><br>
			With best wishes,";

			$str = automailer($email, "iAlumni@IIITA - Registration", $str); 
			echo "<font color='red'>Registration mail sent [$str]. 
			Please open acknowledgement mail to activate your account and complete registration process.
			</font>";
		}
	}
}
$confirmid = $_REQUEST['confirmid'];
if ($confirmid) {
	mysql_query("update registrations set flag=1 where id=$confirmid");
	echo "<font color='red'>Your account has been successfully activated. Please login to complete your registration process.</font>";
}

echo "<table border='0' >
<tr><td width='30%'>Enrolment No. *</td>
<td width='70%'><input type='text' name='rollno' maxlength='10' size='20' value='$rollno'></td></tr>

<tr><td>Name *</td>
<td><input type='text' name='fullname' maxlength='50' size='50' value='$fullname'></td></tr>

<tr><td>Email *</td>
<td><input type='text' name='email' maxlength='50' size='50' value='$email'></td></tr>

<tr><td></td><td><input type='submit' name='submit' value='SUBMIT'></td></tr> 
</table>
* - Mandatory Fields
<br><br>
On submit this form, a mail will be sent to above email address for your confirmation.
<br>
Please confirm by clicking a link there in the mail to proceed with your registration.";
?>