Mini Kabibi Habibi

Current Path : C:/xampp/htdocs/cid/system/
Upload File :
Current File : C:/xampp/htdocs/cid/system/add_daily_accomplishments.php

<?php
session_start();
@include 'include/config.php';

if (!isset($_SESSION['username_school'])) {
    header('Location: login.php');
    exit();
}

$username = $_SESSION['username_school'];

// Handle form submission
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit'])) {
    $name = mysqli_real_escape_string($conn, $_POST['fullname']); // `fullname` input, saved as `name` in DB
    $username = mysqli_real_escape_string($conn, $_POST['username']);
    $designation = mysqli_real_escape_string($conn, $_POST['designation']); 
    $no_of_shs_provided_ta = mysqli_real_escape_string($conn, $_POST['no_of_shs_provided_ta']);
    $no_of_teachers_observed = mysqli_real_escape_string($conn, $_POST['no_of_teachers_observed']);
    $no_of_teachers_provided_ta = mysqli_real_escape_string($conn, $_POST['no_of_teachers_provided_ta']);
    $date_added = mysqli_real_escape_string($conn, $_POST['date_added']);

    // Update table name and use `name` instead of `fullname`
    $sql = "INSERT INTO daily_accomplishments (name, username, designation, no_of_shs_provided_ta, no_of_teachers_observed, no_of_teachers_provided_ta, date_added) 
            VALUES ('$name', '$username', '$designation', '$no_of_shs_provided_ta', '$no_of_teachers_observed', '$no_of_teachers_provided_ta', '$date_added')";

    if (mysqli_query($conn, $sql)) {
        header("Location: daily_accomplishments.php");
        exit();
    } else {
        echo "<div class='alert alert-danger'>Error: " . mysqli_error($conn) . "</div>";
    }
}
?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>PROJECT COURSE</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="images/favicon.ico" type="image/ico" />

    <!-- CSS Dependencies -->
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">
    <link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
    <link href="../vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
    <link href="../vendors/jqvmap/dist/jqvmap.min.css" rel="stylesheet"/>
    <link href="../vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <link href="../build/css/custom.min.css" rel="stylesheet">

    <!-- Style Fix for Buttons -->
    <style>
        .action-buttons {
            min-width: 180px;
            white-space: nowrap;
        }
        .action-buttons .btn {
            margin-right: 5px;
        }
    </style>
</head>
  

<body class="nav-md">
<div class="container body">
    <div class="main_container">
        <!-- Sidebar -->
        <div class="col-md-3 left_col">
            <div class="left_col scroll-view">
                <div class="navbar nav_title" style="border: 0;">
                    <a href="add_daily_accomplishments.php" class="site_title"><i class="fa fa-spinner"></i> <span>PROJ. COURSE</span></a>
                </div>
                <div class="clearfix"></div>

                <!-- Profile Info -->
                <div class="profile clearfix">
                    <div class="profile_info">
                        <span>Welcome,</span>
                        <h2><?php echo htmlspecialchars($username); ?></h2>
                    </div>
                </div>
                <br />

                <!-- Sidebar Menu -->
                <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                    <div class="menu_section">
                        <h3>General</h3>
                        <ul class="nav side-menu">
                            <li><a><i class=" "></i> Home <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="user_index.php">Dashboard</a></li>
                                </ul>
                            </li>
                            <li><a><i class=" "></i> Daily Activities <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="form_user.php">Submit New Activity</a></li>
                                </ul>
                            </li>
                            <li><a><i class="glyphicon glyphicon"></i> Daily Accomplishments <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="add_daily_accomplishments.php">Submit Accomplishments</a></li>
                                    <li><a href="daily_accomplishments.php">View My Accomplishments</a></li>
                                </ul>
                            </li>
                            <li><a><i class="glyphicon glyphicon"></i> Monthly Accomplishment Reports <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="submit_monthly_report.php">Submit Monthly Accomplishment Report</a></li>
                                    <li><a href="monthly_reports.php">View Monthly Accomplishment Reports</a></li>
                                </ul>
                            </li>
                            <li><a><i class="glyphicon glyphicon"></i> MISTA Plans <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="create_mista_plan.php">Create MISTA Plan</a></li>
                                    <li><a href="view_mista_plans.php">View MISTA Plans</a></li>
                                    <li><a href="submit_mista_plan.php">Submit MISTA Plan</a></li>
                                    <li><a href="submitted_mista_plans.php">Submitted MISTA Plans</a></li>  
                                </ul>
                            </li>
                            <li><a><i class="glyphicon glyphicon"></i> MISTA Reports <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="create_mista_report.php">Create MISTA Report</a></li>
                                    <li><a href="view_mista_reports.php">View MISTA Reports</a></li>
                                    <li><a href="submit_mista_report.php">Submit MISTA Report</a></li>
                                    <li><a href="submitted_mista_reports.php">Submitted MISTA Reports</a></li>
                                </ul>
                            </li>
                            <li><a><i class="glyphicon glyphicon"></i> M/QCAIS Reports <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="create_mqcais_report.php">Create M/QCAIS Report</a></li>
                                    <li><a href="view_mqcais_reports.php">View M/QCAIS Reports</a></li>
                                    <li><a href="submit_mqcais_report.php">Submit M/QCAIS Report</a></li>
                                    <li><a href="submitted_mqcais_reports.php">Submitted M/QCAIS Reports</a></li>
                                </ul>
                            </li>
                            
                        </ul>
                    </div>
                </div>

            <!-- /sidebar menu -->

            <!-- /menu footer buttons -->
            <div class="sidebar-footer hidden-small">
              <a data-toggle="tooltip" data-placement="top" title="Settings">
                <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
              </a>
              <a data-toggle="tooltip" data-placement="top" title="FullScreen">
                <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
              </a>
              <a data-toggle="tooltip" data-placement="top" title="Lock">
                <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
              </a>
             <a data-toggle="tooltip" data-placement="top" title="Logout" href="logout.php">
                <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
              </a>
            </div>
            <!-- /menu footer buttons -->
          </div>
        </div>

        <!-- top navigation -->
        <div class="top_nav">
          <div class="nav_menu">
              <div class="nav toggle">
                <a id="menu_toggle"><i class="fa fa-bars"></i></a>
              </div>
              <nav class="nav navbar-nav">
              <ul class=" navbar-right">
                <li class="nav-item dropdown open" style="padding-left: 15px;">
                  <?php
                                    include('include/config.php');
                                     
                                  
                                   $sql = "SELECT * from users where  username ='{$_SESSION['username']}'  ";
                                  $data = mysqli_query($conn,$sql);
                                  while ($row= mysqli_fetch_array($data)) 
                                    {
                                      ?>
                  <a href="javascript:;" class="user-profile dropdown-toggle" aria-haspopup="true" id="navbarDropdown" data-toggle="dropdown" aria-expanded="false">
                   <?php echo $_SESSION['username'];} ?>
                  </a>
                  <div class="dropdown-menu dropdown-usermenu pull-right" aria-labelledby="navbarDropdown">
                   
                
                    <a class="dropdown-item"  href="../logout.php"><i class="fa fa-sign-out pull-right"></i> Log Out</a>
                  </div>
                </li>


              
               
            </nav>
          </div>
        </div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
             
            <div class="clearfix"><div class="x_panel">
                  <div class="x_title">
                    <?php
                                     include('include/config.php');
                                     
                                  
                                   $sql = "SELECT * from information where username ='{$_SESSION['username']}' ";
                                  $data = mysqli_query($conn,$sql);
                                  while ($rows= mysqli_fetch_array($data)) 
                                    {
                                      ?>
    
    
    <?php if (isset($_SESSION['success_add_daily'])): ?>
  <div class="alert alert-success"><?php echo $_SESSION['success_add_daily']; unset($_SESSION['success_add_daily']); ?></div>
<?php endif; ?>
    
     <h2>Submit New Accomplishments</h2>

                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  
                  <div class="x_content">
                  <div class="x_content">

                    <form class="form-horizontal form-label-left" action="add_daily_accomplishments.php" method="POST" novalidate>
                     
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Name <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="name" name="fullname" value="<?php echo $rows['username']; ?>" readonly class="form-control col-md-7 col-xs-12" data-validate-length-range="6" data-validate-words="2"  style="display: none;"   required="required" type="text">
                          <input id="name" name="fullname" value="<?php echo $rows['fullname']; ?>" readonly class="form-control col-md-7 col-xs-12" data-validate-length-range="6" data-validate-words="2"   required="required" type="text">
                          <input id="name" name="username" value="<?php echo $rows['username']; ?>" style="display: none;" readonly class="form-control col-md-7 col-xs-12" data-validate-length-range="6" data-validate-words="2"   required="required" type="text">
                        </div>
                        <div class="hidden">
                          <input id="tracking" style="display: none;" class="hidden" data-validate-length-range="6" data-validate-words="2" name="tracking_no" placeholder="both name(s) e.g Jon Doe" required="required" type="text">

                        </div>
                      </div>

                      <!-- Designation -->
                        <div class="item form-group">
                          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="designation">Designation</label>
                          <div class="col-md-6 col-sm-6 col-xs-12">
                            <input 
                              id="designation" 
                              name="designation" 
                              value="<?php echo htmlspecialchars($rows['designation'] ?? ''); ?>" 
                              readonly 
                              class="form-control col-md-7 col-xs-12" 
                              type="text"
                            >
                          </div>
                        </div>

                      <!-- Activities -->
                        <div class="item form-group">
                          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="no_of_shs_provided_ta">
                            No of SHs Provided TA <span class="required">*</span>
                          </label>
                          <div class="col-md-6 col-sm-6 col-xs-12">
                            <input 
                              type="text" 
                              id="no_of_shs_provided_ta" 
                              name="no_of_shs_provided_ta" 
                              value="<?php echo htmlspecialchars($rows['no_of_shs_provided_ta'] ?? ''); ?>" 
                              class="form-control col-md-7 col-xs-12" 
                              required
                            >
                          </div>
                        </div>

                        <div class="item form-group">
                          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="no_of_teachers_observed">
                            No of Teachers Observed <span class="required">*</span>
                          </label>
                          <div class="col-md-6 col-sm-6 col-xs-12">
                            <input 
                              type="text" 
                              id="no_of_teachers_observed" 
                              name="no_of_teachers_observed" 
                              value="<?php echo htmlspecialchars($rows['no_of_teachers_observed'] ?? ''); ?>" 
                              class="form-control col-md-7 col-xs-12" 
                              required
                            >
                          </div>
                        </div>

                        <div class="item form-group">
                          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="no_of_teachers_provided_ta">
                            No of Teachers Provided TA <span class="required">*</span>
                          </label>
                          <div class="col-md-6 col-sm-6 col-xs-12">
                            <input 
                              type="text" 
                              id="no_of_teachers_provided_ta" 
                              name="no_of_teachers_provided_ta" 
                              value="<?php echo htmlspecialchars($rows['no_of_teachers_provided_ta'] ?? ''); ?>" 
                              class="form-control col-md-7 col-xs-12" 
                              required
                            >
                          </div>
                        </div>

                        <!-- Date -->
                        <div class="item form-group">
                          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="date_added">
                            Date Added<span class="required">*</span>
                          </label>
                          <div class="col-md-6 col-sm-6 col-xs-12">
                            <input 
                              type="date" 
                              id="date_added" 
                              name="date_added" 
                              value="<?php echo htmlspecialchars($rows['date_added'] ?? ''); ?>" 
                              class="form-control col-md-7 col-xs-12" 
                              required
                            >
                          </div>
                        </div>

                    
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
  
                          <button type="submit" name="submit" class="btn btn-success" onclick="return confirmAdd();">Submit</button>

                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
            </div>

</div>
</body>
</html>
                        

    <?php  } ?>

            
                </div>
              </div>
            </div>
          </div> 
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <footer>
          <div class="pull-right">
             SDO BATANGAS CITY - CID PROJECT COURSE
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    <script>
          function randomNumber() {
   
    return Math.floor(Math.random() *900000);
}

document.getElementById('tracking').value =  'C' + randomNumber() + 'D' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }

    function randomNumber() {
   
    return Math.floor(Math.random() *900000);
}

document.getElementById('tracking2').value =  'C' + randomNumber() + 'D' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }

    document.getElementById('tracking3').value =  'E' + randomNumber() + 'F' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


      document.getElementById('tracking4').value =  'G' + randomNumber() + 'H' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


     document.getElementById('tracking5').value =  'I' + randomNumber() + 'J' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


       document.getElementById('tracking6').value =  'K' + randomNumber() + 'L' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }

     document.getElementById('tracking7').value =  'M' + randomNumber() + 'N' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }

         document.getElementById('tracking8').value =  'O' + randomNumber() + 'P' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


         document.getElementById('tracking9').value =  'Q' + randomNumber() + 'R' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


    document.getElementById('tracking10').value =  'S' + randomNumber() + 'T' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


     document.getElementById('tracking11').value =  'U' + randomNumber() + 'V' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }

    document.getElementById('tracking12').value =  'W' + randomNumber() + 'X' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


    document.getElementById('tracking13').value =  'Y' + randomNumber() + 'Z' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


     document.getElementById('tracking14').value =  'A' + randomNumber() + 'A' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }


      document.getElementById('tracking15').value =  'A' + randomNumber() + '2' ;

    function printDiv() {
        //Get the HTML of div
        var divElements = document.getElementById("print").innerHTML;
        //Get the HTML of whole page
        var oldPage = document.body.innerHTML;
        //Reset the page's HTML with div's HTML only
        document.body.innerHTML = "<table></table>" + divElements;
        //Print Page
        window.print();
        //Restore orignal HTML
        document.body.innerHTML = oldPage;

    }
    </script>
    <script src="../vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
   <script src="../vendors/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <!-- FastClick -->
    <script src="../vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="../vendors/nprogress/nprogress.js"></script>
    <!-- iCheck -->
    <script src="../vendors/iCheck/icheck.min.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="../build/js/custom.min.js"></script>
    <script>
  function confirmAdd() {
    return confirm('Are you sure you want to submit this accomplishment?');
  }
</script>

  </body>
</html>