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

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

<?php



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



<?php



   // Definisci la variabile $conn come connessione al database

$connpart = mysqli_connect($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);



   // Esegui la query SQL per selezionare i dati

$optionp = "chatg";

$resultoption = mysqli_query($connpart, $optionp);

$row = mysqli_fetch_assoc($resultoption)

?>

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

	<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

	<!-- Font Awesome -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-RqEzHvnvS1k5K5wzgp5yoWY5U6TD5EoXyj9iikETmdcy1G6dbCVa+ZmzBm7VWzmj8Ov7VwtA9x9X7VWjG8SRFg==" crossorigin="anonymous" referrerpolicy="no-referrer" />

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

    <script>

document.getElementById('clonetrfalert').addEventListener('click', function(e) {

    e.preventDefault();

    if (confirm("Sei sicuro di voler andare al link clonetrf.php?")) {

        window.location.href = e.target.parentNode.href;

    }

});

</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">

                                

							

						  <!-- card for show requirements -->

							<div class="card">

                              <div class="card-body">

                                <h4 class="mt-0 header-title"><?php echo $drafttrftitle; ?></h4>

                                

                              <table id='opt' class="table mb-0 table-centered">

							  <thead>

                                        <tr>

                                            

											<th>From Email</th>

                                            <th>mailhost</th>

                                            <th>CS Email</th>

                                            <th>CS Email2</th>

                                            <th>CS Email3</th>

                                            <th>Under Manteinance</th>

                                        </tr>

                                        </thead>

    

    

                                     <tbody>

   <tr id="row-<?php echo $row['idoptionportal']; ?>">

      <td><?php echo $row['fromaddressmail'] ?></td>

      <td><?php echo $row['mailhost'] ?></td>

      <td><?php echo $row['csmail'] ?></td>

      <td><?php echo $row['csmail2'] ?></td>

      <td><?php echo $row['csmail3'] ?></td>

      <td><?php echo $row['undermanteinance'] ?></td>

   </tr>

   </tbody>

                                    </table>

     <script>

   $(document).ready(function() {

      $('#opt td').click(function() {

         var column_num = parseInt($(this).index()) + 1;

         var row_num = parseInt($(this).parent().index()) + 1;

         var row_id = $('#opt tr:nth-child(' + row_num + ')').attr('id');

         var column_name = $('#opt th:nth-child(' + column_num + ')').text();

         var column_value = $(this).text();

         

         $(this).html('<input type="text" id="editbox" value="' + column_value + '">');

         $('#editbox').focus();

         $('#editbox').keyup(function(event) {

            if (event.keyCode == 13) {

               var new_value = $('#editbox').val();

               $.ajax({

                  type: "POST",

                  url: "update_data.php",

                  data: {

                     row_id: row_id,

                     column_name: column_name,

                     new_value: new_value

                  },

                  success: function(data) {

                     $('#' + row_id).html(data);

                  }

               });

            }

         });

      });

   });

</script>                             

                             

<br>



								  

								  

								

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

							

							

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

                       

							

							

                       

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

							

							<!-- COMPLETE TRF -->

							

							<div class="card">

                                

							

						  <!-- card for show requirements -->

	

							

                       

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