Jump to content

Recommended Posts

okay so i need this same logo to be on the other page..how do i do it..

 

this is code of the logo page..

 

<?
if(isset($_GET[ttid])) {
$ttid = $_GET[ttid];
}

$connection=mysql_connect("$server", "$username", "$password")
or die("Could not establish connection");
mysql_select_db($database_name, $connection)
or die ("Could not select database");


$query = "select master_event.* , 
(DATE_FORMAT(event_datefrom, '%d %M %Y')) as datefrom,
(DATE_FORMAT(event_dateto, '%d %M %Y')) as dateto,
ucase(event_name) as eventname
from master_event
where master_event.event_id = '$ttid '";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){
$eventname = $row['eventname'];
$eventdesc = $row['event_desc'];
//$companydescription = $row['company_description'];
$eventvenue = $row['event_venue'];
$eventfee = $row['event_fee'];
$datefrom = $row['datefrom'];
$dateto = $row['dateto'];

echo "<font color='#000000'  face='arial' ><b> $eventname </b> </font> <br>";
echo "<font color='#000000'  face='arial' ><i>Date</i> : $datefrom - $dateto <br>";
echo "<i>Venue</i> : $eventvenue <br>";

$querypstype = "SELECT DISTINCT master_pstype.pstype_id,  pstype_desc FROM master_pstype
		INNER JOIN master_psevent ON master_psevent.pstype_id= master_pstype.pstype_id
		where master_psevent.event_id = '$ttid'
		ORDER BY pstype_order";

$resultpstype=mysql_query($querypstype);
while($rowpstype = mysql_fetch_array($resultpstype)){
		$pstypeid = $rowpstype['pstype_id'];
		$pstypedesc = $rowpstype['pstype_desc'];
		echo "<br><font color='#8B3A3A' size='1' face='georgia' ><b><i>$pstypedesc</i></b></font> <br>";

		$queryps = "SELECT master_psevent.*, pstype_desc, company_name, company_link, company_description, logo_filename FROM master_psevent
				LEFT JOIN master_pstype ON master_psevent.pstype_id = master_pstype.pstype_id
				LEFT JOIN master_ps ON master_ps.ps_id = master_psevent.ps_id
				WHERE master_psevent.event_id = '$ttid' and master_pstype.pstype_id= '$pstypeid' 
				ORDER BY pstype_desc,company_name ";

				echo $queryps;

		$resultps=mysql_query($queryps);
		while($rowps = mysql_fetch_array($resultps)){
			$companyname = $rowps['company_name'];
			$companyid = $rowps['ps_id'];
			$companylinkori = $rowps['company_link'];
			$companydescription = $rowps['company_description'];
			$logopath = $rowps['logo_filename']; 




			$describelink = "index.php?view=describe&ttid=$ttid&pstypeid=$pstypeid&psid=$companyid";

		if(!empty($companydescription)){
echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\" border=\"0\"></a>";
}
else
{
echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\" border=\"0\"></a>";
}
		}
}

}

?>

 

 

 

i need to put the logo script on this page without removing other data..just wanna add the logo in it..where do i alter?

 


<?

$monthname=$_POST['month'];





if (isset($_GET['np'])){
   $num_pages=$_GET['np'];
} else {
if($searchtype == 'yes')

if ($monthname=="All" || $monthname=="")
{
	$query = "SELECT count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	order by event_datefrom desc";
}else
{
	$query = "SELECT count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom desc";
}


else
if ($monthname=="All" || $monthname=="")
{
	$query = "Select count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id  
	where isupcomingevent = 1 
	order by event_datefrom desc";
}else
{
$query = "Select count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id  
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom desc";
}



   $result=mysql_query($query);
   $row=mysql_fetch_array($result, MYSQL_NUM);
   $num_records=$row[0];
   if ($num_records > $displayhome){
      $num_pages=ceil($num_records/$displayhome);
   } else {
      $num_pages=1;
   }
}
if (isset($_GET['s'])){
   $start=$_GET['s'];
} else {
   $start=0;
}


if ($monthname=="All" || $monthname=="")
{
	$query = "SELECT master_event.*,master_type.type_name, DATE_FORMAT(event_datefrom, '%d %b %y') as datefrom,
	DATE_FORMAT(event_dateto, '%d %b %y') as dateto, event_venue, (event_name) as eventname
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	order by event_datefrom asc LIMIT $start, $displayhome";
}else
{
$query = "SELECT master_event.*,master_type.type_name, DATE_FORMAT(event_datefrom, '%d %b %y') as datefrom,
	DATE_FORMAT(event_dateto, '%d %b %y') as dateto, event_venue, (event_name) as eventname
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom asc LIMIT $start, $displayhome";
}




$result = mysql_query($query);
$bg='#e5e5e5';


while($row = mysql_fetch_array($result)){
$eventid = $row['event_id'];  
   	$eventname = str_replace("", "", $row['eventname']);
$eventdatefrom = $row['datefrom'];
$eventdateto = $row['dateto'];
$event_venue = $row['event_venue'];
$event_desc = $row['event_desc'];
$speakerlist = $row['speakerlist'];


$showline1 = "";
$showpros ="";
$showline2 = "";
$showreg ="";
$showline3 = "";
$showps ="";
$showline4 = "";
$showtestimonial ="";
$showline5 = "";
$showsp ="";
$showline6 = "";
$showsl ="";


if ($eventdatefrom ==$eventdateto) { 
$eventdate = $eventdatefrom;
}
else {
$eventdate = $eventdatefrom . " - " .  $eventdateto;
}


$querypros="select count(*) as proscount from master_prospectus where event_id ='$eventid' ";
$resultpros = mysql_query($querypros);
while($rowpros = mysql_fetch_array($resultpros)){
$proscount = $rowpros['proscount'];
if ($proscount > 0) {
$showline1 = "|";
$showpros ="Request Brochure";
}
}

$queryreg="select (CASE WHEN event_dateto >= NOW() THEN 'valid' ELSE 'invalid' END) AS validreg 
from master_event where event_id ='$eventid' ";
$resultreg = mysql_query($queryreg);
while($rowreg = mysql_fetch_array($resultreg)){
$validreg = $rowreg['validreg'];
if ($validreg == "valid") {
$showline2 = "|";
$showreg ="Online Registration";
}
}

$queryps="select count(*) as pscount from master_psevent where event_id ='$eventid' ";
$resultps = mysql_query($queryps);
while($rowps = mysql_fetch_array($resultps)){
$pscount = $rowps['pscount'];
if ($pscount > 0) {
$showline3 = "|";
$showps ="Partner & Sponsor";
}
}

$querytesm="select count(*) as tesmcount from master_testimonial where event_id ='$eventid' ";
$resulttesm = mysql_query($querytesm);
while($rowtesm = mysql_fetch_array($resulttesm)){
$tesmcount = $rowtesm['tesmcount'];
if ($tesmcount > 0) {
$showline4 = "|";
$showtestimonial ="Testimonial";
}
}

$querysp="select count(*) as spcount from master_speakernote where event_id ='$eventid' ";
$resultsp = mysql_query($querysp);
while($rowsp = mysql_fetch_array($resultsp)){
$spcount = $rowsp['spcount'];
if ($spcount > 0) {
$showline5 = "|";
$showsp ="Speaker Notes";
}
}

if ($speakerlist <> '') {
$showline6 = "|";
$showsl ="Speaker List";
}




echo "<tr><p style=\"font-size:small;\">

<td width='' ><img src='images/search.png' alt='tooltips' ></img>&nbsp<a href='index.php?view=event&content=tips&ttid=$eventid' title ='$eventname' class=\"fancybox fancybox.iframe\"  style=\"color:#104E8B;text-decoration: none; \" ><strong><font size='2' face='Segoe UI'  >$eventname</font></strong></a><br> <font color='#000000' size='2' face='arial'  >Date : $eventdate <br> Venue : $event_venue<br></font>

<table style=\"text-align: left; width: 400px; height: 92px;\"
border=\"0\" cellpadding=\"2\" cellspacing=\"2\">
  <tbody>
    <tr>
      <td></td>
      <td style=\"text-align: justify; color: #000000;\">

<font color='#000000' size='2' face='arial'  > $event_desc</font></td>
      <td></td>
    </tr>
  </tbody>
</table>



<font color='#919191' size='1' face='arial'  ><b>
<a href='index.php?view=prospectus&regrq=$eventid' title ='Request Brochure...'  >$showpros</a> <b>$showline1</b> 
<a href='index.php?view=registration&regrq=$eventid' title ='Online Registration...'   > $showreg </a> <b>$showline2</b> 
<a href='index.php?view=event&content=psevent&ttid=$eventid' title ='Sponsor & Partner...' class='fancybox fancybox.iframe'   >$showps</a> <b>$showline3</b> 
<a href='index.php?view=event&content=tesm&ttid=$eventid' title ='Testimonial...' class='fancybox fancybox.iframe'   >$showtestimonial</a> <b>$showline4</b>
<a href='index.php?view=spl&splid=$eventid' > $showsp</a><b>$showline5</b> 
<a href='index.php?view=event&content=speaker&ttid=$eventid'  title ='$eventname' class='fancybox fancybox.iframe' > $showsl</a></font><br><br></td>
</p></tr></b></font>
";
}

if ($eventid=="")
{
echo "No Records Found.";

}






echo "<td><p style=\"font-size:1;\">";
echo "<br>";
	 if ($num_pages > 1) {
		$current_page = ($start/$displayhome) + 1;
        if ($current_page != 1) {
	       echo '<a href="index.php?view=home&content=list&s=' . ($start - $displayhome) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">Previous</a> ';}
        for ($i = 1; $i <= $num_pages; $i++) {
	       if ($i != $current_page) {
		      echo '<a href="index.php?view=home&content=list&s=' . (($displayhome * ($i - 1))) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">' . $i . '</a> ';
	       } else {
		      echo '<font face="arial" size="2">';
		      echo $i . '</font> ';}
        }
        if ($current_page != $num_pages) {
	       echo '<a href="index.php?view=home&content=list&s=' . ($start + $displayhome) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">Next</a>';}
     }
echo "</p></td>";
?>
</tr>
</div>

</form>

 

 

 

post-131669-13482403399269_thumb.jpg

post-131669-13482403399483_thumb.jpg

Link to comment
https://forums.phpfreaks.com/topic/260658-help-needed/
Share on other sites

Gonna guess it's after the table, so like this. You should break in and out of php probably.

 

<?php

$monthname=$_POST['month'];





if (isset($_GET['np'])){
   $num_pages=$_GET['np'];
} else {
if($searchtype == 'yes')

if ($monthname=="All" || $monthname=="")
{
	$query = "SELECT count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	order by event_datefrom desc";
}else
{
	$query = "SELECT count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom desc";
}


else
if ($monthname=="All" || $monthname=="")
{
	$query = "Select count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id  
	where isupcomingevent = 1 
	order by event_datefrom desc";
}else
{
$query = "Select count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id  
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom desc";
}



   $result=mysql_query($query);
   $row=mysql_fetch_array($result, MYSQL_NUM);
   $num_records=$row[0];
   if ($num_records > $displayhome){
      $num_pages=ceil($num_records/$displayhome);
   } else {
      $num_pages=1;
   }
}
if (isset($_GET['s'])){
   $start=$_GET['s'];
} else {
   $start=0;
}


if ($monthname=="All" || $monthname=="")
{
	$query = "SELECT master_event.*,master_type.type_name, DATE_FORMAT(event_datefrom, '%d %b %y') as datefrom,
	DATE_FORMAT(event_dateto, '%d %b %y') as dateto, event_venue, (event_name) as eventname
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	order by event_datefrom asc LIMIT $start, $displayhome";
}else
{
$query = "SELECT master_event.*,master_type.type_name, DATE_FORMAT(event_datefrom, '%d %b %y') as datefrom,
	DATE_FORMAT(event_dateto, '%d %b %y') as dateto, event_venue, (event_name) as eventname
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom asc LIMIT $start, $displayhome";
}




$result = mysql_query($query);
$bg='#e5e5e5';


while($row = mysql_fetch_array($result)){
$eventid = $row['event_id'];  
   	$eventname = str_replace("", "", $row['eventname']);
$eventdatefrom = $row['datefrom'];
$eventdateto = $row['dateto'];
$event_venue = $row['event_venue'];
$event_desc = $row['event_desc'];
$speakerlist = $row['speakerlist'];


$showline1 = "";
$showpros ="";
$showline2 = "";
$showreg ="";
$showline3 = "";
$showps ="";
$showline4 = "";
$showtestimonial ="";
$showline5 = "";
$showsp ="";
$showline6 = "";
$showsl ="";


if ($eventdatefrom ==$eventdateto) { 
$eventdate = $eventdatefrom;
}
else {
$eventdate = $eventdatefrom . " - " .  $eventdateto;
}


$querypros="select count(*) as proscount from master_prospectus where event_id ='$eventid' ";
$resultpros = mysql_query($querypros);
while($rowpros = mysql_fetch_array($resultpros)){
$proscount = $rowpros['proscount'];
if ($proscount > 0) {
$showline1 = "|";
$showpros ="Request Brochure";
}
}

$queryreg="select (CASE WHEN event_dateto >= NOW() THEN 'valid' ELSE 'invalid' END) AS validreg 
from master_event where event_id ='$eventid' ";
$resultreg = mysql_query($queryreg);
while($rowreg = mysql_fetch_array($resultreg)){
$validreg = $rowreg['validreg'];
if ($validreg == "valid") {
$showline2 = "|";
$showreg ="Online Registration";
}
}

$queryps="select count(*) as pscount from master_psevent where event_id ='$eventid' ";
$resultps = mysql_query($queryps);
while($rowps = mysql_fetch_array($resultps)){
$pscount = $rowps['pscount'];
if ($pscount > 0) {
$showline3 = "|";
$showps ="Partner & Sponsor";
}
}

$querytesm="select count(*) as tesmcount from master_testimonial where event_id ='$eventid' ";
$resulttesm = mysql_query($querytesm);
while($rowtesm = mysql_fetch_array($resulttesm)){
$tesmcount = $rowtesm['tesmcount'];
if ($tesmcount > 0) {
$showline4 = "|";
$showtestimonial ="Testimonial";
}
}

$querysp="select count(*) as spcount from master_speakernote where event_id ='$eventid' ";
$resultsp = mysql_query($querysp);
while($rowsp = mysql_fetch_array($resultsp)){
$spcount = $rowsp['spcount'];
if ($spcount > 0) {
$showline5 = "|";
$showsp ="Speaker Notes";
}
}

if ($speakerlist <> '') {
$showline6 = "|";
$showsl ="Speaker List";
}




echo "<tr><p style=\"font-size:small;\">

<td width='' ><img src='images/search.png' alt='tooltips' ></img>&nbsp<a href='index.php?view=event&content=tips&ttid=$eventid' title ='$eventname' class=\"fancybox fancybox.iframe\"  style=\"color:#104E8B;text-decoration: none; \" ><strong><font size='2' face='Segoe UI'  >$eventname</font></strong></a><br> <font color='#000000' size='2' face='arial'  >Date : $eventdate <br> Venue : $event_venue<br></font>

<table style=\"text-align: left; width: 400px; height: 92px;\"
border=\"0\" cellpadding=\"2\" cellspacing=\"2\">
  <tbody>
    <tr>
      <td></td>
      <td style=\"text-align: justify; color: #000000;\">

<font color='#000000' size='2' face='arial'  > $event_desc</font></td>
      <td></td>
    </tr>
  </tbody>
</table>


if(isset($_GET[ttid])) {
$ttid = $_GET[ttid];
}

$connection=mysql_connect("$server", "$username", "$password")
or die("Could not establish connection");
mysql_select_db($database_name, $connection)
or die ("Could not select database");


$query = "select master_event.* , 
(DATE_FORMAT(event_datefrom, '%d %M %Y')) as datefrom,
(DATE_FORMAT(event_dateto, '%d %M %Y')) as dateto,
ucase(event_name) as eventname
from master_event
where master_event.event_id = '$ttid '";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){
$eventname = $row['eventname'];
$eventdesc = $row['event_desc'];
//$companydescription = $row['company_description'];
$eventvenue = $row['event_venue'];
$eventfee = $row['event_fee'];
$datefrom = $row['datefrom'];
$dateto = $row['dateto'];

echo "<font color='#000000'  face='arial' ><b> $eventname </b> </font> <br>";
echo "<font color='#000000'  face='arial' ><i>Date</i> : $datefrom - $dateto <br>";
echo "<i>Venue</i> : $eventvenue <br>";

$querypstype = "SELECT DISTINCT master_pstype.pstype_id,  pstype_desc FROM master_pstype
		INNER JOIN master_psevent ON master_psevent.pstype_id= master_pstype.pstype_id
		where master_psevent.event_id = '$ttid'
		ORDER BY pstype_order";

$resultpstype=mysql_query($querypstype);
while($rowpstype = mysql_fetch_array($resultpstype)){
		$pstypeid = $rowpstype['pstype_id'];
		$pstypedesc = $rowpstype['pstype_desc'];
		echo "<br><font color='#8B3A3A' size='1' face='georgia' ><b><i>$pstypedesc</i></b></font> <br>";

		$queryps = "SELECT master_psevent.*, pstype_desc, company_name, company_link, company_description, logo_filename FROM master_psevent
				LEFT JOIN master_pstype ON master_psevent.pstype_id = master_pstype.pstype_id
				LEFT JOIN master_ps ON master_ps.ps_id = master_psevent.ps_id
				WHERE master_psevent.event_id = '$ttid' and master_pstype.pstype_id= '$pstypeid' 
				ORDER BY pstype_desc,company_name ";

				echo $queryps;

		$resultps=mysql_query($queryps);
		while($rowps = mysql_fetch_array($resultps)){
			$companyname = $rowps['company_name'];
			$companyid = $rowps['ps_id'];
			$companylinkori = $rowps['company_link'];
			$companydescription = $rowps['company_description'];
			$logopath = $rowps['logo_filename']; 




			$describelink = "index.php?view=describe&ttid=$ttid&pstypeid=$pstypeid&psid=$companyid";

		if(!empty($companydescription)){
echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\" border=\"0\"></a>";
}
else
{
echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\" border=\"0\"></a>";
}
		}
}

}



<font color='#919191' size='1' face='arial'  ><b>
<a href='index.php?view=prospectus&regrq=$eventid' title ='Request Brochure...'  >$showpros</a> <b>$showline1</b> 
<a href='index.php?view=registration&regrq=$eventid' title ='Online Registration...'   > $showreg </a> <b>$showline2</b> 
<a href='index.php?view=event&content=psevent&ttid=$eventid' title ='Sponsor & Partner...' class='fancybox fancybox.iframe'   >$showps</a> <b>$showline3</b> 
<a href='index.php?view=event&content=tesm&ttid=$eventid' title ='Testimonial...' class='fancybox fancybox.iframe'   >$showtestimonial</a> <b>$showline4</b>
<a href='index.php?view=spl&splid=$eventid' > $showsp</a><b>$showline5</b> 
<a href='index.php?view=event&content=speaker&ttid=$eventid'  title ='$eventname' class='fancybox fancybox.iframe' > $showsl</a></font><br><br></td>
</p></tr></b></font>
";
}

if ($eventid=="")
{
echo "No Records Found.";

}






echo "<td><p style=\"font-size:1;\">";
echo "<br>";
	 if ($num_pages > 1) {
		$current_page = ($start/$displayhome) + 1;
        if ($current_page != 1) {
	       echo '<a href="index.php?view=home&content=list&s=' . ($start - $displayhome) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">Previous</a> ';}
        for ($i = 1; $i <= $num_pages; $i++) {
	       if ($i != $current_page) {
		      echo '<a href="index.php?view=home&content=list&s=' . (($displayhome * ($i - 1))) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">' . $i . '</a> ';
	       } else {
		      echo '<font face="arial" size="2">';
		      echo $i . '</font> ';}
        }
        if ($current_page != $num_pages) {
	       echo '<a href="index.php?view=home&content=list&s=' . ($start + $displayhome) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">Next</a>';}
     }
echo "</p></td>";
?>
</tr>
</div>

</form>

 

You should use the full php tag and not the short, use <?php versus <?

 

When wanting to reuse the same code in many areas, you can create a php file for the chunk of code...and then inlude it into the page wherever you need it.

 

Where I inserted that logo code, it could have just been something like this.

 

</table>

<?php include('logo.php');?>

<font color='#919191' size='1' face='arial'  ><b>

Link to comment
https://forums.phpfreaks.com/topic/260658-help-needed/#findComment-1335970
Share on other sites

Can try this, I commented and changed around a few items.

 

Be sure $_GET['ttid'] is included in the address bar like &ttid=value

 

<?php

$monthname=$_POST['month'];

if (isset($_GET['np'])){
   $num_pages=$_GET['np'];
} else {
if($searchtype == 'yes')

if ($monthname=="All" || $monthname=="")
{
	$query = "SELECT count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	order by event_datefrom desc";
}else
{
	$query = "SELECT count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom desc";
}


else
if ($monthname=="All" || $monthname=="")
{
	$query = "Select count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id  
	where isupcomingevent = 1 
	order by event_datefrom desc";
}else
{
$query = "Select count(*) 
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id  
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom desc";
}



   $result=mysql_query($query);
   $row=mysql_fetch_array($result, MYSQL_NUM);
   $num_records=$row[0];
   if ($num_records > $displayhome){
      $num_pages=ceil($num_records/$displayhome);
   } else {
      $num_pages=1;
   }
}
if (isset($_GET['s'])){
   $start=$_GET['s'];
} else {
   $start=0;
}


if ($monthname=="All" || $monthname=="")
{
	$query = "SELECT master_event.*,master_type.type_name, DATE_FORMAT(event_datefrom, '%d %b %y') as datefrom,
	DATE_FORMAT(event_dateto, '%d %b %y') as dateto, event_venue, (event_name) as eventname
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	order by event_datefrom asc LIMIT $start, $displayhome";
}else
{
$query = "SELECT master_event.*,master_type.type_name, DATE_FORMAT(event_datefrom, '%d %b %y') as datefrom,
	DATE_FORMAT(event_dateto, '%d %b %y') as dateto, event_venue, (event_name) as eventname
	FROM master_event 
	LEFT JOIN master_type ON master_type.type_id = master_event.type_id 
	where isupcomingevent = 1 
	AND MONTHNAME(event_datefrom) = '$monthname'
	order by event_datefrom asc LIMIT $start, $displayhome";
}




$result = mysql_query($query);
$bg='#e5e5e5';


while($row = mysql_fetch_array($result)){
$eventid = $row['event_id'];  
   	$eventname = str_replace("", "", $row['eventname']);
$eventdatefrom = $row['datefrom'];
$eventdateto = $row['dateto'];
$event_venue = $row['event_venue'];
$event_desc = $row['event_desc'];
$speakerlist = $row['speakerlist'];


$showline1 = "";
$showpros ="";
$showline2 = "";
$showreg ="";
$showline3 = "";
$showps ="";
$showline4 = "";
$showtestimonial ="";
$showline5 = "";
$showsp ="";
$showline6 = "";
$showsl ="";


if ($eventdatefrom ==$eventdateto) { 
$eventdate = $eventdatefrom;
}
else {
$eventdate = $eventdatefrom . " - " .  $eventdateto;
}


$querypros="select count(*) as proscount from master_prospectus where event_id ='$eventid' ";
$resultpros = mysql_query($querypros);
while($rowpros = mysql_fetch_array($resultpros)){
$proscount = $rowpros['proscount'];
if ($proscount > 0) {
$showline1 = "|";
$showpros ="Request Brochure";
}
}

$queryreg="select (CASE WHEN event_dateto >= NOW() THEN 'valid' ELSE 'invalid' END) AS validreg 
from master_event where event_id ='$eventid' ";
$resultreg = mysql_query($queryreg);
while($rowreg = mysql_fetch_array($resultreg)){
$validreg = $rowreg['validreg'];
if ($validreg == "valid") {
$showline2 = "|";
$showreg ="Online Registration";
}
}

$queryps="select count(*) as pscount from master_psevent where event_id ='$eventid' ";
$resultps = mysql_query($queryps);
while($rowps = mysql_fetch_array($resultps)){
$pscount = $rowps['pscount'];
if ($pscount > 0) {
$showline3 = "|";
$showps ="Partner & Sponsor";
}
}

$querytesm="select count(*) as tesmcount from master_testimonial where event_id ='$eventid' ";
$resulttesm = mysql_query($querytesm);
while($rowtesm = mysql_fetch_array($resulttesm)){
$tesmcount = $rowtesm['tesmcount'];
if ($tesmcount > 0) {
$showline4 = "|";
$showtestimonial ="Testimonial";
}
}

$querysp="select count(*) as spcount from master_speakernote where event_id ='$eventid' ";
$resultsp = mysql_query($querysp);
while($rowsp = mysql_fetch_array($resultsp)){
$spcount = $rowsp['spcount'];
if ($spcount > 0) {
$showline5 = "|";
$showsp ="Speaker Notes";
}
}

if ($speakerlist <> '') {
$showline6 = "|";
$showsl ="Speaker List";
}




echo "<tr><p style=\"font-size:small;\">

<td width='' ><img src='images/search.png' alt='tooltips' ></img>&nbsp<a href='index.php?view=event&content=tips&ttid=$eventid' title ='$eventname' class=\"fancybox fancybox.iframe\"  style=\"color:#104E8B;text-decoration: none; \" ><strong><font size='2' face='Segoe UI'  >$eventname</font></strong></a><br> <font color='#000000' size='2' face='arial'  >Date : $eventdate <br> Venue : $event_venue<br></font>

<table style=\"text-align: left; width: 400px; height: 92px;\"
border=\"0\" cellpadding=\"2\" cellspacing=\"2\">
  <tbody>
    <tr>
      <td></td>
      <td style=\"text-align: justify; color: #000000;\">

<font color='#000000' size='2' face='arial'  > $event_desc</font></td>
      <td></td>
    </tr>
  </tbody>
</table>";
?>

<?php
//start of logo code

if(isset($_GET['ttid']) && $_GET['ttid'] != '') {//code will only work if $_GET['ttid'] is set

//assuming these are set above somewhere in code?
$connection=mysql_connect("$server", "$username", "$password")
or die("Could not establish connection");
mysql_select_db($database_name, $connection)
or die ("Could not select database");

$ttid = mysql_real_escape_string($_GET['ttid']);//escaping before mysql and after the connection

$query = "select master_event.* , 
(DATE_FORMAT(event_datefrom, '%d %M %Y')) as datefrom,
(DATE_FORMAT(event_dateto, '%d %M %Y')) as dateto,
ucase(event_name) as eventname
from master_event
where master_event.event_id = '$ttid '";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){
$eventname = $row['eventname'];
$eventdesc = $row['event_desc'];
//$companydescription = $row['company_description'];
$eventvenue = $row['event_venue'];
$eventfee = $row['event_fee'];
$datefrom = $row['datefrom'];
$dateto = $row['dateto'];

echo "<font color='#000000'  face='arial' ><b> $eventname </b> </font> <br>";
echo "<font color='#000000'  face='arial' ><i>Date</i> : $datefrom - $dateto <br>";
echo "<i>Venue</i> : $eventvenue <br>";

$querypstype = "SELECT DISTINCT master_pstype.pstype_id,  pstype_desc FROM master_pstype
		INNER JOIN master_psevent ON master_psevent.pstype_id= master_pstype.pstype_id
		where master_psevent.event_id = '$ttid'
		ORDER BY pstype_order";

$resultpstype=mysql_query($querypstype);
while($rowpstype = mysql_fetch_array($resultpstype)){
		$pstypeid = $rowpstype['pstype_id'];
		$pstypedesc = $rowpstype['pstype_desc'];
		echo "<br><font color='#8B3A3A' size='1' face='georgia' ><b><i>$pstypedesc</i></b></font> <br>";

		$queryps = "SELECT master_psevent.*, pstype_desc, company_name, company_link, company_description, logo_filename FROM master_psevent
				LEFT JOIN master_pstype ON master_psevent.pstype_id = master_pstype.pstype_id
				LEFT JOIN master_ps ON master_ps.ps_id = master_psevent.ps_id
				WHERE master_psevent.event_id = '$ttid' and master_pstype.pstype_id= '$pstypeid' 
				ORDER BY pstype_desc,company_name ";

				echo $queryps;

		$resultps=mysql_query($queryps);
		while($rowps = mysql_fetch_array($resultps)){
			$companyname = $rowps['company_name'];
			$companyid = $rowps['ps_id'];
			$companylinkori = $rowps['company_link'];
			$companydescription = $rowps['company_description'];
			$logopath = $rowps['logo_filename']; 




			$describelink = "index.php?view=describe&ttid=$ttid&pstypeid=$pstypeid&psid=$companyid";

		if(!empty($companydescription)){
echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\" border=\"0\"></a>";
}
else
{
echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\" border=\"0\"></a>";
}
		}
}

}

}//end of logo code
?>

<?php echo "
<font color='#919191' size='1' face='arial'  ><b>
<a href='index.php?view=prospectus&regrq=$eventid' title ='Request Brochure...'  >$showpros</a> <b>$showline1</b> 
<a href='index.php?view=registration&regrq=$eventid' title ='Online Registration...'   > $showreg </a> <b>$showline2</b> 
<a href='index.php?view=event&content=psevent&ttid=$eventid' title ='Sponsor & Partner...' class='fancybox fancybox.iframe'   >$showps</a> <b>$showline3</b> 
<a href='index.php?view=event&content=tesm&ttid=$eventid' title ='Testimonial...' class='fancybox fancybox.iframe'   >$showtestimonial</a> <b>$showline4</b>
<a href='index.php?view=spl&splid=$eventid' > $showsp</a><b>$showline5</b> 
<a href='index.php?view=event&content=speaker&ttid=$eventid'  title ='$eventname' class='fancybox fancybox.iframe' > $showsl</a></font><br><br></td>
</p></tr></b></font>
";
}

if ($eventid=="")
{
echo "No Records Found.";

}


echo "<td><p style=\"font-size:1;\">";
echo "<br>";
	 if ($num_pages > 1) {
		$current_page = ($start/$displayhome) + 1;
        if ($current_page != 1) {
	       echo '<a href="index.php?view=home&content=list&s=' . ($start - $displayhome) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">Previous</a> ';}
        for ($i = 1; $i <= $num_pages; $i++) {
	       if ($i != $current_page) {
		      echo '<a href="index.php?view=home&content=list&s=' . (($displayhome * ($i - 1))) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">' . $i . '</a> ';
	       } else {
		      echo '<font face="arial" size="2">';
		      echo $i . '</font> ';}
        }
        if ($current_page != $num_pages) {
	       echo '<a href="index.php?view=home&content=list&s=' . ($start + $displayhome) . '&np=' . $num_pages . '#a" class="style1" style="color:#4F94CD;text-decoration: none;">Next</a>';}
     }
echo "</p></td>";
?>
</tr>
</div>

</form>

Link to comment
https://forums.phpfreaks.com/topic/260658-help-needed/#findComment-1335999
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.