forked from binaskar/provect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileHanding.php
48 lines (32 loc) · 966 Bytes
/
fileHanding.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
class fileHandling {
private $file;
function __construct($fileName,$mode) {
// Opening new File
$file = fopen($fileName, $mode);
}
function insertStandard ($ID, $time, $high, $low){
//Used for standard data
$statemnt = "$ID\t$time\t$high\t$low\n";
fwrite($file, $statemnt);
}
function insertCSV ($ID, $time, $high, $low){
//Used for CSV format Data
$statemnt = "$ID\t$time\t$high\t$low\n";
fwrite($file, $statemnt);
}
function insertDB ($patient,$ID, $time, $high, $low){
require_once __DIR__ . '/Real/db_connect.php';
$db = new DB_CONNECT();
$result = mysql_query("INSERT INTO HB (ID, Time, high, low) VALUES('$ID','$time','$high','$low')");
if($result){return "success";}else return "Failed";
}
function readFileLines(){
$line = fgetcsv ($file, 100, "\t");
}
function __destruct() {
// closing file opend
$file->close();
}
}
?>