<?php
    session_start();
    include "../../db.php";
    date_default_timezone_set('Asia/Kolkata');
    $currentTime = date('M j, Y g:i a');

    if ( !isset($_SESSION['uid']) && !isset($_SESSION['uref']) && !isset($_SESSION['utype']) )
        header("Location: logout.php");
?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Training Details</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">


    <link href="css/all.min.css" rel="stylesheet" type="text/css">
    <link href="css/sb-admin-2.min.css" rel="stylesheet">
    <link href="css/alltable.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <script src="vendor/ckeditor.js"></script>


</head>

<body>
<br /><br />

<table  cellpadding="0" cellspacing="0" width="90%" bgcolor="#aaddff" border="1" align="center">
<tr>
    <td>
            <table  cellpadding="0" cellspacing="0" width="100%" bgcolor="#FAFAD2" border="0" align="center">
                 <?php
                if ( isset($_GET["n"]) ) 
                {

                        $t_sql = "SELECT * FROM training WHERE t_sl='$_GET[n]'";
                        $t_data = mysqli_query($con,$t_sql);
                        while($t_rows = mysqli_fetch_array($t_data))
                        {
                            ?>
                                     <tr>
                                        <td colspan="2" style="background-color:#016797; color:#FFFFFF; font:bold 14px Verdana; text-align:left;padding: 6px 10px;">Training  DETAILS</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"  height="5" ></td>
                                    </tr>
                                    <tr>
                                        <td width="18%" align="left" class="Heading"><strong>Title:</strong></td>
                                        <td width="82%" class="introlink" style="color:#000000; font-size:22px; line-height:180%;"><?php echo $t_rows['t_name']; ?> </td>
                                    </tr>
                                                         
                                    <tr>
                                         <td colspan="2"  height="5" ></td>
                                    </tr>                                                                  
                                    
                                    <tr>
                                      <td align="left" class="Heading">&nbsp;</td>
                                      <td class="TabListData">&nbsp;</td>
                                    <tr>
                                         <td colspan="2"  height="5" ></td>
                                    </tr>  
                                    <tr>
                                        <td height="21" align="left"  class="Heading" > <strong>Details:</strong></td>
                                        <td height="21" align="left" class="introlink" style="color:#000000; font-size:14px; line-height:180%;">
                                            <p>&nbsp;
                                                <span style="font-size: 18px;">
                                                    <strong>

                                                        <?php echo $t_rows['m_file']; ?>

                                                        <br><br>
                                                        <?php 
                                                        if ( !empty($t_rows['t_file']))
                                                        {
                                                         ?>
                                                         <a href="../upload/training/<?php echo $t_rows['t_file']; ?>" target="_blank" style="text-decoration:none;">Please Click Here to view the Attached File ...</a>
                                                         <?php 
                                                         }
                                                          ?>
                                                        
                                                        
                                                    </strong>
                                                </span>
                                            </p>
                                        </td>
                                    </tr>
                                                                                                    
                                    <tr>
                                        <td colspan="2"  height="5" ></td>
                                    </tr>

                                    <tr>
                                      <td  align="right"></td>
                                      <td  align="left"> 

                                        <a href='training.php' class='m-2 btn btn-warning' title='Click to Back'> <i class="fas fa-backward"></i> BACK </a>
                                        <a href='training.php?edit_id=<?php echo $t_rows["t_sl"]; ?>' class='m-2 btn btn-success' title='Click to Edit'> <i class='fas fa-pencil-alt'></i> EDIT </a>
                                      </td>
                                      
                                    </tr>
                                    <tr>
                                        <td colspan="2"  height="5" ></td>
                                    </tr>                           

                  <?php         
                        }
                        
                }                                   
                
                            
             ?>
                
              </table>
                             
   </td>
</tr></table>
</body>
</html>