Public feed #894250

Mine

public text v1 · immutable
Raw Edit
·published 2008-02-06 20:26 UTC
rendered paste body
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Family Control Panel</title>
<link href="/cfa/style/styleMain.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../gallery/lightbox.css" type="text/css" media="screen" />
<script language="javascript">
    
        function createRequestObject() { 
           var req; 
           if(window.XMLHttpRequest){ 
              // Firefox, Safari, Opera... 
              req = new XMLHttpRequest(); 
           } else if(window.ActiveXObject) { 
              // Internet Explorer 5+ 
              req = new ActiveXObject("Microsoft.XMLHTTP"); 
           } else { 
              // There is an error creating the object, 
              // just as an old browser is being used. 
              alert('Problem creating the XMLHttpRequest object'); 
           } 
        
           return req; 
        
        } 
        
        // Make the XMLHttpRequest object 
        var http = createRequestObject(); 
        
        function sendRequest(q) { 
        
        /*
           // Open PHP script for requests 
              http.open('get', 'ajaxSearch.php?q='+q); 
              http.onreadystatechange = handleResponse; 
              http.send(null); 
        */
        
          if(q.length > 0) {
            // Open PHP script for requests
            http.open('get', 'ajaxSearch.php?q='+q);
            http.onreadystatechange = handleResponse;
            http.send(null);
          }
          else {
            document.getElementById("searchResults").innerHTML = "";
            document.getElementById("searchResults").className = "resNoFrame";
    
          }
        } 
        
        
        
        
        
        
        function handleResponse() { 
           if(http.readyState == 4 && http.status == 200){ 
        
              // Text returned FROM the PHP script 
              var response = http.responseText; 
    
              if(response) { 
                 // UPDATE ajaxTest content 
                 document.getElementById("searchResults").innerHTML = response;
                 document.getElementById("searchResults").className = "resFrame"; 			 
              } 
            } 
        } 
		
		
				
		function imageBrdrIn(idname) {
				document.getElementById(idname).className = "recentImageList2";
				
		}
		function imageBrdrOut(idname) {
				document.getElementById(idname).className = "recentImageList";
				
		}

</script>

<script type="text/javascript" src="../gallery/prototype.js"></script>
<script type="text/javascript" src="../gallery/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="../gallery/lightbox.js"></script>
 
</head>

<body>



<div id="framecontent">
  <div class="frameinnertube"> <span style="display: inline;"> <a class="topBar" style="margin-left: 15px;" href="/cfa/index.php?action=LogOut">Log Out</a>
    <div class="topBarSpacer" href="#"></div>
    <a class="topBar" style="margin-left: 15px;" href="manager.php">Control Panel</a>
    <div class="topBarSpacer" href="#"></div>
    <a class="topBar" style="margin-left: 15px;" href="userMenu.php">User Menu</a>
    <div class="topBarSpacer" href="#"></div>
    <a class="topBar" style="margin-left: 15px;" href="imageUpload.php">Image Upload</a>
    <div class="topBarSpacer" href="#"></div>
    <a class="topBar" style="margin-left: 15px;" href="imageMgr.php">Image Manager</a>
    <div class="topBarSpacer" href="#"></div>
    <a class="topBar" href="/cfa/secure/index.php?">Home</a> </span> <?php echo date ("F, j Y g:i A"); ?> Logged in as: <?php print $_SESSION['fullname']; ?> </div>
</div>


<table style="height: 100%; width:100%;">
<tr>
<td style="width:127px; background-image:url('../cfa/style/pgbrdleft.jpg'); background-repeat:repeat-y; "></td>

<td>



<div id="maincontent">
  <div class="innertube">
    <div id="wrapper">
      <div class="topSpacer" >Chapman Family Photo Album - Search</div>
      <input autocomplete="off"  name="q" type="text" id="q" style="width:300px" onkeyup="sendRequest(this.value);" />
      <input type="submit" style="display: none;"/>
      <div id="searchResults" style="width:294px; padding:5px; "></div>
    </div>
    
	<div id="pageCenterWrapper">

	Recently Uploaded Images

	<div style="padding-top: 25px;">
    
<?
mysql_connect("localhost", "copperle_admin", "family");
mysql_select_db("copperle_family");
$sql = "SELECT * FROM imagedata WHERE date > ".(time()-30*24*60*60)." ORDER BY date DESC";



      
$result = mysql_query($sql);

$array = array();
      
while($row = mysql_fetch_assoc($result))
  $array[] = $row;

$ids = array();

for($i = 0; count($ids) < 4; $i++)
{
    $entry = $array[rand(0, rand(0, count($array)-1))];
    
	if(!array_key_exists($entry['date'], $ids))
       $ids[$entry['date']] = $entry;
    }
	$inc = 1;
foreach($ids as $value) {
 
 echo "<a title=\"".$value[image_name]." - ".$value[image_descr]."\" href=\"".substr($value[path], strpos($value[path], "/cfa"))."  \" rel=\"lightbox[rand]\" ><img id=\"cfa".$inc."\" onmouseout=\"imageBrdrOut(this.id);\" onmouseover=\"imageBrdrIn(this.id);\" class=\"recentImageList\" src=\"".substr($value[thumb_path], strpos($value[thumb_path], "/cfa"))."\" /></a>";
  $inc = $inc + 1;

 }

?>
    

    
    
    
    </div>


    </div>
  </div>
</div>

</td>

<td style="width:127px; background-image:url('../cfa/style/pgbrdright.jpg'); background-repeat:repeat-y;"></td>

</tr>
</table>

<div style="overflow: hidden; width: 100%; text-align: center;">Copyright 2008 Barry Chapman</div>

</body>




</html>