Location: PHPKode > projects > Silicon Fodder > SiliconFodder/DocumentRoot/notepad/delnote.php
<? require_once("../common/includes.php"); ?>
<? require_once("../admin/util.php"); ?>
<? require_once("../util/general.php"); ?>
<?
if($HTTP_GET_VARS["nC"] == "") {
	header("Location: notepad.php?folder=".$HTTP_GET_VARS["folder"]);
	exit;
}
if($HTTP_GET_VARS["posted"] == "1") {
	$strSQL = "UPDATE notepad SET isDeleted=1 WHERE (id IN (".implode(",", $HTTP_GET_VARS["nC"])."))";
	gendb_query($strSQL, $myDb) or die(gendb_error());

	echo("<script language=\"javascript\">");
	echo("parent.notepadFolders.location='folders.php?folder=".$HTTP_GET_VARS["folder"]."';");
	echo("</script>");
}
?>
<html>
<head>
<? require_once("../common/head.php"); ?>
<script type="text/javascript">
function changeOrder(field) {
	document.frm.orderBy.value = field;
	document.frm.submit();
}
</script>
</head>
<?
// set selected folder
if($HTTP_GET_VARS["folder"] != "") {
	$strSelectedFolder = $HTTP_GET_VARS["folder"];
} else {
	$strSelectedFolder = "U";
}

$strSQL = "SELECT notepad.*, notepadfolders.foldername AS strFolderName FROM notepad LEFT OUTER JOIN notepadfolders ON notepad.folderid = notepadfolders.id WHERE notepad.id IN (".implode(",", $HTTP_GET_VARS["nC"]).")";
$rows = gendb_query($strSQL, $myDb) or die(gendb_error());
$row = gendb_fetch_assoc($rows);

if($strSelectedFolder != "U" && $strSelectedFolder != "A") {
	if($row["id"] == "") {
		$mySQL = "SELECT foldername FROM notepadfolders WHERE id=".$strSelectedFolder;
		$rows2 = gendb_query($mySQL, $myDb) or die(gendb_error());
		$row2 = gendb_fetch_assoc($rows2);
		$strFolderName = $row2["foldername"];
		gendb_free_result($rows2);
	}
}
?>
<body>
<?
$buttons = displayDeleteButton("delnote", "document.frm.submit();");
$buttons.= "&nbsp;".displayCancelButton("cancelnote", "document.location.href='notepad.php?folder=".$strSelectedFolder."';");
if(isPda()) {
	pdaHeader("Notepad", "", true, $buttons);
} else {
	dispHeader("Notepad");
}
?>
<?=displayErrorMessage()?>
<form name="frm" method="get" action="delnote.php">
<input type="hidden" name="folder" value="<?=$strSelectedFolder?>">
<input type="hidden" name="posted" value="1">

<? if(!isPda()) { ?>
<table width="100%" cellspacing="0" cellpadding="1">
<tr>
<td>
<?=$buttons?>
</td>
<hr>
<? } ?>
<table width="100%">
<tr>
<td class="titlebar">
Uncheck any notes you do NOT want to Delete then Confirm
</td>
</tr>
<tr>
<td>
<?
	if($row["id"] == "") {
		echo("<table width=\"100%\"><tr><td align=\"center\">This folder is empty</td></tr></table>");
	} else {
?>
		<table width="100%">
		<tr>
		<th class="head">&nbsp;</th>
		<th class="head">Note</th>
		<th class="head">Folder</th>
		<th class="head">Last Modified</th>
		</tr>
		<?

		do {
			$intID = $row["id"];
			$strNote = substr($row["note"],0,40);
			if(strpos($strNote, "\n")) {
				$strNote = substr($strNote,0,strpos($strNote,"\n"));
			}
			$intFID = $row["folderid"];
			$strLD = $row["lastdate"];
			$strFN = $row["strFolderName"];

			echo("<tr>");

			echo("<td><input name=\"nC[]\" CHECKED value=\"".$intID."\" type=\"checkbox\"></td><td>".$strNote."</td>");

			if($intFID == 0) {
				echo("<td>Unfiled</td>");
			} else {
				echo("<td>".$strFN."</td>");
			}

			echo("<td>".$strLD."</td>");

			echo("</tr>");
		} while ($row = gendb_fetch_assoc($rows));
		?>
		</table>
<?
	}
	gendb_free_result($rows);
?>
</td>
</tr>
</table>
<?=dispFooter()?>
</form>
</body>
</html>
<? require_once("../common/incFinal.php"); ?>
Return current item: Silicon Fodder