#!/bin/sh
# This is a dummy pgi_coversheet producing the same output as createCS in processQC.
# You can use:
#	$1 - tmp-dir ($TMP_DIR/processQC_<pid>)
#	$2 - coversheet name
#	$AB
#	$1/list_graphics: list of all graphics files
#	$PROD_PATH: $DFS_PRODUCT/$RAW_TYPE/$DATE
# The coversheet is moved to $PROD_PATH.

cat > $1/$2 <<EOT
<html>
<head>
<title> QC report coversheet for $AB</title>
</head>

<body>
<h2>QC report coversheet for $AB</h2>
<font size=2>This coversheet collects all QC reports for $AB.</font>

<table style="border-collapse: collapse;" border="1" bordercolor="#333333">
EOT

for G in `cat $1/list_graphics`
do
	cat >> $1/$2 <<EOT
<tr>
  <td>
    <a href="./$G"><img src="./$G" width=300 height=200 title="click to enlarge"></a>
  </td>
  <td valign=bottom><font size=2>$G</font></td>
</tr>
EOT
done

cat >> $1/$2 <<EOT
</body>
</html>
EOT
exit
