| Current Path : /var/www/html/mmishra/mm/ada/ |
| Current File : /var/www/html/mmishra/mm/ada/registrations.php |
<?php
//checkadmin($role);
$tbl = 'registrations';
$id = $_REQUEST["id"];
$submit = $_POST["submit"];
if ($submit == 'SAVE') {
$scheme_name = $_POST["scheme_name"];
$scheme_code = $_POST["scheme_code"];
$property_category = $_POST["property_category"];
$property_code = $_POST["property_code"];
$applicant_name = $_POST["applicant_name"];
$present_address = $_POST["present_address"];
$age = $_POST["age"];
$sex = $_POST["sex"];
$marital_status = $_POST["marital_status"];
$quota = $_POST["quota"];
$occupation = $_POST["occupation"];
$payplan = $_POST["payplan"];
$income_code = $_POST["income_code"];
$annual_income = $_POST["annual_income"];
$applicant_fhname = $_POST["applicant_fhname"];
$permanent_address = $_POST["permanent_address"];
$phone_no = $_POST["phone_no"];
$email = $_POST["email"];
$nominee_name = $_POST["nominee_name"];
$nominee_fhname = $_POST["nominee_fhname"];
$adaproperty_owner = $_POST["adaproperty_owner"];
if (mysql_num_rows(mysql_query("select * from $tbl where id=$id"))) {
mysql_query("update $tbl set scheme_name='$scheme_name',scheme_code='$scheme_code',
property_category='$property_category',property_code='$property_code',applicant_name='$applicant_name',
present_address='$present_address',age=$age,sex='$sex',marital_status='$marital_status',
quota='$quota',occupation='$occupation',payplan='$payplan',income_code='$income_code',
annual_income=$annual_income,applicant_fhname='$applicant_fhname',permanent_address='$permanent_address',
phone_no='$phone_no',email='$email',nominee_name='$nominee_name',nominee_fhname='$nominee_fhname',
adaproperty_owner='$adaproperty_owner',dated=now()
where id=$id");
} else {
mysql_query("insert into $tbl(scheme_name,scheme_code,property_category,property_code,applicant_name,
present_address,age,sex,marital_status,quota,occupation,payplan,income_code,annual_income,
applicant_fhname,permanent_address,phone_no,email,nominee_name,nominee_fhname,adaproperty_owner)
values('$scheme_name','$scheme_code','$property_category','$property_code','$applicant_name',
'$present_address',$age,'$sex','$marital_status','$quota','$occupation','$payplan','$income_code',
$annual_income,'$applicant_fhname','$permanent_address','$phone_no','$email',
'$nominee_name','$nominee_fhname','$adaproperty_owner')");
echo "Thanks for registration... Your registration number is ADA/Reg/".mysql_insert_id()."<br>
Please use your registration number in further communication with development authority.";
}
} else if ($submit == "DELETE") {
mysql_query("delete from $tbl where id=$id");
}
echo "<ol>";
$rs = mysql_query("select * from $tbl order by dated desc,id");
while ($o = mysql_fetch_object($rs)) {
$i++;
echo "<li>";
if ($id == $o->id) {
$scheme_name = $o->scheme_name;
$scheme_code = $o->scheme_code;
$property_category = $o->property_category;
$property_code = $o->property_code;
$applicant_name = $o->applicant_name;
$present_address = $o->present_address;
$age = $o->age;
$sex = $o->sex;
$marital_status = $o->marital_status;
$quota = $o->quota;
$occupation = $o->occupation;
$payplan = $o->payplan;
$income_code = $o->income_code;
$annual_income = $o->annual_income;
$applicant_fhname = $o->applicant_fhname;
$permanent_address = $o->permanent_address;
$phone_no = $o->phone_no;
$email = $o->email;
$nominee_name = $o->nominee_name;
$nominee_fhname = $o->nominee_fhname;
$adaproperty_owner = $o->adaproperty_owner;
include "registration_form.inc";
} else {
$y = strftime("%b-%Y", strtotime($o->dated));
echo "Ref. No. <a href='inner.php?conf=registrations&id=$o->id'>ADA-Reg/$o->id/$y</a>
dated $o->dated by $o->applicant_name ($o->email)";
}
echo "</li>";
}
echo "</ol>";
?>