예제 #1
0
<?php

/* 
 * Displays all customer table
 */
$cust = $data["customers"];
if (!empty($cust)) {
    // actual display table
    echo "<table id='main_table'>\n             <tr>\n                <td>ID</td>\n                <td>Name</td>\n                <td>Email</td>\n                <td>Country</td>\n                <td>Transactions</td>\n            </tr>" . PHP_EOL;
    foreach ($cust as $val) {
        echo "<tr>\n                     <td class='c_id'>" . $val["customer_id"] . "</td>\n                     <td><span class='c_name'>" . $val["customer_name"] . "</span><br>\n                         <div class='actions'>\n                             <a href='javascript:;' class='transactions'>View</a>&nbsp;\n                             <a href='javascript:;' class='edit'>Edit</a>&nbsp;\n                             <a class='delete' href='javascript:;'>Delete</a>\n                         </div>\n                     </td>\n                     <td class='c_email'>" . $val["customer_email"] . "</td>\n                     <td><input type='hidden' class='c_country' value='" . $val["customer_country"] . "'>" . country::get_country($val["customer_country"]) . "</td>\n                     <td>\n                        <p style='padding-top:12px;'><b>Total</b> : " . number_format($val["total"], 2, '.', ',') . "</p>\n                     </td>\n                 </tr>";
    }
    echo "</table>";
    if (isset($data["pagination_links"]) && $data["pagination_links"] != "") {
        echo "<div style='float:left; clear:both; margin:20px 0px'>" . $data["pagination_links"] . "</div>";
    }
} else {
    // actual display table
    echo "<table id='main_table'>\n             <tr>\n                <td>ID</td>\n                <td>Name</td>\n                <td>Email</td>\n                <td>Country</td>\n                <td>Transactions</td>\n            </tr>\n          </table>";
    echo "<h3 style='float:left; margin:50px auto;'>0 RECORD FOUND.</h3>";
}
?>






예제 #2
0
            <table>
                <tr>
                    <td>Customer Name:<input type="hidden" id="cust_id" value=""></td>
                    <td><input type="text" class="cust_in" value="" id="cust_name"></td>
                </tr>
                <tr>
                    <td>Customer Email:</td>
                    <td><input type="text"  class="cust_in" value="" id="cust_email"></td>
                </tr>
                <tr>
                    <td>Country:</td>
                    <td>
                        <select id="cust_country">
                            <option value=""> -- Select -- </option>
                            <?php 
$country = country::get_country();
foreach ($country as $key => $val) {
    echo "<option value='{$key}'>{$val}</option>";
}
?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td><div id="remarks"></div>
                        <input type="button" value="Cancel" id="cancel_btn">
                        <input type="button" value="Save" id="save_btn" class='btn1'>
                        <input type="button" value="Save" id="update_btn" class='btn1'></td>
                </tr>