สอนทำระบบ POS (ระบบขายหน้าร้าน) Ep 26. นำ SESSION ของสินค้า มาแสดง (ขายสินค้า Part 3)
สอนทำระบบ POS (ระบบขายหน้าร้าน) Ep 26.
นำ SESSION ของสินค้า มาแสดง
(ขายสินค้า Part 3)
ระบบ บริหารจัดการร้านกาแฟ PHP | FD22-Cafe (Coffee AND Bakery)
ระบบบริหารจัดการ รีสอร์ท | Booking Resort System PHP
CART&POS (ระบบจัดการงานขายหน้าร้านและ ออนไลน์ สำหรับร้านค้าขนาดกลาง,SME)
ระบบ POS (Point of Sale) ระบบขายหน้าร้าน ตัวเต็ม
(มีระบบ BarCode และ QR-Code รองรับเครื่องแสกน)
ตัวอย่างผลงาน FD22 Logistic 2020 ระบบบริหารจัดการขนส่ง
สอนทำระบบ POS (ระบบขายหน้าร้าน) Ep 26. นำ SESSION ของสินค้า มาแสดง
(ขายสินค้า Part 3)
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
<form id="frmcart" name="frmcart" method="post" action="?t_id=<?php echo $t_id;?>&b_id=<?php echo $b_id;?>=1&act=update"> <h4>รายการสั่งซื้อ</h4> <br> <table border="0" align="center" class="table table-hover table-bordered table-striped"> <tr> <td width="1%" >#</td> <td width="5%" >สินค้า</td> <td width="4%" >ราคา</td> <td width="15%" >จำนวน</td> <td width="4%" >รวม(บาท)</td> <td width="3%" >ลบ</td> </tr> <?php $total=0; if(!empty($_SESSION['cart'])) { foreach($_SESSION['cart'] as $p_id=>$qty) { $sql = "SELECT * FROM tbl_product where p_id=$p_id"; $query = mysqli_query($condb, $sql); $row = mysqli_fetch_array($query); $sum = $row['p_price'] * $qty;//เอาราคาสินค้ามา * จำนวนในตระกร้า $total += $sum; //ราคารวม ทั้ง ตระกร้า echo "<tr>"; echo "<td>" . $ii+=1 . "</td>"; echo "<td>" . $row["p_name"] ."<br>" ."สต๊อก " .$row['p_qty'] ." รายการ" . "</td>"; echo "<td align='right'>" .number_format($row["p_price"],2) . "</td>"; echo "<td align='right'>"; $pqty = $row['p_qty'];//ประกาศตัวแปรจำนวนสินค้าใน stock echo "<input type='number' name='amount[$p_id]' value='$qty' size='2'class='form-control' min='0'max='$pqty'/>"; echo "<td align='right'>".number_format($sum,2)."</td>"; //remove product } echo "<tr>"; echo "<td></td>"; echo "<td></td>"; echo "<td></td>"; echo "<td bgcolor='#CEE7FF' align='center'><b>ราคารวม</b></td>"; echo "<td align='right' bgcolor='#CEE7FF'>"."<b>".number_format($total,2)."</b>"."</td>"; echo "<td align='left' bgcolor='#CEE7FF'></td>"; echo "</tr>"; } ?> </table> <p align="right"> <!-- <a href="list_l.php" class="btn btn-info">กลับหน้ารายการสินค้า</a> --> <!-- <a href="#" target="" class="btn btn-success" onclick="window.print()">Print</a> --> <input type="submit" name="button" id="button" value="ปรับปรุง" class="btn btn-warning" /> <input type="hidden" name="t_id" value="<?php echo $t_id;?>"> <input type="hidden" name="b_id" value="<?php echo $b_id;?>"> </p> </form> |