hi, I have a script that displays a signature of a signed work order. here is the file that calls all the work orders
<style>
@page { size 8.5in 11in; }
div.page { page-break-after: always }
</style>
<?php
include 'config.php';
$id = $_GET['id'];
$result7 = mysql_query("SELECT * FROM workorders WHERE jobnumber = '$id'");
while($row7 = mysql_fetch_array($result7))
{
$woid = $row7['id'];
?>
<div class="page">
<?php
include "printworkorder.php";
?>
</div>
<?php
}
?>
then in the printworkorder.php file (which works fine with only one instance of loading it) when loading multiple work orders to print, it only signs the document on the last one. any idea how I can get it to sign all instances?
<?php
include 'config.php';
if(isset($woid)){
} else {
$woid = $_GET['id'];
}
$result = mysql_query("SELECT * FROM workorders WHERE id = $woid");
while($row = mysql_fetch_array($result))
{
$wodate = $row['date'];
$wojobnum = $row['jobnumber'];
$timesheetid = $row['timesheetid'];
$start = $row['start'];
$finish = $row['finish'];
$timebilled = $row['timebilled'];
$description = $row['description'];
$signator = $row['signator'];
$signature = $row['signature'];
$sig_hash = $row['sig_hash'];
$created = $row['created'];
}
$result3 = mysql_query("SELECT * FROM timesheet WHERE id = '$timesheetid'");
$talltime = 0;
while($row3 = mysql_fetch_array($result3))
{
$tid=$row3['id'];
$tdate=$row3['date'];
$tjobnumber=$row3['jobnumber'];
$teid=$row3['eid'];
$tdescription=$row3['description'];
$tsignin=$row3['start'];
$tfinish=$row3['finish'];
$tlunch=$row3['lunch'];
$tschednum=$row3['schednum'];
$shortid=substr($tjobnumber, 5, -1); //remove the first 5 characters and minus the last character
$jobid=substr($tjobnumber, 5); //remove the first 5 characters
$result = mysql_query("SELECT * FROM jobs WHERE id = '$shortid'");
while($row = mysql_fetch_array($result))
{
$jstatus=$row['status'];
$jaddress=$row['address'];
}
$mechanic = mysql_query("SELECT * FROM staff WHERE eid = '$teid'");
while($row4 = mysql_fetch_array($mechanic))
{
$tmechanic=$row4['name'];
}
}
$result9 = mysql_query("SELECT * FROM jobs WHERE id = '$shortid'");
while($row9 = mysql_fetch_array($result9))
{
$tcustomer=$row9['customer'];
}
?>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr>
<td valign="bottom"><div align="center">
<table border="0" cellpadding="2" style="border-collapse: collapse" width="100%" bordercolorlight="#000000" bordercolordark="#000000">
<tr>
<td><font face="Calibri" style="font-size: (11 pt)">
<img border="0" src="images/logo.png" ></font></td>
<td width="237" valign="top">
<p align="center">
<font face="Calibri" style="font-size: (11 pt)">
<font size="6">Work Order</font><br><?php echo $woid ?></font></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td valign="bottom">
</td>
</tr>
<tr>
<td valign="top">
<font face="Calibri" style="font-size: (11 pt)">
<br>
</font>
<div align="center">
<table border="0" cellpadding="2" style="border-collapse: collapse" width="90%" bordercolorlight="#000000" bordercolordark="#000000">
<tr>
<td width="7%">
<i>
<font face="Calibri" style="font-size: (11 pt); font-weight:700">Customer:</font></i></td>
<td style="border-top-style: none; border-top-width: medium" rowspan="6" valign="top" width="93%"><?php echo $tcustomer; ?></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<table border="1" cellpadding="2" style="border-collapse: collapse" width="100%" bordercolorlight="#000000" bordercolordark="#000000">
<tr>
<td align="center" valign="top"><i>
<font style="font-size: (11 pt); font-weight: 700" face="Calibri">
JOB NUMBER</font></i><br><?php echo "$jobid"; ?></td>
<td align="center" valign="top"><i>
<font style="font-size: (11 pt); font-weight: 700" face="Calibri">
DATE</font></i><br><?php echo date('F j, Y', $created); ?></td>
<td align="center" valign="top" colspan="2"><i>
<font style="font-size: (11 pt); font-weight: 700" face="Calibri">
ADDRESS</font></i><br><?php echo "$jaddress"; ?></td>
</tr>
<tr>
<td colspan="4" ></td>
</tr>
<tr>
<td align="center" valign="top"><i>
<font style="font-size: (11 pt); font-weight: 700" face="Calibri">
TECHNICIAN</font></i><br><?php echo "$tmechanic"; ?></td>
<td align="center" valign="top"><i>
<font style="font-size: (11 pt); font-weight: 700" face="Calibri">
TIME IN</font></i><br><?php echo "$start"; ?></td>
<td align="center" valign="top"><i>
<font style="font-size: (11 pt); font-weight: 700" face="Calibri">
TIME OUT</font></i><br><?php echo "$finish"; ?></td>
<td align="center" valign="top"><i>
<font style="font-size: (11 pt); font-weight: 700" face="Calibri">
TIME BILLED</font></i><br><?php echo "$timebilled hours"; ?></td>
</tr>
<tr>
<td colspan="4">
<font face="Calibri" style="font-size: (11 pt)">
<i><b>Description Of Work: </b></i></font>
<br>
<tt><font face="Arial"><?php echo $description; ?></font><br><br>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td valign="bottom">
<div align="center">
<table border="0" cellpadding="2" style="border-collapse: collapse" width="90%" bordercolorlight="#000000" bordercolordark="#000000">
<tr>
<td style="border-top-style: none; border-top-width: medium"> </td>
<td width="175" style="border-top-style: none; border-top-width: medium"> </td>
</tr>
<tr>
<td>
<br><br><br>
Date Signed: <?php echo date('F j, Y g:i A', $created); ?><br><br>
Printed Name: <?php echo htmlentities($signator, ENT_NOQUOTES, 'UTF-8'); ?><br><br>
Signature:
<?php //regenerate signature ?>
<div class="sigPad signed">
<div class="sigWrapper">
<div class="typed">
<?php echo htmlentities($signator, ENT_NOQUOTES, 'UTF-8'); ?>
</div>
<canvas class="pad" width="348" height="120"></canvas>
</div>
<br>
</div>
<script src="mobile/signature-pad/build/jquery.min.js"></script>
<script src="mobile/signature-pad/build/jquery.signaturepad.min.js"></script>
<script>
$(document).ready(function () {
// Write out the complete signature from the database to Javascript
var sig = <?php echo $signature; ?>;
$('.sigPad').signaturePad({displayOnly : true}).regenerate(sig);
});
</script>
<?php //regenerate signature ?>
<br><br>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td valign="bottom">
<div align="center">
<div align="center">
<table border="0" cellpadding="2" style="border-collapse: collapse" width="90%" bordercolorlight="#000000" bordercolordark="#000000">
<tr>
<td width="33%">
<font face="Calibri" style="font-size: (11 pt)" size="2">Phone:
905-420-2043</font></td>
<td width="33%">
<p align="center">
<font face="Calibri" style="font-size: (11 pt)" size="2">817 Brock Road, Unit
#7<br>Pickering, Ontario, L1W 3L9</font></td>
<td width="33%">
<p align="right">
<font face="Calibri" style="font-size: (11 pt)" size="2">Fax: 905-420-5040</font>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
</div>
any help is appreciated