<?php session_start(); if (!isset($_SESSION['UserID'])) { $_SESSION['UserID'] = ''; $_SESSION['Username'] = ''; } include 'admin/Function/comfig.php'; $sql = 'SELECT * FROM product'; $query = mysqli_query($objCon, $sql); ?> <div class="container"> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead class="thead-dark text-center"> <th scope="2">ยี่ห้อ</th> <th scope="col">รุ่น</th> <th scope="col">ชื่ออุปกรณ์</th> <th scope="col">จำนวน</th> <th scope="col">วันที่นำเข้า</th> <th>รูปสินค้า</th> <th></th> <tbody class="text-center"> <?php while ($result = mysqli_fetch_array($query, MYSQLI_ASSOC)) { ?> <tr> <th><?php echo $result['Brand']; ?></th> <th><?php echo $result['Generation']; ?></th> <th><?php echo $result['Device_name']; ?></th> <th><?php echo $result['value']; ?></th> <th><?php echo $result['Amount']; ?></th> <th><img src="admin/img/<?= $result['Brand_img']; ?>" style="width:100px"></th> <th><button class="btn btn-dark" data-toggle="modal" data-target="#product" data-id="<?php echo $result['id']; ?>" >ยืม<?php echo $result['id']; ?></button></th> <?php } mysqli_close($objCon); ?> </tr> </tbody> </table> </div> </div> </div> <div class="modal fade" id="product" tabindex="-1" role="dialog" aria-labelledby="Productid" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="Productid">ยืม อุปกรณ์ไอที <?php echo $result['id']; ?></h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form action="laypang/add.php" method="post" name="form" id="demo-form2" data-parsley-validate class="form-horizontal form-label-left"> <?php $return_date = date(('Y-m-d'), strtotime('+15 days', strtotime(date('Y-m-d')))); ?> <div class="modal-body"> <div class="form-group"> <input type="date" id="borrow_date" required="required" class="form-control" name="borrow_date" value="<?php echo date('Y-m-d'); ?>"> </div> <div class="form-group"> <select class="form-control" id="borrow_num" name="borrow_num">> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> </div> <div class="form-group"> <input type="date" id="return_date" required="required" class="form-control" name="return_date" value="<?php echo $return_date; ?>"> </div> </div> <div class="modal-footer"> <button type="reset" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Save changes</button> <input TYPE="hidden" NAME="UserID" value="<?php echo $_SESSION['UserID']; ?>"> <input TYPE="hidden" NAME="product_id" value="<?php echo $result['id']; ?>"> </form> </div> </div> </div> </div>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง