Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/indem/pks-ec/studentinfo/
Upload File :
Current File : /var/www/html/mmishra/indem/pks-ec/studentinfo/program.php

<?php
include "registration/header.inc";
include "registration/arrays.inc";
$tbl = "program";

$id = $_REQUEST["id"];
$remoteip = $_SERVER["REMOTE_ADDR"];

if ($id) {
	include "fetch-program.inc";
}

if ($_POST["submit"] == "NEW") {
	header("Location: program.php");
}

if ($_POST["submit"] == "SAVE") {
  $msg = "";

  $programName = $_POST["programName"];
  $discription = $_POST["discription"];
  $duration = $_POST["duration"];
  $level = $_POST["level"];
  $noOfSeat = $_POST["noOfSeat"];
  $yearofstarting = $_POST["yearofstarting"];
  $contacPerson = $_POST["contactPerson"];
  $divisionalHead = $_POST["divisionalHead"];
  $url = $_POST["url"];
  $entryMode = $_POST["entryMode"];
	
	if ($msg) {
		echo "<center><font size=4px color='red'>$msg</font></center>";
	} else {
		 mysql_query ("insert into $tbl (programName,discription,duration,level,noOfSeat,yearofstarting,contactPerson,divisionalHead,url,entryMode,flag,createdBy,dateCreation,remoteip)
			values ('$programName','$discription','$duration','$level','$noOfSeat','$yearofstarting','$contactPerson','$divisionalHead','$url','$entryMode','1','Prashant',now(),'$remoteip')");

		 echo "mysql_query (insert into $tbl (programName,discription,duration,level,noOfSeat,yearofstarting,contactPerson,divisionalHead,url,entryMode,flag,createdBy,dateCreation,remoteip)
			values ('$programName','$discription','$duration','$level','$noOfSeat','$yearofstarting','$contactPerson','$divisionalHead','$url','$entryMode','1','Prashant',now(),'$remoteip'))";
	
		$id = mysql_insert_id();
		   	}
			//header("Location: program.php");
	}
echo "<form>
     <input type='hidden' name='id' value='$id'> 
     <table><tr><td>
	<table>

	 <tr><td>1. Program Name 	</td><td> <input type='text' name='programName' size='50' maxlength='50' value='$programName'></td></tr>
	 <tr><td>2. Discription		</td><td> <input type='text' name='discription' size='50' maxlength='50' value='$discription'></td></tr>
	 <tr><td>3. Duration   		</td><td> <input type='text' name='duration' 	size='50' maxlength='50' value='$duration'></td></tr>
	 <tr><td>4. Level 		</td><td> <input type='text' name='level'       size='50' maxlength='50' value='$level'></td></tr>
	 <tr><td>5. No. of Seats 	</td><td> <input type='text' name='noOfSeat' 	size='50' maxlength-'50' value='$noOfSeat'></td></tr>
	 <tr><td>6. yearofstarting	</td><td> <input type='text' name='yearofstarting'	size='50' maxlength='50' value='$yearofstarting'></td></tr>
	 <tr><td>7. Contact Person	</td><td> <input type='text' name='contactPerson'    	size='50' maxlength='50' value='$contactPerson'></td></tr>
	 <tr><td>8. Divisional Head	</td><td> <input type='text' name='divisionalHead'   	size='50' maxlength='50' value='$divisionalHead'></td></tr>
	 <tr><td>9. URL 		</td><td> <input type='text' name='url'   	size='50' maxlength='50' value='$url'></td></tr>
	 <tr><td>10. Entry Mode 	</td><td> <input type='text' name='entryMode'   size='50' maxlength='50' value='$entryMode'></td></tr>
			
	</table>
     </td><td>
		&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
     </td><td>	
 	<table>
		<tr><td>";
			$rq = mysql_query("select * from $tbl");
			while ($q = mysql_fetch_object($rq)) {
				$id = $q->id;
				echo "<a href='program.php?id=$id'>".strtoupper($q->programName)."</a> - ".$q->discription ."<br>";
			}
	echo"	</td></tr>
	</table>		
     </td></tr></table>
<center><input type='submit' name='submit' value='SAVE'><input type='submit' name='submit' value='NEW'></center>
</form>";
include "registration/footer.inc";
?>