コード例 #1
0
<?php

// this file will accept an input file from account controller and will pass that data to analyzeCprogram
//import general functions
require "functions.php";
$file_an = $_FILES["file_an"];
// getting the file to be analyzed
inputValidation($file_an);
// validating the content of the probes file
$file_result = $file_an["name"];
// creating the file result
// Once we are here all data file validation has been approved
//conection to the database
$connectedDB = connectToDB();
//get logged user id, email, and name from session
session_start();
$id = $_SESSION['id'];
$email = $_SESSION['email'];
$fName = $_SESSION['first_name'];
$lName = $_SESSION['last_name'];
session_write_close();
//insert entry of file one in docs table and save into $idOne the id of the first entry
$sql = "INSERT INTO docs (user_id, doc_name, date, time_stamp) VALUES ('" . $id . "','" . $file_an["name"] . "','" . date("Y/m/d") . "','now()') RETURNING id";
$resultID = pg_query($connectedDB, $sql);
$row = pg_fetch_row($resultID);
$idOne = $row['0'];
//insert entry of file two and save into $idTwo the id of the second entry
$sql = "INSERT INTO docs (user_id, doc_name, date, time_stamp) VALUES ('" . $id . "','" . $file_result . ".results.txt','" . date("Y/m/d") . "','now()') RETURNING id";
$resultID = pg_query($connectedDB, $sql);
$row = pg_fetch_row($resultID);
$idResult = $row['0'];
コード例 #2
0
<?php

// whenever we upload this to the server, we need to change the call functions
// in the shell_exec part
//import general functions
require "functions.php";
//conection to the database
$connectedDB = connectToDB();
//getting the files
$fileOne = $_FILES["fileOne"];
inputValidation($fileOne);
$file_result = $fileOne["name"];
//get logged user id, email, and name from session
session_start();
$id = $_SESSION['id'];
$email = $_SESSION['email'];
$fName = $_SESSION['first_name'];
$lName = $_SESSION['last_name'];
session_write_close();
//insert entry of file one in docs table and save into $idOne the id of the first entry
$sql = "INSERT INTO docs (user_id, doc_name, date, time_stamp) VALUES ('" . $id . "','" . $fileOne["name"] . "','" . date("Y/m/d") . "','now()') RETURNING id";
$resultID = pg_query($connectedDB, $sql);
$row = pg_fetch_row($resultID);
$idOne = $row['0'];
//insert entry of file two and save into $idTwo the id of the second entry
$sql = "INSERT INTO docs (user_id, doc_name, date, time_stamp) VALUES ('" . $id . "','" . $file_result . ".results.txt','" . date("Y/m/d") . "','now()') RETURNING id";
$resultID = pg_query($connectedDB, $sql);
$row = pg_fetch_row($resultID);
$idResult = $row['0'];
//insert entry of file two and save into $idTwo the id of the second entry
$sql = "INSERT INTO rep_sequences (user_id, seq_uploaded_id, seq_result_id, date, time_stamp) VALUES ('" . $id . "','" . $idOne . "','" . $idResult . "','" . date("Y/m/d") . "','now()')";
コード例 #3
0
<?php

// receiving two files from files controller to find genome differences
//import general functions
require "functions.php";
//conection to the database
$connectedDB = connectToDB();
//getting the files
$fileOne = $_FILES["fileOne"];
inputValidation($fileOne);
// validating the content of file 1
$fileTwo = $_FILES["fileTwo"];
inputValidation($fileTwo);
// validating the content of file 2
$file1_name = $fileOne["name"];
// getting the name of the first file
$file2_name = $fileTwo["name"];
// getting the name of the second file
$file1_sub = substr($fileOne["name"], 0, 5);
// get a portion of the name of the first file
$file2_sub = substr($fileTwo["name"], 0, 5);
// get a portion of the name of the second file
$file_result = $file1_sub . $file2_sub;
//get logged user id, email, and name from session
session_start();
$id = $_SESSION['id'];
$email = $_SESSION['email'];
$fName = $_SESSION['first_name'];
$lName = $_SESSION['last_name'];
session_write_close();
//insert entry of file one in docs table and save into $idOne the id of the first entry
コード例 #4
0
        $p_user->execute([$session['uid']]);
        if ($p_user->rowCount()) {
            if (!password_verify($post->oPass, $p_user->fetch()->password)) {
                $error .= 'Old Password incorrect.';
            }
        }
    }
    if (empty($post->nPass)) {
        $error .= 'New Password must be filled.';
    }
    if (empty($post->nPass1)) {
        $error .= 'Confirm New Password must be filled.';
    }
    if ($post->nPass != $post->nPass1) {
        $error .= 'New Password and Confirm New Password didn\'t match.';
    }
    return $error;
}
if (isset($post->changePassword)) {
    $error = inputValidation($post);
    if (empty($error)) {
        $sql = 'UPDATE `users` SET `password` = ? WHERE `id` = ?';
        $p_users = $dbh->prepare($sql);
        if ($p_users->execute([password_hash($post->nPass, PASSWORD_DEFAULT), $session['uid']])) {
            $flash = 'Password succesfully changed' . '<meta http-equiv="refresh" content="2;url=index.php?modul=' . $modul . '">';
        } else {
            $error = 'ERROR: Cannot update database';
        }
    }
}
include 'VIEW_controlPanel.ctp';
コード例 #5
0
<?php

// this file will accept two input files from account controller and will pass that data to probesCprogram
// import general functions
require "functions.php";
$probesFile = $_FILES["probesFile"];
// getting the file that contains the probes
inputValidation($probesFile);
// validating the content of the probes file
$bashFile = $_FILES["bashFile"];
// getting the bash file that has the probes to look for
inputBashValidation($bashFile);
// validating the content of the bash file
$file1_sub = substr($probesFile["name"], 0, 5);
// get a portion of the name of the first file
$file2_sub = substr($bashFile["name"], 0, 5);
// get a portion of the name of the second file
$file_result = $file1_sub . $file2_sub;
// create the name of the result file concatinating substrings
// Once we are here all data file validation has been approved
//conection to the database
$connectedDB = connectToDB();
// get logged user id, email, and name from session
session_start();
$id = $_SESSION['id'];
$email = $_SESSION['email'];
$fName = $_SESSION['first_name'];
$lName = $_SESSION['last_name'];
session_write_close();
//insert entry of probe file in docs table and save into $idOne the id of that entry
$sql = "INSERT INTO docs (user_id, doc_name, date, time_stamp) VALUES ('" . $id . "','" . $probesFile["name"] . "','" . date("Y/m/d") . "','now()') RETURNING id";