Posted By

onefastsnail on 05/24/12


Tagged


Versions (?)

ifs admin


 / Published in: Other
 

  1. <?
  2.  
  3. if($_REQUEST['article']<>0){
  4.  
  5. $display_form = true;
  6. $section = new newssection();
  7.  
  8. if($_REQUEST['action']=="update"){
  9.  
  10. $errors = array();
  11.  
  12. if(sizeof($errors)==0){
  13.  
  14. if($_REQUEST["section"]<>0){
  15. $section->id = clean_db($_REQUEST["section"]);
  16. }
  17.  
  18. $section->title = clean_db($_POST["title"]);
  19. $section->text1 = clean_db($_POST["text1"]);
  20. $section->text2 = clean_db($_POST["text2"]);
  21.  
  22. $section->save();
  23.  
  24. }
  25. else {
  26. //do something with errors
  27. }
  28.  
  29. }
  30.  
  31. if($_REQUEST['action']=="delete"){
  32.  
  33. }
  34.  
  35. if($display_form){ ?>
  36.  
  37. <h1>Amend <?=($section->id<>0)? "<u>".$section->title."</u>" : "";?>Section</h1>
  38. <p>If one column is used then it will expand full width else a two column layout will be used.</p>
  39. <form action="" method="post">
  40.  
  41. <div class="frow"><label>Title</label><input type="text" name="title" value="<?=$section->title;?>"/></div>
  42. <div class="frow"><label>Text 1</label><textarea name="text1"><?=$section->text1;?></textarea></div>
  43. <div class="frow"><label>Text 2</label><textarea name="text2"><?=$section->text21;?></textarea></div>
  44.  
  45. <div class="frow"><label>&nbsp;</label>
  46. <input type="hidden" name="section" value="<?=$section->id;?>"/>
  47. <input type="hidden" name="action" value="update"/>
  48. <input type="hidden" name="article" value="<?=$_REQUEST["article"];?>"/>
  49. <input type="submit" name="submit" value="Submit"/></div>
  50. </form>
  51.  
  52.  
  53. <? }
  54.  
  55.  
  56.  
  57. }
  58. else { ?>
  59. <p>The related article could not be found.</p>
  60. <? } ?>

Report this snippet  

You need to login to post a comment.