Source for file inputdna.php

Documentation is available at inputdna.php

  1. <?php 
  2. /**
  3. * Input DNA data
  4. * <br/><br/>
  5. * form is used for entering new DNA data and editing exisiting DNA data
  6. * <br/><br/>
  7. * Access to all user except of guests
  8. @author Gabriele Droege, DNA Bank Network <contact@dnabank-network.org>
  9. @version 2.0
  10. @package Input
  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. if (isset($_SESSION['guest']&& $_SESSION['guest']{
  17.     /********************************************************************************************
  18.     * Guests don't have permission for entering new DNA data                                    *
  19.     *********************************************************************************************/
  20. echo "<tr><td colspan='3'><span class='error'>Sorry, as a guest you don't have permission for entering new DNA data! If you want to search for existing DNA data please use the Search function!</span></td></tr>"}
  21.  
  22. else ?>
  23.  
  24.  <tr><td colspan="6"><hr /></td></tr>
  25.         <tr><td colspan="6"><h6>DNA details</h6></td></tr>
  26.                 <tr>
  27.                 <td id="DescriptionBlack" valign="bottom">
  28.                 Extraction No</td>
  29.                 <td colspan="2">
  30.           <span id="Abstand">Last: </span><span id="Content">Load..</span><span id="Test"></span><br>
  31.                     <input type="text" id="InputLong" name="formDnaBankNumber" value="<?php 
  32.           
  33.           /********************************************************************************************
  34.           * $Validation is defined in script save.php                                                 *
  35.           *********************************************************************************************/
  36.           
  37.           if($formSubmitCarryForward
  38.             if($msg == "####Error in Save_Specimen.php####" or $Validation == "FALSE"echo $_POST['formDnaBankNumber']}
  39.               else $echoDNA $_POST['formDnaBankNumber'];
  40.                      $echoDNA++
  41.                      echo $echoDNA} }
  42.           if($formSubmitSave and $Validation == "FALSE"echo $_POST['formDnaBankNumber']}
  43.           if($formSubmitVerify
  44.             echo $_POST['formDnaBankNumber'];
  45.           if($formSubmitUpdateecho $DNA_Bank_Number}  
  46.           if(!$formSubmitCarryForward and !$formSubmitVerify and !$formSubmitUpdate
  47.           /********************************************************************************************
  48.           * $Prexif is defined in General setting                                                     *
  49.           *********************************************************************************************/
  50.           echo $Prefix}  
  51.           ?>"> *
  52.          </td>
  53.           <td id="DescriptionBlack" valign="bottom">
  54.         DNA Type</td>
  55.         <td colspan="2" valign="bottom">
  56.       <?php  
  57.          
  58.     if($formSubmitCarryForward or $formSubmitVerify$echoType $_POST['formType']}
  59.     if($formSubmitSave and $Validation == "FALSE"$echoType $_POST['formType']}
  60.     if($formSubmitUpdate$echoType $Type}
  61.     build_select_list("formType",
  62.                       "SELECT ID_Type, Type FROM dnatype " .
  63.                       "ORDER BY Type"$echoType);
  64.     ?>
  65.     </td>            </tr>
  66.     <tr><td><h4 class="background1">Relation to Voucher</h4></td>
  67.      <td colspan="6">
  68.         <?php
  69.     if($formSubmitCarryForward or $formSubmitVerify$echoRelation $_POST['formRelation']}
  70.     if($formSubmitSave and $Validation == "FALSE"$echoRelation $_POST['formRelation']}
  71.     if($formSubmitUpdate$echoRelation $Relation}
  72.     
  73.     build_select_list("formRelation",
  74.                       "SELECT ID_RelationDNA_Voucher, RelationDNA_Voucher FROM relationdna_voucher " .
  75.                       "ORDER BY ID_RelationDNA_Voucher"$echoRelation);
  76.     ?> *
  77.     </td><tr>
  78.     <tr><td id="DescriptionBlack">Tissue</td>
  79.     <td>    
  80.       <?php                                           
  81.     if($formSubmitCarryForward or $formSubmitVerify$echoTissue $_POST['formTissue']}
  82.     if($formSubmitSave and $Validation == "FALSE"$echoTissue $_POST['formTissue']}
  83.     if($formSubmitUpdate$echoTissue $Tissue}
  84.     
  85.     build_select_list("formTissue",
  86.                       "SELECT ID_Tissue, Tissue FROM tissue " .
  87.                       "ORDER BY Tissue"$echoTissue);
  88.     ?>
  89.     </td>
  90.     <td>
  91.         <a href="New_Tissue.php" target="blank"><img src="../images/add.png" title="Add new tissue"/></a>
  92.       </td>
  93.     <td id="DescriptionBlack">
  94.       Tissue material gone</td>
  95.         <td colspan="2"><input id="Checkbox" type="checkbox" name="c[]" value="SourceGone" <?php if($formSubmitUpdate and $Source_Gone{echo "checked";}  ?>>
  96.     </td></tr>
  97.     <tr><td id="DescriptionBlack">
  98.                 Preservation</td>
  99.                 <td>
  100.       <?php  
  101.     if($formSubmitCarryForward or $formSubmitVerify$echoPreservation $_POST['formPreservation']}
  102.     if($formSubmitSave and $Validation == "FALSE"$echoPreservation $_POST['formPreservation']}
  103.     if($formSubmitUpdate$echoPreservation $Preservation}
  104.     build_select_list("formPreservation",
  105.                       "SELECT ID_Preservation, Preservation FROM preservation " .
  106.                       "ORDER BY Preservation"$echoPreservation);
  107.     ?></td><td colspan="4">
  108.     <a href="New_Preservation.php" target="_blank"><img src="../images/add.png" title="Add new preservation method"/></a></td></tr>
  109.     <tr><td colspan="6"><h4 class="background1">Extraction</h4></td></tr>
  110.     
  111.     <tr><td id="DescriptionBlack">Extraction Date*</td>
  112.                 <td colspan="2"> <input type="text" id="InputLong" name="formExtractionDate" value="<?php if(($formSubmitCarryForward or $formSubmitVerifyand $_POST['formExtractionDate'!= "YYYY-MM-DD"echo $_POST['formExtractionDate']}
  113. if($formSubmitSave and $Validation == "FALSE" and $_POST['formExtractionDate'!= "YYYY-MM-DD"echo $_POST['formExtractionDate']}
  114.         if($formSubmitUpdate and $Extraction_Date != ""echo substr($Extraction_Date0-9)}
  115.         if($_POST['formExtractionDate'== "YYYY-MM-DD" or $Extraction_Date "" or ($_POST['formExtractionDate'== "" and !$formSubmitUpdate)) echo "YYYY-MM-DD"?>"></td>
  116.     
  117.                 <td id="DescriptionBlack">
  118.                 Extraction Date not available
  119.                 </td>
  120.  
  121.                 <td colspan="2">
  122.           <input type="checkbox" id="checkbox" value="1" name="formNoExtractDate" <?php if($formSubmitUpdate and $NoExtractDate{echo "checked";}  ?>   />
  123.                 </td>
  124.                 </tr>
  125.         <tr><td id="DescriptionBlack">Extraction Method*</td>
  126.         <td>                 
  127.       <?php                                           
  128.     if($formSubmitCarryForward or $formSubmitVerify$echoExtractionMethod $_POST['formExtractionMethod']}
  129.     if($formSubmitSave and $Validation == "FALSE"$echoExtractionMethod $_POST['formExtractionMethod']}
  130.     if($formSubmitUpdate$echoExtractionMethod $ExtractionMethod}
  131.     build_select_list("formExtractionMethod",
  132.                       "SELECT ID_Method, Method FROM extractionmethod " .
  133.                       "ORDER BY Method"$echoExtractionMethod);
  134.     ?></td><td>
  135.         <a href="New_Method.php" target="_blank"><img src="../images/add.png" title="Add new extraction method"/></a>
  136.         </td>
  137.                 <td id="DescriptionBlack">
  138.                     
  139.                 Extraction Staff*</td>
  140.                 <td colspan="2"> 
  141.                 
  142.                 <?php                                           
  143.     if($formSubmitCarryForward or $formSubmitVerify$echoExtractionStaff $_POST['formExtractionStaff']}
  144.     if($formSubmitSave and $Validation == "FALSE"$echoExtractionStaff $_POST['formExtractionStaff']}
  145.     if($formSubmitUpdate$echoExtractionStaff $ExtractionStaff}
  146.     build_select_list("formExtractionStaff",
  147.                       "SELECT DISTINCT ID_People, Name_All FROM people " .
  148.                       "WHERE ExtractionStaff = 'yes' " .
  149.                       "ORDER BY Name_All"$echoExtractionStaff);
  150.     ?>
  151.         <a href="New_People.php" target="_blank"><img src="../images/add.png" title="Add new extraction staff" /></a>
  152.                 </td>
  153.                 </tr>
  154.         <tr><td colspan="6"><h4 class="background1">Quality</h4></td></tr>        
  155.                 <tr>
  156.                 <td id="DescriptionBlack">
  157.                 Ratio of absorbance</td>
  158.                 <td colspan="3"> 
  159.                 <input type="text" id="InputShort" name="formAbsorbance280" onblur="NurZiffernundPunkt(this)" value="<?php if($formSubmitUpdateecho $Absorbance280}
  160. if($formSubmitSave and $Validation == "FALSE"echo $_POST['formAbsorbance280']}  ?>">
  161.         <a id="Black">OD<sub>260nm</sub>/OD<sub>280nm</sub></a>
  162.                 </td>
  163.         <td colspan="3"><input type="text" id="InputShort" name="formAbsorbance230" onblur="NurZiffernundPunkt(this)" value="<?php 
  164. if($formSubmitUpdateecho $Absorbance230}
  165. if($formSubmitSave and $Validation == "FALSE"echo $_POST['formAbsorbance230']}?>"> 
  166.         
  167.         <a id="Black">OD<sub>260nm</sub>/OD<sub>230nm</sub></a>
  168.         </td>
  169.         </tr>
  170.         <tr>
  171.                 <td id="DescriptionBlack">
  172.                 Concentration in &nbsp;ng/&#956;l</td>
  173.                 <td colspan="2"> 
  174.                  
  175.                 <input type="text" id="InputLong" name="formConcentration" onblur="NurZiffernundPunkt(this)" value="<?php
  176. if($formSubmitUpdateecho $Concentration}
  177. if($formSubmitSave and $Validation == "FALSE"echo $_POST['formConcentration']}
  178.  ?>"> 
  179.                 </td>
  180.         <td id="DescriptionBlack">
  181.                 Purification Method
  182.                 </td>
  183.  
  184.                 <td colspan="2">
  185.       <?php                                           
  186.     if($formSubmitCarryForward or $formSubmitVerify$echoPurificationMethod $_POST['formPurificationMethod']}
  187.     if($formSubmitSave and $Validation == "FALSE"$echoPurificationMethod $_POST['formPurificationMethod']}
  188.     if($formSubmitUpdate$echoPurificationMethod $Purification_Method;   }
  189.     build_select_list("formPurificationMethod",
  190.                       "SELECT ID_Purification, Method FROM purification " .
  191.                       "ORDER BY Method"$echoPurificationMethod);
  192.     ?>                
  193.         <a href="New_Purification.php" target="_blank"><img src="../images/add.png" title="Add new purification method" /></a>
  194.                 </td>
  195.                 </tr>
  196.                 <tr>
  197.                 <td id="DescriptionBlack">
  198.  
  199.                 Quality</td>
  200.                 <td colspan="2"> 
  201.       <?php                                           
  202.     if($formSubmitCarryForward or $formSubmitVerify$echoDegradation $_POST['formDegradation']}
  203.     if($formSubmitSave and $Validation == "FALSE"$echoDegradation $_POST['formDegradation']}
  204.     if($formSubmitUpdate$echoDegradation $Degradation;  }
  205.     build_select_list("formDegradation",
  206.                       "SELECT ID_Degradation, Degradation FROM degradation " .
  207.                       "ORDER BY Degradation"$echoDegradation);
  208.     ?>                                 
  209.         </td>
  210.                 <td id="DescriptionBlack">
  211.                 Quality Check Date</td>
  212.                 <td colspan="2"> 
  213.                  <input type="text" id="InputLong" name="formCheckDate" value="<?php if(($formSubmitCarryForward or $formSubmitVerifyand $_POST['formCheckDate'!= "YYYY-MM-DD"echo $_POST['formCheckDate']}
  214. if($formSubmitSave and $Validation == "FALSE" and $_POST['formCheckDate'!= "YYYY-MM-DD"echo $_POST['formCheckDate']}
  215. if($formSubmitUpdate and $Check_Date != ""echo substr($Check_Date0-9);  }
  216. if($_POST['formCheckDate'== "YYYY-MM-DD" or $Check_Date == "" or ($_POST['formCheckDate'== "" and !$formSubmitUpdate)) echo "YYYY-MM-DD"?>">
  217.         </td>
  218.             <tr><td colspan="6"><h4 class="background1">GenBank or BOLD Entries</h4></td></tr>
  219.       <tr>
  220.       <td colspan="6">
  221.       <table border="0" width="100%" cellpadding="0" cellspacing="0">
  222.  
  223.       
  224.       
  225.  <?php   
  226.         /********************************************************************************************
  227.         * GenBank accessions                                                                        *
  228.         * START                                                                                     *
  229.         *********************************************************************************************/
  230.  
  231.         /********************************************************************************************
  232.         * Update a single record                                                                    *
  233.         * START                                                                                     *
  234.         *********************************************************************************************/
  235.  
  236.  if ($formSubmitUpdate{
  237.   
  238. $test mysql_num_rows($result4);
  239.  
  240. if(!mysql_num_rows($result4))
  241. {}
  242. else {
  243.    while($row mysql_fetch_object($result4))
  244.        {
  245.        $Test[$row->GenBankNumber;
  246.        $Test2[$row->Link;
  247.        $Test3[$row->GeneticLocus;
  248.        $ID_Amplification[$row->ID_Amplification;
  249.        $resultGeneticLocus[mysql_query("SELECT ID_GeneticLocus, GeneticLocus FROM geneticlocus " .
  250.                       "ORDER BY GeneticLocus");
  251.        $resultAmplificationStaff[mysql_query("SELECT ID_People, Name_All " .
  252.                       "FROM people " .
  253.                       "ORDER BY people.Name_All");
  254. }
  255.  
  256.  
  257. foreach($Test as $index => $GenBankTest)
  258. {
  259.  
  260.     $LinkTest $Test2[$index];
  261.     $GeneticLocusTest $Test3[$index];
  262.     $ID_AmplificationTest $ID_Amplification[$index];
  263.     $Resulttest $resultGeneticLocus[$index];
  264.    
  265.     
  266. echo "<tr><td id='DescriptionBlack'>Genetic Locus</td><td><select name='formGeneticLocus[".$index."]' id='SelectShortOne'><option value=''>--------";
  267. while($row=mysql_fetch_row($Resulttest)) 
  268.     {
  269.       $GeneticLocus_ID_GeneticLocus $row[0];
  270.       $GeneticLocus_GeneticLocus $row[1];
  271.       echo "<option value=\"$GeneticLocus_ID_GeneticLocus\"";
  272.       if($GeneticLocusTest == $GeneticLocus_GeneticLocusecho "selected "}
  273.       echo "$GeneticLocus_GeneticLocus <br>\n";
  274.     
  275.     echo "</select>&nbsp;<a href='New_GeneticLocus.php' target='_blank'><img src='../images/add.png' title='Add new Genetic Locus' /></a>\n";
  276.     mysql_free_result($Resulttest);
  277.     echo "</td><td>GenBank Acc.No/<br/>BOLD Process ID</td><td>";      
  278.     echo "<input type='text' id='InputLong' name='formGenBankNo[".$index."]' value='" $GenBankTest "'><input type='hidden' name='formAmplificationID[".$index."]' value='" $ID_AmplificationTest "'></td><td>Link</td><td><input type='text' id='InputLong' name='formLink[".$index."]' value='" $LinkTest "'></td></tr>";
  279.      
  280.        }  }  } //if ($formSubmitUpdate)
  281.  
  282.  
  283.       
  284.         /********************************************************************************************
  285.         * Update a single record                                                                    *
  286.         * END                                                                                       *
  287.         *********************************************************************************************/
  288.       
  289.       
  290.       
  291.       
  292.        if($formSubmitCarryForward or $formSubmitVerify or !$formSubmitUpdate
  293.  
  294.         /********************************************************************************************
  295.         * Entering a new record                                                                     *
  296.         * START                                                                                     *
  297.         *********************************************************************************************/
  298.         ?>
  299.       <tr>
  300.                  <td id="DescriptionBlack">
  301.               Genetic    Locus</td>
  302.                 <td>   <?php         
  303.         if($formSubmitSave and $Validation == "FALSE"$echoGeneticLocus $_POST['formGeneticLocus']}                                  
  304.     build_select_listShort("formGeneticLocus",
  305.                       "SELECT ID_GeneticLocus, GeneticLocus FROM geneticlocus " .
  306.                       "ORDER BY GeneticLocus"$echoGeneticLocus);
  307.     ?>  </td><td>&nbsp;&nbsp;<a href="New_GeneticLocus.php" target="_blank"><img src="../images/add.png"  title="Add new Genetic Locus"/></a></td>
  308.                 <td id="DescriptionBlack">
  309.                 GenBank Acc.No/<br />BOLD Process ID
  310.         <td>
  311.         <input type="text" id="InputLong" name="formGenBankNumber" value="<?php 
  312.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankNumber']}  ?>">
  313.         </td>
  314.                 <td id="DescriptionBlack">
  315.                 Link
  316.                 </td>
  317.                 <td><input type="text" id="InputLong" name="formGenBankLink" value="<?php 
  318.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankLink']}  ?>"></td></tr>
  319.        
  320.        <?php
  321.         /********************************************************************************************
  322.         * Entering a new record                                                                     *
  323.         * END                                                                                     *
  324.         *********************************************************************************************/
  325.  
  326.        
  327.              // if($formSubmitCarryForward or $formSubmitVerify) 
  328.          
  329.         /********************************************************************************************
  330.         * Entering further new records                                                              *
  331.         * START                                                                                     *
  332.         *********************************************************************************************/
  333.          
  334.          ?>
  335.          <tr>
  336.         <td colspan="7" align="right">
  337.        <b>add GenBank or BOLD Entries </b><input type="checkbox" id="checkbox" name="moreGenBank" onclick="document.getElementById('hiddenGenBankA').style.display = this.checked == true ? 'block':'none';"> 
  338.         </td>
  339.         </tr>
  340.         <tr>
  341.         <td colspan="7">
  342.         <table id="hiddenGenBankA" style="display:none" border="0" width="100%">
  343.         <tr>
  344.                 <td id="DescriptionBlack">
  345.                 Genetic Locus</td>
  346.                 <td>
  347.                 <?php              
  348.         if($formSubmitSave and $Validation == "FALSE"$echoGeneticLocusA $_POST['formGeneticLocusA']}                              
  349.     build_select_listShort("formGeneticLocusA",
  350.                       "SELECT ID_GeneticLocus, GeneticLocus FROM geneticlocus " .
  351.                       "ORDER BY GeneticLocus"$echoGeneticLocusA);
  352.     ?>
  353.                 </td>
  354.                 <td id="DescriptionBlack">
  355.                 GenBank Acc.No/<br />BOLD Process ID
  356.                 </td>
  357.         <td>
  358.                 <input type="text" id="InputLong" name="formGenBankNumberA" value="<?php 
  359.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankNumberA']}  ?>">
  360.                 </td>
  361.                 <td id="DescriptionBlack">
  362.                 Link
  363.                 </td>
  364.         <td>
  365.   <input type="text" id="InputLong" name="formGenBankLinkA" value="<?php 
  366.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankLinkA']}  ?>">
  367.                 </td>
  368.         </tr>
  369.         <tr>
  370.                 <td id="DescriptionBlack">
  371.                 Genetic Locus</td>
  372.                 <td>
  373.                 <?php
  374.         if($formSubmitSave and $Validation == "FALSE"$echoGeneticLocusB $_POST['formGeneticLocusB']}                                            
  375.     build_select_listShort("formGeneticLocusB",
  376.                       "SELECT ID_GeneticLocus, GeneticLocus FROM geneticlocus " .
  377.                       "ORDER BY GeneticLocus"$echoGeneticLocusB);
  378.     ?>
  379.                 </td>
  380.                 <td id="DescriptionBlack">
  381.                 GenBank Acc.No/<br />BOLD Process ID
  382.                 </td>
  383.         <td>
  384.                 <input type="text" id="InputLong" name="formGenBankNumberB" value="<?php 
  385.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankNumberB']}  ?>">
  386.                 </td>        
  387.                 <td id="DescriptionBlack">
  388.                 Link
  389.                 </td>
  390.         <td>
  391.                 <input type="text" id="InputLong" name="formGenBankLinkB" value="<?php 
  392.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankLinkB']}  ?>">
  393.                 </td>
  394.         </tr>
  395.         <tr>
  396.                 <td id="DescriptionBlack">
  397.                 Genetic Locus</td>
  398.                 <td>
  399.                 <?php                                           
  400.         if($formSubmitSave and $Validation == "FALSE"$echoGeneticLocusC $_POST['formGeneticLocusC']
  401.     build_select_listShort("formGeneticLocusC",
  402.                       "SELECT ID_GeneticLocus, GeneticLocus FROM geneticlocus " .
  403.                       "ORDER BY GeneticLocus"$echoGeneticLocusC);
  404.     ?>
  405.                 </td>
  406.                 <td id="DescriptionBlack">
  407.                 GenBank Acc.No/<br />BOLD Process ID
  408.                 </td>
  409.         <td>
  410.                 <input type="text" id="InputLong" name="formGenBankNumberC" value="<?php 
  411.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankNumberC']}  ?>">
  412.                 </td>        
  413.                 <td id="DescriptionBlack">
  414.                 Link
  415.                 </td>
  416.         <td>
  417.                 <input type="text" id="InputLong" name="formGenBankLinkC" value="<?php 
  418.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankLinkC']}  ?>">
  419.                 </td>
  420.         </tr>
  421.         <tr>
  422.                 <td id="DescriptionBlack">
  423.                 Genetic Locus</td>
  424.                 <td>
  425.                 <?php
  426.         if($formSubmitSave and $Validation == "FALSE"$echoGeneticLocusD $_POST['formGeneticLocusD']}                                            
  427.     build_select_listShort("formGeneticLocusD",
  428.                       "SELECT ID_GeneticLocus, GeneticLocus FROM geneticlocus " .
  429.                       "ORDER BY GeneticLocus"$echoGeneticLocusD);
  430.     ?>
  431.                 </td>
  432.                 <td id="DescriptionBlack">
  433.                 GenBank Acc.No/<br />BOLD Process ID
  434.                 </td>
  435.         <td>
  436.                 <input type="text" id="InputLong" name="formGenBankNumberD" value="<?php 
  437.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankNumberD']}  ?>">
  438.                 </td>        
  439.                 <td id="DescriptionBlack">
  440.                 Link
  441.                 </td>
  442.         <td>
  443.                 <input type="text" id="InputLong" name="formGenBankLinkD" value="<?php 
  444.         if($formSubmitSave and $Validation == "FALSE"echo $_POST['formGenBankLinkD']}  ?>">
  445.                 </td>
  446.         </tr>     
  447.         </table>
  448.         </td>
  449.         </tr>
  450.         </td>
  451.         </tr>
  452.         </table></tr>
  453.         
  454.         <?php     
  455.         /********************************************************************************************
  456.         * Entering further new records                                                              *
  457.         * END                                                                                       *
  458.         *********************************************************************************************/
  459.         /********************************************************************************************
  460.         * GenBank accessions                                                                        *
  461.         * END                                                                                       *
  462.         *********************************************************************************************/
  463.         
  464.         ?>
  465.  
  466. <tr><td colspan="6"><h4 class="background1">Notes</h4></td></tr>        
  467.             <tr>
  468.                     <td id="DescriptionBlack">
  469.                     DNA Sample Provided by</td>
  470.                     <td>
  471.       <?php                                           
  472.     if($formSubmitCarryForward or $formSubmitVerify$echoProvidedBy $_POST['formProvidedBy']}
  473.     if($formSubmitSave and $Validation == "FALSE"$echoProvidedBy $_POST['formProvidedBy']}
  474.     if($formSubmitUpdate$echoProvidedBy $ProvidedBy}
  475.     build_select_list("formProvidedBy",
  476.                       "SELECT DISTINCT ID_People, Name_All FROM people " .
  477.                       "WHERE Provider = 'yes' " .
  478.                       "ORDER BY Name_All"$echoProvidedBy);
  479.     ?>    
  480.     </td><td colspan="4"><a href="New_People.php" target="_blank"><img src="../images/add.png" title="Add new sample provider" /></a></td></tr>
  481.         <tr>
  482.                 <td id="DescriptionBlack">
  483.                 Block Until</td>
  484.                 <td colspan="2">
  485.                 <input type="text" id="InputLong" name="formBlockDate" value="<?php if(($formSubmitCarryForward or $formSubmitVerifyand $_POST['formBlockDate'!= "YYYY-MM-DD"echo $_POST['formBlockDate']
  486. if($formSubmitSave and $Validation == "FALSE" and $_POST['formBlockDate'!= "YYYY-MM-DD"echo $_POST['formBlockDate']}
  487. if($formSubmitUpdate and $Block_Until != ""echo substr($Block_Until0-9)}
  488. if($_POST['formBlockDate'== "YYYY-MM-DD" or $Block_Until == "" or ($_POST['formBlockDate'== "" and !$formSubmitUpdate)) echo "YYYY-MM-DD"?>">                 
  489.         </td>
  490.             <td id="DescriptionBlack">
  491.             Block in General</td>
  492.             <td colspan="2">
  493.       <input id="Checkbox" type="checkbox" name="c[]" value="BlockGeneral" <?php if($formSubmitUpdate and $Block_Generalecho "checked";}?>></td>
  494.         </tr>
  495.     <tr>
  496.     <td id="DescriptionBlack">
  497.     Remarks for Customers
  498.     </td>
  499.     <td colspan="2">
  500.     <textarea id="SelectLong" name="formNotes"><?php if($formSubmitUpdateecho $Notes
  501.   if($formSubmitSave and $Validation == "FALSE"echo $_POST['formNotes']}?></textarea>
  502.     </td>
  503.   <td id="DescriptionBlack">
  504.     Internal Remarks
  505.     </td>
  506.     <td colspan="2">
  507.     <textarea id="SelectLong" name="formNotesIntern"><?php if($formSubmitUpdateecho $Notes_Intern
  508.   if($formSubmitSave and $Validation == "FALSE"echo $_POST['formNotesIntern']}?></textarea>
  509.     </td>
  510.     </tr>
  511.   <tr><td colspan="6">
  512.   <table>
  513. <tr class="background1"><td><h4>Stock/Aliquots</h4></td><td align="center"><h4>Fridge/Rack/Box</h4></td><td align="center"><h4>Barcode</h4></td><td align="center"><h4>Position</h4></td><td align="center" width="120"><h4>Source volume (&micro;l)</h4></td><td align="center"><h4>Remaining volume (&micro;l)</h4></td></tr>      
  514.                 <tr>
  515.                 <td width="149" id="DescriptionBlack">
  516.                 Stock <?php echo $DNA_Bank_Number?></td>
  517.                 <td>
  518.       <?php        
  519.     if($formSubmitCarryForward or $formSubmitVerify$echoStockFridge $_POST['formStockFridge']}
  520.     if($formSubmitSave and $Validation == "FALSE"$echoStockFridge $_POST['formStockFridge']}
  521.     if($formSubmitUpdate$echoStockFridge $Stock_Fridge}
  522.     build_select_listShort("formStockFridge",
  523.                       "SELECT ID_Stock_Fridge, Stock_Fridge FROM stock_fridge " .
  524.                       "ORDER BY Stock_Fridge"$echoStockFridge);
  525.     ?>
  526.       <?php                                           
  527.     if($formSubmitCarryForward or $formSubmitVerify$echoStockRack $_POST['formStockRack']}
  528.     if($formSubmitSave and $Validation == "FALSE"$echoStockRack $_POST['formStockRack']}    
  529.     if($formSubmitUpdate$echoStockRack $Stock_Rack}    
  530.     build_select_listShortTwo("formStockRack",
  531.                       "SELECT ID_Stock_Rack, Stock_Rack FROM stock_rack " .
  532.                       "ORDER BY Stock_Rack"$echoStockRack);
  533.     ?>
  534.       <?php                                           
  535.     if($formSubmitCarryForward or $formSubmitVerify$echoStockBox $_POST['formStockBox']}
  536.     if($formSubmitSave and $Validation == "FALSE"$echoStockBox $_POST['formStockBox']}        
  537.     if($formSubmitUpdate$echoStockBox $Stock_Box}    
  538.     build_select_listShortTwo("formStockBox",
  539.                       "SELECT ID_Stock_Box, Stock_Box FROM stock_box " .
  540.                       "ORDER BY Stock_Box"$echoStockBox);
  541.     ?>
  542.      </td>
  543.     <td><input type="text" id="InputLong3" name="formBarcodeStock" value="<?php if($formSubmitUpdateecho $Stock_Barcode
  544.     if($formSubmitSave and $Validation == "FALSE"echo $_POST['formBarcodeStock']}    ?>"></td><td align="center"><input type="text" id="InputYear" name="formPositionStock" value="<?php if($formSubmitUpdateecho $Stock_Position
  545.     if($formSubmitSave and $Validation == "FALSE"echo $_POST['formPositionStock']}   
  546.     if($formSubmitCarryForward or $formSubmitVerifyecho $_POST['formPositionStock'];  }?>"></td><td align="center"><input type="text" id="InputDay" name="formStockQuantity" value="<?php if($formSubmitUpdateecho $Stock_Source_Volume
  547.     if($formSubmitSave and $Validation == "FALSE"echo $_POST['formStockQuantity']}     
  548.     if($formSubmitCarryForward or $formSubmitVerify)echo $_POST['formStockQuantity']}  ?>"/></td><td align="center"><input type="text" id="InputDay" name="formStockRest" value="<?php if($formSubmitUpdateecho $Stock_Rest_Volume}  
  549.     if($formSubmitSave and $Validation == "FALSE"echo $_POST['formStockRest']}   
  550.     if($formSubmitCarryForward or $formSubmitVerifyecho $_POST['formStockRest']?>"></td></tr>   
  551. <?php if(!$formSubmitUpdate{
  552.         ?>
  553.               <tr>
  554.                 <td id="DescriptionBlack">
  555.                 Aliquot</td>
  556.                 <td>
  557.       <?php                                           
  558.     if($formSubmitCarryForward or $formSubmitVerify$echoAliquotsFridge $_POST['formAliquotsFridge']}
  559.     if($formSubmitSave and $Validation == "FALSE"$echoAliquotsFridge $_POST['formAliquotsFridge']}    
  560.     build_select_listShort("formAliquotsFridge",
  561.                       "SELECT ID_Aliquots_Fridge, Aliquots_Fridge FROM aliquots_fridge " .
  562.                       "ORDER BY Aliquots_Fridge"$echoAliquotsFridge);
  563.     ?>
  564.       <?php                                           
  565.     if($formSubmitCarryForward or $formSubmitVerify$echoAliquotsRack $_POST['formAliquotsRack']}
  566.     if($formSubmitSave and $Validation == "FALSE"$echoAliquotsRack $_POST['formAliquotsRack']}    
  567.     build_select_listShortTwo("formAliquotsRack",
  568.                       "SELECT ID_Aliquots_Rack, Aliquots_Rack FROM aliquots_rack " .
  569.                       "ORDER BY Aliquots_Rack"$echoAliquotsRack);
  570.     ?>
  571.       <?php                                           
  572.     if($formSubmitCarryForward or $formSubmitVerify$echoAliquotsBox $_POST['formAliquotsBox']}
  573.     if($formSubmitSave and $Validation == "FALSE"$echoAliquotsBox $_POST['formAliquotsBox']}        
  574.     build_select_listShortTwo("formAliquotsBox",
  575.                       "SELECT ID_Aliquots_Box, Aliquots_Box FROM aliquots_box " .
  576.                       "ORDER BY Aliquots_Box"$echoAliquotsBox);
  577.     ?>
  578.      </td>
  579.      <?php
  580.      /*while($row = mysql_fetch_object($result7))
  581.      {
  582.          $Aliquots_Box = $row->Aliquots_Box;
  583.          $Aliquots_Rack = $row->Aliquots_Rack;
  584.          $Aliquots_Fridge = $row->Aliquots_Fridge;
  585.          $Aliquot_Number = $row->Aliquot_Number;
  586.          $Aliquot_Origin = $row->Aliquot_Origin;
  587.          $Aliquot_Rest = $row->Aliquot_Rest;
  588.          $Aliquot_Barcode = $row->Aliquot_Barcode;
  589.          $Aliquot_Position = $row->Aliquot_Position; } */?>
  590.      
  591.      
  592.     <td><input type="text" id="InputLong3" name="formBarcodeAliquot" value="<?php 
  593.     if(($formSubmitSave and $Validation == "FALSE"or $formSubmitCarryForwardecho $_POST['formBarcodeAliquot']?>"/></td><td align="center"><input type="text" id="InputYear" name="formPositionAliquot" value="<?php 
  594.     if(($formSubmitSave and $Validation == "FALSE"or $formSubmitCarryForwardecho $_POST['formPositionAliquot']?>"/></td><td align="center"><input type="text" id="InputDay" name="formQuantityAliquot" value="<?php 
  595.     if(($formSubmitSave and $Validation == "FALSE"or $formSubmitCarryForwardecho $_POST['formQuantityAliquot']?>"/></td><td align="center"><input type="text" id="InputDay" name="formAliquotRest" value="<?php 
  596.     if(($formSubmitSave and $Validation == "FALSE" or $formSubmitCarryForward)) echo $_POST['formAliquotRest']?>"/></td></tr>   
  597.  
  598.  
  599.         <?php 
  600.         //if(!$formSubmitUpdate)
  601.         
  602.         if($formSubmitUpdate{
  603.        while($row mysql_fetch_object($result7))
  604.        {         
  605.          $Test4[$row->Aliquots_Box;
  606.          $Test5[$row->Aliquots_Rack;
  607.          $Test6[$row->Aliquots_Fridge;
  608.          $Test7[$row->Aliquot_Number;
  609.          $Test8[$row->ID_Aliquots;
  610.          $Test9[$row->Aliquot_Origin;
  611.          $Test10[$row->Aliquot_Rest;
  612.          $Test11[$row->Aliquot_Barcode;
  613.          $Test12[$row->Aliquot_Position;
  614.          $resultBox[mysql_query("SELECT ID_Aliquots_Box, Aliquots_Box FROM aliquots_box " .
  615.                       "ORDER BY Aliquots_Box");
  616.          $resultRack[mysql_query("SELECT ID_Aliquots_Rack, Aliquots_Rack FROM aliquots_rack " .
  617.                       "ORDER BY Aliquots_Rack");
  618.          $resultFridge[mysql_query("SELECT ID_Aliquots_Fridge, Aliquots_Fridge FROM aliquots_fridge " .
  619.                       "ORDER BY Aliquots_Fridge");
  620.                       
  621.        }    
  622.        
  623. foreach($Test4 as $index => $BoxTest)
  624. {
  625.       $RackTest $Test5[$index];
  626.       $FridgeTest $Test6[$index];
  627.       $NumberTest $Test7[$index];
  628.       $IDAliquots $Test8[$index];
  629.       $SourceQuantity $Test9[$index];
  630.       $RestQuantity $Test10[$index];
  631.       $Barcode $Test11[$index];
  632.       $Position $Test12[$index];
  633.       $resultBoxTest $resultBox[$index];
  634.       $resultRackTest $resultRack[$index];
  635.       $resultFridgeTest $resultFridge[$index];            
  636.   
  637.  
  638. echo "<tr><td id='DescriptionBlack'>Aliquot ".$NumberTest."</td><td valign='top'>
  639.   <select name='formAliquotsFridge[".$index."]' id='SelectShortOne'><option value=''>--------";
  640.  
  641.     while($row=mysql_fetch_row($resultFridgeTest)) 
  642.     {
  643.       $Fridge_ID_Fridge $row[0];
  644.       $Fridge_Fridge $row[1];
  645.       echo "<option value=\"$Fridge_ID_Fridge\"";
  646.       if($FridgeTest == $Fridge_Fridgeecho "selected "}
  647.       echo "$Fridge_Fridge <br>\n";
  648.     
  649.     echo "</select>\n";
  650.     mysql_free_result($resultFridgeTest);
  651.  
  652.     echo "<input type='hidden' name='formLocationAliquotsID[".$index."]' value='" $IDAliquots "'><select name='formAliquotsRack[".$index."]' id='SelectShortTwo'><option value=''>--------";
  653.  
  654.     while($row=mysql_fetch_row($resultRackTest)) 
  655.     {
  656.       $Rack_ID_Rack $row[0];
  657.       $Rack_Rack $row[1];
  658.       echo "<option value=\"$Rack_ID_Rack\"";
  659.       if($RackTest == $Rack_Rackecho "selected "}
  660.       echo "$Rack_Rack <br>\n";
  661.     
  662.     echo "</select>\n";
  663.     mysql_free_result($resultRackTest);
  664.        
  665.     echo "<select name='formAliquotsBox[".$index."]' id='SelectShortTwo'><option value=''>--------";
  666.  
  667.     while($row=mysql_fetch_row($resultBoxTest)) 
  668.     {
  669.       $Box_ID_Box $row[0];
  670.       $Box_Box $row[1];
  671.       echo "<option value=\"$Box_ID_Box\"";
  672.       if($BoxTest == $Box_Boxecho "selected "}
  673.       echo "$Box_Box <br>\n";
  674.     
  675.     echo "</select>\n";
  676.     mysql_free_result($resultBoxTest);
  677.     echo "</td><td><input type='text' id='InputLong3' name='BarcodeAliquot[".$index."]' value='".$Barcode."'></td><td align='center'><input type='text' id='InputYear' name='PositionAliquot[".$index."]' value='".$Position."'></td><td align='center'><input type='text' id='InputDay' name='formSourceQuantity[".$index."]' value='".$SourceQuantity."'></td><td align='center'><input type='text' id='InputDay' name='formRestQuantity[".$index."]' value='".$RestQuantity."'></td></tr>";
  678.     
  679.  
  680.     }
  681.         }
  682.         ?>
  683.         
  684.         </table>
  685.         </td></tr>
  686.         
  687.         
  688.         <tr>
  689.       <td id="DescriptionBlack">Price per Aliquot
  690.       <?php if ($Currency != ''echo " in ".$Currency;?>
  691.       </td><td colspan="2"><input type="text" id="SelectLong" name="priceperaliquot" value="<?php if ($PricePerAliquot != '' and !$formSubmitCarryForwardecho $PricePerAliquot;
  692. else echo $_POST['priceperaliquot']}?>"></td>  
  693.       <td id="DescriptionBlack" >Backup Aliquot</td><td><input type="checkbox" id="checkbox" name="c[]" value="Backup" 
  694.       
  695.       <?php if($formSubmitUpdate and $Backup == '1'echo " checked";}  
  696.       if ($BackupAliquot == '1' and !$formSubmitCarryForwardecho " checked";?>
  697.       
  698.       ></td>
  699.       
  700.                  <td align="right"><b>add Aliquots </b><input type="checkbox" id="checkbox" name="Aliquot" onclick="document.getElementById('hiddenAliquot').style.display = this.checked == true ? 'block':'none';document.getElementById('hiddenAliquots').style.display = this.checked == true ? 'none':'block';" value="Aliquot">            
  701. </td>
  702.             </tr>        
  703.   <tr>
  704.   <td colspan="6">
  705.    <table border="0" style="display:none;" id="hiddenAliquot" width="100%">
  706.   <tr>
  707.   <td id="DescriptionBlack">Aliquot
  708.   </td>
  709.   <td width="201">
  710.   <?php                                          
  711.     build_select_listShort("x[]",
  712.                       "SELECT ID_Aliquots_Fridge, Aliquots_Fridge FROM aliquots_fridge " .
  713.                       "ORDER BY Aliquots_Fridge""");
  714.  
  715.                       "SELECT ID_Aliquots_Rack, Aliquots_Rack FROM aliquots_rack " .
  716.                       "ORDER BY Aliquots_Rack""");
  717.                                          
  718.                       "SELECT ID_Aliquots_Box, Aliquots_Box FROM aliquots_box " .
  719.                       "ORDER BY Aliquots_Box""");
  720.     ?></td><td width="123" align="left"><input type="text" id="InputLong3" name="BarcodeAliquot[]"></td>
  721.     <td width="85" align="left"><input type="text" id="InputYear" name="PositionAliquot[]"></td>
  722.     <td width="120"><input type="text" id="InputDay" name="AliquotSourceQuantity[]"></td>
  723.     <td><input type="text" id="InputDay" name="AliquotRestQuantity[]"></td>
  724.   </tr>
  725.   <tr>
  726.   <td align="right">
  727.   <span class="DescriptionBlack">Aliquot</span>
  728.   </td>
  729.   <td>
  730.   <?php                                          
  731.     build_select_listShort("x[]",
  732.                       "SELECT ID_Aliquots_Fridge, Aliquots_Fridge FROM aliquots_fridge " .
  733.                       "ORDER BY Aliquots_Fridge""");
  734.  
  735.                       "SELECT ID_Aliquots_Rack, Aliquots_Rack FROM aliquots_rack " .
  736.                       "ORDER BY Aliquots_Rack""");
  737.                                          
  738.                       "SELECT ID_Aliquots_Box, Aliquots_Box FROM aliquots_box " .
  739.                       "ORDER BY Aliquots_Box""");
  740.     ?></td><td><input type="text" id="InputLong3" name="BarcodeAliquot[]"></td>
  741.     <td><input type="text" id="InputYear" name="PositionAliquot[]"></td>
  742.     <td><input type="text" id="InputDay" name="AliquotSourceQuantity[]"></td>
  743.     <td><input type="text" id="InputDay" name="AliquotRestQuantity[]"></td>
  744.   </tr>
  745.   <tr>
  746.   <td align="right">
  747.   <span class="DescriptionBlack">Aliquot</span>
  748.   </td>
  749.   <td>
  750.   <?php                                          
  751.     build_select_listShort("x[]",
  752.                       "SELECT ID_Aliquots_Fridge, Aliquots_Fridge FROM aliquots_fridge " .
  753.                       "ORDER BY Aliquots_Fridge""");
  754.  
  755.                       "SELECT ID_Aliquots_Rack, Aliquots_Rack FROM aliquots_rack " .
  756.                       "ORDER BY Aliquots_Rack""");
  757.                                          
  758.                       "SELECT ID_Aliquots_Box, Aliquots_Box FROM aliquots_box " .
  759.                       "ORDER BY Aliquots_Box""");
  760.     ?></td><td><input type="text" id="InputLong3" name="BarcodeAliquot[]"></td>
  761.     <td><input type="text" id="InputYear" name="PositionAliquot[]"></td>
  762.     <td><input type="text" id="InputDay" name="AliquotSourceQuantity[]"></td>
  763.     <td><input type="text" id="InputDay" name="AliquotRestQuantity[]"></td>
  764.   </tr>
  765.   <tr>
  766.   <td align="right">
  767.   <span class="DescriptionBlack">Aliquot</span>
  768.   </td>
  769.   <td>
  770.   <?php                                          
  771.     build_select_listShort("x[]",
  772.                       "SELECT ID_Aliquots_Fridge, Aliquots_Fridge FROM aliquots_fridge " .
  773.                       "ORDER BY Aliquots_Fridge""");
  774.  
  775.                       "SELECT ID_Aliquots_Rack, Aliquots_Rack FROM aliquots_rack " .
  776.                       "ORDER BY Aliquots_Rack""");
  777.                                          
  778.                       "SELECT ID_Aliquots_Box, Aliquots_Box FROM aliquots_box " .
  779.                       "ORDER BY Aliquots_Box""");
  780.     ?></td><td><input type="text" id="InputLong3" name="BarcodeAliquot[]"></td>
  781.     <td><input type="text" id="InputYear" name="PositionAliquot[]"></td>
  782.     <td><input type="text" id="InputDay" name="AliquotSourceQuantity[]"></td>
  783.     <td><input type="text" id="InputDay" name="AliquotRestQuantity[]"></td>
  784.   </tr>
  785.   <tr>
  786.   <td align="right">
  787.   <span class="DescriptionBlack">Aliquot</span>
  788.   </td>
  789.   <td>
  790.   <?php                                          
  791.     build_select_listShort("x[]",
  792.                       "SELECT ID_Aliquots_Fridge, Aliquots_Fridge FROM aliquots_fridge " .
  793.                       "ORDER BY Aliquots_Fridge""");
  794.  
  795.                       "SELECT ID_Aliquots_Rack, Aliquots_Rack FROM aliquots_rack " .
  796.                       "ORDER BY Aliquots_Rack""");
  797.                                          
  798.                       "SELECT ID_Aliquots_Box, Aliquots_Box FROM aliquots_box " .
  799.                       "ORDER BY Aliquots_Box""");
  800.     ?></td><td><input type="text" id="InputLong3" name="BarcodeAliquot[]"></td>
  801.     <td><input type="text" id="InputYear" name="PositionAliquot[]"></td>
  802.     <td><input type="text" id="InputDay" name="AliquotSourceQuantity[]"></td>
  803.     <td><input type="text" id="InputDay" name="AliquotRestQuantity[]"></td>
  804.   </tr>
  805.   </table>
  806.   </td></tr>
  807.   <?php if(!$formSubmitUpdate?>
  808.   
  809.   <tr><td colspan="5"></td>
  810.  <td id="tdbutton"><input type="submit" value="Save+Carry Forward" name="formSubmitCarryForward" class="button" onClick="return CheckInput();"></td>        
  811.      </tr> <?php ?>
  812.  
  813.     <td colspan="3">
  814.     </td>
  815.   <td colspan="2">* Required field</td>
  816.     <td id="tdbutton">
  817.   
  818.   <?php echo '<input type="submit" value="Save" name="formSubmitSave" class="button"';
  819.   if(!$formSubmitUpdateecho ' onClick="return CheckInput();"'
  820.   echo '><br />
  821.                     <input type="reset" value="Clear fields" name="formSubmitClear" class="button">'}?></td></tr>
  822.             </table>
  823.   <?php ?>

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