[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 472
  • Last Modified:

PHP loop function

I have this function that working just great

# executed projects
function get_executed(){
	$p=trime($_GET['p']);
	$PageSize=6;
	$strSQL="SELECT * FROM lead_projects WHERE project_active= 1 and project_executedorongoing = 1 ";
	$objRS=mysql_query($strSQL); 
	$total=mysql_num_rows($objRS);
	$strSQL=makePages($strSQL,$PageSize,$p);
	$objRS=mysql_query($strSQL);
	
	echo "<table width='950'><tr>";
	echo "<td width='53' valign='top' style='padding-top:15px;'>";
	echo dispPagesB ($total,$PageSize,$p,'id='.$id);
	echo "</td>";
	echo "<td valign='top'>";
	echo "<ul style='width:830px;'>";
	
	
	
	while($row=mysql_fetch_object($objRS)){
	echo "<li style='width:255px; height:122px; float:left; padding:10px;'>";
	echo "<table><tr><td valign='top'>";
	echo "<a class='lightbox' rel='group1' href='img/".$row->project_mainpicture."'>".gd_image($row->project_mainpicture,"cropratio=1:1&width=98&height=98")."</a>";
	echo "</td><td width='5'></td><td valign='top'>";
	echo "<span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>".$row->project_name."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: ".$row->project_location."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: ".$row->project_area."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: ".$row->project_role."</span><br />";
	echo "</td></tr></table>";
	
	echo "</li>";


	}
	echo "<br class='clear' />";
	echo "</ul>";
	
	echo "</td>";
	echo "<td width='53' valign='top' style='padding-top:15px;'>";
	
	
	echo dispPagesF ($total,$PageSize,$p,'id='.$id);
	echo "</td>";
	echo "</tr></table>";

}

Open in new window


it reads from this table:

CREATE TABLE `lead_projects` (
  `project_id` int(11) NOT NULL AUTO_INCREMENT,
  `project_executedorongoing` varchar(250) NOT NULL,
  `project_name` varchar(250) NOT NULL,
  `project_location` varchar(250) NOT NULL,
  `project_role` varchar(250) NOT NULL,
  `project_area` varchar(250) NOT NULL,
  `project_year` varchar(250) NOT NULL,
  `project_mainpicture` varchar(250) NOT NULL,
  `project_active` int(1) NOT NULL,
  `project_highlighted` int(1) NOT NULL,
  `pos` int(11) NOT NULL,
  PRIMARY KEY (`project_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ;



I have this little bit
      echo "<a class='lightbox' rel='group1' href='img/".$row->project_mainpicture."'>".gd_image($row->project_mainpicture,"cropratio=1:1&width=98&height=98")."</a>";

reading from project_mainpicture

is it possible to make it read from a different table completely and using lightbox flip through all the images in that table that are related to the project
the other table  is:

CREATE TABLE `lead_projectpictures` (
  `picture_id` int(11) NOT NULL AUTO_INCREMENT,
  `picture_projectid` varchar(250) NOT NULL,
  `picture_picture` varchar(250) NOT NULL,
  PRIMARY KEY (`picture_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=87 ;
0
zahimezher
Asked:
zahimezher
  • 7
  • 4
1 Solution
 
zahimezherAuthor Commented:
picture_projectid is a foreign key in my cms to give many pics the same project id...
0
 
lwadwellCommented:
If I understand correctly ... you would replace the existing 'echo "<a class='lightbox' rel='group1' ... etc' with something like:
$picSQL="SELECT * FROM lead_projectpictures WHERE picture_projectid = $row->project_id ";
$picRS=mysql_query($picSQL); 
while($pic=mysql_fetch_object($picRS)){
	echo "<a class='lightbox' rel='group1' href='img/".$pic->picture_picture."'>".gd_image($row->picture_picture,"cropratio=1:1&width=98&height=98")."</a>";
}

Open in new window

0
 
ienaxxxCommented:
Sure:
add this:

$strSQL="SELECT * FROM lead_projectpictures WHERE picture_projectid=".$row->project_id
      $objRSpict=mysql_query($strSQL);

while (mysql_fetch_array($objRSpict)){
     <here goes the echo-html part>
}

inside the loop starting at row 20. You'll get series of tables containing all the project's images.


I don't see difficulties... perhaps i don't get the point. sorry.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
zahimezherAuthor Commented:
Ok so both answers look similar to what i want but they don't work :s i'm totally new at this.
I just want one pic displayed in the projects page witch is project_main picture.

and when i click on it i want the lightbox to open up and i can flip through all the pics saved in lead_projectpictures where picture_projectid = project_id...
0
 
zahimezherAuthor Commented:
I guess it called a loop within a loop :S
0
 
zahimezherAuthor Commented:
lwadwell, that kinda works.

This is my code so far.
# executed projects
function get_executed(){
	$p=trime($_GET['p']);
	$PageSize=6;
	$strSQL="SELECT * FROM lead_projects WHERE project_active= 1 and project_executedorongoing = 1 ";
	$objRS=mysql_query($strSQL); 
	$total=mysql_num_rows($objRS);
	$strSQL=makePages($strSQL,$PageSize,$p);
	$objRS=mysql_query($strSQL);
	
	echo "<table width='950'><tr>";
	echo "<td width='53' valign='top' style='padding-top:15px;'>";
	echo dispPagesB ($total,$PageSize,$p,'id='.$id);
	echo "</td>";
	echo "<td valign='top'>";
	echo "<ul style='width:830px;'>";
	
	
	
	while($row=mysql_fetch_object($objRS)){
	echo "<li style='width:255px; height:122px; float:left; padding:10px;'>";
	echo "<table><tr><td valign='top'>";
	
	
	
	
$picSQL="SELECT * FROM lead_projectpictures WHERE picture_projectid = ".$row->project_id ;
$picRS=mysql_query($picSQL); 
while($pic=mysql_fetch_object($picRS)){
echo "<a class='lightbox' rel='group1' href='img/".$pic->picture_picture."'>".gd_image($row->project_mainpicture,"cropratio=1:1&width=98&height=98")."</a>";
}
                                            
	

	

	echo "</td><td width='5'></td><td valign='top'>";
	echo "<span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>".$row->project_name."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: ".$row->project_location."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: ".$row->project_area."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: ".$row->project_role."</span><br />";
	echo "</td></tr></table>";
	
	echo "</li>";


	}
	
	
	
	echo "<br class='clear' />";
	echo "</ul>";
	
	echo "</td>";
	echo "<td width='53' valign='top' style='padding-top:15px;'>";
	
	
	echo dispPagesF ($total,$PageSize,$p,'id='.$id);
	echo "</td>";
	echo "</tr></table>";

}

Open in new window


The thing is i want the original picture to show only (project_mainpicture)
and the other one just hidden or something and when the project picture is clicked the user will be able to flip through the rest of the images from the other table.

Ill also attach a screen shot of the output. Its showing project_mainpicture many times over :S


Thanks again
Screen-shot-2012-09-04-at-7.49.1.png
0
 
lwadwellCommented:
Do you have a lightbox package that you are using?  The original echo "<a class='lightbox' rel='group1' ... etc' would be put back next to the new code and the echo inside the new loop would write the html for the lightbox show.  As I am unaware of the actual lightbox setup you have (there are many) I cannot guess the html syntax.
0
 
zahimezherAuthor Commented:
Yes i do have a lightbox package.

This is the source code of this page

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<title>My Project title bar</title>
<meta name="Keywords" content="" />
<meta name="Description" content=""/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Language" content="en-uk"/>
<meta name="Rating" content="Safe For Kids" />
<meta name="Author" content="Lip-Smackingdesign" />
<meta name="Copyright" content="&copy; 2011" />
<link rel="stylesheet" type="text/css" href="css/styles.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/menu.css" media="screen" />
<link rel="shortcut icon" type="image/x-icon" href="http://localhost:8888/leadconstructors/img/" /> 


<!-- left banner -->
   <script src="js/google.js" type="text/javascript"></script>
   <script src="js/jsCarousel-2.0.0.js" type="text/javascript"></script>
    <link href="css/jsCarousel-2.0.0.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        $(document).ready(function() {
   $('#carouselv').jsCarousel({ onthumbnailclick: function(src) { alert(src); }, autoscroll: false, circular: true, masked: false, itemstodisplay: 2, orientation: 'v' });
        });       
    </script>
<!-- left banner -->



<!-- banner -->
<style>
    .wrapper{
        max-width: 817px;
    }
</style>

<!--<script type="text/javascript" src="scripts/google.js"></script>-->
<script src="js/jquery.slideshow-pan.js"></script>

<script>
$(function(){
    
    $(".myslideshow").slideshow({
        width: 817,
        height: 154,
        duration : 3500,// time between slides
        speed : 500, // speed of the transition - must be 500 or greater if using pan
        images : [  "img/lsd.jpg","img/lsd.jpg","img/lsd.jpg","img/lsd.jpg","img/lsd.jpg",                 ],
        pathToImgs : "",
        effect : "fade",
        pan : true,
        panSpeed : 3000 // must be at least 500 ms less than duration
        });
});  
</script>
<!-- banner -->











<!-- dd menu -->
<script type="text/javascript">
var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;
function mopen(id)
{	
	mcancelclosetime();
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
}
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
document.onclick = mclose; 
</script>
<!-- dd menu -->


<!-- right banner -->
<link rel="stylesheet" type="text/css" href="css/circular.css" />
<!-- right banner -->


</head>
<body> 

<div class="main-width">

<a style="position:relative; top:0px; left:0px; z-index:2;" href="index.php"><img src="images/logo.png"/></a>



<!-- banner -->
<div style="position:inherit; top:0px; right:0px; z-index:1;">
<div class="myslideshow"></div>      
</div>	
<!-- banner -->



<!-- menu -->
<div class="menudiv">
  <ul id="sddm"> 
<!-- about us -->
        <li><a href="#" 
            onmouseover="mopen('m1')" 
            onmouseout="mclosetime()">
            	<img border="0" src="images/menu/aboutus.png" 
                onMouseOver="javascript: this.src='images/menu/aboutus-o.png';"
                onMouseOut="javascript: this.src='images/menu/aboutus.png';" />
            </a>
                <div id="m1" 
                onmouseover="mcancelclosetime()" 
                onmouseout="mclosetime()">
                    <a href="mission.php">MISSION</a>
                    <a href="vision.php">VISION</a>
                    <a href="values.php">VALUES</a>
                    <a href="testimonials.php">TESTIMONIALS</a> 
                </div>
        </li>
<!-- projects -->
        <li><a href="#" 
            onmouseover="mopen('m2')" 
            onmouseout="mclosetime()">
            	<img border="0" src="images/menu/projects.png" 
                onMouseOver="javascript: this.src='images/menu/projects-o.png';"
                onMouseOut="javascript: this.src='images/menu/projects.png';" />
            </a>
                <div id="m2" 
                onmouseover="mcancelclosetime()" 
                onmouseout="mclosetime()">
                    <a href="executed.php">EXECUTED</a>
                    <a href="ongoing.php">ONGOING</a>
                </div>
        </li>    
<!-- services -->
        <li><a href="#" 
            onmouseover="mopen('m3')" 
            onmouseout="mclosetime()">
            	<img border="0" src="images/menu/services.png" 
                onMouseOver="javascript: this.src='images/menu/services-o.png';"
                onMouseOut="javascript: this.src='images/menu/services.png';" />
            </a>
                <div id="m3" 
                onmouseover="mcancelclosetime()" 
                onmouseout="mclosetime()">
                    <a href='services.php?id=1'>Service Name</a><a href='services.php?id=2'>Service Name</a><a href='services.php?id=3'>Service Name</a><a href='services.php?id=4'>Service Name</a><a href='services.php?id=5'>Service Name</a><a href='services.php?id=6'>Service Name</a>                </div>
        </li>       
<!-- resources -->
        <li><a href="#" 
            onmouseover="mopen('m4')" 
            onmouseout="mclosetime()">
            	<img border="0" src="images/menu/resources.png" 
                onMouseOver="javascript: this.src='images/menu/resources-o.png';"
                onMouseOut="javascript: this.src='images/menu/resources.png';" />
            </a>
                <div id="m4" 
                onmouseover="mcancelclosetime()" 
                onmouseout="mclosetime()">
                    <a href="staff.php">KEY STAFF</a>
                    <a href="chart.php">ORGANIZATIN CHART</a>
                    <a href="equipment.php">EQUIPMENT</a>
                </div>
        </li>        
<!-- contact us -->
        <li><a href="contactus.php"> 
            	<img border="0" src="images/menu/contactus.png" 
                onMouseOver="javascript: this.src='images/menu/contactus-o.png';"
                onMouseOut="javascript: this.src='images/menu/contactus.png';" />
            </a>
        </li> 	     
    </ul>	
    <img src="images/menu/menu-other.jpg" border="0" usemap="#Map" class="other-buttons" style="float:right;"/>
        <map name="Map" id="Map">
              <area shape="rect" coords="3,2,78,28" href="realestate.php" />
              <area shape="rect" coords="84,2,162,39" href="news.php" />
              <area shape="rect" coords="171,2,232,34" href="gallery.php" />
        </map>
<br class="clear" />
</div>
<!-- menu -->

<div class="info-box"><link rel="stylesheet" type="text/css" href="scripts/themes/default/jquery.lightbox.css" />
<script type="text/javascript" src="scripts/jquery.cycle.all.pack.js"></script>
<script type="text/javascript" src="scripts/jquery.cycle.all.min.js"></script>
<script type="text/javascript" src="scripts/jquery.lightbox.min.js"></script>  

<img src="images/executed.jpg"/>
<br /><br />
<table width='950'><tr><td width='53' valign='top' style='padding-top:15px;'></td><td valign='top'><ul style='width:830px;'><li style='width:255px; height:122px; float:left; padding:10px;'><table><tr><td valign='top'><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a></td><td width='5'></td><td valign='top'><span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>Project</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: Lebanon</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: 235 m2</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: Manager</span><br /></td></tr></table></li><li style='width:255px; height:122px; float:left; padding:10px;'><table><tr><td valign='top'><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a></td><td width='5'></td><td valign='top'><span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>Project</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: Lebanon</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: 235 m2</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: Manager</span><br /></td></tr></table></li><li style='width:255px; height:122px; float:left; padding:10px;'><table><tr><td valign='top'><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a></td><td width='5'></td><td valign='top'><span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>Project</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: Lebanon</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: 235 m2</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: Manager</span><br /></td></tr></table></li><li style='width:255px; height:122px; float:left; padding:10px;'><table><tr><td valign='top'><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a></td><td width='5'></td><td valign='top'><span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>Project</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: Lebanon</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: 235 m2</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: Manager</span><br /></td></tr></table></li><li style='width:255px; height:122px; float:left; padding:10px;'><table><tr><td valign='top'><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a></td><td width='5'></td><td valign='top'><span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>Project</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: Lebanon</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: 235 m2</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: Manager</span><br /></td></tr></table></li><li style='width:255px; height:122px; float:left; padding:10px;'><table><tr><td valign='top'><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a><a class='lightbox' rel='group1' href='img/lsd.jpg'><img src="http://localhost:8888/leadconstructors/image.php/lsd.jpg?cropratio=1:1&width=98&height=98&image=http://localhost:8888/leadconstructors/img/lsd.jpg"></a></td><td width='5'></td><td valign='top'><span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>Project</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: Lebanon</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: 235 m2</span><br /><span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: Manager</span><br /></td></tr></table></li><br class='clear' /></ul></td><td width='53' valign='top' style='padding-top:15px;'><a href='?p=2&id='><img style='border:0px;' src='images/next.jpg'/></a></td></tr></table>
<script>
jQuery(document).ready(function() {
	$('.lightbox').lightbox();
});
</script>



</div>


        <div class="footer">
            <table width="1000"><tr>
            <td width="500">
            <p style="padding-top:0px;">
            <a style="font-family:Verdana, Geneva, sans-serif; font-size:0.4em; color:#ccc; font-weight:normal;" target="_blank" href="http://http://www.firefly-leb.com/">DESIGN: Firefly Multimedia</a>
            &nbsp;-&nbsp;
            <a style="font-family:Verdana, Geneva, sans-serif; font-size:0.4em; color:#ccc; font-weight:normal;" target="_blank" href="https://www.lipsmackingdesign.com">Development: LSD</a>
            </p>
      		</td>
            <td width="250">
            <p style="padding-top:0px;">
            <a href="img/About_Stacks.pdf"><img src="images/download.jpg"/></a>
            </p>
            </td>
            <td align="right">
            <p style="padding-top:36px; color:#fff; font-size:0.4em; text-align:right;">
            &copy; 
			LEAD CONSTRUCTORS 2012            </p>
        	</td>
            </tr>
            </table>
            
        
        </div>

</div>

    
</body>
</html>

Open in new window



This the function so far:

# executed projects
function get_executed(){
	$p=trime($_GET['p']);
	$PageSize=6;
	$strSQL="SELECT * FROM lead_projects WHERE project_active= 1 and project_executedorongoing = 1 ";
	$objRS=mysql_query($strSQL); 
	$total=mysql_num_rows($objRS);
	$strSQL=makePages($strSQL,$PageSize,$p);
	$objRS=mysql_query($strSQL);
	
	echo "<table width='950'><tr>";
	echo "<td width='53' valign='top' style='padding-top:15px;'>";
	echo dispPagesB ($total,$PageSize,$p,'id='.$id);
	echo "</td>";
	echo "<td valign='top'>";
	echo "<ul style='width:830px;'>";
	
	
	
	while($row=mysql_fetch_object($objRS)){
	echo "<li style='width:255px; height:122px; float:left; padding:10px;'>";
	echo "<table><tr><td valign='top'>";
	
	
	
	
$picSQL="SELECT * FROM lead_projectpictures WHERE picture_projectid = ".$row->project_id ;
$picRS=mysql_query($picSQL); 
while($pic=mysql_fetch_object($picRS)){
echo "<a class='lightbox' rel='group1' href='img/".$pic->picture_picture."'>".gd_image($row->project_mainpicture,"cropratio=1:1&width=98&height=98")."</a>";
}
                                            
	

	

	echo "</td><td width='5'></td><td valign='top'>";
	echo "<span style='font-size:12px; color:#0A819D; font-weight:normal; text-transform:uppercase;'>".$row->project_name."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Location: ".$row->project_location."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Area: ".$row->project_area."</span><br />";
	echo "<span style='font-size:9px; color:#666; font-weight:normal; text-align:left;'>Role: ".$row->project_role."</span><br />";
	echo "</td></tr></table>";
	
	echo "</li>";


	}
	
	
	
	echo "<br class='clear' />";
	echo "</ul>";
	
	echo "</td>";
	echo "<td width='53' valign='top' style='padding-top:15px;'>";
	
	
	echo dispPagesF ($total,$PageSize,$p,'id='.$id);
	echo "</td>";
	echo "</tr></table>";

}

Open in new window


And ill attach a screen shot of the light box im using
Screen-shot-2012-09-05-at-9.20.1.png
0
 
lwadwellCommented:
Still cannot be sure what you are using ... I see references to jsCarousel-2.0.0.js, jquery.slideshow-pan.js and query.lightbox.min.js in your script.  I suspect that it is query.lightbox.min.js that you are using for this.  I do know from where it came nor how it works.  Most of the lightbox packages I looked at while trying to figure out how to get it working seem to have all of the pictures on the page first anyway.
So ... I do not know whether it is possible to hide the others or not.  If you could supply some working (albeit hard-coded) example of the required html ... I could help build it from the database.
0
 
zahimezherAuthor Commented:
would it help if i upload the site? im not very familliar with teh technical things you are asking for and about. let me know how i can help.

Thanks
0
 
lwadwellCommented:
If the site has a working example of the lightbox in a manner like you want ... then yes, it might.
What is the lightbox package you are using? ... where is it from? ... and where can I get the documentation on how it is to be used?
0
 
zahimezherAuthor Commented:
I just had to use this but place the < a href /> out side the loop and the images from the picture table had to be set as (style="display:none;") and it all worked :)

Thanks
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now