Source for file new_tissue.php

Documentation is available at new_tissue.php

  1. <?php
  2. /**
  3. * Input new tissue
  4. * <br/><br/>
  5. * Access to all user except of guests
  6. @author Gabriele Droege, DNA Bank Network <contact@dnabank-network.org>
  7. @version 2.0
  8. @package Input
  9. @copyright Copyright © 2011 DNA Bank Network http://www.dnabank-network.org<br>The contents of this file are subject to the Mozilla Public License Version 1.1
  10. @filesource
  11. @license http://www.mozilla.org/MPL/ MPL
  12. */
  13.  
  14.     /**
  15.     * calling connection to database
  16.     */
  17.     include ("../config/head.php");
  18.  
  19.     /**
  20.     * calling authorisation script
  21.     */
  22.     include ("../auth.php");
  23. ?>
  24. <html>
  25.  
  26. <head>
  27. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  28. <title>DNA Module - Add New Tissue</title>
  29. <link rel="stylesheet" type="text/css" href="../format.css">
  30. <SCRIPT LANGUAGE="JavaScript1.1" src="../Functions.js"></SCRIPT>
  31. <NOSCRIPT>PLease enable Javascript!</NOSCRIPT>
  32.  
  33. </head>
  34. <body>
  35. <div align="center">
  36. <?php 
  37.   /**
  38.   * including navigation menu
  39.   */
  40. include("../tablenavi.php")?>
  41. <form name="formular" method="POST" action="new_tissue.php"> 
  42. <table id="tablemain" class="main">
  43. <tr>
  44.   <td id="tdLogo"><a href="<?php echo $Path_Wiki."/Features#Input"?>" target="_blank"><img border="0" src="../images/Logo-Wiki.png" height="78"></a></td>
  45.         <td id="tdtitle">
  46.         <h1>Add New Tissue</h1></td>
  47.     <td id="tdLogo2"><?php echo $Path_Logo?></td>
  48.     </tr>
  49.   <tr>
  50.   <td><?php
  51.     echo "Logged in as: ";
  52.     $log $_SESSION["log"];
  53.     echo $log;
  54.  
  55.     ?></td>
  56.   </tr>
  57. <tr>
  58. <td valign="top" align="center" valign="middle" colspan="3">
  59. <table id="table" width="70%" border="0" style="margin:30 0 0 0">
  60. <tr>
  61. <td align="center" colspan="2">
  62. <?php
  63. if (isset($_SESSION['guest']|| $_SESSION['guest']{
  64.     /********************************************************************************************
  65.     * Guests don't have permission for entering new DNA data                                    *
  66.     *********************************************************************************************/
  67. echo "<tr><td colspan='3'><span class='error'>Sorry, as a guest you don't have permission for entering new data! If you want to search for existing DNA data please use the Search function!</span></td></tr>"}
  68.  
  69. else {
  70.  
  71.  
  72.  
  73. if($formSubmitSave)
  74. {  
  75.  
  76.   if(empty($formNewTissue))
  77.     unset($formNewTissue)}
  78.  
  79.   else 
  80.   {
  81.      $resultmysql_query ("SELECT ID_Tissue, Tissue FROM tissue " .
  82.                             "WHERE Tissue = '$formNewTissue'");
  83.   
  84.      if(mysql_num_rows($result))
  85.        {  
  86.        echo "<span class='error'>Tissue already exists!</span>";
  87.        }
  88.  
  89.      else    
  90.        {
  91.         $result "INSERT INTO tissue (Tissue, Created_Who)" .
  92.                           "VALUES ('$formNewTissue','$log')";  
  93.         $sql mysql_query($result);
  94.  
  95. #######################################Error 1###############################################################
  96.  
  97. if(!$sql)
  98. $msg $result."\n";
  99.   $msg .= "####Error 1####";
  100.   trigger_error($msgE_USER_ERROR);
  101.   /**
  102.   * calling Error message
  103.   */
  104.   include ("Errorreport.php");   }
  105.   
  106. #############################################################################################################
  107.  
  108.         else {
  109.         echo "<span class='fine'>Changes accepted!</span>"}                            
  110.        }
  111.    }
  112. }//if ($formSubmitSave)
  113.  
  114. ?>
  115. <table border="1" style="margin:0 0 0 0">
  116.  
  117. <?php
  118.  
  119. $resultmysql_query ("SELECT * FROM tissue " .
  120.                       "ORDER BY Tissue");
  121.       
  122. $num_rows mysql_num_rows($result);
  123.  
  124. if($num_rows 0{
  125.     echo"<th>Tissue</th><th>Created</th>";
  126.  
  127. while ($row mysql_fetch_object($result))
  128. {
  129.     echo "<tr><td align='center'>".$row->Tissue."</td><td>".$row->Created_Who." (".$row->Created_When.")</td></tr>";
  130. }}
  131.  
  132. ?>
  133. </table>
  134. </td></tr>
  135. <tr>
  136. <td id="Change">Add new tissue:</td><td><input type="text" name="formNewTissue"></td></tr>
  137. <tr>
  138. <td>
  139. </td>
  140. <td><input type="submit" id="button" name="formSubmitSave" value="Save New Tissue" style="float:left">
  141. </td>
  142. </tr>
  143. <tr>
  144. <td colspan="2"><input type="submit" id="button" name="formSubmitClose" value="Close Form" style="float:right" onclick="window.close();"></td>
  145. </tr>
  146. <tr><td colspan="2"><span class="error">Please refresh input/search mask after closing this form.</span></td></tr>
  147.  
  148. <?php ?>
  149. </table>
  150. </td>
  151. </tr>
  152. </table>
  153. <?php
  154.     /**
  155.     * including footer
  156.     */
  157.     include("../footer.php")?> 
  158.  
  159. </form>
  160. </div>
  161. </body>
  162. </html>

Documentation generated on Tue, 29 Nov 2011 10:44:58 +0100 by phpDocumentor 1.4.3