Location: PHPKode > scripts > Create Your Own Directory > cms/HRAS/users/referrals.php
<?php
include "../login/authheader.php";


if($block != true)
{
?>
<html>
<?php
$home="../../";
include "../login/A-header.php";
?>		
	     <a href="addlisting.php" style="text-decoration: none; color:black;"><div align=right style="text-decoration:none;"><strong>[ADD NEW LISTING]</strong></a></div><br>
           </td></tr><tr><td valign=top colspan=2 ><table width=90%>
           <?php 
			
			$name=$_GET['name'];
			$match=$_GET['match'];
			$order=$_POST['order'];
		?>
		<?php
			$str="select cntid,name,id,tid,dat,rid,description,adddate,title,version,license,coalesce(rateval,0)as rateval,
			coalesce(referral,0)as referral, coalesce(view,0) as view from content left join (SELECT rid, sum(rateval) as rateval,dat from rating where ( DATEDIFF(CURDATE(),dat)) < 30 group by rid) A ON (content.cntid = A.rid)left join (select crid,sum(referral)  as
			referral,refdate from referral where (DATEDIFF(CURDATE(), refdate) ) < 30 group by crid) C on (content.cntid=C.crid) left join (select  name,id from hioxpm )D on (content.usrid=D.id)where D.name='$name' and status !='TBR'";		     	
			//echo"$str";
			$result = mysql_query($str,$link);
			while($row = @mysql_fetch_array($result,MYSQL_ASSOC)){
			$cntid=$row['cntid'];
			$tid=$row['tid'];
			$usrid=$row['usrid'];
			$ratid=$row['rid'];
			$description=$row['description'];
			$adddate=$row['adddate'];
			$title=$row['title'];
			$version=$row['version'];
			$license=$row['license'];
			$rateval=$row['rateval'];
			$view=$row['view'];
			$name=$row['name'];
$url1 = $_SERVER['SCRIPT_NAME'];
$host = $_SERVER['SERVER_NAME'];
$ser = "http://$host";
$url= $ser.$url1;
$pos=strrpos($url, "/");
$rest = substr($url, 0, $pos);


	  echo"<form name='select_all'><tr><td><div style='padding-left:20px;' ><table border=0 width=95% cellpadding=0 cellspacing=0 style='border: 1px solid grey; background-color: #ffffff;'>
	  <tr height=25 bgcolor=#84A258><td colspan=2>&nbsp;&nbsp;&nbsp;<a href='$title1-$cntid.html' class=cathead>$title </a>
	  </td></tr>
	 <tr><td colspan=2><div style=\"padding: 5px 15px; \" align=left ><a href='$title-$cntid.html' class=heading1>$description</a></div></td></tr>
	  <tr bgcolor=#eeeeee><td style=\"padding: 5px 15px;font-weight:bold; font-size:11px\" >Date: $adddate <br>
	  License:$license</td><td align=right style=\"font-weight:bold; font-size:11px;padding: 5px 15px;\">Views: $view<br>Rating:$rateval</td></tr>
	  </table></div><br></td><td>Code for Referral Link<textarea name=\"text_area\" ><a href='$rest/$title-$cntid.html'>$title</a>
</textarea></td><td><input type=button value='Select All' onClick=\"javascript:this.form.text_area.focus();this.form.text_area.select();\"></form></td></tr>";
		   }
echo"</table>";
         ?>
<?php
	include '../login/A-footer.php';
}
?>



Return current item: Create Your Own Directory