Jeg er lidt stødt på et problem. Nemlig sorteringen i adminmodulet. Denne driller også. Du kan se det her:
http://safetycar.dk/Kalender/kalender_view.phpJeg går ud fra at det er filen kalender_dml.php som har en fejl. Denne fil indeholder følgende:
<?php
// Data functions for table kalender
// This script and data application were generated by AppGini 2.61 on 11-02-2005 at 19:43:48
// Download AppGini for free from
http://www.bigprof.com/appgini/download/function insert()
{
global $HTTP_SERVER_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_POST_FILES, $Translation;
if(get_magic_quotes_gpc())
{
$dato = $HTTP_POST_VARS["datoYear"] . '-' . $HTTP_POST_VARS["datoMonth"] . '-' . $HTTP_POST_VARS["datoDay"];
$begivenhed = $HTTP_POST_VARS["begivenhed"];
}
else
{
$dato = $HTTP_POST_VARS["datoYear"] . '-' . $HTTP_POST_VARS["datoMonth"] . '-' . $HTTP_POST_VARS["datoDay"];
$begivenhed = addslashes($HTTP_POST_VARS["begivenhed"]);
}
if($begivenhed== ""){
echo StyleSheet() . "\n\n<div class=Error>" . $Translation["error:"] . " 'Begivenhed': " . $Translation['field not null'] . "</div>";
exit;
}
sql("insert into kalender (dato, begivenhed) values (" . (($dato != "") ? "'$dato'" : "NULL") . ", " . (($begivenhed != "") ? "'$begivenhed'" : "NULL") . ")");
return mysql_insert_id();
}
function delete($selected_id)
{
// insure referential integrity ...
global $Translation;
sql("delete from kalender where id='$selected_id'");
}
function update($selected_id)
{
global $HTTP_SERVER_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $Translation;
if(get_magic_quotes_gpc())
{
$dato = $HTTP_POST_VARS["datoYear"] . '-' . $HTTP_POST_VARS["datoMonth"] . '-' . $HTTP_POST_VARS["datoDay"];
$begivenhed = $HTTP_POST_VARS["begivenhed"];
}
else
{
$dato = $HTTP_POST_VARS["datoYear"] . '-' . $HTTP_POST_VARS["datoMonth"] . '-' . $HTTP_POST_VARS["datoDay"];
$begivenhed = addslashes($HTTP_POST_VARS["begivenhed"]);
}
sql("update kalender set " . "dato=" . (($dato != "") ? "'$dato'" : "NULL") . ", " . "begivenhed=" . (($begivenhed != "") ? "'$begivenhed'" : "NULL") . " where id='$selected_id'");
}
function form($selected_id = "", $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1)
{
// function to return an editable form for a table records
// and fill it with data of record whose ID is $selected_id. If $selected_id
// is empty, an empty form is shown, with only an 'Add New'
// button displayed.
global $Translation;
if(!$AllowInsert && $selected_id==""){ return ""; }
$code = "<br><table border=1 bordercolor=navy cellpadding=0 cellspacing=0><tr><td><div class=TableTitle>Detaljeret visning</div></td></tr><tr><td><table>";
$code .= "\n\t<tr><td colspan=2></td><td rowspan=7 valign=top>";
if($AllowInsert)
$code .= "<div><input type=image src=insert.gif name=insert alt='" . $Translation["add new record"] . "'></div>";
// combobox: dato
$combo_dato = new DateCombo;
$combo_dato->DateFormat = "dmy";
$combo_dato->MinYear = 1900;
$combo_dato->MaxYear = 2100;
$combo_dato->DefaultDate = date("Y-m-d");
$combo_dato->MonthNames = $Translation['month names'];
$combo_dato->CSSOptionClass = 'Option';
$combo_dato->CSSSelectedClass = 'SelectedOption';
$combo_dato->NamePrefix = 'dato';
if($selected_id)
{
$res = sql("select * from kalender where id='$selected_id'");
$row = mysql_fetch_array($res);
$combo_dato->DefaultDate = $row["dato"];
$code .= "<br>";
if($AllowUpdate)
$code .= "<div><input type=image src=update.gif vspace=1 name=update alt='" . $Translation["update record"] . "'></div>";
if($AllowDelete)
$code .= "<div><input type=image src=delete.gif vspace=1 name=delete alt='" . $Translation["delete record"] . "' onclick='return confirm(\"" . $Translation["are you sure?"] . "\");'></div>";
$code .= "<div><input type=image src=deselect.gif vspace=1 name=deselect alt='" . $Translation["deselect record"] . "'></div>";
}
$code .= "</td></tr>";
// Detail view form fields
/* $code .= "\n\t<tr><td class=TableHeader valign=top><div class=TableHeader style='text-align:right;'>Id</div></td><td class=TableBody width=300>" . $row['id'] . " </td></tr>";
*/ $code .= "\n\t<tr><td class=TableHeader valign=top><div class=TableHeader style='text-align:right;'>Dato</div></td><td class=TableBody width=300>" . $combo_dato->GetHTML() . " </td></tr>";
$code .= "\n\t<tr><td class=TableHeader valign=top><div class=TableHeader style='text-align:right;'><b class='Error'>" . $Translation['*'] . "</b> Begivenhed</div></td><td class=TableBody width=300><textarea class=TextBox name=begivenhed cols=50 rows=6>" . htmlspecialchars($row["begivenhed"], ENT_QUOTES) . "</textarea> </td></tr>";
$code .= "</table></td></tr></table>";
return $code;
}
?>
Hygge
P.S. Nu hvor det ikke var en del af det oprindelige spørgsmål smider jeg en sjat point mere i puljen :)