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

forgotten to include functions.import.php

This commit is contained in:
Alex
2015-03-05 12:59:31 +03:00
parent 3a3023bbe3
commit 08297ea098
2 changed files with 204 additions and 172 deletions

View File

@@ -1,6 +1,32 @@
<?php <?php
/** /**
* Import a sample from a Headered CSV file * Import a sample from a Headered CSV file
*
*
* This file is part of queXS
*
* queXS 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.
*
* queXS 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 queXS; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* @author Adam Zammit <adam.zammit@deakin.edu.au>
* @copyright Deakin University 2007,2008
* @package queXS
* @subpackage admin
* @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
*
*/ */
/** /**
@@ -88,6 +114,8 @@ else if (isset($_POST['import_file']))
display_table(get_first_row($tmpfname)); display_table(get_first_row($tmpfname));
?> ?>
<p><input type="hidden" name="description" value="<?php if (isset($_POST['description'])) print($_POST['description']); ?>"/></p> <p><input type="hidden" name="description" value="<?php if (isset($_POST['description'])) print($_POST['description']); ?>"/></p>
<input type="hidden" name="filename" value="<?php echo $tmpfname; ?>"/> <input type="hidden" name="filename" value="<?php echo $tmpfname; ?>"/>
@@ -119,7 +147,7 @@ else
//print "ua=" . $_SERVER['HTTP_USER_AGENT']; //print "ua=" . $_SERVER['HTTP_USER_AGENT'];
?> ?>
<form class="form-horizontal col-sm-12" enctype="multipart/form-data" action="" method="post"> <form class="form-horizontal col-sm-12 " enctype="multipart/form-data" action="" method="post">
<fieldset> <fieldset>
<input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /> <input type="hidden" name="MAX_FILE_SIZE" value="1000000000" />
@@ -155,4 +183,5 @@ else
<?php <?php
xhtml_foot($js_foot); xhtml_foot($js_foot);
} }
?> ?>

View File

@@ -123,8 +123,8 @@ function verify_fields($fields)
*/ */
function display_table($data) function display_table($data)
{ {
print "<table>"; print "<table class='table-hover table-bordered table-condensed tclass'><thead class='highlight'>";
print "<tr><th></th><th>" . T_("Import?") . "</th><th>" . T_("Name") . "</th><th>" . T_("Type") . "</th><th>" . T_("Allow operator to see?") . "</th></tr>"; print "<tr><th>" . T_("Selected file column name") . "</th><th>" . T_("Import ?") . "</th><th class='col-sm-4'>" . T_("New Sample Variable Name") . "</th><th>" . T_("Variable Type") . "</th><th>" . T_("Show to operator?") . "</th></tr></thead><tbody>";
$row = 1; $row = 1;
global $db; global $db;
@@ -140,21 +140,24 @@ function display_table($data)
$checked = "checked"; $checked = "checked";
if (empty($val)) $val = "samp_$row"; if (empty($val)) $val = "samp_$row";
print "<tr><td>$value</td><td><input type=\"checkbox\" name=\"i_$row\" checked=\"$checked\"/></td><td><input type=\"text\" value=\"$val\" name=\"n_$row\"/></td><td>"; print "<tr><td>$value</td>
print "<select name=\"t_$row\">"; <td><input type=\"checkbox\" name=\"i_$row\" checked=\"$checked\" switch=\"yes\" data-size=\"small\" data-on-text=\"" . TQ_("Yes") . "\" data-off-text=" . TQ_("No") . " /></td>
$selected = "selected=\"selected\""; <td><input type=\"text\" value=\"$val\" name=\"n_$row\" class=\"form-control\" /></td>
foreach($rs as $r) <td>";
{ print "<select name=\"t_$row\" class=\"form-control\">";
print "<option value=\"{$r['type']}\" $selected>" . T_($r['description']) . "</option>"; print "<option value=\"\" $selected></option>";
$selected = ""; $selected = "selected=\"selected\"";
} foreach($rs as $r)
print "</select></td>"; {
print "<td><input type=\"checkbox\" name=\"a_$row\"/></td>"; print "<option value=\"{$r['type']}\" >" . T_($r['description']) . "</option>";
$selected = "";
}
print "</select></td>";
print "<td>&emsp;<input type=\"checkbox\" name=\"a_$row\" switch=\"yes\" data-size=\"small\" data-on-text=\"" . TQ_("Yes") . "\" data-off-text=" . TQ_("No") . " /></td>";
print "</tr>"; print "</tr>";
$row++; $row++;
} }
print "</table>"; print "</tbody></table>";
} }