Example #1
0
 *	
 *	You should have received a copy of the GNU General Public License
 *	along with queXF; if not, write to the Free Software
 *	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
include_once "../config.inc.php";
include_once "../db.inc.php";
include '../functions/functions.xhtml.php';
include '../functions/functions.import.php';
xhtml_head(T_("Update banding from XML"));
if (isset($_FILES['bandingxml']) && isset($_POST['qid']) && !empty($_POST['qid'])) {
    $qid = intval($_POST['qid']);
    $a = true;
    $xmlname = $_FILES['bandingxml']['tmp_name'];
    $r = import_bandingxml(file_get_contents($xmlname), $qid, true);
    if ($a) {
        if ($r) {
            print "<h2>" . T_("Successfully loaded banding XML file") . "</h2>";
        } else {
            print "<h2>" . T_("Failed to load banding XML file") . "</h2>";
        }
    }
}
print "<h1>" . T_("Update banding from XML") . "</h1>";
print "<p>" . T_("WARNING: All previous banding will be erased") . "</p>";
$sql = "SELECT description,qid as value, '' AS selected\r\n\tFROM questionnaires";
$rs = $db->GetAll($sql);
?>

<form enctype="multipart/form-data" action="" method="post">
Example #2
0
 *
 */
include_once "../config.inc.php";
include_once "../db.inc.php";
include '../functions/functions.xhtml.php';
include '../functions/functions.import.php';
xhtml_head(T_("Add new questionnaire"));
$a = false;
if (isset($_FILES['form'])) {
    $a = true;
    $filename = $_FILES['form']['tmp_name'];
    $desc = $_POST['desc'];
    $r = newquestionnaire($filename, $desc);
    if (!is_array($r) && isset($_FILES['bandingxml']) && !empty($_FILES['bandingxml']['tmp_name'])) {
        $xmlname = $_FILES['bandingxml']['tmp_name'];
        $r2 = import_bandingxml(file_get_contents($xmlname), $r);
    }
}
if ($a) {
    $suc = false;
    if (!is_array($r)) {
        print "<h1>" . T_("Successfully inserted new questionnaire") . "</h1>";
        $suc = true;
        if (isset($r2)) {
            if ($r2) {
                print "<h2>" . T_("Successfully loaded banding XML file") . "</h2>";
            } else {
                print "<h2>" . T_("Failed to load banding XML file") . "</h2>";
                $suc = false;
            }
        }