Location: PHPKode > projects > EasyFest > new/editFestDetails.php
<?php
	include_once("include/db_connection.php");
	session_start();
	if($_SESSION["adminloggedIn"] == FALSE){
				header("Location:admin_login.php");
				exit;
	}
include_once("config_admin.php");
	include('header.php');
	include('left1.php');?>
    
    
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Premium Series by Free CSS Templates</title>
<meta name="keywords" content="" />
<meta name="Premium Series" content="" />
<link href="./default.css" rel="stylesheet" type="text/css" media="screen" />
	<link type="text/css" href="./themes/base/jquery.ui.all.css" rel="stylesheet" />
	<script type="text/javascript" src="./jquery-1.4.2.js"></script>
	<script type="text/javascript" src="./jquery.ui.core.js"></script>
	<script type="text/javascript" src="./jquery.ui.widget.js"></script>
	<script type="text/javascript" src="./jquery.ui.datepicker.js"></script>
	<link type="text/css" href="./demos.css" rel="stylesheet" />
	<script type="text/javascript">
	$(function() {
		$("#datepicker").datepicker({
			showOn: 'button',
			buttonImage: 'images/calendar.gif',
			buttonImageOnly: true
		});
	});
	</script>
<script language="JavaScript" src="gen_validatorv31.js" type="text/javascript"></script>

<title>Untitled Document</title>
</head>

<body>
<div id="wrapper">
	<!-- start page -->
	<div id="page">
    	  <!-- start content -->
        <div id="prtCnt" align="center">
		<div id="content" align="center">
		  <div class="post">
	    <h2 class="title">&nbsp;</h2>
	    <div class="entry">
	<?php  
	     
		$UserName = $_SESSION['UserName'];
		$sqlDetails = "SELECT * FROM fest ";
		$resultDetails = MYSQL_QUERY($sqlDetails);
		$FestName = MYSQL_RESULT($resultDetails,"0","FestName");
		$Description = MYSQL_RESULT($resultDetails,"0","Description");
		$Budget = MYSQL_RESULT($resultDetails,"0","Budget");
		$UploadSpace = MYSQL_RESULT($resultDetails,"0","UploadSpace");
		$StartDate =MYSQL_RESULT($resultDetails,"0","StartDate");
		$EndDate = MYSQL_RESULT($resultDetails,"0","EndDate");
		$Venue = MYSQL_RESULT($resultDetails,"0","Venue");
	
?>
<div align="center">Edit Fest Detais</div>
<form action="editingFestDetails.php" method="POST" name="edit_user" onSubmit="return validate_form(this)"> 
	  <table width="517" height="277" border="0">
        
        <tr>
          <td width="39%" height="35" align="center" bgcolor="#E6E6E6"><strong>Fest Name</strong></td>
          
         <td width="61%" align="left" bgcolor="#FFFFFF"><strong>
           <input name="FestName" type="text"  value="<?php echo $FestName; ?>" size="35" maxlength="30" />
         </strong></td>
        </tr>
        		  <tr>
          <td width="39%" height="35" align="center" bgcolor="#E6E6E6"><strong>Description </strong></td>
          
         <td width="61%" align="left" bgcolor="#FFFFFF"><strong>
           <input name="Description" type="text"  value="<?php echo $Description; ?>" size="35" maxlength="250" />
         </strong></td>
        </tr>

         <tr>
          <td width="39%" height="35" align="center" bgcolor="#E6E6E6"><strong>Budget</strong></td>
         <td width="61%" align="left" bgcolor="#FFFFFF"><strong><input name="Budget" type="text"  value="<?php echo $Budget; ?>" size="35" maxlength="30" /></strong></td>
        </tr>
		
		
         <tr>
          <td width="39%" height="35" align="center" bgcolor="#E6E6E6"><strong>UploadSpace</strong></td>
          
        <td width="61%" align="left" bgcolor="#FFFFFF"><strong><input name="UploadSpace" type="text"  value="<?php echo $UploadSpace; ?>" size="35" maxlength="45" /></strong></td>
        </tr>
        
        <tr>
        <td width="39%" height="35" align="center" bgcolor="#E6E6E6"><strong>StartDate</strong>(yyyy-mm-dd)</td>
         
         <td width="61%" align="left" bgcolor="#FFFFFF"><strong>
           <input name="StartDate" type="text"  value="<?php echo $StartDate; ?>" size="35" maxlength="45" onChange="isDate(this.value)" />
         </strong></td> 
       </tr>
		 <tr>
          <td width="39%" height="35" align="center" bgcolor="#E6E6E6"><strong>EndDate</strong>(yyyy-mm-dd)</td>
          
         <td width="61%" align="left" bgcolor="#FFFFFF"><strong>
           <input name="EndDate" type="text"  value="<?php echo $EndDate; ?>" size="35" maxlength="45" />
         </strong></td>
        </tr>

			  <tr>
          <td width="39%" height="35" align="center" bgcolor="#E6E6E6"><strong>Venue</strong></td>
          
         <td width="61%" align="left" bgcolor="#FFFFFF"><strong>
           <input name="Venue" type="text"  value="<?php echo $Venue; ?>" size="35" maxlength="250" />
         </strong></td>
        </tr>
          
	 <tr>
         
          
        <td height="39" align="center" ><input type="submit" name="Submit" value="Submit" /></td>
        </tr>
  </table>
  
</form> 
<script language="JavaScript" type="text/javascript">
 var frmvalidator = new Validator("edit_user");
 
 
 frmvalidator.addValidation("FestName","req","Please enter FestName");
 frmvalidator.addValidation("FestName","maxlen=35","Max length for First Name is 45");
 frmvalidator.addValidation("FestName","alpha_s");
 
 frmvalidator.addValidation("Description","req","Please enter the Fest Description");
 frmvalidator.addValidation("Description","maxlen=200","Max length for Description is 200");
 frmvalidator.addValidation("Description","alpha_s");
 
 frmvalidator.addValidation("Budget","req","Please enter Fest Budget");
 frmvalidator.addValidation("Budget","numeric");
 
 frmvalidator.addValidation("UploadSpace","req","Please enter Fest Upload Space");
 frmvalidator.addValidation("UploadSpace","numeric");
 
 frmvalidator.addValidation("StartDate","req","Please enter the Fest StartDate");
 


 frmvalidator.addValidation("EndDate","req","Please enter the Fest StartDate");
// frmvalidator.addValidation("EndDate","alpha_s");

	frmvalidator.addValidation("Venue","req","Please enter the Fest venue");
 frmvalidator.addValidation("Venue","maxlen=45","Max length for Venue is 45");
 frmvalidator.addValidation("Venue","alpha_s");

/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "-";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm-dd-yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function dateValidateForm(){
	var dt=document.frmSample.txtDate
	if (isDate(dt.value)==false){
		dt.focus()
		return false
	}
    return true
 }

</script>

      </p>
				</div>
		  </div>
		</div>
        </div>
        <!-- end content -->
		<!-- start sidebars -->
		<!-- end sidebars -->
	  <div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end page -->
</div>
</html>
<?php
	include('footer.php');
?>

  
Return current item: EasyFest