-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrabSubjects.php
executable file
·68 lines (51 loc) · 2.32 KB
/
grabSubjects.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
<script src="js/jquery/jquery.tools.min.js"></script>
<script src="js/jquery/jquery-1.1.3.1.pack.js" type="text/javascript"></script>
<script src="js/jquery/jquery.history_remote.pack.js" type="text/javascript"></script>
<?php
require_once 'config.php';
require_once 'class.form.php';
require_once 'class.table.php';
require_once 'class.case.php';
ini_set("error_reporting",E_ALL & ~E_NOTICE);
error_reporting("on");
$myLayout = new Layout(SITENAME,SITEDESC,$styles,$javascript,$op);
//$myLayout->printHeader();
echo '<IMG src="/img/header.jpg" width="600">';
$myCase = new lqCase();
?>
<script src=js/layout.js></script>
<script>
function doIt(value)
{
var val = value.replace(/\+/g,' ');
var selectobject=window.opener.document.getElementById("subjects");
var newSubj = opener.document.getElementById('theSubject').value;
alert(val + ' will be added to the list. If it is already there it will be ignored');
for (var i=0; i<selectobject.length; i++){
// if (newSubj == selectobject.options[i].value)
// selectobject.options[i] = null;
if (selectobject[i].value == val)
selectobject[i].remove();
}
appendOptionLast(count2++,val,'parent'); // add to list
}
</script>
<?php
echo "
<h1>Interleaf Library Database Query -> Search</h1>
<em><font size=-1>The following authority subjects were found</font></em><br>";
//phpinfo();
if ( count($myCase->getSubjectList($_COOKIE['searchTerm']) ) <= 0)
{
echo "<h2 align='center'>No Results Found</h2>";
}
else {
foreach ($myCase->getSubjectList($_COOKIE['searchTerm']) as $key => $val)
{
$value = str_replace(" ","+",$val);
echo "<a style='text-decoration:none; color:black;' onClick=doIt('";
echo $value;
echo "'); href=# id=subj>" . $val . "</a><br/>";
}
}
?>