Ejemplo n.º 1
0
<?php

session_start();
include_once "convenience_functions.php";
$page_number = 4;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] >= $page_number) {
    header('Location:./');
    exit;
} else {
    $page = $_GET['page'];
}
if ($page == $page_number - 1) {
    saveToDB();
    session_destroy();
} else {
    writePOSTtoSESSION();
}
$nextpage = $page + (isset($_POST['previous']) ? -1 : +1) % $page_number;
header('Location:./?page=' . $nextpage);
exit;
function saveToDB()
{
    $db = openDB();
    //Patient table
    $patientSQL = $db->prepare('INSERT INTO Patient (
            patient_insee, patient_firstName, patient_lastName, patient_dateOfBirth, patient_sex, patient_size, patient_weight,
            patient_typeOfID, patient_insurancePlanIdentification, patient_countryOfResidence)
            VALUES (
            :insee, :firstName, :lastName, :dateOfBirth, :sex, :size, :weight,
            \'INSEE\', \'INSEE\', :countryOfResidence)
            ON DUPLICATE KEY UPDATE
Ejemplo n.º 2
0
 $kp_id = $_POST['ref_no'];
 //echo $product.$fieldID.$kp_id;
 $target_dir = '../uploadFile/' . $kp_id;
 $attach_loc = 'labs/uploadFile/' . $kp_id . '/';
 if (file_exists($target_dir)) {
     echo "";
 } else {
     mkdir($target_dir);
 }
 $target_dir = $target_dir . '/';
 if ($fieldID == "sumofMethod" or $fieldID == "otherDoc") {
     if (isset($_FILES[$fieldID])) {
         $file_name = renameFile($product, basename($_FILES[$fieldID]["name"]));
         $target_file = $target_dir . $file_name;
         move_uploaded_file($_FILES[$fieldID]["tmp_name"], $target_file);
         saveToDB($kp_id, $fieldID, $file_name, $attach_loc, $target_dir, basename($_FILES[$fieldID]["name"]));
     }
 } else {
     if (isset($_FILES[$fieldID])) {
         $method = "Compendial";
         if (strpos($fieldID, 'non') !== false) {
             $method = "NonCompendial";
         }
         $cat = "Assay";
         if (strpos($fieldID, 'DS') !== false) {
             $cat = "Dissolution";
         }
         if (strpos($fieldID, 'RS') !== false) {
             $cat = "RelatedSubstance";
         }
         if (strpos($fieldID, 'MCT') !== false) {