<?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 article_type ON `trf-details`.idarticletype=article_type.idarticletype LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification WHERE `trf-details`.iduser='$iduserlogin'  AND `trf-details`.signedon IS NOT NULL or `trf-details`.signedon <>'' ORDER BY `trf-details`.trfnumber");

$archivetrflist->execute();?>

<?php

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

$drafttrf->setQuery("SELECT * FROM `trf-details` LEFT JOIN article_type ON `trf-details`.idarticletype=article_type.idarticletype LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification WHERE `trf-details`.iduser='$iduserlogin' AND `trf-details`.signedon IS NULL or `trf-details`.signedon ='' 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>

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

	





$(document).ready(function() {

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

        pageLength: 20,

        order: [[0, 'desc']],

        

		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>



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

	





$(document).ready(function() {

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

        pageLength: 20,

        order: [[0, 'desc']],

        

		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);">TRF</a></li>

                                        <li class="breadcrumb-item active">Starter</li>

                                    </ol>

                                </div>

                                <h4 class="page-title"><?php echo $titlewb; ?></h4>

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

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

                    </div>

					<div class="row">

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

							

							

							

							<!-- DRAFT TRF -->

							

                          <div class="card">

                                

	<?php

	$idtrfnewnumb=$_GET["idtrfnew"];

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

$drafttrf->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrfnewnumb'");

$drafttrf->execute();

$idtrf=$idtrfnewnumb;

?>						

						  <!-- card for show requirements -->

							<div class="card">

                              <div class="card-body">

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

                                

                        Stai revisionando il TRF N.  <?php echo $drafttrf->getColumnVal("trfnumber"); ?>.  Il numero di revisione è: <?php echo $_GET["nextrevnumber"]; ?>         

                             

<br>



<br><br>

 <?php if ($drafttrf->getColumnVal("idcertification")==5) { ?>

      

      <a href="typeofcertificate5.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a>

            

            <?php } elseif ($drafttrf->getColumnVal("idcertification")==6) { ?>

      

      <a href="typeofcertificate6.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a>

            

            

  <?php } else { ?>

                <a href="trfdetails.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a>

            <?php } ?>



                

								  

								  

								

                              </div><!--end card-body-->

							

							

                      </div><!--end card-->

                       

							

							

                       

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

							

							<!-- COMPLETE TRF -->

							

						

                                

							

						 

						

                      

							

                      </div><!--end card-->

                       

							

							

                       

                  </div>

              </div>

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

                    



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

<!-- footer start -->

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

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

    </div>

            <!-- end page content -->

        </div>

        <!-- 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>