Ejemplo n.º 1
0
<?php

include 'functions.inc';
openHTML("Edit Memo", "memos Palm");
$db = openDatabase('myToDo');
$id = $_GET['item'];
echo "<p>Item: " . $id . "</p>\n";
$q1 = "SELECT A.`title`,A.`content`,A.`category`,B.`color` " . "FROM `memos` A, `categories` B " . "WHERE A.`memo_id`=" . $id . " AND  A.`category` = B.`cat_id`";
//echo "<p>[" . $q1 . "]</p>\n";
$r1 = getResult($q1, $db);
$row = mysql_fetch_row($r1);
echo "<form name=\"memo\" method=\"post\" action=\"memo2.php?item=" . $id . "\">\n";
echo "<b><input type=\"text\" name=\"title\" size=\"34\" value=\"" . $row[0] . "\" style=\"background-color: " . $row[3] . "; \" /></b>\n";
echo "<textarea name=\"content\" cols=\"36\" rows=\"40\">\n";
echo $row[1] . "\n";
echo "</textarea><br />\n";
echo "<p>&nbsp;</p>\n<center>\n";
echo "<input type=\"submit\" value=\"Submit\" style=\"font-size: 28pt; \">\n";
echo "<p>&nbsp;</p>\n";
echo "<a href=\"memo.php\">Back to list</a>\n";
echo "<p>&nbsp;</p>\n";
echo "</form>\n";
closeHTML();
Ejemplo n.º 2
0
<?php

include 'functions.inc';
openHTML("Memos", "memos Palm");
$db = openDatabase('myToDo');
// If category passed in display only that category
if (isset($_GET['category'])) {
    $category = $_GET['category'];
    $SelectCat = " AND `category`=" . $category;
} else {
    $SelectCat = "";
}
echo "<p></p>\n";
// Display memo items
echo "<div id=\"head\">\n";
echo "<h1><center>Memos</center></h1>\n</div>\n";
echo "  <table width=100%>\n";
echo "    <tr><th>ID</th><th>Title</th></tr>\n";
$q1 = "SELECT A.memo_id,A.title,B.color" . " FROM `memos` A, categories B" . " WHERE A.category = B.cat_id" . $SelectCat . " ORDER BY A.`updated` DESC" . " LIMIT 0,10";
$result = getResult($q1, $db);
while ($myrow = mysql_fetch_row($result)) {
    echo "    <tr style=\"background-color: " . $myrow[2] . "; height: 28pt; \" valign=\"middle\">\n";
    echo "      <td align=\"center\" style=\"font-size: 28pt; \">" . $myrow[0] . "</td>\n      <td><a href=\"memo1.php?item=" . $myrow[0] . "\">" . $myrow[1] . "</a></td>\n";
    echo "    </tr>\n";
}
echo "  </table>\n";
echo "\n";
echo "  <hr />\n";
// List categories with self link filtered by category
echo "  <div id=\"head\"><h1><center>Categories</center></h1></div>\n";
echo "  <table width=\"100%\">\n";
Ejemplo n.º 3
0
<?php

include 'functions.inc';
openHTML("New memo", "memos Palm");
$db = openDatabase('myToDo');
echo "<form name=\"memo\" method=\"post\" action=\"memo4.php \">\n";
echo "<b>Title:</b><br />\n";
echo "<b><br /><input type=\"text\" name=\"title\" size=\"34\" /></b>\n";
echo "<br />Category:<br />\n";
$q1 = "SELECT `cat_id`,`name`,`color` FROM `categories`";
$r1 = getResult($q1, $db);
echo "<select name=\"category\" type=\"select\">\n";
while ($row1 = mysql_fetch_row($r1)) {
    echo "  <option value=\"" . $row1[0] . "\" style=\"background-color:" . $row1[2] . ";\"";
    if ($row1[0] == "4") {
        echo " selected=\"selected\"";
    }
    echo " >" . $row1[1] . "</option>\n";
    //      echo "  <option value=\"" . $row1[0] . "\" >";
    //      echo $row1[1];
    //      echo "</option>\n";
}
echo "</select>\n";
echo "<br /><b>Contents:</b><br />\n";
echo "<textarea name=\"content\" cols=\"36\" rows=\"40\">\n";
//echo $row[1] . "\n";
echo "</textarea><br />\n";
echo "<p>&nbsp;</p>\n<center>\n";
echo "<input type=\"submit\" value=\"Submit\" style=\"font-size: 28pt; \">\n";
echo "<p>&nbsp;</p>\n";
echo "<a href=\"memo.php\">Back to list</a>\n";
Ejemplo n.º 4
0
<?php

include 'functions.inc';
openHTML("To-Do List", "ToDo");
$db = openDatabase('myToDo');
// Get item number to display
$item = $_GET['item'];
// Conntect to server
echo "<p>\n";
echo "</p>\n";
$q1 = "SELECT `due`,`priority`,`category`,`predecessor`,`hours`," . "`percent`,`short_desc`,`description`,`comment`,`item_id`,`predecessor`" . " FROM `todo_items`" . " WHERE `item_id`=" . $item;
$result = getResult($q1, $db);
$row = mysql_fetch_row($result);
echo "<form name=\"edit1\" method=\"post\" action=\"todo2.php?item=" . $row[9] . "\">\n";
echo "<table width=\"100%\" border=\"1\">\n";
// To-Do item number (item_id)
echo "<tr><th align=\"right\">ID</th>";
echo "<td id=\"id\"><b>" . $row[9] . "</b></font></td></tr>\n";
// Short description (short_desc)
echo "<tr><th align=\"right\">Item</th>";
echo "<td>" . $row[6] . "</td></tr>\n";
// Date due (due)
echo "<tr><th align=\"right\">Due</th>";
$dueyr = substr($row[0], 0, 4);
$duemo = substr($row[0], 5, 2);
$dueda = substr($row[0], 8, 2);
//echo "<td>" . $row[0] . "</td></tr>\n";
echo "<td>";
echo "<select name=\"dueyr\" value=\"" . $dueyr . "\" >\n";
echo "<option>" . $dueyr . "</option>\n";
echo "<option>2010</option>\n";