Advertisement
Guest User

Untitled

a guest
Aug 7th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 4.47 KB | None | 0 0
  1.                        <table class="table" id="productTable">
  2.                           <thead>
  3.                             <tr>
  4.                               <th>Model</th>
  5.                               <th>Retail Price</th>
  6.                               <th>Quantity</th>
  7.                               <th>Total</th>
  8.                               <th>Action</th>
  9.                             </tr>
  10.                           </thead>
  11.  
  12.                           <tbody>
  13.                             <?php
  14.                             $arrayNumber = 0;
  15.                             for($x = 1; $x < 4; $x++){ ?><!-- for loop start -->
  16.                               <tr id="row<?php echo $x; ?>" class="<?php echo $arrayNumber; ?>">
  17.                                 <td>
  18.                                   <div class="form-group">
  19.                                     <select class="form-control" name="po_supplier[]" id="po_supplier<?php echo $x; ?>" onchange="getProductData(<?php echo $x; ?>)">
  20.                                       <option value="">~~SELECT SUPPLIER~~</option>
  21.                                       <?php
  22.                                       $productSql = "SELECT * FROM inventory";
  23.                                       $productData = $link->query($productSql);
  24.  
  25.                                       while($row = $productData->fetch_array()) {
  26.                                         echo "<option value='".$row['inv_id']."' id='changeProduct".$row['inv_id']."'>".$row['product_description']."</option>";
  27.                                       } // /while
  28.  
  29.                                       ?>
  30.                                     </select>
  31.                                   </div>
  32.                                 </td>
  33.                                 <td>
  34.                                   <!--UNIT PRICE-->
  35.                                   <input type="text" name="retail_price[]" id="retail_price<?php echo $x; ?>" autocomplete="off" disabled="true" class="form-control" />
  36.                                   <input type="hidden" name="retailPriceValue[]" id="retailPriceValue<?php echo $x; ?>" autocomplete="off" class="form-control" />
  37.                                 </td>
  38.                                 <td>
  39.                                   <div class="form-group"><!--QTY-->
  40.                                     <input type="number" name="qty[]" id="qty<?php echo $x; ?>" onkeyup="getTotal(<?php echo $x; ?>)" autocomplete="off" class="form-control" min="1" />
  41.                                   </div>
  42.                                 </td>
  43.                                 <td>
  44.                                   <!--TOTAL PRICE-->
  45.                                   <input type="text" name="total[]" id="total<?php echo $x; ?>" autocomplete="off" class="form-control" disabled="true" />
  46.                                   <input type="hidden" name="totalValue[]" id="totalValue<?php echo $x; ?>" autocomplete="off" class="form-control" />
  47.                                 </td>
  48.                                 <td>
  49.                                   <button class="btn btn-default removeProductRowBtn" type="button" id="removeProductRowBtn" onclick="removeProductRow(<?php echo $x; ?>)"><i class="glyphicon glyphicon-trash"></i></button>
  50.                                 </td>
  51.                               </tr>
  52.  
  53.                               <?php $arrayNumber++; } ?> <!-- For Loop End -->
  54.                             </tbody>
  55.                             <tfoot>
  56.                              
  57.                                 <button type="button" class="btn btn-default" onclick="addRow()" id="addRowBtn" data-loading-text="Loading..."> <i class="glyphicon glyphicon-plus-sign"></i> Add Row </button>
  58.  
  59.                               <tr>
  60.                                 <td>
  61.                                   <div class="form-group">
  62.                                     <label for="subTotal" class="col-sm-3 control-label">Sub Amount</label>
  63.                                     <div class="col-sm-9">
  64.                                       <input type="text" class="form-control" id="subTotal" name="subTotal" disabled="true" />
  65.                                       <input type="hidden" class="form-control" id="subTotalValue" name="subTotalValue" />
  66.                                     </div>
  67.                                   </div>
  68.                                 </td>
  69.                               </tr>
  70.                             </tfoot>
  71.                           </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement