<?php

if (isset($idtrf)) {

    //include('include/checkstepfile.php');

    include('include/chemicalsquerycheck.php');

}

?>

<div class="left-sidenav">

    <ul class="metismenu left-sidenav-menu">



        <?php if ((Auth::user()->hasRole('Admin')) || (Auth::user()->hasRole('User')) || (Auth::user()->hasRole('Superuser'))) : ?>

            <li>

                <a href="dashboard.php"><i class="ti-bar-chart"></i><span><?php echo $dashboard; ?></span></a>

            </li>

            <li>



                <?php if (isset($codelist)) { ?>

                    <a href=""><i class="ti-angle-double-down"></i><span><?php echo $trfinprogress; ?></span></a>

                    <ul class="nav-second-level mm-collapse mm-show" style="">

                        <!-- first line trf -->



                        <?php if (in_array(1, $stepscertif)) {  ?>

                            <?php if (in_array(1, $codelist)) {  ?>







                                <li>

                                    <a href="" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $certificationtitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $certificationtitle; ?> </a>

                                </li>

                        <?php }

                                } ?>

                        <!-- end first line trf -->

                        <!-- second line trf -->

                        <?php if (in_array(2, $stepscertif)) {  ?>

                            <?php if (in_array(2, $codelist)) {  ?>

                                <li>

                                    <a href="trfdetails.php?idtrf=<?php echo $idtrf; ?>" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $descriptionsteptitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $descriptionsteptitle; ?> </a>

                                </li>

                        <?php }

                                } ?>

                        <!-- end second line trf -->

                        <!-- third line trf -->

                        <?php if (in_array(3, $stepscertif)) {  ?>

                            <?php if (in_array(3, $codelist)) {  ?>

                                <li>

                                    <a href="standardstep.php?idtrf=<?php echo $idtrf; ?>" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $standardsteptitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $standardsteptitle; ?> </a>

                                </li>

                        <?php }

                                } ?>

                        <!-- end third line trf -->

                        <!-- fourth line trf -->

                        <?php if (in_array(4, $stepscertif)) {  ?>

                            <?php if (in_array(4, $codelist)) {  ?>

                                <li>

                                    <a href="additionalinfo.php?idtrf=<?php echo $idtrf; ?>" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $additionalinfosteptitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $additionalinfosteptitle; ?> </a>

                                </li>

                        <?php }

                                } ?>

                        <!-- end fourth line trf -->

                        <!-- first five trf -->

                        <?php if (in_array(5, $stepscertif)) {  ?>

                            <?php if (in_array(5, $codelist)) {  ?>

                                <li>

                                    <a href="addrequirements.php?idtrf=<?php echo $idtrf; ?>" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $addrequirementssteptitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $addrequirementssteptitle; ?> </a>

                                </li>

                        <?php }

                                } ?>

                        <!-- end five line trf -->

                        <!-- six line trf -->

                        <?php if (isset($chemicalstep) && ($chemicalstep == "Y")) {   ?>



                            <?php if (in_array(6, $codelist)) {  ?>

                                <li>

                                    <a href="chemicalagent.php?idtrf=<?php echo $idtrf; ?>" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $chemicalagentsteptitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $chemicalagentsteptitle; ?> </a>

                                </li>

                            <?php }

                                } else { ?>

                        <?php } ?>

                        <!-- end six line trf -->

                        <!-- seven line trf -->

                        <?php if (in_array(7, $stepscertif)) {  ?>

                            <?php if (in_array(7, $codelist)) {  ?>

                                <li>

                                    <a href="identificationparts.php?idtrf=<?php echo $idtrf; ?>" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $identificationpartssteptitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $identificationpartssteptitle; ?> </a>

                                </li>

                        <?php }

                                } ?>

                        <!-- end seven line trf -->

                        <!-- seveeightn line trf -->

                        <?php if (in_array(8, $stepscertif)) {  ?>

                            <?php if (in_array(8, $codelist)) {  ?>

                                <li>

                                    <a href="adddocument.php?idtrf=<?php echo $idtrf; ?>" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $uploaddocsteptitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $uploaddocsteptitle; ?> </a>

                                </li>

                        <?php }

                                } ?>

                        <!-- end eight line trf -->

                        <?php if (in_array(9, $stepscertif)) {  ?>

                            <?php if (in_array(9, $codelist)) {  ?>

                                <li>

                                    <a href="trfoption.php?idtrf=<?php echo $idtrf; ?>" style="color:green"><i class="fas fa-check-circle" style="color:green"></i><?php echo $addparameterstitle; ?> </a>

                                </li> <?php  } else { ?>

                                <li>

                                    <a style="color:darkorange"><i class="fas fa-times-circle" style="color:darkorange"></i><?php echo $addparameterstitle; ?> </a>

                                </li>

                        <?php }

                                } ?>



                    </ul><?php } ?>



            </li>

            <li>

                <a href="archivetrf.php"><i class="fas fa-history"></i><span><?php echo $historicaltrf; ?></span></a>



            </li>

            <li>

                <a href="archivetd.php"><i class="fas fa-history"></i><span><?php echo $archivetd; ?></span></a>



            </li>

            <li>

                <a href="https://www.cimac.it/contatti/" target="_blank"><i class="ti-help"></i><span><?php echo $helptitle; ?></span></a>



            </li>

            <li>

                <a href="https://www.cimac.it/contatti/" target="_blank"><i class="fas fa-users"></i><span><?php echo $contactus; ?></span></a>



            </li>

        <?php endif; ?>

        <?php if ((Auth::user()->hasRole('Admin')) || (Auth::user()->hasRole('Superuser'))) : ?>

            <li>

                <a href="javascript: void(0);"><i class="ti-lock"></i><span>Admin Area</span><span class="menu-arrow"><i class="mdi mdi-chevron-right"></i></span></a>

                <ul class="nav-second-level mm-collapse" aria-expanded="false">

                    <li class="nav-item"><a class="nav-link" href="admin-dashboard.php"><i class="fas fa-cogs"></i>Admin Panel</a></li>

                    <li class="nav-item"><a class="nav-link" href="repositoryupload.php"><i class="fas fa-archive"></i>Files Download</a></li>

                    <li class="nav-item"><a class="nav-link" href="cstrf.php"><i class="fas fa-archive"></i>CS TRF Board</a></li>

                    <li class="nav-item"><a class="nav-link" href="revcstrf.php"><i class="fas fa-archive"></i>REVCS</a></li>





                </ul>

            </li>

        <?php endif; ?>

        <?php if (Auth::user()->hasRole('CustomerService')) : ?>

            <li>



            <li class="nav-item"><a class="nav-link" href="cstrf.php"><i class="fas fa-archive"></i>CS TRF Board</a></li>

            <li class="nav-item"><a class="nav-link" href="revcstrf.php"><i class="fas fa-archive"></i>REVCS</a></li>





    </ul>

    </li>

<?php endif; ?>

<?php if (Auth::user()->hasRole('Certification')) : ?>

    <li>



    <li class="nav-item"><a class="nav-link" href="cstd.php"><i class="fas fa-archive"></i>Certification Board</a></li>





    </ul>

    </li>

<?php endif; ?>

<?php if (Auth::user()->hasRole('Admin')) : ?>

    <li>



    <li class="nav-item"><a class="nav-link" href="others/icons-fontawesome.html"><i class="ti-control-record"></i>Template</a></li>





    </ul>

    </li>

<?php endif; ?>











</ul>

</div>