-
Notifications
You must be signed in to change notification settings - Fork 6
/
applet_test_async.php
70 lines (62 loc) · 1.6 KB
/
applet_test_async.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
64
65
66
67
68
69
70
<?php
require_once "lib_global_funcs.php";
require_once "lib_db_query.php";
require_once "lib_applet.php";
require_once "lib_form_elements.php";
pageHeader();
// get random structure
list($result)=mysql_select_array(array(
"table" => "molecule_fix_smiles",
"dbs" => -1,
"limit" => 1,
"filter" => "smiles NOT LIKE \"\"",
"order_obj" => array(
array(
"field" => "RAND()",
"no_hints" => true,
),
),
));
echo script;
// prüfen
if (!empty($_REQUEST["appl"])) {
$molecule=readMolfile($_REQUEST["appl"],array() ); // for fingerprinting and serialisation
if ($molecule["smiles_stereo"]!=$_REQUEST["smiles_stereo"] || $molecule["smiles"]!=$_REQUEST["smiles"]) {
echo "alert(".fixStr(
"molecule_id:".
$_REQUEST["molecule_id"].
"\\nOriginal stereoSMILES: ".
$_REQUEST["smiles_stereo"].
"\\nNeues: ".
$molecule["smiles_stereo"].
"\\nOriginal SMILES: ".
$_REQUEST["smiles"].
"\\nNeues: ".
$molecule["smiles"]
).");";
}
}
$newData=array();
// neue Aufgabe
if ($_REQUEST["modus"]=="compare") {
$newData["appl"]=$result["molfile_blob"];
}
else {
$newData["appl"]="";
}
$newData["molfile_blob_before"]=$result["molfile_blob"];
$newData["smiles_stereo"]=$result["smiles_stereo"];
$newData["smiles"]=$result["smiles"];
$newData["molecule_id"]=$result["molecule_id"];
$newData["active_modus"]=$result["modus"];
$newData["molfile_blob_after"]="";
echo "parent.setControlValues(".json_encode($newData).");
parent.addMoleculeToUpdateQueue(\"molfile_blob_before\");
parent.addMoleculeToUpdateQueue(\"molfile_blob_after\");
parent.updateMolecules();
".
_script.
"<body>
</body>
</html>";
?>