now the selection option working and another things happen which the datepicker does not work… But how to make it show all the data in the select table as default? Because as default the table area is empty but i want it shows all the data. and when select ALL it also able to show all the data… any clue?
[php]
<br></br>
<p id="hiderow">
<select name= "COMPANYNAME">
<option value="">ALL</option>
<?php while ($row = mysqli_fetch_array($result1)):;?>
<option value="<?php echo ($row['COMPANYNAME']); ?>"><?php echo ($row['COMPANYNAME']); ?></option>
<?php
endwhile;
?>
</select>
<input type="submit" name="submit" value="Submit"/>
</p>
<br /><hr />
<?php
if(isset($_POST['COMPANYNAME']))
{
$COMPANYNAME = $_POST['COMPANYNAME'];
$fetch = "SELECT * FROM `sl_iv` Inner Join `ar_iv` On ar_iv.DOCNO = sl_iv.DOCNO Inner Join `payment_terms` On ar_iv.TERMS = payment_terms.id WHERE COMPANYNAME = '".$COMPANYNAME."'";
$result = mysqli_query($conn_connection,$fetch)or die("MySQL error: " . mysqli_error($conn_connection) . "<hr>\nQuery: $fetch");
?>
<table id="items">
<center>
<thead>
<tr>
<th width="15%" style="text-align:center"><span>Doc No.</span></th>
<th width="10%" style="text-align:center"><span>Date</span></th>
<th width="10%" style="text-align:center"><span>Terms</span></th>
<th width="10%" style="text-align:center"><span>Due</span></th>
<th width="5%" style="text-align:center"><span>Age</span></th>
<th width="20%" style="text-align:center"><span>Customer Name</span></th>
<th width="10%" style="text-align:center"><span>Ammount</span></th>
<th width="10%" style="text-align:center"><span>Payment</span></th>
<th width="10%" style="text-align:center"><span>OutStanding</span></th>
</tr>
</thead>
</center>
<tbody>
<?php
if($COMPANYNAME =="")
{
$res=mysqli_query($conn_connection, $fetch);
}
while($data=mysqli_fetch_array($result))
{
$docamt = $data['DOCAMT'];
$paymentamt = $data['PAYMENTAMT'];
$outstanding = $docamt - $paymentamt;
$then = $data['DOCDATE'];
$then = strtotime($then);
$now = time();
$difference = $now - $then;
$dateage = floor($difference / (60*60*24));
?>
<tr class="item-row">
<td style="text-align:left; font-size:15px" readonly><?php echo ($data['DOCNO']);?></td>
<td style="text-align:center; font-size:15px"><?php echo ($data['DOCDATE']);?></td>
<td style="text-align:center; font-size:15px"><?php echo ($data['terms']);?></td>
<td style="text-align:center; font-size:15px"><?php echo ($data['DUEDATE']);?></td>
<td style="text-align:center; font-size:15px"><?php echo $dateage;?></td>
<td style="text-align:left; font-size:15px" readonly><?php echo ($data['COMPANYNAME']);?></td>
<td><input type="text" style="text-align:right; font-size:15px" class="form-control input-sm TotalAmt" id="TotalAmt0" name="TotalAmt[]" value="<?php echo htmlspecialchars($data['DOCAMT']);?>" readonly></td>
<td><input type="text" style="text-align:right; font-size:15px" class="form-control input-sm payment" id="payment0" name="payment[]" value="<?php echo htmlspecialchars($data['PAYMENTAMT']);?>" readonly></td>
<td><input type="text" style="text-align:right; font-size:15px" class="form-control input-sm Total_Outstanding" id="Total_Outstanding0" name="Total_Outstanding[]" value="<?php echo number_format((float)$outstanding, 2, '.', '');?>" readonly></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php } ?>
</form>
[/php]