Example #1
0
                if (isset($_GET['bypass']) && $_GET['bypass'] == '1') {
                    $states = "(state  = 'AHR' or state like 'UA%')";
                    $link = "?bypass";
                } else {
                    $states = "state  = 'AHR'";
                    $link = "";
                }
                if (isset($_GET['sched'])) {
                    $states = 'state = "UAAdmin"';
                    $state = 'UA';
                    $apadmin = ', accadmin = "1"';
                } else {
                    $apadmin = "";
                }
                if ($state == 'DAAdmin') {
                    $dareason = $_GET['dareason'];
                } else {
                    $dareason = "";
                }
                savelogs("Approve Leave", $xxxsss['nameofemployee'] . ' Date From: ' . $xxxsss['dateofleavfr'] . ' To: ' . $xxxsss['dateofleavto'] . ' Payment: ' . $xxxsss['leapay']);
                $date = date('Y-m-d h:i A');
                $sql = "UPDATE nleave set state = '{$state}',dareason = '{$dareason}', datehr = '{$date}' {$apadmin} where leave_id = {$id} and (state = 'UAAdmin' or state = 'UALate' or state = 'AHR')";
                if ($conn->query($sql) == TRUE) {
                    echo '<script type="text/javascript">window.location.replace("admin.php' . $link . '"); </script>';
                } else {
                    die("Connection error:" . $conn->connect_error);
                }
            }
        }
    }
}
Example #2
0
                $end = '22';
                $mo += 1;
            } else {
                $day = '23';
                $end = '07';
                $mo += 0;
            }
        }
        if ($_SESSION['level'] == 'Admin') {
            echo '<script type="text/javascript">window.location.replace("admin.php"); </script>';
        } else {
            echo '<script type="text/javascript">window.location.replace("accounting.php?ac=penloan"); </script>';
        }
        $xxxss = "SELECT * FROM login where account_id = '{$accid}'";
        $xxxsss = $conn->query($xxxss)->fetch_assoc();
        savelogs("Approve Loan", $xxxsss['fname'] . ' ' . $xxxsss['lname'] . ' - Approve Loan: ' . $appamount . ' - Requested Loan: ' . $oldamnt . ' - Start Date: ' . $cutoffdate);
    } else {
        echo "Error updating record: " . $conn->error;
    }
}
if (isset($_GET['cashadv'])) {
    $o = mysql_escape_string($_GET['cashadv']);
    $rcve_code = random_string(4);
    $accid = $_SESSION['acc_id'];
    $sql = "UPDATE cashadv set \n\t   \t\tstate = 'ARcvCash', rcve_code = '{$rcve_code}'\n\t    where cashadv_id = '{$o}' and account_id = '{$accid}' and state = 'ACash'";
    if ($conn->query($sql) === TRUE) {
        echo '<script type="text/javascript">window.location.replace("employee.php?ac=penca"); </script>';
    } else {
        echo "Error updating record: " . $conn->error;
    }
}
Example #3
0
         <th>AttendanceType</th>
         <th>Hours</th>
         <th>JobCode</th>
         <th>SubCategory</th>
         <th>Rate</th>
         <th>EmployeeName</th>
     </tr>
     <?php 
 include 'conf.php';
 $sql1 = "SELECT * FROM nleave,login where nleave.account_id = login.account_id and (state = 'AAdmin' or state = 'CheckedHR' or state = 'CLea' or state = 'ReqCLea' or state = 'ReqCLeaHR') and (dateofleavfr BETWEEN '{$date1}' and '{$date2}' or dateofleavto BETWEEN '{$date1}' and '{$date2}') and leapay = 'wthpay' ORDER BY datefile ASC";
 $sql2 = "SELECT * FROM overtime,login where overtime.account_id = login.account_id and (state = 'AAdmin' or state = 'CheckedHR') and dateofot BETWEEN '{$date1}' and '{$date2}' ORDER BY datefile ASC";
 $result1 = $conn->query($sql1);
 $result2 = $conn->query($sql2);
 $type = "1";
 if ($result1->num_rows > 0 || $result2->num_rows > 0) {
     savelogs("Export Leave and Overtime", "For the Cutoff " . date("M j, Y", strtotime($date1)) . ' to ' . date("M j, Y", strtotime($date2)));
     while ($row1 = $result2->fetch_assoc()) {
         echo '<tr>';
         echo '<td>' . $row1['phoenix_empid'] . '</td>';
         echo '<td>' . $row1['dateofot'] . '</td>';
         if (stristr($row1['officialworksched'], 'Restday') == true) {
             $type = '17';
         } elseif (stristr($row1['officialworksched'], 'Special N-W Holliday') == true) {
             $type = '16';
         } elseif (stristr($row1['officialworksched'], 'Legal Holliday') == true) {
             $type = '15';
         }
         echo '<td>' . $type . '</td>';
         if (stristr($row1['approvedothrs'], ':30') == true) {
             $row1['approvedothrs'] = str_replace(':30', '.5', $row1['approvedothrs']);
         } elseif (stristr($row1['approvedothrs'], ':00') == true) {
Example #4
0
            unset($_POST['regsubmit']);
            $conn->close();
        }
    }
}
?>

<?php 
if (isset($_POST['hreg'])) {
    include 'conf.php';
    session_start();
    $uname = mysqli_real_escape_string($conn, $_POST['reguname']);
    $pw = mysqli_real_escape_string($conn, $_POST['regpword']);
    $cpw = mysqli_real_escape_string($conn, $_POST['regcppword']);
    $level = mysqli_real_escape_string($conn, $_POST['level']);
    $sql = "SELECT * FROM `login` where `uname` = '{$uname}'";
    $result = $conn->query($sql);
    if ($result->num_rows > 0) {
        echo '<script type="text/javascript">window.location.replace("hr.php"); </script>';
        $_SESSION['err'] = 'ex';
        $conn->close();
    } else {
        $stmt = $conn->prepare("INSERT into `login` (uname, pword, level) VALUES (?, ?, ?)");
        $stmt->bind_param("sss", $uname, $pw, $level);
        $stmt->execute();
        savelogs("Create New User", "Username: "******" Level: " . $level);
        echo '<script type = "text/javascript">alert("Registration succesful")</script>';
        echo '<script type="text/javascript">window.location.replace("hr.php?ac=penot"); </script>';
        $conn->close();
    }
}
Example #5
0
        echo '</div>';
        if (isset($_GET['print'])) {
            echo '<div class = "pull-right" style = "text-align: center; font-size: 11px; margin-right: 50px;">_________________________________<br> Checked/Verified By</div>';
        }
        echo '</div><div align="center">';
        $actual_link = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
        echo '<a href = "' . $actual_link . '&print" class = "btn btn-primary"> Print </a> ';
        if (!isset($_GET['complete'])) {
            echo '<a class = "btn btn-danger" href = "?liqdate">Back</a>';
        } else {
            echo '<a href = "?complete=1&petty_id=' . $_GET['liqdate'] . '" class = "btn btn-danger">Back</a>';
        }
        echo '</div>';
        if (isset($_GET['print'])) {
            echo '<script type = "text/javascript">	$(window).load(function() {window.print();window.location.href = "?liqdate=' . $_GET['liqdate'] . '&acc=' . $_GET['acc'] . '&complete";});</script>';
            savelogs("Print Liquidation", "Petty #: " . $petyid);
        }
    }
}
if (!isset($_GET['pettyac']) && !isset($_GET['report']) && !isset($_GET['release']) && !isset($_GET['liqdate']) && !isset($_GET['complete']) && !isset($_GET['validate'])) {
    ?>
<h2 align = "center"><i> Pending Petty Request </i></h2>
	<form role = "form">
		<table id="myTable" style = "width: 100%;"class = "table table-hover " align = "center">
			<thead>
				<tr>
					<th ><i>Date File</i></th>					
					<th ><i>Name of Employee</i></th>
					<th ><i>Type</i></th>
					<th ><i>Amount</i></th>
					<th ><i>Transfer ID</i></th>
Example #6
0
echo '<th>Petty ID</th>';
echo '<th>Date</th>';
echo '<th>Name</th>';
echo '<th>Petty Amount</th>';
echo '<th>Total Used Petty</th>';
echo '<th>Change</th>';
echo '<th id = "backs" >Status</th>';
echo '<th id = "show" style = "display: none;">Code</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$tchange = 0;
$tamount = 0;
$tused = 0;
if ($result->num_rows > 0) {
    savelogs("Print Return All Changes", date("M j, Y"));
    while ($row = $result->fetch_assoc()) {
        $petid = $row['petty_id'];
        $accid = $row['account_id'];
        $query = "SELECT * FROM `petty_liqdate` where petty_id = '{$petid}'";
        $data = $conn->query($query)->fetch_assoc();
        $query1 = "SELECT * FROM `login` where account_id = '{$accid}'";
        $data1 = $conn->query($query1)->fetch_assoc();
        if ($data1['position'] == 'House Helper') {
            continue;
        }
        $query2 = "SELECT sum(liqamount) as totalliq FROM `petty_liqdate` where petty_id = '{$petid}'";
        $data2 = $conn->query($query2)->fetch_assoc();
        if ($data2['totalliq'] != "") {
            $tots = '<td>₱ ' . number_format($data2['totalliq'], 2) . '</td>';
            $a = str_replace(',', '', $row['amount']);
Example #7
0
    $obtimeout = mysql_escape_string($_POST['obtimeout']);
    $accid = mysql_escape_string($_POST['accid']);
    $obid = $_SESSION['otid'];
    $date = date('Y-m-d h:i A');
    $upstate = 'AHR';
    if ($_SESSION['level'] == 'ACC') {
        $acc = ', dateacc = 1';
    } else {
        $acc = "";
    }
    $edithr = mysql_escape_string($_POST['oldobtimein']) . ' - ' . mysql_escape_string($_POST['oldobtimeout']);
    $xxxss = "SELECT * FROM login where account_id = '{$accid}'";
    $xxxsss = $conn->query($xxxss)->fetch_assoc();
    $stmt = "UPDATE `officialbusiness` set \n\t\t\t\tobtimein = '{$obtimein}', obtimeout = '{$obtimeout}', state = 'CheckedHR', edithr = '{$edithr}', datehr = '{$date}' {$acc}\n\t\t\twhere account_id = '{$accid}' and state = 'UA' and officialbusiness_id = '{$obid}'";
    if ($conn->query($stmt) === TRUE) {
        savelogs("Update Official Business", $xxxsss['fname'] . ' ' . $xxxsss['lname'] . " In: " . $obtimein . " Out: " . $obtimeout);
        if ($_SESSION['level'] == 'ACC') {
            echo '<script type="text/javascript">window.location.replace("accounting.php?ac=penob"); </script>';
        } else {
            echo '<script type="text/javascript">window.location.replace("hr.php?ac=penob"); </script>';
        }
    } else {
        echo "Error updating record: " . $conn->error;
    }
    $conn->close();
}
if (isset($_POST['hruphol'])) {
    $obtimein = mysql_escape_string($_POST['hruptimein']);
    $obtimeout = mysql_escape_string($_POST['hruptimeout']);
    $accid = mysql_escape_string($_POST['accid']);
    $obid = mysqli_real_escape_string($conn, $_POST['hol']);
Example #8
0
            if ($_SESSION['level'] == 'ACC') {
                echo '<script type="text/javascript">window.location.replace("accounting-petty.php?validate=1&petty_id=' . $pet_id . '"); </script>';
            }
        }
    }
}
?>

<?php 
if (isset($_GET['excesscode']) && $_SESSION['level'] == 'Admin') {
    $pet_id = mysql_escape_string($_GET['excesscode']);
    $query = "SELECT * FROM `petty_liqdate` where petty_id = '{$pet_id}'";
    $result = $conn->query($query);
    if ($result->num_rows > 0) {
        $sql = "UPDATE petty_liqdate set \n\t\t   \t\taccval = 'AdminRcv'\n\t\t    where petty_id = '{$pet_id}' and accval IS NULL and liqstate = 'CompleteLiqdate'";
        savelogs("Receive Change", "Petty #: " . $pet_id);
        if ($conn->query($sql) === TRUE) {
            if ($_SESSION['level'] == 'Admin') {
                echo '<script type="text/javascript">window.location.replace("admin-petty.php?liqdate=' . $_GET['excesscode'] . '&acc=' . $_GET['acc'] . '"); </script>';
            } else {
                if ($_SESSION['level'] == 'ACC') {
                    //	echo '<script type="text/javascript">window.location.replace("accounting-petty.php"); </script>';
                }
            }
        } else {
            echo "Error updating record: " . $conn->error;
        }
    } else {
        $_SESSION['err'] = 'Incorrect Code';
        if ($_SESSION['level'] == 'Admin') {
            echo '<script type="text/javascript">window.location.replace("admin.php?release=1&petty_id=' . $pet_id . '"); </script>';
Example #9
0
                    $hrchange = date("Y-m-d");
                    $catdates = ", regdate = '{$catdate}'";
                }
                $stmts2 = "SELECT count(account_id) as count FROM `login` where account_id = '{$modify}' and hrchange != '0'";
                $data = $conn->query($stmts2)->fetch_assoc();
                if (date("Y-m-d") < "2015-12-29") {
                    $stmt = "UPDATE `login` \n        set empcatergory = '{$empcatergory}', sickleave = '{$sickleave}', vacleave = '{$vacleave}', hrchange = '{$hrchange}', oldpost = '{$oldpost}',\n            usedvl = '{$usedvl}', usedsl = '{$usedsl}' {$catdates}\n        where account_id = '{$modify}' and hrchange = 0";
                } else {
                    $stmt = "UPDATE `login` \n        set empcatergory = '{$empcatergory}', hrchange = '{$hrchange}', oldpost = '{$oldpost}', payment = '{$payment}' {$catdates}\n        where account_id = '{$modify}' and hrchange = 0";
                }
                if ($data['count'] == 0) {
                    if ($conn->query($stmt) == TRUE) {
                        echo '<script type = "text/javascript">alert("Successful"); window.location.replace("hr-emprof.php");</script>';
                        $stmts2xx = "SELECT * FROM `login` where account_id = '{$modify}'";
                        $dataxx = $conn->query($stmts2xx)->fetch_assoc();
                        savelogs("Update Category", $dataxx['fname'] . ' ' . $dataxx['lname'] . " Category: " . $empcatergory . " Old Position: " . $oldpost . " Payment: " . $payment . ' Date' . $catdate);
                    }
                } else {
                    echo '<script type = "text/javascript">alert("You still have pending changes."); window.location.replace("hr-emprof.php");</script>';
                }
            }
        }
    }
} else {
    include "conf.php";
    $sql = "SELECT * from `login` where account_id = '{$_GET['view']}' and level != 'Admin'";
    $result = $conn->query($sql);
    if ($result->num_rows > 0) {
        while ($row = $result->fetch_assoc()) {
            ?>
<div class="modal fade" id="myModal2" role="dialog">
Example #10
0
            echo $row['amount'];
        } else {
            echo number_format($row['amount']);
        }
        echo '"/></td></tr>';
        echo '<input name = "appart" value = "' . $row['particular'] . '" type="hidden"/>';
        echo '<tr><td colspan = 2><button class = "btn btn-primary" name = "submitrans">Submit</button><br><br><a href = "accounting-petty.php" class = "btn btn-danger" name = "backpety">Back</a></td></tr>';
    }
} else {
    echo '<script type="text/javascript">window.location.replace("accounting-petty.php"); </script>';
}
echo "</table></form>";
if (isset($_POST['submitrans'])) {
    $acctrans = date("Y-m-d g:i A");
    function random_string($length)
    {
        $key = '';
        $keys = array_merge(range(0, 9), range('a', 'z'));
        for ($i = 0; $i < $length; $i++) {
            $key .= $keys[array_rand($keys)];
        }
        return $key;
    }
    $code = random_string(4);
    $petid = mysql_escape_string($_POST['petty_id']);
    $sql = "UPDATE `petty` set acctrans = '{$acctrans}', state = 'TransProc', rcve_code = '{$code}' where petty_id = '{$petid}' and state = 'UATransfer'";
    if ($conn->query($sql) == TRUE) {
        savelogs("Approve Petty Transfer", "Petty #: " . $petid);
        echo '<script type="text/javascript">window.location.replace("accounting-petty.php"); </script>';
    }
}
Example #11
0
        echo $state;
        echo '</td>';
        echo '<td>' . $tchange . '</td>';
        echo '</tr>';
        $used += $data2['totalliq'];
        $total += $a;
        $change += $a - $data2['totalliq'];
    }
}
if (isset($_GET['print'])) {
    echo '<tr id = "bords"><td></td><td></td><td></td><td><b> Total: </td><td>₱ ' . number_format($total, 2) . '</td><td>₱ ' . number_format($used, 2) . '</td><td>₱ ' . number_format($change - $xchange, 2) . '</td></tr>';
    echo '<tr id = "bords"><td></td><td></td><td></td><td></td><td></td><td><b>Balance: </td><td>₱ ' . number_format($_SESSION['repleamount'] - $total, 2) . '</td><td></td></tr>';
    echo '<tr id = "bords"><td></td><td></td><td></td><td></td><td></td><td><b>Cash On Hand: </td><td>₱ ' . number_format($_SESSION['repleamount'] - $total + ($change - $xchange), 2) . '</td><td></td></tr>';
    echo '<tr><td colspan = 10 style = "border-top: 0px;"><br><br><br><br><br> -- Nothing Follows -- </td></tr>';
    if (isset($_GET['nopending'])) {
        $statusss = " Completed ";
    } elseif (isset($_GET['spendliqui'])) {
        $statusss = " All Pending Petty Cash ";
    } elseif (isset($_GET['bdochck'])) {
        $statusss = " Completed BDO Check ";
    } elseif (isset($_GET['planterschck'])) {
        $statusss = " Planters Check ";
    } elseif (isset($_GET['pendingchck'])) {
        $statusss = " All Pending Check ";
    } else {
        $statusss = " All ";
    }
    savelogs("Print Replenish Report", "Total Fund: ₱ " . number_format($_SESSION['repleamount']) . " - Status: " . $statusss . " - Date Covered: " . date("M j, Y", strtotime($date1)) . ' - ' . date("M j, Y", strtotime($date2)));
}
echo "</tbody></table></div>";
echo '<div align = "center"><br><a id = "backs" style = "margin-right: 10px;"class = "btn btn-primary" href = "?replenish&print&' . $xlink . '"><span id = "backs"class="glyphicon glyphicon-print"></span> Print Report</a><a id = "backs" class = "btn btn-danger" href = "accounting-petty.php"><span id = "backs"class="glyphicon glyphicon-chevron-left"></span> Back to List</a></div>';