我这里有3个表单using C<V, Args...>::f;
用于处理表的查询,
query.php
用于输出表格,salesorder_table.php
用于初始化data_fetch_table
。
我的问题是,当我尝试var_dump salesorder_table
时,它给了我空字符串和icant执行我的查询,因为我应该怎么做?
query.php
$SALESORDER_CODE
salesorder_table.php
$SALESORDER_CODE=$_POST["SALESORDER_CODE"];
var_dump($SALESORDER_CODE);
$salesorder=mysqli_query($link,"SELECT* FROM salesorder WHERE
USER_ID='".$display_userid."' AND SALESORDER_CODE = '".$SALESORDER_CODE."'");
fetch_data_table.js
<?php
include ("query.php");
echo '
<table id="example1" class="datatable table table-bordered table-striped" >
<thead>
<tr class="default">
<th class="display_invisible">ID</th>
<th></t h>
<th>Item Code <i class="fa fa-sort" aria-hidden="true"></i> </th>
<th>Quantity <i class="fa fa-sort" aria-hidden="true"></i></th>
<th>Rate <i class="fa fa-sort" aria-hidden="true"></i></th>
<th>Total <i class="fa fa-sort" aria-hidden="true"></i></th>
</tr>
</thead>
<tbody>';
while($sorow=mysqli_fetch_array($salesorder)){
$SALESORDER_ID=$sorow["SALESORDER_ID"];
$SALESORDER_QUANTITY=$sorow["SALESORDER_QUANTITY"];
$SALESORDER_UNITPRICE=$sorow["SALESORDER_UNITPRICE"];
$SALESORDER_AMOUNT=$sorow["SALESORDER_AMOUNT"];
$ITEM_ID=$sorow["ITEM_ID"];
$total= number_format($SALESORDER_AMOUNT, 2);
$itemquery=mysqli_query($link,"select * from item where ITEM_ID = '".$ITEM_ID."'");
while($itemrow=mysqli_fetch_array($itemquery)){
$ITEM_NAME=$itemrow["ITEM_NAME"];
}
?>
<tr class="datatablefetch">
<td class="display_invisible"><?php echo $SALESORDER_ID ?></td>
<td class="text-center">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li class="bg-success"><a href="" title="Edit Customer Info" data-toggle="modal" data-target="#editso">Edit</a></li>
<li class="bg-danger"><a data-toggle="modal" data-target="#deleteitemmodal" href="" title="Inactive Customer ">Delete</a></li>
</ul>
</div>
</td>
<td class="text-center"><?php echo $ITEM_NAME; ?></td>
<td class="text-center"><?php echo $SALESORDER_QUANTITY; ?></td>
<td class="text-center"><?php echo $SALESORDER_UNITPRICE; ?></td>
<td class="text-center
<?php
if($ITEM_ID != "3"){
echo 'amount';
}else{
echo 'discount';
}?>"><?php echo $total;?></td>
</tr>
<?php
}
echo'
</tbody>
<tfoot>
<tr class="default">
<th class="display_invisible">ID</th>
<th></th>
<th>Item Code <i class="fa fa-sort" aria-hidden="true"></i> </th>
<th>Quanitity <i class="fa fa-sort" aria-hidden="true"></i></th>
<th>Rate <i class="fa fa-sort" aria-hidden="true"></i></th>
<th>Total <i class="fa fa-sort" aria-hidden="true"></i></th>
</tr>
</tfoot>
</table>';
?>