Source for file generalsettings.php

Documentation is available at generalsettings.php

  1. <?php
  2. /**
  3. * General Settings
  4. * <br/><br/>
  5. * Script for defining the general setting of DNA Module
  6. * <br/><br/>
  7. * Access for administrators and members of group "Management"
  8. @author Gabriele Droege, DNA Bank Network <contact@dnabank-network.org>
  9. @version 2.0
  10. @package Configuration
  11. @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
  12. @filesource
  13. @license http://www.mozilla.org/MPL/ MPL
  14. */
  15.  
  16.     /**
  17.     * calling connection to database
  18.     */
  19.     include ("../config/head.php");
  20.  
  21.     /**
  22.     * calling authorisation script
  23.     */
  24.     include ("../auth.php");
  25. ?>
  26. <html>
  27.  
  28. <head>
  29. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  30. <title>DNA Module - Settings</title>
  31. <link rel="stylesheet" type="text/css" href="../format.css">
  32. <link rel="stylesheet" type="text/css" href="../input/XSLT/Styles.css">
  33. <SCRIPT LANGUAGE="JavaScript1.1" src="../Functions.js"></SCRIPT>
  34. <NOSCRIPT>Please enable Javascript!</NOSCRIPT>
  35.  
  36. </head>
  37.  
  38. <body>
  39. <form name="formular" method="POST" action="generalsettings.php">
  40. <div align="center">
  41.  
  42. <?php
  43.  
  44.     /**
  45.     * including navigation menu
  46.     */
  47.     include("../tablenavi.php")?>
  48.  
  49. <table id="tablemain" class="main">
  50. <tr>
  51. <td id="tdLogo"><a href="<?php echo $Path_Wiki."/Installation#First_steps"?>" target="_blank"><img border="0" src="../images/Logo-Wiki.png" width="123"></a></td>
  52.         <td id="tdtitle">
  53.         <h1>General Settings</h1></td>
  54.     <td id="tdLogo2"><?php echo $Path_Logo?></td>
  55.     </tr>
  56.   <tr>
  57.     <td colspan="4"><?php
  58.     echo "Logged in as: ";
  59.     $log $_SESSION["log"];
  60.     $ID $_SESSION["log2"];
  61.     echo $log;
  62.     ?></td>
  63.   </tr>    
  64.     <tr>
  65.         <td colspan="3" valign="top">
  66.         <table border="0 id="table2">
  67.     <?php
  68.     
  69.     /**
  70.     * message permission denied for non administrators or managers
  71.     */
  72.     
  73.      if (!isset($_SESSION['admin']&& !$_SESSION['admin'&& !isset($_SESSION['management']&& !$_SESSION['management'])
  74.  echo '<tr>
  75.       <td id="DescriptionBlack" colspan="2"></td>';
  76.       include("../No_permission.php");
  77.       echo '</td></tr>'
  78.     
  79.     else {
  80.  
  81.     /********************************************************************************************
  82.     * rewriting of xml file ../load/config.xml with new parameters                              *
  83.     * START                                                                                     *
  84.     *********************************************************************************************/
  85.     
  86.     
  87.     if($_POST['formSubmitSave']{
  88.    
  89.     
  90.     $file1 "../load/config.xml";
  91.  
  92.     $newfile1 fopen($file1,"w+");
  93.  
  94.     $newxml1 '<?xml version="1.0" encoding="UTF-8"?>
  95.     <configuration>
  96.     <logopath>'.$_REQUEST['logopath'].'</logopath>
  97.     <logopathalternative>../'.$_REQUEST['logopath'].'</logopathalternative>
  98.     <currency>'.$_REQUEST['currency'].'</currency>
  99.     <standardvolume>'.$_REQUEST['standardvolume'].'</standardvolume>
  100.     <priceperaliquot>'.$_REQUEST['priceperaliquot'].'</priceperaliquot>
  101.     <prefix>'.$_REQUEST['prefix'].'</prefix>
  102.     <backupaliquot>'.$_REQUEST['backupaliquot'].'</backupaliquot>
  103.     </configuration>'
  104.     rewind($newfile1);
  105.     fwrite($newfile1$newxml1);
  106.     fclose($newfile1)
  107.  
  108.     $file2 "../load/smtp.xml";
  109.  
  110.     $newfile2 fopen($file2,"w+");
  111.  
  112.     $newxml2 '<?xml version="1.0" encoding="UTF-8"?>
  113.     <smtp>
  114.     <path>'.$_REQUEST['path'].'</path>
  115.     <port>'.$_REQUEST['port'].'</port>
  116.     <mail>'.$_REQUEST['emailadmin'].'</mail>
  117.     </smtp>'
  118.     rewind($newfile2);
  119.     fwrite($newfile2$newxml2);
  120.     fclose($newfile2)
  121.  
  122.     }
  123.     
  124.     /********************************************************************************************
  125.     * rewriting of xml file ../load/config.xml with new parameters                              *
  126.     * END                                                                                       *
  127.     *********************************************************************************************/
  128.     
  129.     /********************************************************************************************
  130.     * start page                                                                                *
  131.     * loading configurations for DNA Module, include xml-parser (and xml file) and              *
  132.     * smtp settings from DNA_MODULE_PATH/load/                                                  *
  133.     * START                                                                                     *
  134.     *********************************************************************************************/
  135.     
  136.     /**
  137.     * loading configurations for DNA Module from DNA_MODULE_PATH/load/ (xml file)
  138.     */
  139.     
  140.     include("../load/loadconfig.php");
  141.     
  142.     /**
  143.     * loading smtp settings from DNA_MODULE_PATH/load/ (xml file)
  144.     */
  145.      
  146.     include("../load/loadsmtp.php");
  147.     ?>
  148.     <tr><td colspan="3"><h3>Requests:</h3></td></tr>
  149.          <tr>
  150.                 <td id="DescriptionBlack">
  151.                 Price per Aliquot:</td>
  152.                 <td colspan="2">
  153.         <input name="priceperaliquot" id="SelectLong" type="text" value="<?php echo $PricePerAliquot?>"/></td>
  154.     </tr>
  155.     <tr>
  156.                 <td id="DescriptionBlack">
  157.                 Currency:</td>
  158.                 <td colspan="2">
  159.         <input name="currency" id="SelectLong" type="text" value="<?php echo $Currency?>"/></td>
  160.     </tr>
  161.     <tr>
  162.         <td id="DescriptionBlack">
  163.                 Standard Aliquot volume for shipping in Âµl:</td>
  164.                 <td colspan="2">
  165.         <input name="standardvolume" id="SelectLong" type="text" value="<?php echo $StandardVolume?>"/></td>
  166.     </tr>
  167.     <tr><td colspan="3"><h3>Input & Search:</h3></td></tr>
  168.          <tr>
  169.                 <td id="DescriptionBlack">
  170.                 Prefix DNA Extraction No:</td>
  171.                 <td colspan="2">
  172.         <input name="prefix" id="SelectLong" type="text" value="<?php echo $Prefix?>"/></td>
  173.     </tr>
  174.     <tr>
  175.                 <td id="DescriptionBlack">
  176.                 Backup Aliquot made:</td>
  177.                 <td colspan="2">
  178.         <select name="backupaliquot" id="SelectLong">
  179.         <option value="1" <?php if($BackupAliquot == "1"echo "selected"?>>Yes</option>
  180.         <option value="0" <?php if($BackupAliquot == "0"echo "selected"?>>No</option>
  181.         </select></td>
  182.     </tr>
  183.     <tr><td colspan="3"><h3>General:</h3></td></tr>
  184.     <tr>
  185.         <td id='DescriptionBlack'>
  186.         Logo path:</td>
  187.         <td>
  188.         <input type='text' name='logopath' id='InputLong' value='<?php echo $Logo_Path_Settings?>'/></td>
  189.         <td>Enter image path from root,<br />
  190.         e.g. for YOUR_DNA_MODULE_FOLDER/images/logo.png type "images/logo.png"</td>
  191.     </tr>
  192.     <tr>
  193.       <td id='DescriptionBlack'>SMTP path:</td>
  194.       <td><input type='text' name='path' id='InputLong' value='<?php echo $SMTP_Path?>'/></td>
  195.       <td>SMTP path of your email server.</td>
  196.     </tr>
  197.     <tr>
  198.       <td id='DescriptionBlack'>SMTP port:</td>
  199.       <td><input type='text' name='port' id='InputLong' value='<?php echo $SMTP_Port?>'/></td>
  200.       <td>SMTP port of your email server.</td></tr>
  201.     <tr>
  202.       <td id='DescriptionBlack'>Administrator email:</td>
  203.       <td><input type='text' name='emailadmin' id='InputLong' value='<?php echo $Email_Admin?>'/></td>
  204.       <td>Email of local administrator that works as sender of any information or error reporting emails related to the DNA Module.</td></tr>
  205.       <tr>
  206.         <td id="DescriptionBlack"></td>
  207.         <td>
  208.             <input type="submit" value="Save" name="formSubmitSave" id="SelectLong"></td>
  209.     </tr>    
  210.     
  211.     <?php 
  212.     
  213.     /********************************************************************************************
  214.     * start page                                                                                *
  215.     * loading configurations for DNA Module, include xml-parser (and xml file) and              *
  216.     * smtp settings from DNA_MODULE_PATH/load/                                                  *
  217.     * END                                                                                    *
  218.     *********************************************************************************************/
  219.     
  220.     ?>
  221.     
  222.             </table>
  223.         </td>
  224.     </tr>
  225.   <tr>
  226.       <td id="DescriptionBlack" colspan="2"></td>
  227.       <td align="right"><input type="button" value="Return to Configuration Tool" name="formSubmitMenu" id="SelectLong" onClick="self.location.href = 'configuration.php';"></td>
  228.     </tr>
  229. </table>
  230.  <?php
  231.     /**
  232.     * including footer
  233.     */
  234.     include ("../footer.php")?>
  235.     
  236. </form>
  237. </div>
  238. </body>
  239.  
  240. </html>

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