Location: PHPKode > scripts > SimpleNotes > simplenotes/snoteindex.php
<?php 

/*****************************************************************************
/* SimplyNotes
/* version 1.10 23/08/2005
/* Copyright (C) 2004 Martin Hanus
/* hide@address.com
/* License:	This code is released under GPL version 2
*****************************************************************************/
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<meta name="Author" content="martin hanus">
<link rel="stylesheet" href="snote.css" type="text/css">

</head>

<body class="page1" topmargin="0" leftmargin="0" rightmargin="0">

<?php

require("snote.php");


if(empty($_GET["RootID"])) {$RootID=1;}else{$RootID=($_GET["RootID"]);}
if(empty($_GET["SnoteID"])) {$SnoteID=1;}else{$SnoteID=($_GET["SnoteID"]);}
if(empty($_GET["MoveWhat"])) {$MoveWhat=1;}else{$MoveWhat=($_GET["MoveWhat"]);}
if(empty($_GET["mode"])) {$mode="list";}else{$mode=($_GET["mode"]);}
if(empty($_GET["action"])) {$action="";}else{$action=($_GET["action"]);}
if(empty($_GET["MaxLevel"])) {$MaxLevel=100;}else{$MaxLevel=($_GET["MaxLevel"]);}
if(empty($_POST["Name"])) {$Name="?????";}else{$Name=($_POST["Name"]);}
if(empty($_POST["Hyperlink"])) {$Hyperlink="";}else{$Hyperlink=($_POST["Hyperlink"]);}
if(empty($_POST["BriefDesc"])) {$BriefDesc="";}else{$BriefDesc=htmlspecialchars($_POST["BriefDesc"], ENT_QUOTES);}
if(empty($_POST["BigText"])) {$BigText="";}else{$BigText=htmlspecialchars($_POST["BigText"], ENT_QUOTES);}

?>

<table width=100% class="header">
 <tr>
  <td><?php echo "<a class='hdr1'".HyperlinkToScript(1, 1, $mode, ReduceAction($action), $MaxLevel, $SnoteID).">"; ?><H1 class="dark">SimpleNotes</H1></a></td>
  <td>
    <table width=100%  class="menu">
     <tr>
      <td width=20%><?php echo "<a class='menu1'".HyperlinkToScript(1,1,"list","", 100, $SnoteID).">"; ?>Content</a></td>
      <td width=20%><?php if ($mode=="list") {echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, "full", "", $MaxLevel, $MoveWhat).">";} else {echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, "list", "", $MaxLevel, $MoveWhat).">";} ?>Details</a></td>
      <td width=20%><?php if ($MaxLevel>90) {echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, $mode,"", 3, $MoveWhat).">";} else {echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, $mode,"", 100, $MoveWhat).">";} ?>3 Levels Only</a></td>
      <td width=20%><?php echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, $mode, "", $MaxLevel+1, $MoveWhat).">"; ?>Level+1</a></td>
      <td width=20%><?php echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, $mode, "", $MaxLevel-1, $MoveWhat).">"; ?>Level-1</a></td>
     </tr>
     <tr>
      <td width=20%><?php echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, $mode, "selectnew", $MaxLevel, $MoveWhat).">"; ?>New</a></td>
      <td width=20%><?php echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, $mode, "selectedit", $MaxLevel, $MoveWhat).">"; ?>Edit</a></td>
      <td width=20%><?php echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, $mode, "selectdelete", $MaxLevel, $MoveWhat).">"; ?>Delete</a></td>
      <td width=20%><?php echo "<a class='menu1'".HyperlinkToScript($RootID, $RootID, $mode, "selectmove", $MaxLevel, $MoveWhat).">"; ?>Move</a></td>
      <td width=20%><a class="menu1" href=help.html>Help</a></td>
     </tr>
    </table>
  </td>
 </tr>
</table>
<span class="normal">
<?php
	switch ($action) {
		case "selectnew":
			echo "Insert mode. Select position!!!";
			break;
		case "selectedit":
			echo "Edit mode. Select position!!!";
			break;
		case "selectdelete":
			echo "Delete mode. Select position!!!";
			break;
		case "selectmove":
			echo "Move mode. Select what to move!!!";
			break;
		case "movewhat":
			echo "Move mode. Select where to move!!!";
			break;
		}
?>

<?php



/* function control */
	switch ($action) {
		case "":
			show_snote_structure($RootID,$RootID,1,$mode, $action,$MaxLevel,1);
			break;
		case "selectnew":
			show_snote_structure($RootID,$RootID,1,$mode,"new",$MaxLevel,1);
			break;
		case "new":
			add_snote($Name, $BriefDesc, $Hyperlink, $BigText, $SnoteID);
			show_snote_structure($RootID,$RootID,1,$mode,"",100, 1);
			break;
		case "selectedit":
			show_snote_structure($RootID,$RootID,1,$mode,"edit",$MaxLevel,1);
			break;
		case "edit":
			edit_snote($Name, $BriefDesc, $Hyperlink, $BigText, $SnoteID);
			show_snote_structure($RootID,$RootID,1,$mode,"",100, 1);
			break;
		case "selectdelete":
			show_snote_structure($RootID,$RootID,1,$mode,"del",100, 1);
			break;
		case "del":
			delete_snote($SnoteID);
			show_snote_structure($RootID,$RootID,1,$mode,"",100, 1);
			break;
		case "selectmove":
			show_snote_structure($RootID,$RootID,1,$mode,"movewhat",$MaxLevel,1);
			break;
		case "movewhat":
			show_snote_structure(1,1,1,$mode,"movewhere",$MaxLevel,$SnoteID);
			break;
		case "movewhere":
			move_snote($MoveWhat, $SnoteID);
			show_snote_structure(1,1,1,$mode,"",100, 1);
			break;
		}

?>
</span>
</body>
</html>

Return current item: SimpleNotes