PageRenderTime 259ms CodeModel.GetById 94ms app.highlight 67ms RepoModel.GetById 90ms app.codeStats 1ms

/da_catalog_edit_testSection.php

https://github.com/jmjamison/da_catalog_maintenance
PHP | 634 lines | 367 code | 178 blank | 89 comment | 72 complexity | 4208f476d982c584727f036ab848d2e8 MD5 | raw file
  1<html>
  2<head><title>Data Archive Catalog: Edit</title>
  3<link rel="stylesheet" href="2col_leftNav.css" type="text/css">
  4<!--  Javascript(s) to 1) paste PI names into text field, 2) clear the text fiels -->
  5<script language="JavaScript" src="da_catalog.js" type="text/javascript"><!--  da_catalog scripts //--></script>
  6<!-- end Javascript PI paste and clear -->
  7
  8</head>
  9<body>
 10  <?php
 11		
 12	$sscnetHTTP = "http://www.sscnet.ucla.edu/issr/da/da_catalog/";
 13	$sscnetHTTP_maintenance_test = "http://www.sscnet.ucla.edu/issr/da/da_catalog_maintenance_test/";
 14	$sscnetHTTP_maintenance_live = "http://www.sscnet.ucla.edu/issr/da/da_catalog_maintenance/";
 15	$mydestopHTTP = "http://localhost/da_catalog/";
 16	$currentHTTP = $sscnetHTTP_maintenance_live;
 17	
 18	$sscnetInclude = "ISSRDATEST_login.php";
 19	$mydesktopInclude = "../db_login2.php";
 20	$currentInclude = $sscnetInclude;
 21	include($currentInclude); 
 22	
 23	// for desktop test system
 24	//$db_name = "da_catalog";	
 25	
 26	
 27	if (!empty($_POST['studynumber'])) {
 28		//echo "studynumber: " . $studynumber;
 29		$_SESSION['studynumber'] = $_POST['studynumber'];
 30		
 31			// something is selected
 32			$queryGetBaseRecord = "SELECT title.*, picode.ID as picode_id, picode.picode, picode.tisubsort,  pifull.*, shcode.ID as shcode_id, shcode.subjectcode, shcode.subsort as subject_subsort, shfull.*, wwwlink_pi.wwwlink AS wwwlink_pi, wwwlink_pi.wwwtext AS wwwtext_pi, wwwlink_subject.wwwlink AS wwwlink_subject, wwwlink_subject.wwwtext AS wwwtext_subject, cite.cite, cite.subsort, pifull.picode FROM cite RIGHT JOIN ((((((title LEFT JOIN picode ON title.tisort = picode.tisort) LEFT JOIN pifull ON picode.picode = pifull.picode) LEFT JOIN shcode ON title.tisort = shcode.tisort) LEFT JOIN shfull ON shcode.subjectcode = shfull.subjectcode) LEFT JOIN wwwlink AS wwwlink_subject ON shfull.subjectcode = wwwlink_subject.subjectcode) LEFT JOIN wwwlink AS wwwlink_pi ON pifull.picode = wwwlink_pi.picode) ON cite.citenum = title.Cite WHERE (((title.StudyNum)='" . $studynumber ."'))";
 33			
 34	//echo "<br>" . $queryGetBaseRecord . "<br>";
 35			
 36	// PDO connect  
 37		$PDO_string = "mysql:host=" . $db_host . ";port=" . $db_port . ";dbname=" . $db_name ;
 38
 39	 
 40	//  echo "<br>" .  $queryGetBaseRecord . "<br>";
 41			try	{
 42				$PDO_connection = new PDO($PDO_string, $db_username, $db_password);
 43		
 44				} catch(PDOException $e)	{
 45					echo "Could not connect to the database because: ".	$e->getMessage()."<br>";
 46					die();
 47					}
 48	
 49			// PDO - create prepared statement: get the table.pifull
 50 			// --------------------------------------------------------
 51			$PDO_query = $PDO_connection->prepare($queryGetBaseRecord);
 52			// PDO - execute the query
 53			$result = $PDO_query->execute();
 54	  		if (!$result) {
 55				die ("Could not query the database: <br />". mysql_error());
 56				} 	
 57			// complete record info
 58			$titleRecord = array();  // record - the title, sub# and restricted y/n
 59			// list of pi(s)
 60			$piList = array();		// list of pi(s)
 61			$piListFull = array();
 62			$current_pi = null;
 63			$temp = "";
 64			
 65			$subjectList = array(); // list of subjects
 66			$subjectListFull = array();
 67			$current_subject = null;
 68			
 69			$usefulLinks = array();	// linklist
 70			
 71			$row_index = 0;   
 72			while ($row = $PDO_query->fetch(PDO::FETCH_ASSOC))  {
 73		
 74			//----------------------------------------------------------------------------------------------------------------------------
 75			//
 76			//  there will only be one title record. these are essentially the fields from the title table
 77			//     because the query grabs everything in one big swoop the title record items will appear more than once even though there can only be
 78			//     one title record - the title record is the base record
 79			//    
 80			//     on the otherhand there can be multiple PIs, Subjects/Keywords and links. Those are handled separated. This note referes specifically to
 81			//          the title record
 82			//
 83			//---------------------------------------------------------------------------------------------------------------------------
 84				
 85				// relevant fields from the title and cite tables
 86				
 87				$_SESSION['title'] = $row["Title"];
 88				$_SESSION['tisort'] = $row["tisort"];   // ID for title table, connecting field to the picode and shcode tables
 89				$_SESSION['restricted'] = $row[ "Restricted" ];
 90				$_SESSION['www'] = $row[ "WWW" ];
 91				$_SESSION['cite_title'] = $row[ "cite"];
 92				$_SESSION['cite_subsort'] = $row["subsort"];
 93				if ($_SESSION['cite_subsort'] <= 1) { $_SESSION['cite_subsort'] = 1; }    // in the event that subsort is 0/not set, reset it to 1
 94				$_SESSION['sda'] = $row["SDA"];
 95				$_SESSION['varsrch'] = $row["Varsrch"];
 96				$_SESSION['justonCD'] = $row["JustOnCD"];
 97				$_SESSION['mobilityData'] = $row["mobilityData"];
 98				$_SESSION['eveFielderCollection'] = $row["eveFielderCollection"];
 99			
100				
101				$piList[$row_index] = $row[ "pi"];
102				
103				
104				$temp_pi = $row["pi"];
105				if ($temp_pi != $current_pi) {
106					
107					$piListFull[$row_index]["picode_id"] = $row["picode_id"];
108					$piListFull[$row_index]["pi_tisubsort"] = $row["tisubsort"];
109					$piListFull[$row_index]["pi"] = $temp_pi;
110					$piListFull[$row_index]["picode"] = $row["picode"];
111					
112					$current_pi = $temp_pi;	
113					//echo "<br>" . $temp_pi . "<br>";
114				}
115				
116				
117			
118				$subjectList[$row_index] = $row[ "subject"];
119				
120				$temp_subject = $row["subject"];
121				if ($temp_subject != $current_subject) {
122					
123					$subjectListFull[$row_index]["shcode_id"] = $row["shcode_id"];
124					$subjectListFull[$row_index]["subject_subsort"] = $row["subject_subsort"];
125					$subjectListFull[$row_index]["subject"] = $temp_subject;
126					$subjectListFull[$row_index]["subjectcode"] = $row["subjectcode"];
127					
128					$current_subject = $temp_subject;
129					//echo "<br>" . $temp_subject . "<br>";
130				}
131			
132				$row_index++;
133				
134			}
135			//print_r($subjectListFull);
136			//echo "<br>";
137			
138			sort($piListFull);   // this will sort and re-number
139			sort($subjectListFull);
140			//print_r($piListFull);
141			//echo "<br><br>";
142			$piListFullCount = count($piListFull);
143			$subjectListFullCount = count($subjectListFull);
144						
145			$piList = array_unique($piList);
146			sort($piList);
147			$piListCount = count($piList);
148			//echo "<br>unique pi rows: " . $piListCount;
149			
150			//print_r($piList);
151			
152			if ($piListCount <= 1) {   //  just one pi
153			
154				$row_index = 0;
155				
156				$pi = $piList[$row_index];
157				// I'm still using both of these
158				$piTempList = $piList[$row_index];
159				
160				$_SESSION['pi'] = $piList[$row_index];
161				
162			} elseif ($piListCount > 1) { // there will be a list of PIs
163			
164					$piTempList = "";
165					
166					for ($row_index = 0; $row_index < $piListCount-1; $row_index++) {  // minus 1 so the last item won't have a ;
167						
168						$piTempList .= $piList[$row_index] . "; ";
169						
170						}
171						
172						$piTempList .= $piList[$row_index];
173						
174						//echo $piTempList . "<br>";
175						
176						$_SESSION["pi"] = $piTempList;
177					
178			}
179			//echo $piTempList . "<br>";
180			//$subjectListCount = count($piList);
181			$subjectList = array_unique($subjectList);
182			sort($subjectList);
183			$subjectListCount = count($subjectList);			
184			
185			if ($subjectListCount <= 1) {   //  just one subject/keyword
186			
187				$row_index = 0;
188				$_SESSION['subject'] = $subjectList[$row_index];
189				
190			} elseif ($subjectListCount > 1) { // there will be a list of PIs
191			
192					$subjectTempList = "";
193					
194					for ($row_index = 0; $row_index < $subjectListCount-1; $row_index++) {  // minus 1 so the last item won't have a ;
195						
196						$subjectTempList .= $subjectList[$row_index] . "; ";
197						
198						}
199						
200						$subjectTempList .= $subjectList[$row_index];
201						
202						//echo $subjectTempList . "<br>";
203						
204						$_SESSION["subject"] = $subjectTempList;
205					
206			}
207					
208			//echo "<br>" . $subjectTempList . "<br>";
209						
210			// close connection
211			$PDO_connection = null;
212			
213			//
214			
215		
216		
217		
218	} else 
219		
220			$studynumber = '';  
221	
222	//  add session variables so the pages stays populated
223	//session_start();
224	
225	if (isset($_SESSION['studynumber']))
226			$studynumber = $_SESSION['studynumber'];
227	else 
228			$studynumber = ''; 
229			
230	if (isset($_SESSION['title']))
231			$title = $_SESSION['title'];
232	else 
233			$title = '';
234			
235	if (isset($_SESSION['tisort']))
236			$tisort = $_SESSION['tisort'];
237	else 
238			$tisort = '';
239			
240	if (isset($_SESSION['pi']))
241			$pi = $_SESSION['pi'];
242	else 
243			$pi = '';
244	
245	if (isset($_SESSION['subject']))
246			$subject = $_SESSION['subject'];
247	else 
248			$subject = '';
249	
250	if (isset($_SESSION['cite_title']))
251			$cite_title = $_SESSION['cite_title'];
252	else 
253			$cite_title = '';
254			
255	if (isset($_SESSION['cite_subsort']))
256			$cite_subsort = $_SESSION['cite_subsort'];
257	else 
258			$cite_subsort = '';
259			
260	if (isset($_SESSION['wwwtext']))
261			$wwwtext = $_SESSION['wwwtext'];
262	else 
263			$wwwtext = '';
264			
265	if (isset($_SESSION['wwwlink']))
266			$wwwlink = $_SESSION['wwwlink'];
267	else 
268			$wwwlink = '';
269			
270	if (isset($_SESSION['sda']))
271			$sda = $_SESSION['sda'];
272	else 
273			$sda = '';
274			
275	if (isset($_SESSION['varsrch']))
276			$varsrch = $_SESSION['varsrch'];
277	else 
278			$varsrch = '';
279			
280	if (isset($_SESSION['restricted']))
281			$restricted = $_SESSION['restricted'];
282	else 
283			$restricted = '';
284			
285	if (isset($_SESSION['justonCD']))
286			$justonCD = $_SESSION['justonCD'];
287	else 
288			$justonCD = '';
289			
290	if (isset($_SESSION['mobilityData']))
291			$mobilityData = $_SESSION['mobilityData'];
292	else 
293			$mobilityData = '';
294			
295	if (isset($_SESSION['eveFielderCollection']))
296			$eveFielderCollection = $_SESSION['eveFielderCollection'];
297			
298	else 
299			$eveFielderCollection = '';
300			
301	
302	//echo "<br>" . $title . ", " . $sda . ", " . $justonCD . ", " . $varsrch . ", " . $mobilityData . ", " . $eveFielderCollection . "<br>";
303	
304	//$queryFileTypes = "SELECT distinct FileType FROM fileinfo where FileType != '' ORDER BY FileType";
305$queryFileTypes = "SELECT DISTINCT fileinfo.FileType FROM fileinfo WHERE ((Not (fileinfo.FileType)='')) OR (((fileinfo.FileType) Is Not Null)) ORDER BY fileinfo.FileType";
306	
307	$queryTitleStudyNumFileType = "SELECT title.StudyNum, fileinfo.FileType, fileinfo.DTAfile FROM title LEFT JOIN fileinfo ON title.StudyNum = fileinfo.StudyNum ORDER BY title.StudyNum";
308	
309	
310	
311	// PDO connect  
312	$PDO_string = "mysql:host=" . $db_host . ";port=" . $db_port . ";dbname=" . $db_name ;
313	
314	try	{
315		$PDO_connection = new PDO($PDO_string, $db_username, $db_password); 
316		
317		} catch(PDOException $e)	{
318			echo "Could not connect to the database because: ".	$e->getMessage()."<br>";
319			die();
320			}
321	
322			// PDO - create prepared statement: get the table.pifull
323 			// --------------------------------------------------------
324			$PDO_query = $PDO_connection->prepare($queryTitleStudyNumFileType);
325			// PDO - execute the query
326			$result = $PDO_query->execute();
327	  		if (!$result) {
328				die ("Could not query the database: <br />". mysql_error());
329				} 	
330			$fileTypeList = array();
331			$studynumberList = array();
332			$titleList = array();
333			$dtafileList = array();
334			
335			$result = $PDO_query->fetch(PDO::FETCH_ASSOC); 
336			$row_index = 0;   
337			while ($row = $PDO_query->fetch(PDO::FETCH_ASSOC))  {
338					
339					$studynumberList[$row_index] = $row["StudyNum"];
340					if (!is_null($row["FileType"])) { $fileTypeList[$row_index] = $row["FileType"];  }  // others won't have nulls
341					$dtafileList[$row_index] = $row["DTAfile"];
342					
343					
344					$row_index++;
345			}
346			
347			$fileTypeList = array_unique($fileTypeList);
348			sort($fileTypeList);
349			$fileTypeTotal = count($fileTypeList);
350			
351			$dtafileList = array_unique($dtafileList);
352			sort($dtafileList);
353			
354			
355			$studynumberList = array_unique($studynumberList);
356			sort($studynumberList);
357			$studynumberListTotal = count($studynumberList);
358			
359			
360			$fileTypeListText = implode("','", $fileTypeList);
361			$fileTypeListText = "'" . $fileTypeListText . "'";
362			
363			
364//--------------------------------------------------------------------
365//  Section: populate the PI listbox
366//      used for authority control, javascript select_PIs will paste in selected fields
367//----------------------------------------------------------------------
368$queryPI_list = "SELECT DISTINCT * FROM pifull ORDER BY pi";
369// echo text for debugging purposes only
370	
371	// PDO connect  
372	$PDO_string = "mysql:host=" . $db_host . ";port=" . $db_port . ";dbname=" . $db_name ;
373	
374	try	{
375		$PDO_connection = new PDO($PDO_string, $db_username, $db_password); 
376		
377		} catch(PDOException $e)	{
378			echo "Could not connect to the database because: ".	$e->getMessage()."<br>";
379			die();
380			}
381	
382			// PDO - create prepared statement: get the table.pifull
383 			// --------------------------------------------------------
384			$PDO_query = $PDO_connection->prepare($queryPI_list);
385			// PDO - execute the query
386			$result = $PDO_query->execute();
387	  		if (!$result) {
388				die ("Could not query the database: <br />". mysql_error());
389				} 	
390			$PI_list = array();
391			
392			
393			$result = $PDO_query->fetch(PDO::FETCH_ASSOC); 
394			$row_index = 0;   
395			
396			while ($row = $PDO_query->fetch(PDO::FETCH_ASSOC))  {
397					
398					$PI_list[$row_index]["picode"] = $row["picode"];
399					$PI_list[$row_index]["pi"] = $row["pi"];
400					$row_index++;
401			}
402			
403			$PI_list_count = count($PI_list);
404			echo "PI count: " . $PI_list_count . "    ";
405			
406//--------------------------------------------------------------
407//       end populate PI section
408//-------------------------------------------------------------
409
410//--------------------------------------------------------------------
411//  Section: populate the Subject/Index-term listbox
412//      used for authority control, javascript to copy and paste in selected fields
413//----------------------------------------------------------------------
414$querySubject_list = "SELECT DISTINCT subject FROM shfull ORDER BY subject";
415//  echo for debugging purposes only
416	
417	// PDO connect  
418	$PDO_string = "mysql:host=" . $db_host . ";port=" . $db_port . ";dbname=" . $db_name ;
419	
420	try	{
421		$PDO_connection = new PDO($PDO_string, $db_username, $db_password); 
422		
423		} catch(PDOException $e)	{
424			echo "Could not connect to the database because: ".	$e->getMessage()."<br>";
425			die();
426			}
427	
428			// PDO - create prepared statement: get the table.pifull
429 			// --------------------------------------------------------
430			$PDO_query = $PDO_connection->prepare($querySubject_list);
431			// PDO - execute the query
432			$result = $PDO_query->execute();
433	  		if (!$result) {
434				die ("Could not query the database: <br />". mysql_error());
435				} 	
436			$Subject_list = array();
437			
438			
439			$result = $PDO_query->fetch(PDO::FETCH_ASSOC); 
440			$row_index = 0;   
441			
442			while ($row = $PDO_query->fetch(PDO::FETCH_ASSOC))  {
443					
444					$Subject_list[$row_index]["subject"] = $row["subject"];
445					$row_index++;
446			}
447			
448			$Subject_list_count = count($Subject_list);
449			echo "Subject count: " . $Subject_list_count . "<br>";
450//--------------------------------------------------------------
451//       end populate Subject section
452//-------------------------------------------------------------
453	
454				
455?>
456
457<div id="masthead">
458<h1 id="siteName">UCLA Institute for Social Research Data Archives</h1> 
459          <h2 id="siteName"><a href="index.php" target="_self">Maintenance Menu</a>&nbsp;/&nbsp;Edit Base Record</h2>  
460</div> <!--end masthead--><!--end masthead-->
461
462<div style="margin: 1% 5% 2% 2%;line-height: 1.5;	">
463  <form <?php 
464  
465  	if (isset($_SESSION['studynumber'])) {     //   a study has been chose so post means go to updateCheck
466			echo " action='da_catalog_updateCheck.php'";  
467			
468		}   else {    //  a study HAS NOT been chosen so post the study info back to the input page when you do choose a study
469				echo " action=''";  
470				}
471	
472	?>    method="post" name="updateRecord" target="_self">
473  
474  
475    <p><label>Studynumber: 
476     <?php
477		   		if (isset($_SESSION['studynumber'])) {
478					
479					$studynumber = $_SESSION['studynumber'];
480					
481					echo '<input name="studynumber" type="text" id="studynumber" value="' . $studynumber . '" size="30" maxlength="255">';
482					
483					
484					echo '</select>';
485					
486					
487				} else {
488			
489					echo '<select name="studynumber" id="studynumber">';
490		   			echo '<option value="">choose studynumber</option>';
491	   		
492					foreach ($studynumberList as $key => $value) {
493				
494						echo '<option value="' . $value . '">' . $value;
495				
496				 	}
497					
498			echo " <input name='getbaserecord' type='submit' id='getbaserecord' value='Get this Studynumber'>";
499				}
500			
501			
502							
503		?></label>
504   
505    <input name="updateTitle" type="submit" id="updateTitle" value="save/update record">
506    <input name="reset form" type="reset" value="reset">
507    <input type="button" onClick="history.go(0)" value="Reload page">
508    <br><br>
509      <input name="title" type="hidden" value="title">
510       
511       <label>Title: <input name="title" type="text" value="<?php echo $title ?>" size="100" maxlength="225">
512       </label><input name="tisubsort" type="hidden" value="1">
513       
514          <br><br>
515      <label>Title level citation: (Subsort number: <?php echo $cite_subsort ?>) <textarea name="cite_title" type="text" cols="200"><?php echo $cite_title ?></textarea></label>
516      <input name="cite_subsort" type="hidden" value="<?php echo $cite_subsort ?>">
517   
518      <label>Restricted:<input name="restricted" type="checkbox"  value="*" <?php if ($restricted == "*") { echo "CHECKED"; }   ?>  >
519      </label> 
520       
521       <label>SDA:<input name="sda" type="checkbox" value="*" <?php if ($sda == "*") { echo "CHECKED"; }   ?>  >
522       </label>
523       &nbsp;&nbsp;
524       <label>Varsrch:<input name="varsrch" type="checkbox" value="*" <?php if ($varsrch == "*") { echo "CHECKED"; }   ?>  >
525       </label>
526       
527       &nbsp;&nbsp;
528      <label>CD Only:
529         <input name="justonCD" type="checkbox" id="justonCD" value="*" <?php if ($justonCD == "*") { echo "CHECKED"; }   ?>  >
530       </label>
531       &nbsp;&nbsp;
532       <label>
533         <input name="article" type="hidden" value="">
534       </label>
535       &nbsp;&nbsp;
536       <label>Mobility Data:<input name="mobilityData" type="checkbox" id="mobilityData" value="*" <?php if ($mobilityData == "*") { echo "CHECKED"; }   ?>  >
537       </label> <label>Eve Fielder Collection:<input name="eveFielderCollection" type="checkbox" id="eveFielderCollection" value="*" <?php if ($eveFielderCollection == "*") { echo "CHECKED"; }   ?>  >
538       </label></p>
539  </form>
540  <form action="da_catalog_processFormCheck.php" method="post" name="editSubject" target="_self">
541  <br><label>Subject/Index Term List: <input name="subject" type="text" value="<?php echo $subjectTempList;  ?> " size="200" maxlength="255"></label>
542     
543      <label>Select Subject/Keyword(s) from list:</label>
544        <input name="pickSubjects" type="button" id="pickSubjects" onClick="selectPasteCopy('editSubject', 'subject_list','subject')" value="Select and Paste to Subject List">
545        <input name="clearOutSubject_list" type="button" id="clearOutSubject_list" onClick="clearoutTextElement('addRecord', 'subject')" value="clear out Subject list">
546        <br>
547        <strong>Note</strong>: It is possible to select <em>MULTIPLE</em> subject/keyword terms but in order to add terms in a <strong>specific order</strong>, select and paste <em>each term Individually</em>. <br>
548        
549      <select name="subject_list" size="10" multiple id="subject_list">
550  <!--
551        //--------------------------------------------------------------------------
552        //   dropdown box that is populated with Subject/Keyword terms
553        //         used as authority control
554        //         pick from list and paste into text box/pi with javscript (da_catalog.js library)  selectPasteCopy and clearoutTextElement scripts functions
555        //--------------------------------------------------------------------------
556         -->
557          <?php
558	   		
559			for ($row_index=0; $row_index < $Subject_list_count; $row_index++) {
560				$subject =  $Subject_list[$row_index]["subject"];
561				
562				echo '<option value="' . $subject . '">' .$subject;
563				
564				 }
565		?>
566        <!--
567         //---------------------------------------------------------------------------------
568     	//  end of suybject list box
569    	 //------------------------------------------------
570          -->
571          
572    </select>
573   
574        
575         <label>Subject(s)/Keywords(s) currently linked to <?php echo $studynumber;  ?></label>
576  <?php if (isset($_SESSION['studynumber'])) {
577					
578					//echo "<br>";
579					$studynumber = $_SESSION['studynumber'];
580					
581					//sort($subjectListFull);
582					//$subjectListFull = array_unique($subjectListFull);
583					sort($subjectListFull);
584					$subjectListFullCount = count($subjectListFull);
585					//echo "<br>unique subject rows: " . $subjectListFullCount . "<br>";
586			
587					
588						for ($row_index = 0; $row_index < $subjectListFullCount; $row_index++) {
589							
590							$subject = $subjectListFull[$row_index]["subject"];
591							$shcode_id = $subjectListFull[$row_index]["shcode_id"];
592							$subjectcode = $subjectListFull[$row_index]["subjectcode"];
593							$subject_subsort = $subjectListFull[$row_index]["subject_subsort"];
594							$currentSubject = null;
595							
596							if ($subjectcode != $currentSubjectCode) {
597							echo "<input name='subject' type='text' value='" . $subject . "'  size='100' maxlength='255'>";
598							echo "<input name='studynumber' type='hidden' value='" .  $studynumber  . "' >";
599							echo "<input name='tisort' type='hidden' value='" .  $tisort  . "' >";
600							echo "<input name='subjectcode' type='text' value='subjectcode: " .  $subjectcode  . "' >";
601							echo "<input name='shcode_id' type='text' value='shcode_id: " .  $shcode_id  . "' >";
602							echo "<input name='item_id' type='hidden' value='" .  $shcode_id  . "' >";
603							echo "<input name='requestCategory' type='hidden' value='subject'>";
604							// name below is the connecting table for the subjects
605							//
606							echo "<input name='subject_subsort' type='hidden' value='" . $subject_subsort . "'  size='3' maxlength='3'>";
607							echo "<input name='item_subsort' type='text' value='" . $subject_subsort . "'  size='3' maxlength='3'>";
608							//
609							echo "<input name='table_name' type='hidden' value='shcode'>";
610							echo "<input name='item_subsort_fieldname' type='hidden' value='subsort'>";
611							echo "<input name='requestType' type='submit' value='Update sort number'>     <input name='requestType' type='submit' value='Delete link'>";
612							//echo "   " . $row_index;
613							$currentSubjectCode = $subjectcode;
614							}
615							
616						}
617								
618				} 
619        
620         ?>
621    </form>
622 
623  <br>
624  <?php  
625 
626 // close the connection
627	// mysql_close($connection);		
628	$PDO_connection = null;
629	
630	?>
631 
632</div> <!-- end content-->
633 
634  </body></html>