⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newevent.php

📁 zapatec suite 最新版 20070204,非常棒的ajax widgets 工具包
💻 PHP
字号:
<?/* $Id: newEvent.php 4322 2006-09-04 08:49:33Z shacka $ */	session_start();	include("config.php");	include($ado_lib_root);	$conn = &ADONewConnection($dsn);	$conn->SetFetchMode(ADODB_FETCH_ASSOC); 		session_register("logged");	$_SESSION["logged"] = true;	session_register("user_id");	$_SESSION["user_id"] = 1;		$text = "";	$inf = "";	$res = "";	if ($_GET["action"] == "update") {		$query = "SELECT * FROM dates WHERE id=".$_GET["id"];		$res = $conn->Execute($query);		$text = $res->fields["div1"];		$inf = $res->fields["div2"];	}?>	<?		if ($_SESSION["logged"] != true) {	?>	<form method="post" action="wizard.php">		<table>			<tr><td>login:</td><td><input name="login" type="Text"></td></tr>			<tr><td>password:</td><td><input name="password" type="Password"></td></tr>			<tr><td><input type="Submit"></td></tr>		</table>	</form>	<?		} else {	?>	<form class="zpForm" id="eventsForm" method="post" action="<?if ($_GET["action"] != "update") {echo "addEvent.php";} else {echo "saveEvent.php?id=".$res->fields[id];}?>">		<table>			<tr>				<td><label class="zpFormLabel" for="div1">Title single line text:</label></td>				<td colspan="2"><textarea cols="25" rows="4" name="div1"><?echo $text;?></textarea></td>			</tr>			<tr><td><label class="zpFormLabel" for="div2">Description:</label></td><td colspan="2"><textarea cols="25" rows="4" name="div2"><?echo $inf;?></textarea></td></tr>			<tr><td><label class="zpFormLabel">Date:</label></td><td colspan="2">				<input type="Hidden" name="day" id="day">				<input type="Hidden" name="month" id="month">				<input type="Hidden" name="year" id="year">				<input type="Hidden" name="start_time" id="start_time">				<div id="cal"></div>			</td></tr>			<!--tr>				<td><label class="zpFormLabel">Recurs:</label></td>				<td><input type="Checkbox" name="month_recur" value="true">monthly</td>				<td><input type="Checkbox" name="year_recur" value="true">yearly</td>							</tr-->			<tr><td><input type="Submit" value="<?if ($_GET["action"] != "update") {echo "Add";} else {echo "Save";}?>" name="Add"></td></tr>		</table>	</form><script language="JavaScript">		var sYear = null, sMonth = null, sDay = null, sStartTime = null;		<?			if ($_GET["id"]) {				echo "sYear = ".$res->fields["year"].";";				echo "sMonth = ".$res->fields["month"].";";				echo "sDay = ".$res->fields["day"].";";				echo "sStartTime = '".$res->fields["start_time"]."';";			}		?>		if (sYear != null && sMonth != null && sDay != null && sStartTime != null) {			sStartTime = sStartTime.match(/(\d+):(\d+):(\d+)/);			var sDate = new Date(sYear, --sMonth, sDay, sStartTime[1], sStartTime[2], sStartTime[3]);		} else {			var sDate = new Date();		}		function dateChanged(calendar) {			var day = document.getElementById("day");			var month = document.getElementById("month");			var year = document.getElementById("year");			var startTime = document.getElementById("start_time");			day.value = calendar.date.print("%e");			month.value = calendar.date.print("%m");			year.value = calendar.date.print("%Y");			startTime.value = calendar.date.print("%H:%M:%S");					}		var cal = Zapatec.Calendar.setup({			date    :   sDate,			flat	:	"cal",			showsTime : true,			flatCallback : dateChanged		});		dateChanged(cal);		var form = new Zapatec.Form("eventsForm", {			showErrors : 'afterField', 			showErrorsOnSubmit : true, 			asyncSubmitFunc : function () {				form.domForm.action = "addEvent.php";				form.domForm.elements.namedItem("Add").value = "Add";				form.domForm.elements.namedItem("div1").value = "";				form.domForm.elements.namedItem("div2").value = "";			}});	</script><?		}	?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -