<?php require_once('../Connections/cmctrfdb.php'); ?>

<?php require_once('../webassist/mysqli/rsobj.php'); ?>

<?php



include('include/headscript.php'); ?>

<?php /*

$archivetrflist = new WA_MySQLi_RS("archivetrflist",$cmctrfdb,0);

$archivetrflist->setQuery("SELECT * FROM `trf-details` LEFT JOIN auth_users ON `trf-details`.iduser=auth_users.id LEFT JOIN company ON `trf-details`.idcompany=company.idcompany LEFT JOIN article_type ON `trf-details`.idarticletype=article_type.idarticletype LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification WHERE `trf-details`.signedon !='' GROUP BY `trf-details`.trfnumber ORDER BY `trf-details`.revtrf, `trf-details`.trfnumber DESC");

$archivetrflist->execute(); */

?>

<?php

$archivetrflist = new WA_MySQLi_RS("archivetrflist", $cmctrfdb, 0);

$archivetrflist->setQuery("SELECT * FROM auth_users

ORDER BY auth_users.last_name DESC;");

$archivetrflist->execute();

?>

<?php

$drafttrf = new WA_MySQLi_RS("drafttrf", $cmctrfdb, 20);

$drafttrf->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.iduser='$iduserlogin' AND `trf-details`.signedon IS NULL ORDER BY `trf-details`.trfnumber");

$drafttrf->execute();

?>

<!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="utf-8" />

    <title>TRF CIMAC </title>

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <meta content="CIMAC TRF Portal" name="description" />

    <meta content="" name="author" />

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />



    <!-- App favicon -->

    <link rel="shortcut icon" href="../images/favicon.ico">



    <!-- DataTables -->



    <link rel="shortcut icon" type="image/png" href="/media/images/favicon.png">

    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.datatables.net/rss.xml">

    <link rel="stylesheet" type="text/css" href="/media/css/site-examples.css?_=8f7cff5ee7757412879aedf3efbfaee01">

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.3.2/css/buttons.dataTables.min.css">

    <style type="text/css" class="init">



    </style>

    <script type="text/javascript" src="/media/js/site.js?_=1d5abd169416a09a2b389885211721dd" data-domain="datatables.net" data-api="https://plausible.sprymedia.co.uk/api/event"></script>

    <script src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>

    <script type="text/javascript" src="/media/js/dynamic.php?comments-page=extensions%2Fbuttons%2Fexamples%2Finitialisation%2Fexport.html" async></script>

    <script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>

    <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>

    <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/dataTables.buttons.min.js"></script>

    <script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>

    <script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>

    <script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>

    <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.html5.min.js"></script>

    <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.print.min.js"></script>





    <!--Form Wizard-->

    <link href="../plugins/jquery-steps/jquery.steps.css" rel="stylesheet" type="text/css">



    <!-- App css -->

    <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

    <link href="assets/css/jquery-ui.min.css" rel="stylesheet">

    <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />

    <link href="assets/css/metisMenu.min.css" rel="stylesheet" type="text/css" />

    <link href="assets/css/app.min.css" rel="stylesheet" type="text/css" />





    <!-- submit form with button -->

    <script>

        function formSubmit() {

            document.forms["myForm"].submit();

        }

    </script>

    <script type="text/javascript" class="init">

        $(document).ready(function() {

            var table = $('#example').DataTable({

                pageLength: 200,

                order: [

                    [1, 'asc']

                ],



                dom: 'Bfrtip',

                buttons: [

                    'copy', 'csv', 'excel', 'pdf'

                ]





            });



            $('a.toggle-vis').on('click', function(e) {

                e.preventDefault();



                // Get the column API object

                var column = table.column($(this).attr('data-column'));



                // Toggle the visibility

                column.visible(!column.visible());

            });



        });

    </script>





</head>



<body>



    <!-- Top Bar Start -->







    <!-- Top Bar Start -->

    <?php include('include/topbar.php'); ?>

    <!-- Top Bar End -->





    <!-- Left Sidenav -->

    <?php include('include/leftsidenav.php'); ?>

    <!-- end left-sidenav-->



    <div class="page-wrapper">

        <!-- Page Content-->

        <div class="page-content">



            <div class="container-fluid">

                <!-- Page-Title -->

                <div class="row">

                    <div class="col-sm-12">

                        <div class="page-title-box">

                            <div class="float-right">

                                <ol class="breadcrumb">

                                    <li class="breadcrumb-item"><a href="javascript:void(0);">Application Form</a></li>

                                    <li class="breadcrumb-item"><a href="javascript:void(0);">CIMAC</a></li>

                                    <li class="breadcrumb-item active">CS TRF</li>

                                </ol>

                            </div>

                            <h4 class="page-title">CS TRF DASHBOARD</h4>

                        </div><!--end page-title-box-->

                    </div><!--end col-->

                </div>

                <!-- end page title end breadcrumb -->

                <!-- end row -->







                <div class="row">

                    <div class="col-12">

                        <div class="card">

                            <div class="card-body">



                                <h4 class="mt-0 header-title">USERS</h4>



                                <table id="example" class="display table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">

                                    <thead>

                                        <tr>

                                            <th>Nome</th>

                                            <th>Cognome</th>

                                            <th>Email</th>

                                            <th>Token</th>

                                        </tr>

                                    </thead>





                                    <tbody>

                                        <?php

                                        $wa_startindex = 0;

                                        while (!$archivetrflist->atEnd()) {

                                            $wa_startindex = $archivetrflist->Index;

                                        ?>

                                            <tr>

                                                <td><?php echo ($archivetrflist->getColumnVal("first_name")); ?></td>

                                                <td><?php echo ($archivetrflist->getColumnVal("last_name")); ?></td>

                                                <td><?php echo ($archivetrflist->getColumnVal("email")); ?></td>

                                                <td><?php echo ($archivetrflist->getColumnVal("signaturecode")); ?></td>



                                            </tr>

                                        <?php

                                            $archivetrflist->moveNext();

                                        }

                                        $archivetrflist->moveFirst(); //return RS to first record

                                        unset($wa_startindex);

                                        unset($wa_repeatcount);

                                        ?>

                                    </tbody>

                                </table>

                            </div>

                        </div>

                    </div> <!-- end col -->

                </div> <!-- end row -->







            </div><!-- container -->



            <footer class="footer text-center text-sm-left">

                &copy; 2020 Crovex <span class="text-muted d-none d-sm-inline-block float-right">Crafted with <i class="mdi mdi-heart text-danger"></i> by Mannatthemes</span>

            </footer><!--end footer-->

        </div>

        <!-- end page content -->

    </div>









    <!-- Page Content-->



    <!-- end page-wrapper -->









    <!-- jQuery  -->



    <script src="assets/js/bootstrap.bundle.min.js"></script>

    <script src="assets/js/metismenu.min.js"></script>

    <script src="assets/js/waves.js"></script>

    <script src="assets/js/feather.min.js"></script>

    <script src="assets/js/jquery.slimscroll.min.js"></script>

    <script src="assets/js/jquery-ui.min.js"></script>









    <script src="../plugins/jquery-steps/jquery.steps.min.js"></script>

    <script src="assets/pages/jquery.form-wizard.init.js"></script>



    <!-- App js -->

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



</body>



</html>