Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- session_start();
- include '../config.php';
- if(!isset($_SESSION['year']))
- {
- $year = date("Y");
- } else {
- $year = $_SESSION['year'];
- }
- $id = $_SESSION['id'];
- if(!isset($_POST['checkall']))
- {
- $check = $_POST['checkbox'];
- }
- else
- {
- $check = $_POST['checkall'];
- $check = explode(" ",$check);
- }
- $code = $_POST['code'];
- for($i = 0;$i < sizeof($check);$i++)
- {
- //$query = mysql_query("update checklist set check_status = '1' where check_id = '$check[$i]'") or die(mysql_error());
- $query = mysql_query("insert into directorate_kpi (kpi_code) values ('$code[$i]')");
- }
- if($query){
- ?>
- <script language="JavaScript">
- alert("Successfully Approved KPI");
- document.location="./dirkpiapp.php?id=<?php echo $id; ?>";
- </script>
- <?php
- }
- /*$queryweight = mysql_query("select sum(kpi_weight) from corporate_kpi where kpi_status = 'Approved'");
- $fetchweight = mysql_fetch_array($queryweight);
- $weight = $fetchweight[0];
- $sum = 0;
- for($j = 0;$j < sizeof($_POST['weight']);$j++)
- {
- $totalsum = $weight + $_POST['weight'][$j];
- }
- if($totalsum > 100)
- {
- ?>
- <script>
- alert("Weight more than 100% cannot approve anymore, try review again");
- window.location.href="dirkpiapp.php";
- </script>
- <?php
- } else {
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement