include ("data/data.php"); //include ("data/top.php"); $page = "index.php"; /* if ($logged_in!=1) { $query_string = str_replace('&','__',$HTTP_SERVER_VARS['QUERY_STRING']); $query_string = str_replace('=','++',$query_string); // echo "query: ".$query_string; header ("location: ".link_func($WWW_Host."ideas/login.php?redirect=$page&query_string=$query_string")); exit; } */ if(isset($_POST["action"])) { $action=$_POST["action"]; $id=$_POST["id"]; $cat_id=$_POST["ideas_category"]; if($action=="save") { $title=$_POST["title"]; $text=$_POST["text"]; if($id>0) { $Command = "update ideas set title='$title', text='$text', ideas_category_id=$cat_id where id=$id"; mysql_db_query($db,$Command); } else { $Command = "insert into ideas (state_id,ideas_category_id,title,text,created,modified) values(2,$cat_id,'$title','$text',now(),now())"; mysql_db_query($db,$Command); } header("location: ".$WWW_Host."ideas/index.php"); exit; } elseif ($action=="delete") { $Command="update ideas set state_id=5, modified=now() where id=$id"; mysql_db_query($db,$Command); header("location: ".$WWW_Host."ideas/index.php"); exit; } elseif ($action=="update") { $Command="select title,text,ideas_category_id from ideas where id=$id"; $res = mysql_db_query($db,$Command); $title = mysql_result($res,0,0); $text = mysql_result($res,0,1); $cat_id = mysql_result($res,0,2); } } ?>
"; echo $category .": | "; echo $title." | "; echo ""; echo " | "; echo ""; echo " |
"; echo $text; echo " | "; echo " | ||