mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fix typo in import.php
Fixed bug: Sample not importing due to new sample_var table structure
This commit is contained in:
@@ -61,7 +61,7 @@ if (isset($_POST['import_form']))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print -"<div class='alert alert-danger col-md-offset-2'><p>" . T_("Error importing file. Please try again") . "</p></div>";
|
print "<div class='alert alert-danger col-md-offset-2'><p>" . T_("Error importing file. Please try again") . "</p></div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -204,8 +204,8 @@ function import_file($file, $description, $fields, $firstrow = 2)
|
|||||||
(sample_import_id, description)
|
(sample_import_id, description)
|
||||||
VALUES (NULL, '$description')";
|
VALUES (NULL, '$description')";
|
||||||
|
|
||||||
//print("$sql<br/>");
|
// print("$sql<br/>");
|
||||||
//if ($db->HasFailedTrans()) { print "FAILED"; exit(); }
|
// if ($db->HasFailedTrans()) { print "FAILED"; exit(); }
|
||||||
|
|
||||||
$rs = $db->Execute($sql);
|
$rs = $db->Execute($sql);
|
||||||
$id = $db->Insert_ID();
|
$id = $db->Insert_ID();
|
||||||
@@ -234,7 +234,7 @@ function import_file($file, $description, $fields, $firstrow = 2)
|
|||||||
VALUES ($id,'" . $fields["n_" . substr($key,2)] . "','" . $fields["t_" . substr($key,2)] . "',$restrict)";
|
VALUES ($id,'" . $fields["n_" . substr($key,2)] . "','" . $fields["t_" . substr($key,2)] . "',$restrict)";
|
||||||
|
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
|
|
||||||
$sirv_id[substr($key,2)] = $db->Insert_ID(); //
|
$sirv_id[substr($key,2)] = $db->Insert_ID(); //
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -305,6 +305,7 @@ function import_file($file, $description, $fields, $firstrow = 2)
|
|||||||
VALUES (NULL,'$id','$tzone','$dppid')";
|
VALUES (NULL,'$id','$tzone','$dppid')";
|
||||||
|
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
|
|
||||||
$sid = $db->Insert_Id();
|
$sid = $db->Insert_Id();
|
||||||
|
|
||||||
|
|
||||||
@@ -315,11 +316,11 @@ function import_file($file, $description, $fields, $firstrow = 2)
|
|||||||
{
|
{
|
||||||
$dkey = $db->Quote($data[$key - 1]);
|
$dkey = $db->Quote($data[$key - 1]);
|
||||||
|
|
||||||
$sql = "INSERT INTO sample_var (sample_id,var_id,var,val,type)
|
$sql = "INSERT INTO sample_var (sample_id,var_id,val)
|
||||||
VALUES ('$sid','{$sirv_id[$key]}','$val',{$dkey},'{$selected_type[$key]}')";
|
VALUES ('$sid','{$sirv_id[$key]}',{$dkey})";
|
||||||
|
|
||||||
$db->Execute($sql);
|
$db->Execute($sql);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$imported++;
|
$imported++;
|
||||||
|
|||||||
Reference in New Issue
Block a user