Source for file logo.php

Documentation is available at logo.php

  1. <?php
  2. /**
  3. * Defining logo path for the first time
  4. @author Gabriele Droege, DNA Bank Network <contact@dnabank-network.org>
  5. @version 2.0
  6. @package First_Steps
  7. @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
  8. @filesource
  9. @license http://www.mozilla.org/MPL/ MPL
  10. */
  11. $config true;
  12.     /**
  13.     * calling connection to database
  14.     */
  15.     include ("config/head.php");
  16.  
  17.     /**
  18.     * calling authorisation script
  19.     */
  20.     include ("auth.php");
  21. ?>
  22. <html>
  23.  
  24. <head>
  25. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  26. <title>DNA Bank Network - First Steps</title>
  27. <link rel="stylesheet" type="text/css" href="format.css">
  28. <link rel="stylesheet" type="text/css" href="XSLT/Styles.css">
  29. <SCRIPT LANGUAGE="JavaScript1.1" src="Functions.js"></SCRIPT>
  30. <NOSCRIPT>Please enable Javascript!</NOSCRIPT>
  31. </head>
  32.  
  33. <body>
  34. <div align="center">
  35. <form name="formular" method="POST" action="logo.php">
  36. <table id="tablemain" border="0" class="main">
  37.     <tr>
  38.   <td id="tdLogo"><a href="http://www.dnabank-network.org/Wiki/index.php/Installation#First_steps" target="_blank"><img border="0" src="images/Logo-Wiki.png"></a></td>
  39.         <td id="tdtitle">
  40.         <h1>Welcome to the DNA Module - First Steps</h1></td>
  41.     <td id="tdLogo2"><?php 
  42.     
  43.     if($formSubmitSave{
  44.     $Logopath $_REQUEST['logopath'];
  45.     if($Logopath != ""{echo "<img src='$Logopath' height='78' />"}
  46.     else {  echo "Your logo will be placed here later during cofiguration."}}
  47.     else {
  48.     /**
  49.     * try to load xml-parser for general settings (logo path, load/loadconfig.php), if not successful display message that logo will be placed here later during configuration
  50.     */
  51.     include("load/loadconfig.php")if($Path_Logo != ""{echo $Path_Logo}
  52.     else {  echo "Your logo will be placed here later during cofiguration."}}?></td>
  53.     </tr>
  54.     <tr>
  55.         <td colspan="3" valign="top">
  56.         <table border="0" id="table2">
  57.     <tr><td colspan="2"><h2>Step 5: Define logo path</h2></td><td align="right"><a href="user.php" class="black">Go back to step 5</a></td></tr>
  58.     <tr><td colspan="3">
  59.     <div id="note">
  60.     Please define path of your institution logo. Ask your administrator for help if you want to load the image file in DNA Module folder. <br /></div>
  61.    </td></tr>
  62.  
  63. <?php 
  64.     /********************************************************************************************
  65.     * check, if user is logged in as administrator, if not check if any user exists in database *
  66.     *********************************************************************************************/
  67. if (!isset($_SESSION['admin']|| !$_SESSION['admin']{
  68.  
  69. $sql"SELECT ID_User FROM user";
  70. $result mysql_query($sql);
  71. if(mysql_num_rows($result1{                        
  72. $TestAdmin false;
  73. echo "<tr><td colspan='3'><span class='error'>Sorry, you have no permission for editing configuration parameters! Please login as administrator or contact an admin.</span></td></tr>"}
  74.  
  75. else
  76. $Test true}
  77. }
  78.  
  79. if($Test == "true" or (isset($_SESSION['admin']|| $_SESSION['admin'])) {
  80.  
  81. if($formSubmitSave{
  82.  
  83. if($_POST['logopath'== ""echo "<tr><td colspan='2'><span class='error'>Please enter logo path!</span></td></tr>"
  84. $test true}
  85.  
  86. if($test != true{
  87.     
  88.     /********************************************************************************************
  89.     * Saving logo path in an xml file (load/config.xml)                                         *
  90.     * further configurations (general settings) can be done via the Configuration Tool          *
  91.     * that's why except of logo path all xml tags left empty                                    *
  92.     * START                                                                                     *
  93.     *********************************************************************************************/
  94.     
  95. $file "load/config.xml";
  96.  
  97. $newfile fopen($file,"w+");
  98.  
  99.     $newxml '<?xml version="1.0" encoding="UTF-8"?>
  100.     <configuration>
  101.     <logopath>'.$_REQUEST['logopath'].'</logopath>
  102.     <currency></currency>
  103.     <priceperaliquot></priceperaliquot>
  104.     <standardvolume></standardvolume>
  105.     <prefix></prefix>
  106.     <backupaliquot></backupaliquot>
  107.     </configuration>'
  108. rewind($newfile);
  109. fwrite($newfile$newxml);
  110. fclose($newfile)}
  111.  
  112.  
  113.  echo "<tr><td colspan='3'><span class='fine'>Your logo should be placed on top right now.</span></td></tr>";  
  114.  
  115. }
  116.     /********************************************************************************************
  117.     * Saving logo path in an xml file (load/config.xml)                                         *
  118.     * END                                                                                       *
  119.     *********************************************************************************************/
  120.     
  121.     
  122.     if(file_exists("load/loadconfig.php")) {
  123.     /**
  124.     * Start page, try to load the xml file via load/loadconfig.php (xml-Parser)
  125.     */
  126.     include("load/loadconfig.php");      }       
  127.     
  128.    
  129.   echo "<tr><td id='DescriptionBlack'>Logo path:</td><td><input type='text' name='logopath' id='InputLong' value='".$Logo_Path."'/></td><td colspan='2'>Path of your institution logo.</td></tr>";
  130.   echo '<tr><td id="DescriptionBlack"></td><td><input type="submit" name="formSubmitSave" value="Save configuration" id="InputLong"/></td><td colspan="2"></td></tr>';  
  131. ?>
  132.    
  133.    
  134.             </table>
  135.         </td>
  136.     </tr>
  137.   <tr><td colspan="3"><div id="note">Main configuration steps are done now. Thank you very much for your time and now enjoy the <a href="index.php" class="red">DNA Module</a>.</div></td></tr>
  138. </table>
  139. <?php
  140.     /**
  141.     * including footer
  142.     */
  143.     include("footer.php")?>
  144. </div>
  145. </form>
  146. </body>
  147.  
  148. </html>

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