Page MenuHomec4science

index.php.wml
No OneTemporary

File Metadata

Created
Tue, Jul 23, 07:26

index.php.wml

## $Id$
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002 CERN.
##
## The CDSware is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## The CDSware is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDSware; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#include "configbis.wml"
<?
require("<LIBDIR>/php/cdsware/websubmit/commonPhpFunctions.php");
?>
#include "cdspage.wml" \
title="Submit" \
navbar_name="main" \
navbar_select="submit" \
cdspageboxlefttopadd="<protect><?displayLoginMenu('submit');?></protect>"
<?
<protect>
## $Id$
## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.
// database connection
connectDB(DOCS_DATABASE);
$formnb = 1;
</protect>
if (SUMMARYON)
include("<LIBDIR>/php/cdsware/websubmit/Navigation_Functions.php");
else
include("<LIBDIR>/php/cdsware/websubmit/Fake_Navigation_Functions.php");
<protect>
?>
<SCRIPT TYPE="text/javascript" LANGUAGE="Javascript1.2">
var allLoaded = 1;
</SCRIPT>
<BR>
<SMALL>
<STRONG class=headline>Notice:</STRONG><BR>
Please select the type of document you want to submit:
</SMALL>
<BR><BR>
<TABLE width="100%">
<TR>
<TD width="50%">
<?
print "<FORM method=get action=\"$URLPATH/access/action.php\">\n";
?>
<INPUT type="hidden" name="doctypes">
<?
# Initialise catalogues array
$catalogues = array();
makeCataloguesTable();
?>
</TD>
<TD valign=top>
<DIV ID="TEXTWND"
STYLE="POSITION: relative; Z-INDEX: 20; VISIBILITY: hidden;">
</DIV>
<?
if (SUMMARYON)
{
$res = mysql_query("
SELECT sdocname,
ldocname,
description
FROM sbmDOCTYPE");
while ($row = mysql_fetch_row($res))
{
print " <DIV ID=\"$row[0]\" STYLE=\"POSITION: ".
"absolute; Z-INDEX: 20; VISIBILITY: hidden; WIDTH: 300;\">\n";
print " <SMALL><IMG SRC=\"".$IMAGES."/".
"okay.gif\" ALT=\"\"><STRONG>$row[1]:</STRONG></SMALL><BR><HR>".
"<SMALL>$row[2]</SMALL><HR>\n";
print " </DIV>\n\n";
}
}
?>
</TD>
</TR>
</TABLE>
</FORM>
<?
function makeCataloguesTable()
{
global $catalogues;
$queryResult = mysql_query("
SELECT id_son
FROM sbmCOLLECTION_sbmCOLLECTION
WHERE id_father=0
ORDER BY catalogue_order");
if($queryResult)
{
# Query has executed successfully, so we can proceed to display all
# catalogues in the EDS system...
if (mysql_num_rows($queryResult) == 0)
print "<h3>No catalogues yet...</h3>\n";
else
print "<UL>\n";
while ($row = mysql_fetch_array($queryResult))
{
array_push($catalogues,$row[id_son]);
displayCatalogueBranch($row[id_son],1);
}
if (mysql_num_rows($queryResult) != 0)
print "</UL>\n";
} // END if
else
{
# In this case, the query failed, so we can terminate the scripts
# running, and terminate the EDS Administrator session, as no
# further actions can be carried out...
print("<H3>Error: Unable to retrieve data from the catalogues table."
. "</H3>\n");
} // END else
}
function displayCatalogueBranch($id_father,$level)
{
global $catalogues;
$res = mysql_query("
SELECT name,
id
FROM sbmCOLLECTION
WHERE id=$id_father");
$row = mysql_fetch_row($res);
if ($level == 1)
print "<LI><font size=\"+1\"><strong>".$row[0]."</strong></font>\n";
elseif ($level == 2)
print "<LI>". $row[0]."\n";
elseif ($level > 2)
print "<LI>". $row[0]."\n";
// display the son document types
$res1 = mysql_query("
SELECT id_son
FROM sbmCOLLECTION_sbmDOCTYPE
WHERE id_father=$id_father
ORDER BY catalogue_order");
$res2 = mysql_query("
SELECT id_son
FROM sbmCOLLECTION_sbmCOLLECTION
WHERE id_father=$id_father
ORDER BY catalogue_order");
if (mysql_num_rows($res1) != 0 || mysql_num_rows($res2) != 0)
print "<UL>\n";
if (mysql_num_rows($res1) != 0)
while ($row = mysql_fetch_array($res1))
displayDoctypeBranch($row[id_son]);
// display the son catalogues
while ($row = mysql_fetch_array($res2))
{
array_push($catalogues,$row[id_son]);
displayCatalogueBranch($row[id_son],$level+1);
}
if (mysql_num_rows($res1) != 0 || mysql_num_rows($res2) != 0)
print "</UL>\n";
}
function displayDoctypeBranch($doctype)
{
global $catalogues,$formnb;
$res = mysql_query("
SELECT ldocname
FROM sbmDOCTYPE
WHERE sdocname='$doctype'");
$row = mysql_fetch_row($res);
print "<LI><small><a href=\"\" onmouseover=\"javascript:"
. "popUpTextWindow('$doctype',true,event);\" "
. "onmouseout=\"javascript:popUpTextWindow('$doctype',false,event);\""
. " onClick=\"document.forms[$formnb].doctypes.value='$doctype';"
. "document.forms[$formnb].submit();return false;\">"
. $row[0]."</a></small>\n";
}
</protect>
?>

Event Timeline