:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/crm/quatation/**
:: Editing File: page21-scope.php
<?php include 'conn/db.php'; ?> <div class="text-center"> <img src="assets/images/logo.png" class="logo"> <hr> </div> <h2 class="section-title">Scope of Work</h2> <table border="1" width="100%" cellpadding="8" cellspacing="0"> <tr> <th>Sr No</th> <th>DESCRIPTION of Work</th> <th>Specification</th> </tr> <?php $sql = " SELECT c.id AS category_id, c.name AS category, d.name AS description, i.name AS item FROM quotation_categories c JOIN quotation_descriptions d ON d.category_id = c.id JOIN quotation_items i ON i.desc_id = d.id WHERE c.id IN (1,2,3) ORDER BY c.id, d.id, i.id "; $result = mysqli_query($conn, $sql); $currentCategory = ''; $sr_no = 1; while ($row = mysqli_fetch_assoc($result)) { // ============================== // Print Category Heading Once // ============================== if ($currentCategory != $row['category']) { // Reset serial number for new category $sr_no = 1; echo " <tr> <th colspan='3' style='text-align:left;background:#f2f2f2'> {$row['category']} </th> </tr>"; $currentCategory = $row['category']; } // ============================== // Print Item Row // ============================== echo " <tr> <td>{$sr_no}</td> <td>{$row['description']}</td> <td>{$row['item']}</td> </tr>"; $sr_no++; } ?> </table>