Пример #1
0
<table border="1">
  <col width="100">
  <col width="250">
  <col width="250">
  <col width="170">
  <col width="295">
   <ul> <tr>
    <th>Sl no</th>
    <th>Book Name</th>
    <th>Author</th>
    <th>No. of copies</th>
    <th>Avilability</th>
  </tr>
	<?php 
list_books();
function list_books()
{
    $slno = 0;
    $query = "SELECT * FROM library ORDER BY book_id ASC";
    $result = mysql_query($query);
    while ($book_data = mysql_fetch_array($result)) {
        //Creates a loop to loop through results
        $slno = $slno + 1;
        //Extract user details only if book is issued
        if ($book_data['unissued'] < $book_data['copies'] | $book_data['not_requested'] < $book_data['copies']) {
            $request_id_1 = $book_data['request_by_1'];
            $request_id_2 = $book_data['request_by_2'];
            $issuer_id_1 = $book_data['issued_to_1'];
            $issuer_id_2 = $book_data['issued_to_2'];
            $request_1_details = user_data($request_id_1, 'user_id', 'first_name', 'last_name');
Пример #2
0
 function render_body()
 {
     dom::h3('', 'Raw SQL');
     dom::push_form('lists.php');
     dom::textarea("sql");
     dom::br();
     dom::hidden('action', 'sql');
     dom::submit();
     dom::pop();
     list_instructors();
     list_sections();
     list_books();
     list_courses();
 }