
PK 
<?php
session_start();
include_once('../include/common.php');
include_once('../include/connection.php');
include_once('../include/session.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=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<title>form</title>
<!-- CSS -->
<script language="javascript">
function emptyfield() {
//alert("dudfsufdysui");
var certificateNo = document.getElementById("certificateNo");
var name = document.getElementById("name");
var fatherName = document.getElementById("fatherName");
var regNo = document.getElementById("regNo");
var day = document.getElementById("day");
var mon = document.getElementById("mon");
var year = document.getElementById("year");
var course = document.getElementById("course");
var grade = document.getElementById("grade");
var duration = document.getElementById("duration");
var address = document.getElementById("address");
var centerName = document.getElementById("centerName");
if(certificateNo.value=='') {
alert("Enter your Certificate No.");
certificateNo.focus();
return false;
}
if(name.value=='') {
alert("Enter your Name");
name.focus();
return false;
}
if(fatherName.value=='') {
alert("Enter your Father Name");
fatherName.focus();
return false;
}
if(regNo.value=='') {
alert("Enter your Registration No.");
regNo.focus();
return false;
}
if(day.value=='--DD--') {
alert("Enter your admission date.");
day.focus();
return false;
}
if(mon.value=='--MM--') {
alert("Enter your admission Month.");
mon.focus();
return false;
}
if(year.value=='YYYY') {
alert("Enter your admission Year.");
year.focus();
return false;
}
if(course.value=='Select course') {
alert("Please select your Course");
course.focus();
return false;
}
if(grade.value=='') {
alert("Enter your Grade");
grade.focus();
return false;
}
if(duration.value=='') {
alert("Enter your Duration");
duration.focus();
return false;
}
if(address.value=='') {
alert("Enter your Address");
address.focus();
return false;
}
if(centerName.value=='') {
alert("Enter your Center Name");
centerName.focus();
return false;
}
}
</script>
</head>
<body>
<table border="0px" width="100%" align="center" cellpadding="0" cellspacing="0">
<!--header-->
<tr>
<td align="center" colspan="3"><?php include"../include/adminheader.php"; ?></td>
</tr>
<!--/header-->
<form name="form" method="post" action="form_action.php" enctype="multipart/form-data">
<?php
$act="add";
if($_GET['action']=='edit') {
$editsql="SELECT * FROM certificate WHERE cId='".$_GET['cId']."'";
$editres=mysql_query($editsql);
$editrow=mysql_fetch_array($editres);
$act='edit';
}
?>
<!--Content-->
<tr>
<td width="20%"> </td>
<td width="60%">
<table border="0px" align="center" width="50%" class="feedback" cellpadding="5" cellspacing="0">
<tr>
<td valign="bottom">Certificate No. :</td>
<td><img src="student_images/<?=$editrow['img']; ?>" width="100px" style="padding-left:100px;"></td>
</tr>
<tr>
<td colspan="2"><input type="text" name="certificateNo" id="certificateNo" value="<?=$editrow['certificateNo']; ?>" class="feed_input"><span class="spanStyle">*</span></td>
</tr>
<td>Name :</td>
<td>Father's Name :</td>
</tr>
<tr>
<td><input type="text" name="name" id="name" value="<?=$editrow['name']; ?>" class="feed_input"><span class="spanStyle">*</span></td>
<td><input type="text" style="width:209px;" name="fatherName" id="fatherName" value="<?=$editrow['fatherName']; ?>" class="feed_input"><span class="spanStyle">*</span></td>
</tr>
<tr>
<td>Registration No. :</td>
<td>Admission Date :</td>
</tr>
<tr>
<td><input type="text" name="regNo" id="regNo" value="<?=$editrow['regNo']; ?>" class="feed_input"><span class="spanStyle">*</span></td>
<?php
$redate=explode("-",$editrow['admiDate']);$_POST['day']."-".$_POST['mon']."-".$_POST['year'];
//print_r($redate);
?>
<td><select class="feed_input" name="day" id="day" style="width:65px;"><option>--DD--</option>
<?php
for($i=1; $i<=31; $i++) {
if($redate[2]==$i) {
echo "<option value=".$i." selected='selected'>".$i."</option>";
} else {
echo "<option value=".$i.">$i</option>";
}
}
?>
</select>
<select class="feed_input" name="mon" id="mon" style="width:65px;"><option>--MM--</option>
<?php
for($i=1; $i<=12; $i++) {
if($redate[1]==$i) {
echo "<option value=".$i." selected='selected'>$i</option>";
} else {
echo "<option value=".$i.">$i</option>";
}
}
?>
</select>
<select class="feed_input" name="year" id="year" style="width:74px;"><option value="YYYY">YYYY</option>
<?php
for($i=1982; $i<=2020; $i++) {
if($redate[0]==$i) {
echo "<option value=".$i." selected='selected'>$i</option>";
} else {
echo "<option value=".$i.">$i</option>";
}
}
?>
</select></td>
</tr>
<tr>
<td>Course :</td>
<td>Grade :</td>
</tr>
<tr>
<td>
<?php
if($editrow['course']=='Office Automation')
$office="selected='selected'";
elseif($editrow['course']=='Decktop Publishing(DTP)')
$decktop="selected='selected'";
elseif($editrow['course']=='Manual Accounting')
$manual="selected='selected'";
elseif($editrow['course']=='Computer Accounting')
$computer="selected='selected'";
elseif($editrow['course']=='Web Designing')
$web="selected='selected'";
elseif($editrow['course']=='Programing')
$programing="selected='selected'";
elseif($editrow['course']=='VB.net/C#')
$vb_net="selected='selected'";
elseif($editrow['course']=='Java2.0')
$java2="selected='selected'";
elseif($editrow['course']=='Certificate in Computer Application(CCA)')
$cca="selected='selected'";
elseif($editrow['course']=='Diploma in Computer Application(DCA)')
$dca="selected='selected'";
elseif($editrow['course']=='Diploma in Information Technology(DIT)')
$dit="selected='selected'";
elseif($editrow['course']=='Diploma in Hardware & Networking(DHN)')
$dhn="selected='selected'";
elseif($editrow['course']=='Eng. Speaking & Personality Development(ESPD)')
$espd="selected='selected'";
elseif($editrow['course']=='IELTS')
$ielts="selected='selected'";
elseif($editrow['course']=='Network Technology')
$n_Technology="selected='selected'";
elseif($editrow['course']=='Network Practicess')
$n_Practicess="selected='selected'";
elseif($editrow['course']=='Office Automation +')
$n_officeauto="selected='selected'";
elseif($editrow['course']=='Programming in C +')
$n_cp="selected='selected'";
elseif($editrow['course']=='Programming in C ++')
$n_cpp="selected='selected'";
elseif($editrow['course']=='Computer Applications and DTP')
$n_cad="selected='selected'";
elseif($editrow['course']=='Computer Applications and Accounts')
$n_cad="selected='selected'";
?>
<select name="course" id="course" class="feed_input">
<option>Select course</option>
<option <?=$office; ?>>Office Automation</option>
<option <?=$decktop; ?>>Decktop Publishing(DTP)</option>
<option <?=$manual; ?>>Manual Accounting</option>
<option <?=$computer; ?>>Computer Accounting</option>
<option <?=$web; ?>>Web Designing</option>
<option <?=$programing; ?>>Programing</option>
<option <?=$vb_net; ?>>VB.net/C#</option>
<option <?=$java2; ?>>Java2.0</option>
<option <?=$cca; ?>>Certificate in Computer Application(CCA)</option>
<option <?=$dca; ?>>Diploma in Computer Application(DCA)</option>
<option <?=$dit; ?>>Diploma in Information Technology(DIT)</option>
<option <?=$dhn; ?>>Diploma in Hardware & Networking(DHN)</option>
<option <?=$espd; ?>>Eng. Speaking & Personality Development(ESPD)</option>
<option <?=$ielts; ?>>IELTS</option>
<option <?=$n_Technology; ?> >Network Technology</option>
<option <?=$n_Practicess; ?>>Network Practicess</option>
<option <?=$n_officeauto; ?>>Office Automation +</option>
<option <?=$n_cp; ?>>Programming in C +</option>
<option <?=$n_cpp; ?>>Programming in C ++</option>
<option <?=$n_cad; ?>>Computer Applications and DTP</option>
<option <?=$n_cad; ?>>Computer Applications and Accounts</option>
</select>
<span class="spanStyle">*</span></td>
<!--<select name="course" style="width:213px;">
<option value=""></option>
</select>-->
<td><input type="text" name="grade" id="grade" value="<?=$editrow['grade']; ?>" class="feed_input"><span class="spanStyle">*</span></td>
</tr>
<tr>
<td align="left" colspan="2">Duration :</th>
</tr>
<tr>
<td colspan="2"><textarea class="feed_txt" name="duration" id="duration" cols="55" rows="1" ><?=$editrow['duration']; ?></textarea></td>
</tr>
<tr>
<td align="left" colspan="2">Adderss :</th>
</tr>
<tr>
<td colspan="2"><textarea class="feed_txt" name="address" id="address" cols="55" rows="1" ><?=$editrow['address']; ?></textarea></td>
</tr>
<tr>
<td>Center Name :</td>
<td>Image :</td>
</tr>
<tr>
<td><input type="text" name="centerName" id="centerName" value="<?php echo $editrow['centerName']; ?>" class="feed_input"/></td>
<td><input type="file" name="img" class="feed_input"></td>
</tr>
<tr>
<input type="hidden" name="cId" value="<?=$editrow['cId']; ?>" />
<input type="hidden" name="action" value="<?=$act; ?>" />
<td align="left" colspan="2" ><input type="submit" name="submit" value="Submit" onclick="return emptyfield();" class="submit" />
<input type="reset" value="Clear" class="submit" />
</td>
</tr>
</table>
</td>
<td width="20%" align="left"> </td>
</tr>
</form>
<!--End Content-->
<!--footer-->
<tr>
<td align="center" colspan="3"><?php include"../include/adminfooter.php"; ?></td>
</tr>
<!--footer-->
</table>
</body>
</html>


PK 99