# Run a query to get all of the submission types for the doctype to
# be cloned...
$cloneRes1 = mysql_query("SELECT * FROM sbmIMPLEMENT WHERE docname ="
. " '$doc2clone' ORDER BY actname");
if($cloneRes1)
{
# Fine, the query has worked...
# Get the current date...
$modDate = makeEDSmdDate();
# Okay, for each submission
while($sub2Clone = mysql_fetch_array($cloneRes1))
{
# Clone functions
$res = mysql_query("select * from sbmFUNCTIONS where doctype='$doc2clone' and action='".$sub2Clone["actname"]."'");
while ($row = mysql_fetch_array($res))
{
$res2 = mysql_query("select 1 from sbmFUNCTIONS where doctype='$sdocname' and action='".$row["action"]."' and function='".$row["function"]."' and score='".$row['score']."' and step='".$row['step']."'");
if (mysql_num_rows($res2) < 1)
mysql_query("insert into sbmFUNCTIONS(action, doctype, function, score, step) values ('".$row['action']."','$sdocname','".$row['function']."','".$row['score']."','".$row['step']."')");
}
#clone parameters
$res = mysql_query("select * from sbmPARAMETERS where doctype='$doc2clone'");
while ($row = mysql_fetch_array($res))
{
$res2 = mysql_query("select 1 from sbmPARAMETERS where doctype='$sdocname' and name='".$row['name']."'");
if (mysql_num_rows($res2) < 1)
mysql_query("insert into sbmPARAMETERS(doctype, name, value) values ('$sdocname','".$row['name']."','".$row['value']."')");
}
# Make a query to insert this submission data for the new