Source for file doQuery.php
Documentation is available at doQuery.php
* Building query for getting specimen data from original provider
* @author Gabriele Droege, DNA Bank Network <contact@dnabank-network.org>
* @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
* @license http://www.mozilla.org/MPL/ MPL
if($formSubmitVerify and (!isset
($_SESSION['guest']) &&
!$_SESSION['guest']))
$SpecimenNumber =
urlencode($_POST['formSpecimenNumber']);
if(empty($formProviderIntern) and empty($formProviderExtern))
unset
($formProviderIntern);
unset
($formProviderExtern);
echo
"<a id='Red'>Please select a Specimen Database!</a>";}
if(!empty($formProviderIntern) and !empty($formProviderExtern))
echo
'<a id="Red">Please select either an "Internal" or "External" Specimen database!</a>'; }
if(!empty($formProviderIntern))
("SELECT dataset.ID_Dataset, " .
" dataset.ID_Provider, " .
" schemata.QueryPart1, " .
" schemata.QueryPart1_1, " .
" schemata.QueryPart1_2, " .
" schemata.QueryPart2, " .
" schemata.QueryPart3, " .
" schemata.QueryPart4, " .
" dataset.Digir_Resource, " .
" dataset.Digir_Source, " .
" LEFT JOIN provider ON dataset.ID_Provider = provider.ID_Provider " .
" LEFT JOIN schemata ON provider.ID_Schema = schemata.ID_Schema " .
" WHERE dataset.ID_Dataset = '$formProviderIntern'");
if(!empty($formProviderExtern))
("SELECT dataset.ID_Dataset, " .
" dataset.ID_Provider, " .
" schemata.QueryPart1, " .
" schemata.QueryPart1_1, " .
" schemata.QueryPart1_2, " .
" schemata.QueryPart2, " .
" schemata.QueryPart2a, " .
" schemata.QueryPart3, " .
" schemata.QueryPart4, " .
" dataset.Digir_Resource, " .
" dataset.Digir_Source, " .
" LEFT JOIN provider ON dataset.ID_Provider = provider.ID_Provider " .
" LEFT JOIN schemata ON provider.ID_Schema = schemata.ID_Schema " .
" WHERE dataset.ID_Dataset = '$formProviderExtern'");
/********************************************************************************************
* All parts of the query are recorded in a table *
* it depends on required provider software and data schema which one to chose *
* the connection to a single specimen data provider is defined via new_dataset.php *
*********************************************************************************************/
$ID_Dataset =
$row->ID_Dataset;
$ID_Provider =
$row->ID_Provider;
$Provider =
$row->Provider;
$QueryPart1 =
$row->QueryPart1;
$QueryPart1_1 =
$row->QueryPart1_1;
$QueryPart1_2 =
$row->QueryPart1_2;
$QueryPart2 =
$row->QueryPart2;
$QueryPart2a =
$row->QueryPart2a;
$QueryPart3 =
$row->QueryPart3;
$QueryPart4 =
$row->QueryPart4;
$Digir_Resource =
$row->Digir_Resource;
$Digir_Source =
$row->Digir_Source;
$ID_Schema =
$row->ID_Schema;
$Digir_Resource1 =
urlencode($Digir_Resource);
if($ID_Dataset ==
'1' and $ID_Provider ==
'0')
* if specimen provider = Specimen Tool and its data are not yet availbae via a wrapper, calling this script
include ("../sptool/show_cache_data.php"); }
* calling script for building query and transforming received xml data into xslt and html
/**********************************************************************************************
* sometimes the user received more than one specimen record, than he/she has to select one *
* to be sure that during query process the right one is called some further help form elements*
* are filled with content and are checked here *
* this parameters are filled during the xslt transformation (see scripts in folder XSLT) *
**********************************************************************************************/
$variable1 =
$_POST['formUnitID'];
$CatalogNoText =
$_POST['CatalogNoText'];
$variable2 =
$_POST['formSourceInstitutionID'];
$variable3 =
$_POST['formSourceID'];
$variable4 =
$_POST['formProviderExtern'];
$variable5 =
$_POST['formTest'];
$variable6 =
$_POST['formProviderIntern'];
if($variable5 !=
"" and !$formSubmitVerify and !$formSubmitSave)
$mykey =
key($variable5);
("SELECT dataset.ID_Dataset AS ID_Dataset, " .
" schema.QueryPart1b AS QueryPart1b, " .
" schema.QueryPart1_1 AS QueryPart1_1, " .
" schema.QueryPart1_2b AS QueryPart1_2b, " .
" schema.QueryPart2 AS QueryPart2, " .
" schema.QueryPart3 AS QueryPart3, " .
" schema.QueryPart4 AS QueryPart4, " .
" schema.QueryPart5 AS QueryPart5, " .
" provider.Provider AS Provider, " .
" dataset.Digir_Resource AS Digir_Resource, " .
" dataset.Digir_Source AS Digir_Source, " .
" provider.Provider AS Provider, " .
" provider.ID_Schema AS ID_Schema " .
" LEFT JOIN provider ON dataset.ID_Provider = provider.ID_Provider " .
" LEFT JOIN schemata ON provider.ID_Schema = schemata.ID_Schema " .
" WHERE dataset.ID_Dataset = '$variable4'");
("SELECT dataset.ID_Dataset AS ID_Dataset, " .
" schemata.QueryPart1b AS QueryPart1b, " .
" schemata.QueryPart1_1 AS QueryPart1_1, " .
" schemata.QueryPart1_2b AS QueryPart1_2b, " .
" schemata.QueryPart2 AS QueryPart2, " .
" schemata.QueryPart3 AS QueryPart3, " .
" schemata.QueryPart4 AS QueryPart4, " .
" schemata.QueryPart5 AS QueryPart5, " .
" provider.Provider AS Provider, " .
" dataset.Digir_Resource AS Digir_Resource, " .
" dataset.Digir_Source AS Digir_Source, " .
" provider.Provider AS Provider, " .
" provider.ID_Schema AS ID_Schema " .
" LEFT JOIN provider ON dataset.ID_Provider = provider.ID_Provider " .
" LEFT JOIN schemata ON provider.ID_Schema = schemata.ID_Schema " .
" WHERE dataset.ID_Dataset = '$variable6'");
$ID_Dataset =
$row->ID_Dataset;
$Provider =
$row->Provider;
$QueryPart1b =
$row->QueryPart1b;
$QueryPart1_1 =
$row->QueryPart1_1;
$QueryPart1_2b =
$row->QueryPart1_2b;
$QueryPart2 =
$row->QueryPart2;
$QueryPart3 =
$row->QueryPart3;
$QueryPart4 =
$row->QueryPart4;
$QueryPart5 =
$row->QueryPart5;
$Digir_Resource =
$row->Digir_Resource;
$Digir_Source =
$row->Digir_Source;
$ID_Schema =
$row->ID_Schema;
$SourceUnitID =
urlencode($variable1[$mykey]);
$SourceInstitutionCode =
urlencode($variable2[$mykey]);
$Digir_Resource1 =
urlencode($Digir_Resource);
* if specimen provider = Specimen Tool and its data are not yet availbae via a wrapper, calling this script
include ("../sptool/show_cache_data.php");
* calling script for transferring received xml data into html
Documentation generated on Tue, 29 Nov 2011 10:44:49 +0100 by phpDocumentor 1.4.3