-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsave_record_blob.php
63 lines (57 loc) · 1.74 KB
/
save_record_blob.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
session_start();
require_once 'config.php';
require_once 'base/common.php';
require_once 'project_common.php';
require_once $GLOBALS['main_user_location'];
//echo '<br>Sending POST from server<br><pre>';
//print_r($_SESSION);
//print_r($_POST);
//print_r($_FILES);
//echo '<br>With proper POSTing of data by to-script and proper output by from-script AJAX is complate';
//javascript to encode url and PHP to decode POST value is must
//date india vs mysql. Corusponding change in edit_dc.php
//if($_POST['field']=='from_date' ||$_POST['field']=='to_date' )
//{
// $_POST['value']=india_to_mysql_date($_POST['value']);
//}
//echo $_POST['session_name'];
$link=get_link($GLOBALS['main_user'],$GLOBALS['main_pass']);
$released_by=get_one_ex_result($link,$_POST['sample_id'],$GLOBALS['released_by']);
if(strlen($released_by)==0)
{
save_result($link);
}
else
{
echo '<h3>Released samples can not be edited, refresh/view to get previous data</h3>';
}
function save_result($link)
{
$sql='update result_blob,primary_result_blob
set
result_blob.result=primary_result_blob.result,
result_blob.recording_time=now(),
result_blob.recorded_by=\''.$_POST['user'].'\'
where
result_blob.sample_id=\''.$_POST['sample_id'].'\'
and
result_blob.examination_id=\''.$_POST['examination_id'].'\'
and
result_blob.sample_id=primary_result_blob.sample_id
and
result_blob.examination_id=primary_result_blob.examination_id
and
primary_result_blob.uniq=\''.$_POST['uniq'].'\'
';
//echo $sql;
if(!$result=run_query($link,$GLOBALS['database'],$sql))
{
echo '<p>Data not updated</p>';
}
else
{
echo '<p>Blob data for '.$_POST['sample_id'].'|'.$_POST['examination_id'].' imported from primary table</p>';
}
}
?>