include("../includes/common.htm");
$id=mysql_real_escape_string($id);
$pjob=mysql_real_escape_string($pjob);
$networktable="lerage_network";
$perpage=15;
if ($start=='') { $start=0; }
$next=$start+$perpage;
$prev=$start-$perpage;
/* remove profile */
if ($fid) {
if (($delid!='') && ($deljob!='')) {
$delete="delete from $networktable where subscribe_id='$delid' and subscribe_job='$deljob' and pid='$fid' and pjob='$job'";
$delrec = mysql_query("$delete");
$update="update $networktable set status='' where pid='$delid' and pjob='$deljob' and subscribe_id='$fid' and subscribe_job='$job' and status='approved'";
$updaterec = mysql_query("$update");
//print "$delete
";
}
}
if ($id) {
$qry="select distinct subscribe_id,subscribe_job from $networktable where pid='$id' and pjob='$pjob' and subscribe_id!='0' and status='approved' order by `date` desc limit $start,$perpage";
$rec=SelectQry($qry);
//$tqry="select distinct subscribe_id from $networktable where pid='$id' and subscribe_id!='0' and status='approved'";
$tqry="select distinct subscribe_id,subscribe_job from $networktable where pid='$id' and pjob='$pjob' and subscribe_id!='0' and status='approved'";
$trec=SelectQry($tqry);
//print "$qry";
}
if (($fid) && ($status=='add')) {
$mycomment=trim($mycomment);
if ($mycomment!='') {
$mycomment=ereg_replace("\'","\\'",$mycomment);
$insert="insert into $networktable (pid,pjob,MyPost,`date`,post_id,post_job,type,objectid) values ('$fid','$job','$mycomment','$current_datetime','$id','$pjob','$type','$objectid')";
print "$insert
";
// $insertrec = mysql_query("$insert") or $msg="Unable to insert post, contact admin.
";
if ($insertrec!='') { $msg="Comment successfully posted.
Click on your posted comment to edit."; }
} else { $msg="Empty Post"; }
}
?>
$avatar | "; print "" . ucfirst($pname) . " $jobtitle[$job]"; if ($fid==$id) print " | ";
$row++;
} else {
$row=1;
print "|
$avatar | "; print "" . ucfirst($pname) . " $jobtitle[$job]"; if ($fid==$id) print " | ";
$row++;
}
}
if (count($trec)==1) { print ""; } else if (count($trec)<6) { print " | "; } ?> |