I AM PREPARING A CODE FOR PAYSLIP FOR MY COMPANY
IN OUR DATA SOME COLUMN ARE “O” , I WANT TO DISPLAY AS TABLE
BUT NULL VALUE SHOULD SKIP
HERE THE CODE
[code=html]
<?php
session_start();
if (!isset($_SESSION[‘staff_id’]))
{
die(header(‘Location: ../index.php’));
}
?>
<?php
//database connection
include(‘../admin/connection.php’);
include(‘../sanitise.php’);
$staff_id = sanitise($_GET[‘staff_id’]);
$qry =(“SELECT * FROM sal_08_12 WHERE staff_id = ‘$staff_id'”);
$update = mysql_query($qry) or die(mysql_error());
$row_update = mysql_fetch_assoc($update);
$totalRows_update = mysql_num_rows($update);
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Pay Slip</title>
<script language=”javascript” type=”text/javascript” >
// Disen
document.onselectstart=new Function(‘return false’);
function dMDown(e) {return false;}
function dOClick() {return true;}
document.onmousedown=dMDown;
document.onclick=dOClick
–>
</script>
<style>
body, html
{
margin:0;
padding:0;
font-family:”Lucida Sans Unicode”, “Lucida Grande”, sans-serif;
font-size:11px;
background-color:#fff;
}
#outerwrapper
{
width:800px;
height:auto;
margin:auto;
}
#slip
{
width:747px;
height:auto;
margin:auto;
font-size: x-small;
}
#slip2
{
width:418px;
height:auto;
margin-left:150px;
margin-top:40px;
text-align: right;
}
.text
{
font-size:14px;
font-family:Tahoma, Geneva, sans-serif;
font-weight:bold;
}
</style>
</head>
<body>
<div id=”outerwrapper”>
<div id=”slip”>
<table width=”747″ border=”1″>
<tr>
<td colspan=”4″ align=”center”><span class=”text”>RAMESH FLOWERS</span><br />
<span class=”text”>TUTICORIN</span><br />
H628007<br />
ACCOUNTS SECTION<br />
<br />
<br />
<table width=”200″ border=”0″>
<tr>
<td align=”center”>PAYSLIP</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><strong>Generated At</strong></td>
<td><i><?php echo $row_update[‘date_s’]; ?></i></td>
</tr>
<tr>
<td><strong>Staff ID</strong></td>
<td><?php echo $row_update[‘staff_id’]; ?></td>
<td><strong>Name</strong></td>
<td width=”181″><?php echo $row_update[‘NAME’]; ?></td>
</tr>
<tr>
<td width=”87″><strong>payband</strong></td>
<td width=”368″><?php echo $row_update[‘PAYBAND’]; ?></td>
<td width=”83″><strong>designation</strong></td>
<td><?php echo $row_update[‘DCODE1’]; ?></td>
</tr>
<tr>
<td><strong>accno</strong></td>
<td><?php echo $row_update[‘ACCTNO’]; ?></td>
<td><strong>pay</strong></td>
<td>GL<?php echo $row_update[‘PAY’]; ?></td>
</tr>
<tr>
<td colspan=”4″>
<div id=”slip2″>
<table width=”418″ border=”1″>
<?php
if(isset($PAYARREARS))
{
?>
<tr>
<td width=”180″><strong>payarrears</strong></td>
<td width=”222″><?php echo $row_update[‘PAYARREARS’]; ?></td>
</tr>
<?php
}
?>
<tr>
<td><strong>payreco</strong></td>
<td><?php echo $row_update[‘PAYRECO’]; ?></td>
</tr>
<tr>
<td><strong>dpay</strong></td>
<td><?php echo $row_update[‘DPAY’]; ?></td>
</tr>
<tr>
<td><strong>dparrs</strong></td>
<td><?php echo $row_update[‘DPARRS’]; ?></td>
</tr>
<tr>
<td><strong>REC</strong></td>
<td><?php echo $row_update[‘REC’]; ?></td>
</tr>
<tr>
<td><strong>FPAARRS</strong></td>
<td><?php echo $row_update[‘FPAARRS’]; ?></td>
</tr>
<tr>
<td><strong>GROSS</strong></td>
<td><?php echo $row_update[‘GROSS’]; ?></td>
</tr>
<tr>
<td><strong>TOTAL SALARY</strong></td>
<td><strong>N<?php echo $row_update[‘TOTSAL’]; ?></strong></td>
</tr>
</table>
</div></td>
</tr>
</table>
<table width=”747″ border=”1″>
<tr>
<td align=”center”><br />
……………………………………………………<br />
Acountant </td>
<td align=”center”><br />
……………………………………………………<br />
Finance Manager</td>
</tr>
</table>
Click <a href=”print3.php”>here</a> to go back<br />
<a href=”javascript:self.print()”>Print This Page</a> <br />
</div>
</div>
</body>
</html>