3
function __autoload($class_name) {
4
require_once $class_name . '.php';
6
function printE($id,$type,$value)
8
echo "\t\t\telementList.push(new element(\"".$id."\",\"".$type."\",\"".$value."\"));\n";
12
if(isset($_GET["refid"]) && strcmp($_GET["refid"],"")!=0)
14
$refid = intval($_GET["refid"]);
15
$dbconn = new dbcontrol();
16
$connectionStatus = $dbconn->connectdb();
17
if($connectionStatus != 1)
19
$debugString = "I can't connect to the DB to load data!";
24
$_SESSION["searching".KEY]= false;
26
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
27
"http://www.w3.org/TR/html4/strict.dtd">
30
<title>Pottery Database</title>
31
<link rel="stylesheet" type="text/css" href="style.css"/>
32
<script type="text/javascript">
34
window.location = "editPottery.php";
37
<script type="text/javascript" src="RequestQueue.js"></script>
38
<script type="text/javascript" src="JavaScript.js"></script>
42
$queryString = "select * from tbl_pottery where refid=".$refid;
43
$queryResult = $dbconn->sendquery2($queryString);
44
$rowNr = $dbconn->numberofrows();
47
echo "\t\t<script type=\"text/javascript\">\n";
48
echo "\t\t\tisLoading = true;\n";
49
echo "\t\t\telementList = new Array();\n";
50
//pottery related elements
51
$rowArray = pg_fetch_array($queryResult,null,PGSQL_ASSOC);
52
printE("potteryNumber","input",$rowArray["potterynumber"]);
53
printE("contextNumber","input",$rowArray["contextnumber"]);
54
printE("siteNumber","input",$rowArray["sitenumber"]);
55
printE("dateArea","input",$rowArray["datearea"]);
56
printE("descriptionCode","input",$rowArray["descriptioncode"]);
57
printE("colour","input",$rowArray["colour"]);
58
printE("surface_treatment","input",$rowArray["surface_treatment"]);
59
printE("fabric","input",$rowArray["fabric"]);
60
printE("form","input",$rowArray["form"]);
61
//getting the pot list
62
$queryString = "select * from tbl_entry_location where tbl_pottery_refid=".$refid." order by refid";
63
$potQueryResult = $dbconn->sendquery2($queryString);
64
$potRowNr = $dbconn->numberofrows();
67
for($potNo=0;$potNo<$potRowNr;++$potNo)
69
$rowarray = pg_fetch_array($potQueryResult,null,PGSQL_ASSOC);
70
printE("pot:".$potNo."-0-0-0","select",$rowarray["potzone"]);
71
//getting the location list
72
$queryString = "select * from tbl_entry_type where tbl_entry_type_refid=".$rowarray["refid"]." order by refid";
73
$locationQueryResult = $dbconn->sendquery2($queryString);
74
$locationRowNr = $dbconn->numberofrows();
77
for($locationNo=0;$locationNo<$locationRowNr;++$locationNo)
79
$rowarray = pg_fetch_array($locationQueryResult,null,PGSQL_ASSOC);
80
printE("location:".$potNo."-".$locationNo."-0-0","select",$rowarray["entrytype"]);
81
$locationValue = $rowarray["entrytype"];
82
printE("method:".$potNo."-".$locationNo."-0-0","input",$rowarray["method"]);
83
printE("inlay:".$potNo."-".$locationNo."-0-0","input",$rowarray["inlay"]);
84
printE("design:".$potNo."-".$locationNo."-0-0","input",$rowarray["design"]);
85
printE("comments:".$potNo."-".$locationNo."-0-0","input",$rowarray["comments"]);
86
//getting the entry list
87
$queryString = "select * from tbl_entry_type_detail where entrytyperefid=".$rowarray["refid"]." order by refid";
88
$entryQueryResult = $dbconn->sendquery2($queryString);
89
$entryRowNr = $dbconn->numberofrows();
92
for($entryNo=0;$entryNo<$entryRowNr;++$entryNo)
94
$rowarray = pg_fetch_array($entryQueryResult,null,PGSQL_ASSOC);
95
if(strcmp($locationValue,"all over")!=0)
97
if(strcmp($locationValue,"zoned")==0 && strcmp($rowarray["entrydetail"],"geometric")==0 )
99
printE("entryType:".$potNo."-".$locationNo."-".$entryNo."-0","select",$rowarray["entrydetail"]."2");
100
$entryValue = $rowarray["entrydetail"]."2";
104
printE("entryType:".$potNo."-".$locationNo."-".$entryNo."-0","select",$rowarray["entrydetail"]);
105
$entryValue = $rowarray["entrydetail"];
109
$entryValue = $rowarray["entrydetail"];
110
$entryRefid = $rowarray["refid"];
112
$isPatternInfill = false;
113
//getting the component list
114
$queryString = "select * from tbl_entry_type_components where typedetailrefid=".$entryRefid." order by refid";
115
$componentQueryResult = $dbconn->sendquery2($queryString);
116
$componentRowNr = $dbconn->numberofrows();
117
if($componentRowNr >0)
119
for($componentNo=0;$componentNo<$componentRowNr;++$componentNo)
121
$rowarray = pg_fetch_array($componentQueryResult,null,PGSQL_ASSOC);
122
if( (strcmp($locationValue,"zoned")==0 && strcmp($rowarray["entrytype"],"infill")==0) ||
123
(strcmp($entryValue,"linear")==0 && strcmp($rowarray["entrytype"],"elements")==0) ||
124
(strcmp($entryValue,"swag")==0 && strcmp($rowarray["entrytype"],"elements")==0) ||
125
(strcmp($entryValue,"running scroll")==0 && strcmp($rowarray["entrytype"],"infill")==0) ||
126
(strcmp($entryValue,"geometric")==0 && strcmp($rowarray["entrytype"],"type")==0)
128
printE($rowarray["entrytype"].":".$potNo."-".$locationNo."-".$entryNo."-0","simpleSelect",$rowarray["entryvalue"]);
129
elseif((strcmp($entryValue,"curvilinear")==0 && strcmp($rowarray["entrytype"],"type")==0))
130
printE($rowarray["entrytype"].":".$potNo."-".$locationNo."-".$entryNo."-0","specialInput",$rowarray["entryvalue"]);
132
printE($rowarray["entrytype"].":".$potNo."-".$locationNo."-".$entryNo."-0","input",$rowarray["entryvalue"]);
133
if(strcmp($rowarray["entrytype"],"infill")==0 && strcmp($rowarray["entryvalue"],"pattern")==0)
134
$isPatternInfill = true;
137
//getting the border list
138
$queryString = "select * from tbl_component_borders where typedetailrefid=".$entryRefid." order by refid";
139
$componentQueryResult = $dbconn->sendquery2($queryString);
140
$componentRowNr = $dbconn->numberofrows();
141
if($componentRowNr >0)
144
for($componentNo=0;$componentNo<$componentRowNr;++$componentNo)
146
$rowarray = pg_fetch_array($componentQueryResult,null,PGSQL_ASSOC);
148
if($isPatternInfill && strcmp($rowarray["borderorshape"],"border")==0)
150
if(strcmp($rowarray["borderorshape"],"border")==0)
151
printE("border:".$potNo."-".$locationNo."-".$entryNo."-".($componentNo+$surplus),"simpleSelect",$rowarray["value"]);
153
printE("shape:".$potNo."-".$locationNo."-".$entryNo."-".($componentNo+$surplus),"simpleSelect",$rowarray["value"]);
154
if(strcmp($rowarray["type"],"")!=0)
155
printE("borderType:".$potNo."-".$locationNo."-".$entryNo."-".($componentNo+$surplus),"input",$rowarray["type"]);
156
if(strcmp($rowarray["orientation"],"")!=0)
157
printE("borderOrientation:".$potNo."-".$locationNo."-".$entryNo."-".($componentNo+$surplus),"input",$rowarray["orientation"]);
158
printE("borderMethod:".$potNo."-".$locationNo."-".$entryNo."-".($componentNo+$surplus),"input",$rowarray["method"]);
159
printE("borderContinuity:".$potNo."-".$locationNo."-".$entryNo."-".($componentNo+$surplus),"input",$rowarray["continuity"]);
160
printE("borderElements:".$potNo."-".$locationNo."-".$entryNo."-".($componentNo+$surplus),"input",$rowarray["elements"]);
161
printE("borderNoRows:".$potNo."-".$locationNo."-".$entryNo."-".($componentNo+$surplus),"input",$rowarray["numberofrows"]);
164
//getting the bandElements list
165
$queryString = "select * from tbl_component_elements where typedetailrefid=".$entryRefid." order by refid";
166
$componentQueryResult = $dbconn->sendquery2($queryString);
167
$componentRowNr = $dbconn->numberofrows();
168
if($componentRowNr >0)
170
for($componentNo=0;$componentNo<$componentRowNr;++$componentNo)
172
$rowarray = pg_fetch_array($componentQueryResult,null,PGSQL_ASSOC);
173
printE("bandelements:".$potNo."-".$locationNo."-".$entryNo."-".$componentNo,"simpleSelect",$rowarray["value"]);
174
printE("bandorientation:".$potNo."-".$locationNo."-".$entryNo."-".$componentNo,"input",$rowarray["orientation"]);
175
printE("bandmethod:".$potNo."-".$locationNo."-".$entryNo."-".$componentNo,"input",$rowarray["method"]);
176
printE("bandnoRows:".$potNo."-".$locationNo."-".$entryNo."-".$componentNo,"input",$rowarray["numberofrows"]);
177
printE("bandContinuity:".$potNo."-".$locationNo."-".$entryNo."-".$componentNo,"input",$rowarray["continuity"]);
186
echo "\t\t\telementList.reverse();\n";
187
echo "\t\t</script>\n";
192
<body onload="initialize()">
193
<h1>Pottery Database</h1>
194
<div id="welcomeSection">
196
<form name="logout" action="logonAuthentication.php" method="POST">
197
<input name="action" value="logout" type="hidden"/>
198
<a class="inlineLink" href="#" onclick="document.forms['logout'].submit();"> Logout <?echo $_SESSION["fname".KEY]." ".$_SESSION["lname".KEY];?></a>
205
echo " | <a class=\"inlineLink\" href=\"javascript:addnew()\">New</a>";
210
<a class="inlineLink" href="index2.php">pot list</a>
211
| <a class="inlineLink" href="searchPottery.php">Search Pottery</a>
214
if(isset($_GET["status"]) && strcmp($_GET["status"],"succes")==0)
215
echo "<h3>Previous data has been succesfully added to the database...</h3>\n";
217
echo "<h3>".$debugString."</h3>";
220
<form name="entry" method="post" action="nextStep.php">
221
<div id="entryDetail">
222
<p class="details">Pot details:</p>
225
<input type="text" name="pottery number" maxlength="20" id="potteryNumber" length="10"/>
229
<input type="text" name="context number" maxlength="20" id="contextNumber" length="10"/>
233
<input type="text" name="site number" maxlength="20" id="siteNumber" length="10" onkeypress="onDigitInputsChange(event)"/>
237
<input type="text" name="date area" maxlength="20" id="dateArea" length="10"/>
240
<p>description code</p>
241
<input type="text" name="description code" maxlength="20" id="descriptionCode" length="10"/>
245
<input type="text" name="fabric" maxlength="20" id="fabric" length="10"/>
249
<input type="text" name="colour" maxlength="30" id="colour" length="10"/>
252
<p>surface treatment</p>
253
<input type="text" name="surface_treatment" maxlength="30" id="surface_treatment" length="10"/>
257
<input type="text" name="form" maxlength="20" id="form" length="10"/>
259
<div class="clear"></div>
263
<div id="potteryForm" class="inline">
264
<div id="0-0-0-0" class="block" lastLocationNumber="1">
268
<input type="submit" value="Save" title="press this button to save data"/>
270
<div id="WindowCover" class="invisible">
273
<br/>Loaded<p id="WindowCoverLoaded"></p>%
278
Developed by Oxford Archaeology, Maturo Cito, Adnitor Alternus Alicubi Clavis
b'\\ No newline at end of file'