<!DOCTYPE html>
<html lang="zxx">
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, shrink-to-fit=no"
    />
    <title>Staff Dashboard</title>
    <link rel="icon" href="/img/kp.png" type="image/png" />

    <link rel="stylesheet" href="/css/bootstrap1.min.css" />

    <link rel="stylesheet" href="/vendors/themefy_icon/themify-icons.css" />

    <link rel="stylesheet" href="/vendors/niceselect/css/nice-select.css" />

    <link rel="stylesheet" href="/vendors/owl_carousel/css/owl.carousel.css" />

    <link rel="stylesheet" href="/vendors/gijgo/gijgo.min.css" />

    <link rel="stylesheet" href="/vendors/font_awesome/css/all.min.css" />
    <link rel="stylesheet" href="/vendors/tagsinput/tagsinput.css" />

    <link rel="stylesheet" href="/vendors/datepicker/date-picker.css" />

    <link rel="stylesheet" href="/vendors/scroll/scrollable.css" />

    <link
      rel="stylesheet"
      href="/vendors/datatable/css/jquery.dataTables.min.css"
    />
    <link
      rel="stylesheet"
      href="/vendors/datatable/css/responsive.dataTables.min.css"
    />
    <link
      rel="stylesheet"
      href="/vendors/datatable/css/buttons.dataTables.min.css"
    />

    <!-- toastr -->
    <link href="/js/toastr.css" rel="stylesheet">
    <link rel="stylesheet" href="/vendors/text_editor/summernote-bs4.css" />

    <link rel="stylesheet" href="/vendors/morris/morris.css" />

    <link rel="stylesheet" href="/vendors/material_icon/material-icons.css" />
    <link rel="stylesheet" href="/vendors/staff_sidebar/style.css" />

    <link rel="stylesheet" href="/css/metisMenu.css" />

    <link rel="stylesheet" href="/css/style1.css" />
    <link rel="stylesheet" href="/css/colors/default.css" id="colorSkinCSS" />
  </head>
  <body class="crm_body_bg">
  
 

    <section class=" container-fluid ">
     

      <div class="main_content_iner"> <br>
        <%if(error){%>
          <div class="alert alert-danger" role="alert">
            Error occured: <%= error%>
          </div>
      <%}%>
        <div class="container-fluid p-0">
          <div class="row mt-5">
            <div>
              <label for="text">Approval Comment</label><br>
              <textarea name="comment" id="comment" cols="4" rows="3" class="form-control"></textarea>
            </div>
            <div class="mt-5">
              
              <button class="btn btn-success" onclick="updateTopicAction('accept','<%=doc.id %>')" > Approve </button>
              <button class="btn btn-danger" onclick="updateTopicAction('reject','<%=doc.id %>')"> Reject</button>
            </div>
      </div> 
        <iframe src="https://docs.google.com/document/d/<%= doc.slug%>/edit?api=1&key=AIzaSyD4pHemgDHxMtsSGH8gFPewHlMx2IqyZL0" width="100%" height="800"></iframe>
 
            
          </div>
            <footer class="footer footer-light  footer-static  footer1">
              <p class="clearfix mb-0">
                <span class="float-md-start d-block d-md-inline-block mt-25 text-center">COPYRIGHT &copy;
                  <script>document.write(new Date().getFullYear())</script><a class="ms-25" href="">CORASS</a>,
                  <span class="d-inline-block">All rights Reserved</span>
                </span>
                <span class="float-md-end d-block text-center">Centralized Online Research Assessment and Submission System<i data-feather="file-text"></i></span>
              </p>
            </footer>
    <script src="/js/jquery1-3.4.1.min.js"></script>

    <script src="/js/popper1.min.js"></script>

    <script src="/js/bootstrap1.min.js"></script>

    <script src="/js/metisMenu.js"></script>

    <script src="/vendors/count_up/jquery.waypoints.min.js"></script>

    <script src="/vendors/chartlist/Chart.min.js"></script>

    <script src="/vendors/count_up/jquery.counterup.min.js"></script>

    <script src="/vendors/niceselect/js/jquery.nice-select.min.js"></script>

    <script src="/vendors/owl_carousel/js/owl.carousel.min.js"></script>

    <script src="/vendors/datatable/js/jquery.dataTables.min.js"></script>
    <script src="/vendors/datatable/js/dataTables.responsive.min.js"></script>
    <script src="/vendors/datatable/js/dataTables.buttons.min.js"></script>
    <script src="/vendors/datatable/js/buttons.flash.min.js"></script>
    <script src="/vendors/datatable/js/jszip.min.js"></script>
    <script src="/vendors/datatable/js/pdfmake.min.js"></script>
    <script src="/vendors/datatable/js/vfs_fonts.js"></script>
    <script src="/vendors/datatable/js/buttons.html5.min.js"></script>
    <script src="/vendors/datatable/js/buttons.print.min.js"></script>
    <script src="/js/chart.min.js"></script>
<script src="/js/toastr.min.js"></script>
<!--Start of Tawk.to Script-->
<script type="text/javascript">
  var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
  (function(){
  var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
  s1.async=true;
  s1.src='https://embed.tawk.to/61c33018c82c976b71c2a947/1fnh77ocr';
  s1.charset='UTF-8';
  s1.setAttribute('crossorigin','*');
  s0.parentNode.insertBefore(s1,s0);
  })();
</script>
<!--End of Tawk.to Script-->
<!-- END: Page JS-->
    <script src="/vendors/progressbar/jquery.barfiller.js"></script>

    <script src="/vendors/tagsinput/tagsinput.js"></script>

    <script src="/vendors/text_editor/summernote-bs4.js"></script>
    <script src="/vendors/am_chart/amcharts.js"></script>

    <script src="/vendors/scroll/perfect-scrollbar.min.js"></script>
    <script src="/vendors/scroll/scrollable-custom.js"></script>
    <script src="/vendors/chart_am/core.js"></script>
    <script src="/vendors/chart_am/charts.js"></script>
    <script src="/vendors/chart_am/animated.js"></script>
    <script src="/vendors/chart_am/kelly.js"></script>
    <script src="/vendors/chart_am/chart-custom.js"></script>
    
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script src="/js/custom.js"></script>
    <script src="/js/corass.js"></script>
    <script>
      function updateTopicAction(actionType,docId){
        const message = $('#comment').val();
       if(!message){
        toastr.error(
          "Please provide comment to justify your action",
          "ERROR", {
            timeOut: 9000
          }
        );
        return
       }
       jQuery.ajax({
        url:`/document-topic`,
        method:'POST',
        data:{
          docId,
          actionType,
          message
        },
         success:function(data)
            {
              console.log(data)
              if(data.success == false){
                toastr.error(
                  data.message,
                  "ERROR", {
                    timeOut: 9000
                  }
                ); 
              return
              }
              toastr.success(
                  data.message,
                  "SUCCESS", {
                    timeOut: 11000
                  }
                );
              // location.href = "/admin/projects";        
            }
        });
      }
      
    </script>
  </body>
</html>
