Link to enlarge Archaeology Plate 107 ©Annie Hunter Travis Doering and Lori Collins
MESOAMERICAN THREE-DIMENSIONAL IMAGING DATABASE

© 2007 Travis Doering and Lori Collins
AIST Logo

'; ##split search words for 'and' and 'or' if($search) { if(strstr($search,' and ') || strstr($search,' or ')) { if(strstr($search,' and ')) { $arr=split(' and ',$search); while(list($key,$value) = each($arr)) { if($where=="") { $where="WHERE (id_number like '%$value%' or artifact_name like '%$value%' or origin_site like '%$value%' or artifact_type like '%$value%' or artifact_medium like '%$value%' or location like '%$value%' or notes like '%$value%' or chron_era like '%$value%' or chron_specific like '%$value%' or collaborators like '%$value%' or site_info like '%$value%')"; } else { $where=$where . " and (id_number like '%$value%' or artifact_name like '%$value%' or origin_site like '%$value%' or artifact_type like '%$value%' or artifact_medium like '%$value%' or location like '%$value%' or notes like '%$value%' or chron_era like '%$value%' or chron_specific like '%$value%' or collaborators like '%$value%' or site_info like '%$value%')"; } //end where=="" }//end while } //end if strstr($search,' and ') if(strstr($search,' or ')) { $arr=split(' or ',$search); while(list($key,$value) = each($arr)) { if($srch_cnt>0) { if($where=="") { $where="WHERE (id_number like '%$value%' or artifact_name like '%$value%' or origin_site like '%$value%' or artifact_type like '%$value%' or artifact_medium like '%$value%' or location like '%$value%' or notes like '%$value%' or chron_era like '%$value%' or chron_specific like '%$value%' or collaborators like '%$value%' or site_info like '%$value%')"; } else { $where=$where . " or (id_number like '%$value%' or artifact_name like '%$value%' or origin_site like '%$value%' or artifact_type like '%$value%' or artifact_medium like '%$value%' or location like '%$value%' or notes like '%$value%' or chron_era like '%$value%' or chron_specific like '%$value%' or collaborators like '%$value%' or site_info like '%$value%')"; } //end where=="" }// end $srch_cnt>0 }//end while } // end strstr($search,' or ') } else { if($where =="") { $where="WHERE (id_number like '%$search%' or artifact_name like '%$search%' or origin_site like '%$search%' or artifact_type like '%$search%' or artifact_medium like '%$search%' or location like '%$search%' or notes like '%$search%' or chron_era like '%$search%' or chron_specific like '%$search%' or collaborators like '%$search%' or site_info like '%$search%')"; } else { $where = $where . " and (id_number like '%$search%' or artifact_name like '%$search%' or origin_site like '%$search%' or artifact_type like '%$search%' or artifact_medium like '%$search%' or location like '%$search%' or notes like '%$search%' or chron_era like '%$search%' or chron_specific like '%$search%' or collaborators like '%$search%' or site_info like '%$search%')"; } //end if($where =="") } //end if(strstr($search,' and ') || strstr($search,' or ')) } else { if($where =="") { $where="WHERE (id_number like '%$search%' or artifact_name like '%$search%' or origin_site like '%$search%' or artifact_type like '%$search%' or artifact_medium like '%$search%' or location like '%$search%' or notes like '%$search%' or chron_era like '%$search%' or chron_specific like '%$search%' or collaborators like '%$search%' or site_info like '%$search%')"; } else { $where = $where . " and (id_number like '%$search%' or artifact_name like '%$search%' or origin_site like '%$search%' or artifact_type like '%$search%' or artifact_medium like '%$search%' or location like '%$search%' or notes like '%$search%' or chron_era like '%$search%' or chron_specific like '%$search%' or collaborators like '%$search%' or site_info like '%$search%')"; } //end if($where =="") } //end if $search //if($icons) { if (@array_count_values($chron) ) { //echo '
' . $icons[0]; $cnt_chron = count($chron); //echo $cnt_chron; if($chron[0]) { for($w=0; $w<$cnt_chron; $w++) { //echo 'inside icons array'; if($chron_elements=="") { $chron_elements = $chron[$w]; } else { $chron_elements = $chron_elements . " and " . $chron[$w]; } if(strstr($chron[$w],' or ')) { $arr=split(' or ',$chron[$w]); while(list($key,$value) = each($arr)) { if($where =="") { $where = "where (chron_specific like '%$value%' or chron_specific like '%$value %' or chron_era like '%$value%' or chron_era like '%$value %')"; } else { $where = $where . " or chron_specific like '%$value%' or chron_specific like '%$value %' or chron_era like '%$value%' or chron_era like '%$value %')"; } //end if($where =="") } //while(list($key,$value) = each($arr)) } else { //echo 'inside else'; if($where =="") { $where = "where (chron_specific like '%$value%' or chron_specific like '%$value %' or chron_era like '%$value%' or chron_era like '%$value %')"; } else { $where = $where . " and (chron_specific like '%$value%' or chron_specific like '%$value %' or chron_era like '%$value%' or chron_era like '%$value %')"; } //end if($where =="") }//end if(strstr($chron[$w],' or ')) }//end for($w=0; $w<$cnt_chron; $w++) } //end if($chron[0]) } else { $chron_elements = ""; if(strstr($chron,' and ')) { if($chron_elements=="") { $chron_elements = $chron; } else { $chronelements = $chron_elements . " and " . $chron; } //end if($chron_elements=="") $arr=split(' and ',$chron); while(list($key,$value) = each($arr)) { if($where =="") { $where = "where (chron_specific like '%$value%' or chron_specific like '%$value %' or chron_era like '%$value%' or chron_era like '%$value %')"; } else { $where = $where . " and (chron_specific like '%$value%' or chron_specific like '%$value %' or chron_era like '%$value%' or chron_era like '%$value %')"; } //end if($where =="") }//while(list($key,$value) = each($arr)) } else if(strstr($chron,' or ')) { if($chron_elements=="") { $chron_elements = $chron; } else { $chron_elements = $chron_elements . " or " . $chron; } //end if($chron_elements=="") $arr=split(' or ',$chron); while(list($key,$value) = each($arr)) { if($where =="") { $where = "where (chron_specific like '%$value%' or chron_specific like '%$value %' or chron_era like '%$value%' or chron_era like '%$value %')"; } else { $where = $where . " and (chron_specific like '%$value%' or chron_specific like '%$value %' or chron_era like '%$value%' or chron_era like '%$value %')"; } //end if($where =="") }//while(list($key,$value) = each($arr)) } else { if($chron) { if($chron_elements=="") { $chron_elements = $chron; } else { $chron_elements = $chron_elements . " or " . $chron; } //end if($chron_elements=="") if($where =="") { $where = "where (chron_specific like '%$chron%' or chron_specific like '%$chron %' or chron_era like '%$chron%' or chron_era like '%$chron %')"; } else { $where = $where . " and (chron_specific like '%$chron%' or chron_specific like '%$chron %' or chron_era like '%$chron%' or chron_era like '%$chron %')"; } //end if($where =="") } //end if($chron) } //end if(strstr($chron,' and ')) } //end if (@array_count_values($chron) ) if($culture) { if($where =="") { $where = "where (culture like '%$culture%' or culture like '%$culture %')"; } else { $where = $where . " and (culture like '%$culture%' or culture like '%$culture %')"; } } if($geographicarea) { if($where =="") { $where = "where (geographicarea like '%$geographicarea%' or geographicarea like '%$geographicarea %')"; } else { $where = $where . " and (geographicarea like '%$geographicarea%' or geographicarea like '%$geographicarea %')"; } } if($site) { if($where =="") { $where = "where (origin_site like '%$site%' or origin_site like '%$site %')"; } else { $where = $where . " and (origin_site like '%$site%' or origin_site like '%$site %')"; } } //only display the published items if($where =="") { $where = "where publish = 1"; } else { $where = $where . " and publish = 1"; } //geographicarea, culture and chron not used at this time //if($search || $site) { #query db with new search term $result = mysql_query("select * from 3dproject $where order by id_number, artifact_type ASC limit $rowstart,$display_number"); $sql = "select * from 3dproject $where order by id_number, artifact_type ASC limit $rowstart,$display_number"; //echo $sql; $result2 = mysql_query("select * from 3dproject $where order by id_number, artifact_type ASC"); if(@mysql_num_rows($result2)==0) { $result_cnt = 0; } else { $result_cnt = mysql_num_rows($result2); } if(@mysql_num_rows($result)==0) { $record_cnt = 0; } else { $record_cnt = mysql_num_rows($result); } ##determine number of pages if (!isset($num_pages)) { if($result_cnt > $display_number) { $num_pages = ceil($result_cnt/$display_number); } elseif($result_cnt > 0) { $num_pages = 1; } } else { $start=0; } $a = $rowstart + ($display_number) ; if ($a > $result_cnt) { $a = $result_cnt ; } $b = $rowstart + 1 ; echo ''; echo ''; echo '
Click on any image to view in high resolution.
'; echo "Click the checkboxes and the 'review selections' button to view images with captions in a printable format.
"; echo '
'; echo ''; echo '

'; if ($rowstart>$numrows) {?>
'; ?> '; ?> Edit Query Review Selections'; echo '
'; echo ''; echo '
'; if($search != "") { if(strstr($search,'%')) { $search = str_replace("%","*",$search); } echo 'Results '.$b.' - '.$a. ' of ' .$result_cnt .' for "' .stripslashes($search).'"'; } else { echo 'Results '.$b.' - '.$a. ' of ' .$result_cnt; } echo '
'; echo '

'; echo ''; //put all the code here for running the script itself using $result in the while loop if($record_cnt>0) { for ($i=0; $i<$record_cnt; $i++) { ##while ($row= mysql_fetch_array($result)) { $row = mysql_fetch_array($result); $image = ""; if($row['id_number']) { $queryPhoto = mysql_query("select * from 3dproject_images where id_number = '".$row['id_number']."' and image_type = 'photo' and thumbnail = 1 order by 3dproject_image_id ASC limit 1"); $resultPhoto = mysql_num_rows($queryPhoto); if($resultPhoto>0){ $data = mysql_fetch_array($queryPhoto); $image=trim($data['image']); //GET ALT tag for image if($data['credit']) { switch($data['image_type']) { case 'line_draw' : $credit = 'Drawing by '.$data['credit']; break; case 'photo' : $credit = 'Photograph by '.$data['credit']; break; default : $credit = 'Scan Image by '.$data['credit']; break; }//end switch } //end if alt tag } //end if($resultPhoto>0) $k++; $image_number=$row['id_number']; echo ''; if ($i>$k) { echo '
'; ?>
'; if($image) { $image_name=str_replace('uploads/','',$image); $image = '/3D_imaging/uploads/'; //echo "'.$credit.'
'; echo ''.$credit.'
'; echo ''; echo $row['id_number']; } else { echo ''; echo $row['id_number'].'
'; } echo '
'; echo $row['artifact_name']; echo '

'; echo 'select item for review
'; if(($i+1)<$record_cnt){ echo ''; } $k=$k+2; } else { $k--; } //end if ($i>$k) } //end if($row['id_number']) } //end for ($i=0; $i<$record_cnt; $i++) echo '
'; } else { for($p=0; $p<$cnt_maya; $p++) { echo ''; echo '
'; }//end for($p=0; $p<$cnt_maya; $p++) } //end if($record_cnt>0) //echo '
'; if ($i>$k) { echo '
'; echo ''; } else { echo '
'; echo '
'; } //add Logos if($site == "Takalik Abaj") { echo ''; echo ''; echo ""; } //end add logos echo '
'; echo '
Prepared for and in collaboration with:
Schieber de Lavarreda & Orrego/Proyecto Nacional Tak'alik Ab'aj/Ministerio de Cultura y Deportes
Dirección General del Patrimonio Cultural y Natural-IDAEH
'; if($num_pages>1) { if ($rowstart==0) { $current_page = 1; } else { $current_page=($rowstart/$display_number) + 1; } } if (($rowstart<=$numrows) && ($rowstart !=0)) {?> '; echo ''; echo 'Edit query'; echo ''; echo '
'; echo ''; echo '
'; echo 'Go to Page:  '; for($i=1;$i<=$num_pages;$i++) { $next_start=$start + $display_number; if($i!=$current_page) { echo '' . $i . ' '; } else { echo ' ' . $i . ' '; } } echo '
'; //echo '
'; //} //end if($search | $site) ?>