$borrow_id = $_GET['borrow_id'];
 $output = "";
 $order = 0;
 $output .= "<form method='POST' id='frm_media' action=''><div class=datagrid>\r\n         <table>\r\n                <thead>\r\n                <tr class=''>\r\n                    <th class=''><input type='checkbox' onclick='chk_all_return()' class='chk_all_return'></th>\r\n                   <th class='center'>ลำดับ</th>\r\n                   <th>รหัส</th>\r\n                   <th>ชื่อสื่อทัศนวัสดุ</th>\r\n                   <th class='center'>สถานะ</th>\r\n                   <th>วันที่ยืม</th>\r\n                    <th>กำหนดคืน</th>\r\n                    <th>วันที่คืน</th>\r\n                    <th>ค่าปรับ</th>\r\n                   <th class='center'>ตัวเลือก</th>\r\n             \r\n                </thead>\r\n                <tbody>";
 $totalAmt = 0;
 //เก็บค่าปรับรวมทั้งหมด
 while ($row = mysql_fetch_assoc($result)) {
     $id = $row['id'];
     $name = $row['name'];
     $_ID = $row['id'];
     $order++;
     $mediaStatus = getDataDesc('status', 'tb_borrow_list', 'borrow_id=' . $borrow_id . ' AND media_id=' . $id);
     $dateBorrow = getDataDesc('borrow_date', 'tb_borrow_list', 'borrow_id=' . $borrow_id . ' AND media_id=' . $id);
     $dateReturnReal = '';
     if (getDataDesc('return_date', 'tb_borrow_list', 'borrow_id=' . $borrow_id . ' AND media_id=' . $id) != '0000-00-00') {
         $dateReturnReal = getDataDesc('return_date', 'tb_borrow_list', 'borrow_id=' . $borrow_id . ' AND media_id=' . $id);
     }
     $dateReturn = getAddDays($dateBorrow, $row['days_borrow']);
     //หาวันที่ต้องคืน
     $total = 0;
     //เก็บค่าปรับเฉพาะสื่อ
     if (strtotime(DATE) > strtotime($dateReturn)) {
         //เปรียบเทียบวันถ้าคืนเกินเวลาให้ตำนวณค่าปรับ
         $total = DiffDays($dateReturn, DATE) * $row['fine_per_day'];
         //คิดค่าปรับตามระยะเวลาที่เกิน
         $totalAmt = $totalAmt + $total;
     }
     //  $classStatus = 'bg-warning';
     $classStatus = $mediaStatus == 'ยืม' ? 'bg-warning' : 'bg-success';
     $btn_cancel_return = '';
     if ($mediaStatus == 'ยืม') {
        ?>
                                            <tr class="<?php 
        echo $classStatus;
        ?>
" >
                                
                                                <td class="center"><?php 
        echo $row['media_id'];
        ?>
</td>
                                                <td class="center"><?php 
        echo getDataDesc('name', 'tb_category', 'id = ' . $catID);
        ?>
</td> 
                                                <td class="center"><?php 
        echo getDataDesc('name', 'tb_media', 'id = ' . $row['media_id']);
        ?>
</td> 
                                                <td class="center"> <?php 
        echo $row['borrow_date'];
        ?>
</td>
                                   
                                                </td>

                                            </tr>


                                            <?php 
    }
}
        ?>
</td>
                                                <td class="center"><?php 
        echo getDataDesc('name', 'tb_category', 'id = ' . $catID);
        ?>
</td> 
                                                <td class="center"><?php 
        echo getDataDesc('name', 'tb_media', 'id = ' . $row['media_id']);
        ?>
</td> 
                                                <td class="center"> <?php 
        echo getDataDesc('id_card', 'tb_borrow', 'id=' . $row['borrow_id']);
        ?>
</td>
                                                <td class="center"> <?php 
        echo getDataDesc('first_name', 'tb_people', 'id=' . $peopleID) . ' ' . getDataDesc('last_name', 'tb_people', 'id=' . $peopleID);
        ?>
</td>
                                                <td class="center"> <?php 
        echo $row['borrow_date'];
        ?>
</td>
                                                <td class="center"> <?php 
        echo $row['return_date'];
        ?>
</td>
                                                <td class="center "><?php 
        echo $total;
        ?>
</td>
    if (mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_assoc($result)) {
            $classStatus = '';
            $image = getDataDesc('image', 'tb_computer', 'id = ' . $row['computer_id']);
            ?>
                                            <tr class="<?php 
            echo $classStatus;
            ?>
" >

                                                <td class="center"><?php 
            echo $row['repair_id'];
            ?>
</td>
                                                <td class="center"><?php 
            echo getDataDesc('name', 'tb_category', 'id = ' . $row['category_id']);
            ?>
</td> 
                                                <td class="center"><?php 
            echo $row['computer_id'];
            ?>
</td> 
                                                <td class="center"> <img src="./dist/images/media/<?php 
            echo $image;
            ?>
" style="width: 75px;"></td> 
                                                <td class="center"> <?php 
            echo $row['problem_description'];
            ?>
</td>
                                                <td class="center "> <?php 
                                                <div class="col-md-10">
                                                    <textarea class="form-control" rows="5" name="detail" readonly=""><?php 
        echo getDataDesc('detail', 'tb_computer', 'id=' . $row['computer_id']);
        ?>
</textarea>
                                                    <p class="help-block"></p>
                                                </div>
                                            </div>
                                            <div class="row da-form-row ">
                                                <label class="col-md-2">ภาพคอมพิวเตอร์</label>
                                                <div class="col-md-10">
        <?php 
        if ($_GET['id'] != '') {
            ?>
                                                        <img src="<?php 
            echo './dist/images/media/' . getDataDesc('image', 'tb_computer', 'id=' . $row['computer_id']);
            ?>
" class="img-responsive"> 
                                                    <?php 
        }
        ?>
                                                    <p class="help-block"></p>
                                                </div>
                                            </div>
                                        </fieldset>
                                        <fieldset class="scheduler-border">
                                            <legend class="scheduler-border">ข้อมูลอาการปัจจุบัน </legend>

                                            <div class="row da-form-row">
                                                <label class="col-md-2">สถานะปัจจุบัน <span class="required">*</span></label>
                                                <div class="col-md-10">
    }
}
?>
                                    </select>
                                    <p class="help-block"></p>
                                </div>
                            </div>

                            <div class="row da-form-row">
                                <label class="col-md-2">ภาพที่อัพโหลด</label>
                                <div class="col-md-10">
                                    <?php 
if ($_GET['id'] != '') {
    ?>
                                        <img src="<?php 
    echo './dist/images/media/' . getDataDesc('image', 'tb_media', 'id=' . $_GET['id']);
    ?>
" style="max-width: 100%;" class="img-thumbnail"> 
                                    <?php 
}
?>
                                    <p class="help-block"></p>
                                </div>
                            </div>
                            <div class="row da-form-row">
                                <label class="col-md-2">อัพโหลดภาพ </label>
                                <div class="col-md-10">
                                    <input class="form-control input-sm" name="file_array[]" type="file" value="">
                                    <p class="help-block"></p>
                                </div>
                            </div>
示例#7
0
        ?>
" >
                                                <td class="center"> <input type="checkbox" name="select_all[]" class="checkboxes" value="<?php 
        echo $row['id'];
        ?>
" onclick="countSelect()"></td>
                                                <td class="center"><?php 
        echo $row['id'];
        ?>
</td>
                                                <td><?php 
        echo $row['id_card'];
        ?>
</td>
                                                <td><?php 
        echo getDataDesc('first_name', 'tb_people', 'id = ' . $row['people_id']) . ' ' . getDataDesc('last_name', 'tb_people', 'id = ' . $row['people_id']);
        ?>
</td> 
                                                <td><?php 
        echo $row['booking_date'];
        ?>
</td>
                                                <td class="center"><?php 
        echo $row['status'];
        ?>
</td>
                                                <td class="center"><?php 
        echo $row['updated_at'];
        ?>
</td>
                                                <td class="center "><a href="<?php 
    //        $output .= "</tbody>
    //            </table>
    //        </div></form>";
    //    }
    $booking_id = getDataDesc('id', 'tb_booking', 'status = "จองอยู่" AND people_id =' . $_GET['id']);
    if ($booking_id != '') {
        $sql_list = "SELECT * FROM tb_booking_list WHERE booking_id in(" . $booking_id . ")";
        $result2 = mysql_query($sql_list);
        $numRow2 = mysql_num_rows($result2);
        if ($numRow2 > 0) {
            $output .= "<form method='POST' id='frm_media' action=''><div class=datagrid>\r\n         <table>\r\n                <thead>\r\n                <tr>\r\n                    <th class='hidden'></th>\r\n                    <th>ลำดับ</th>\r\n                   <th>รหัสสื่อ</th>\r\n                   <th>ชื่อสื่อทัศนวัสดุ</th>\r\n            \r\n                    <th class='center'>ตัวเลือก</th>\r\n                </thead>\r\n                <tbody>";
            while ($row2 = mysql_fetch_assoc($result2)) {
                $mediaName = getDataDesc('name', 'tb_media', 'id=' . $row2['media_id']);
                $mediaID = $row2['media_id'];
                $allMediaID .= ',' . $row2['media_id'];
                $order++;
                //           $check_media_id_null = getDataDesc('media_id', 'tb_booking_list', 'booking_id ='.$booking_id.' AND media_id ='.$mediaID);
                //           $booked = 'highlight';
                //           if ($check_media_id_null == '') {
                //               $booked = '';
                //           }
                $output .= "<tr class=''>\r\n                    <td class='hidden'><input type='hidden' name='_media_id[]' value='{$mediaID}'></td>\r\n                    <td>{$order}</td>   \r\n                    <td><span class='mID'>{$mediaID}</span></td>   \r\n                    <td>{$mediaName}</td>\r\n                     <td class='center'><a href='javascript:;' onclick='_submit({$mediaID});'  class='btn btn-sm btn-danger'>ลบ</a></td>\r\n                </tr>";
            }
            $output .= "</tbody>\r\n            </table>\r\n        </div></form>";
        }
        $booking_date = getDataDesc('booking_date', 'tb_booking', 'people_id =' . $_GET['id']);
        $date_booking = "<p class='date_booking'>วันที่ได้ทำการจอง : {$booking_date}</p>";
        $arr = array('html' => $date_booking . $output, 'media_id' => substr($allMediaID, 1), 'id_booking' => $booking_id);
        echo json_encode($arr);
    }
}
            echo ShowDate($row['date_input']);
            ?>
</td>
                                                <td class="center "> <?php 
            echo $row['status'] == '' ? 'อยู่ระหว่างดำเนินการ' : $row['status'];
            ?>
</td>
                                                <td class="center"> <?php 
            echo ShowDate($row['date_success']);
            ?>
</td>
                                                <?php 
            if ($_SESSION['group'] == 'ผู้บริหาร' || $_SESSION['group'] == 'ผู้ดูแลระบบ') {
                ?>
                                                    <td class="center"> <?php 
                echo getDataDesc('first_name', 'tb_staff', 'id = ' . $row['staff_id']);
                ?>
</td>
                                                <?php 
            }
            ?>
                                                </td>

                                            </tr>


                                            <?php 
        }
    }
    ?>
示例#10
0
</td>
                                                <td class="center"><?php 
        echo getDataCount('repair_id', 'tb_repair_list', 'repair_id = ' . $row['id']);
        ?>
</td>

                                                <td class="center">
                                                    <div class="">

                                                        <?php 
        $arr_com_id = arr_getDataDesc('computer_id', 'tb_repair_list', 'repair_id = ' . $row['id']);
        foreach ($arr_com_id as $value) {
            if (getDataDesc('status', 'tb_repair_list', 'repair_id = ' . $row['id'] . ' AND computer_id = ' . $value) == '') {
                $status = 'แจ้งซ่อม';
            } else {
                $status = getDataDesc('status', 'tb_repair_list', 'repair_id = ' . $row['id'] . ' AND computer_id = ' . $value);
            }
            ?>
                                                            <p class="badge "><?php 
            echo $value . ' | ' . $status;
            ?>
</p><br>
                                                        <?php 
        }
        ?>
                                                    </div>
                                                </td>
                                                <td class="center"><?php 
        echo ShowDate($row['created_at']);
        ?>
</td>