2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

fix lp: 1527201

This commit is contained in:
Alex
2015-12-21 20:31:19 +03:00
parent c9ee8279c7
commit f1c54ddd40
2 changed files with 11 additions and 23 deletions

View File

@@ -136,7 +136,7 @@ function display_table($data)
foreach ($data as $key => $value)
{
$val = str_replace(" ", "_", $value);
$val = str_replace(array(" ,",", ",","," "," "),"_", $value);
$checked = "checked";
if (empty($val)) $val = "samp_$row";
@@ -219,19 +219,14 @@ function import_file($file, $description, $fields, $firstrow = 2)
if (strncmp($key, "i_", 2) == 0)
{
$selected_type[substr($key,2)] = $fields["t_" . substr($key,2)];
$selected_name[substr($key,2)] = $fields["n_" . substr($key,2)];
$restrict = 1;
$selected_name[substr($key,2)] = str_replace(array(" ,",", ",","," "," "),"_", $fields["n_" . substr($key,2)]);
//Set restrictions on columns
if (isset($fields["a_" . substr($key,2)]))
{
$restrict = 0;
}
if (isset($fields["a_" . substr($key,2)])) $restrict = 0; else $restrict = 1;
$sql = "INSERT INTO sample_import_var_restrict
(`sample_import_id`,`var`,`type`,`restrict`)
VALUES ($id,'" . $fields["n_" . substr($key,2)] . "','" . $fields["t_" . substr($key,2)] . "',$restrict)";
VALUES ($id,'" . $selected_name[substr($key,2)] . "','" . $selected_type[substr($key,2)] . "',$restrict)";
$db->Execute($sql);