public function showUI() { tinymceinit(); ?> <br> <br> <fieldset> <legend> Ny anteckning </legend> <form method="POST" action="tidkoll.php"> <br/> <label for="rubrik"> Rubrik: </label> <input type="text" name="rubrik" id="rubrik"/><br/> <label for="anttyp">Typ: </label> <?php $this->db->QueryAndGenereateSelectList("anttyp", "anttyp", "id", "namn", 1); ?> <br/><br/> <label for="antecning"> Anteckning: </label><br><textarea rows="10" cols="80" name="anteckning" id="anteckning"></textarea> <input type="submit" name="skickanyant" value="Spara"/> </form> </fieldset> <br> <?php }
public function showUI() { $sql = "select anttyp,rubrik, innehall from anteckning where id={$this->anteckning}"; $res = $this->db->query($sql); $row = $res->fetchRow(); $anttyp = $row[0]; $rubrik = $row[1]; $innehall = $row[2]; tinymceinit(); ?> <br> <br> <fieldset> <legend> Redigera anteckning </legend> <form id="mysave" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <label for="rubrik"> Rubrik: </label> <input type="text" name="rubrik" id="rubrik" size=50 value="<?php echo $rubrik; ?> "/><br/><br/> <label for="anttyp"> Typ:</label> <?php $this->db->QueryAndGenereateSelectList("anttyp", "anttyp", "id", "namn", $anttyp); ?> <br><br> <label for="anteckning"> Anteckning: </label><br><textarea rows="40" cols="80" name="anteckning" id="anteckning"><?php echo $innehall; ?> </textarea> <input type="submit" name="skickaantred" value="Spara"/> <br/> <br/> <input type="submit" name="raderaant" value="Radera anteckning"/> </form> </fieldset> <br> <script type="text/javascript"> function mysave() { document.forms["myform"].submit(); } </script> <?php }