Good morning,
I have a PHP Snippet that works using ECHO statement, but I am looking to "Convert" it to be able to put it into "View As Custom" on a field on the print page. I know that I must use "$value =" and can't use ECHO in "View As Custom", but am not sure how to put it into "View As Custom". Below listed is the PHP Snippet that I have:
global $conn;
$strSQLSelect = "SELECT * FROM training_recertifications WHERE (ps = '".$_SESSION["ps"]."') ORDER BY datetime_effective";
$rsSelect = db_query($strSQLSelect,$conn);
echo "<table border =1>";
echo "<th><P align=center><span style=padding-left:10px> Title:<span style=padding-right:10px></th>";
echo "<th><P align=center><span style=padding-left:10px> Hours: <span style=padding-right:10px></th>";
echo "<th><P align=center><span style=padding-left:10px> Date Effective: <span style=padding-right:10px></th>";
echo "<th><P align=center><span style=padding-left:10px> Expiration Date: <span style=padding-right:10px></th>";
echo "<th><P align=center><span style=padding-left:10px> PS #: <span style=padding-right:10px></th>";
echo "<th><P align=center><span style=padding-left:10px> Rank/Name: <span style=padding-right:10px></th>";
echo "<th><P align=center><span style=padding-left:10px> Work Location: <span style=padding-right:10px></th>";
echo "<th><P align=center><span style=padding-left:10px> Issued By: <span style=padding-right:10px></th>";
while($data1=db_fetch_array($rsSelect))
{
$effectivedate = $data1['datetime_effective'];
$effectivedate1 = date("m/d/Y",strtotime($effectivedate));
$expirationdate = $data1['datetime_expiring'];
$expirationdate1 = date("m/d/Y",strtotime($expirationdate));
echo "<tr>";
echo "<td><P align=left><span style=padding-left:10px>".$data1['title']."<span style=padding-right:10px></td>";
echo "<td><P align=center>".$data1['hours']."</td>";
echo "<td><P align=center>$effectivedate1</td>";
echo "<td><P align=center>$expirationdate1</td>";
echo "<td><P align=center>".$data1['ps']."</td>";
echo "<td><P align=left><span style=padding-left:10px>".$data1['rankname']."<span style=padding-right:10px></td>";
echo "<td><P align=center>".$data1['work_location']."</td>";
echo "<td><P align=left><span style=padding-left:10px>".$data1['issued_by']."<span style=padding-right:10px></td>";
echo "</tr>";
}
echo "</table>";
Thank you in advance for your help,
Brian