Page MenuHomec4science

LINK_showone.shtml.wml
No OneTemporary

File Metadata

Created
Wed, Nov 13, 14:50

LINK_showone.shtml.wml

<?
/*********************************************************************
This file is part of the CERN Document Server Software (CDSware).
Copyright (C) 2002 CERN.
1211 Geneva 23 - Switzerland
<cds.support@cern.ch>
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
*********************************************************************/
//==========================================================================
// File: LINK_add.shtml (flexElink WI)
// Description: Show the details of a link definition which is in the DB. It
// shows link definition data (parameters, type, base paths) and
// corresponding link condtions with their actions. It allows to perform
// management operations (delete, add, modifiy) over all the items diplayed
// POST parameters:
// linktype --> (required) Name (id) of the link definition to be shown
// Requires: DB, ERROR, FUNCTION_LIB
// Author: Hector.Sanchez@cern.ch
//==========================================================================
include("localconf.inc.shtml");
include(DB);
include(ERROR);
include(FUNCTION_LIB);
?>
<script language="javascript">
<!---
function openwindowlink( addr, name )
{
window.open( addr, "Window"+name, "height=420,witdh=320,scrollbars,resizable")
}
//-->
</script>
<?
if((!isset($linktype))||(trim($linktype)==""))
{
print "<b>ERROR</b>: Link type label hasn't been specified!!<hr>";
print "<a align=\"center\" href=\"JavaScript:window.close();\">[Close]</a>";
exit;
}
if(get_magic_quotes_gpc())
{
$linktype=stripslashes($linktype);
}
$db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD );
mysql_selectdb( $DB_DB );
$qry="select solvingtype, base_file, base_url
from flxLINKTYPES
where linktype='".addslashes($linktype)."'";
$qh=mysql_query($qry);
print '<table width="100%" bgcolor="#CCCCCC" border="1">';
print "<tr bgcolor=\"#33CC00\" align=\"center\">";
print "<td colspan=\"2\"><font size=\"6\">Details of link type '$linktype'</font></td>";
print "</tr>";
list($stype, $bfile, $burl)=mysql_fetch_row($qh);
$qry_par="select pname
from flxLINKTYPEPARAMS
where linktype='".addslashes($linktype)."'
order by ord";
$qh_par=mysql_query($qry_par);
$pars="";
while($row=mysql_fetch_array($qh_par))
{
$pars.=$row[0].",";
}
print "<tr bgcolor=\"#FFFFFF\">";
print "<td bgcolor=\"#CCFFCC\" width=\"15%\"><b>Parameters</b></td>";
print "<td>$pars</td>";
print "</tr>";
print "<tr bgcolor=\"#FFFFFF\">";
print "<td bgcolor=\"#CCFFCC\"><b>Solving type</b></td>";
$temp="Internal";
if($stype=="EXT")
{
$temp="External";
}
print "<td>$temp</td>";
print "</tr>";
if($stype=="INT")
{
print "<tr bgcolor=\"#FFFFFF\">";
print "<td bgcolor=\"#CCFFCC\"><b>Base file path</b></td>";
print "<td>$bfile</td>";
print "</tr>";
print "<tr bgcolor=\"#FFFFFF\">";
print "<td bgcolor=\"#CCFFCC\"><b>Base url</b></td>";
print "<td>$burl</td>";
print "</tr>";
}
print "</table>";
print '<table width="100%" cellspacing="0" bgcolor="#CCCCCC" cellpadding="4" border="0">';
print "<tr align=\"center\">";
print "<td>
<a href=\"JavaScript:openwindowlink('LINK_COND_add_edit.shtml?linktype=".urlencode($linktype)."', 'LRADDC$linktype')\">[Add condition]</a></td>";
print "<td><a href=\"LINK_edit.shtml?linktype=".urlencode($linktype)."\">[Modify]</a></td>";
print "<td><a href=\"LINK_del.shtml?linktype=".urlencode($linktype)."\">[Delete]</a></td>";
print "</tr>";
print "</table>";
$qry="select eval_order, el_condition, el_action,
solvingtype, base_file, base_url
from flxLINKTYPECONDITIONS
where linktype='".addslashes($linktype)."'
order by eval_order";
$qh=mysql_query($qry, $db);
if(mysql_num_rows($qh)>=1)
{
print '<table width="100%" bgcolor="#CCCCCC" border="1">';
print "<tr bgcolor=\"#33CC00\" align=\"center\">";
print "<td colspan=\"4\"><b>CONDITIONS</b></td>";
print "</tr>";
while($row=mysql_fetch_array($qh))
{
print "<tr bgcolor=\"#CCFFCC\" align=\"center\">";
print "<td><font size=\"2\"><b>Evaluation Order</b></font></td>";
print "<td width=\"100%\"><font size=\"2\"><b>Condition EL Code</b></font></td>";
print "<td><font size=\"2\"><b>Solve type</b></font></td>";
print "<td><font size=\"2\"><b>Formats</b></font></td>";
print "</tr>";
list($eorder, $condition, $action, $stype, $bfile, $burl)=$row;
$qry_fmts="select f.name
from flxLINKTYPECONDITIONSFILEFORMATS cf, flxFILEFORMATS f
where cf.linktype='".addslashes($linktype)."'
and cf.eval_order='$eorder'
and f.name=cf.fname";
$qh_fmts=mysql_query($qry_fmts, $db);
$fmts="";
while($fmt=mysql_fetch_array($qh_fmts))
{
$fmts.=$fmt[0]."<br>";
}
print "<tr bgcolor=\"#FFFFFF\">";
print "<td align=\"center\">$eorder</td>";
print "<td>".text2HTML($condition)."</td>";
print "<td>$stype</td>";
print "<td>$fmts</td>";
print "</tr>";
if($stype=="INT")
{
print "<tr bgcolor=\"#FFFFFF\">";
print "<td bgcolor=\"#CCFFCC\"><font size=\"2\"><b>Base FILE</b></font></td>";
print "<td colspan=\"4\">$bfile</td>";
print "</tr>";
print "<tr bgcolor=\"#FFFFFF\">";
print "<td bgcolor=\"#CCFFCC\"><font size=\"2\"><b>Base URL</b></font></td>";
print "<td colspan=\"4\">$burl</td>";
print "</tr>";
}
$qry_ac="select apply_order, el_code
from flxLINKTYPECONDITIONSACTIONS
where linktype='".addslashes($linktype)."'
and eval_order=$eorder
order by apply_order";
$qh_ac=mysql_query($qry_ac, $db);
while($row_ac=mysql_fetch_array($qh_ac))
{
list($aorder, $action)=$row_ac;
print "<tr bgcolor=\"#FFFFFF\">";
print "<td bgcolor=\"#CCFFCC\">
<font size=\"2\"><b>Action ($aorder)</b></font></td>";
print "<td>".text2HTML($action)."</td>";
print "<td><font size=\"2\">
<a href=\"JavaScript:openwindowlink('LINK_ACTION_add_edit.shtml?linktype=".urlencode($linktype)."&eorder=$eorder&aorder=$aorder', 'LCAE$linktype$eorder$aorder')\">[Modify]</a></td>";
print "<td><font size=\"2\">
<a href=\"LINK_ACTION_del.shtml?linktype=".urlencode($linktype)."&eorder=$eorder&aorder=$aorder\">[Delete]</a></td>";
print "</tr>";
}
print "<tr bgcolor=\"#CCCCCC\" align=\"center\">";
print "<td colspan=\"5\">
<font size=\"2\">
<a href=\"JavaScript:openwindowlink('LINK_ACTION_add_edit.shtml?linktype=".urlencode($linktype)."&eorder=$eorder', 'LCAADD$linktype$eorder$aorder')\">[Add Action]</a>
<a href=\"JavaScript:openwindowlink('LINK_COND_add_edit.shtml?linktype=".urlencode($linktype)."&eorder=$eorder', 'LCEDIT$linktype$eorder')\">[Modify]</a>
<a href=\"LINK_COND_del.shtml?linktype=".urlencode($linktype)."&eorder=$eorder\">[Delete]</a>
</font>
</td>";
print "</tr>";
}
print "</table>";
}
mysql_close( $db );
?>

Event Timeline