<?php
start_session();

$_SESSION["manu"]="M00001";
//receiving parameter
//$id = $_GET['id'];
//echo $id;
//echo "<input id='id' type='hidden' value='" .$id. "'/>";
?>

<!--
<div class="container-fluid">
    <div class="row">

        <div class="col-md-12">
            <div class="card card-plain">
                <div class="header">
                    <h4 class="title">Senarai Produk</h4>
                    <p class="category">Jumlah Rekod: <span id="totalrow">0</span></p>
                </div>
                <div class="content table-responsive table-full-width">
                    <table id="products" class="table table-hover">
                        <thead>
                            <th>#</th>
                            <th><b>Jenis</b></th>
                            <th><b>Jenama</b></th>
                            <th><b>Model/Kod Produk</b></th>
                            <th><b>Tahun Keluaran</b></th>
                            <th>[Tindakan]</th>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>


    </div>
</div>
-->

    <!--   Core JS Files   -->
    <script src="/assets/js/jquery-1.10.2.js" type="text/javascript"></script>
	<script src="/assets/js/bootstrap.min.js" type="text/javascript"></script>

	<!--  Checkbox, Radio & Switch Plugins -->
	<script src="/assets/js/bootstrap-checkbox-radio.js"></script>

    <!--  Notifications Plugin    -->
    <script src="/assets/js/bootstrap-notify.js"></script>

    <!-- Paper Dashboard Core javascript and methods for Demo purpose -->
	<script src="/assets/js/paper-dashboard.js"></script>

	<script src="/assets/js/app.js"></script>
    
    <!--
    <script>

        $(document).ready(function() {

            var id = $('#id').val();
            console.log('id...', id);

            var url = "";
            url = getBase();

            //getData();



            function getData(){
                $.ajax({
                    type: "get",
                    url: url + "/m/ws/get_products.php?id=" + id
                    }).done(function(json) { 
                    //console.log(json);
                    var data = $.parseJSON(json);
                    console.log('data...', data);
                    
                    if (data && data.length > 0) {
                        //console.log('data0...', data[0]);

                        var loop = 0;
                        $.each(data, function(k, v) {
                            //console.log('loop...', loop);
                            //console.log('val...', v);

                            var tr = "";
                            loop++;
                            tr = tr + "<tr>";
                            tr = tr + "    <td>" +loop+ "</td>";
                            tr = tr + "    <td>" +v.type+ "</td>";
                            tr = tr + "    <td>" +v.jenama+ "</td>";
                            tr = tr + "    <td>" +v.model+"/"+v.produk+  "</td>";
                            tr = tr + "    <td>" +v.prod_year+ "</td>";
                            tr = tr + "    <td>";
                            tr = tr + "        <a href='show_prod.php?id=" +v.nfc+ "'>";
                            tr = tr + "            <i class='ti-info-alt' title='Papar Maklumat'></i>&nbsp;&nbsp;&nbsp;";
                            tr = tr + "        </a>";
                            tr = tr + "    </td>";
                            tr = tr + "</tr>";

                            console.log('tr...', tr);

                            $("#products tbody").append(tr);

                        });

                        $("#totalrow").html(loop).change();




                    }                
                });	
            }


        });

    </script>  
    -->  
