Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 13.58.61.176
Current Path : /var/www/html/oums/ |
| Current File : /var/www/html/oums/account_heads.php |
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="jscript/mainpage.js" type="text/javascript"></script>
<script src="jquery/jquery-3.1.0/jquery.min.js" type="text/javascript"></script>
<SCRIPT TYPE="text/javascript">
$(document).ready(function() {
$("#del").click(function() {
if ($('input[type=checkbox]:checked').length < 1) {
alert("Select records to delete!");
return false;
}
});
});
</SCRIPT>
</head>
<body>
<?php
include("header.php");
include("sys_module.php");
get_page_info(basename($_SERVER['PHP_SELF']));
@$page_mode = "";
$acnt_type = "%";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
@$acnt_type = $_POST["txtacnttype"];
}
?>
<form name="<?php echo @$link_name; ?>" id="<?php echo @$link_name; ?>" action="<?php echo @$link_path; ?>" method="post">
<div id="page-middle">
<div class="page-container-head">
<div id="page-container-titl"><?php echo @$page_mode . " " . @$link_tit; ?></div>
<div id="page-container-link"><?php echo @$link_but; ?></div>
</div>
<div id="page-container-body">
<div class="grid_outer">
<table class="table_content" style="width:100%;" border="1">
<tr>
<td align="left">
<select id="txtacnttype" name="txtacnttype" style="width:100%; border:0px;" onChange="this.form.submit()">
<option value="%" <?php if (strtoupper(@$acnt_type) == '%') {
echo 'selected="selected"';
} ?>>ALL TYPES</option>
<option value="PAYMENT" <?php if (strtoupper(@$acnt_type) == 'PAYMENT') {
echo 'selected="selected"';
} ?>>PAYMENT ONLY</option>
<option value="RECEIPT" <?php if (strtoupper(@$acnt_type) == 'RECEIPT') {
echo 'selected="selected"';
} ?>>RECEIPT ONLY</option>
</select>
</td>
</tr>
</table>
<hr>
<?php
include("mysql_db_connect.php");
$mysql = "select * from mashead where facnttype like '$acnt_type' order by facnttype,fheadtype,fheaddesc";
$myres = mysqli_query($mycon, $mysql);
echo "<table class=table_grid border=1>";
echo "<tr>";
echo "<th> # </th>";
echo "<th> Account Type </th>";
echo "<th> Head Type </th>";
echo "<th> Head Description </th>";
echo "<th width=5%> <input type=checkbox id=CheckAll name=CheckAll onClick='check_all(document.$link_name)'/></th>";
echo "</tr>";
$i = 0;
while ($row = @mysqli_fetch_assoc($myres)) {
?>
<tr ondblClick="window.location='account_heads_save.php?id=<?php echo $row["fheadcode"]; ?>'">
<td width="4%" align="center"> <?php echo $i + 1; ?> </td>
<td width="10%" align="center"><?php echo $row["facnttype"]; ?></td>
<td width="30%" align="left"><?php echo $row["fheadtype"]; ?></td>
<td width="40%" align="left"><?php echo $row["fheaddesc"]; ?></td>
<td width="1%" align="center"><input type="checkbox" name="check_list[]" id="check_list[]" value="<?php echo $row["fheadcode"]; ?>"></td>
</tr>
<?php
$i++;
}
echo "</table>";
?>
</div>
</div>
</div>
</form>
</body>
</html>
<?php
if (isset($_POST['del'])) { //check to see if the delete button has been pressed
if (isset($_POST['check_list'])) { //check to see if any boxes have been checked
$num = 0; //used to count the number of rows that were deleted
$box = $_POST['check_list'];
while (list($key, $val) = @each($box)) { //loop through all the checkboxes
$num++;
include("mysql_db_connect.php");
$mysqldel = "delete from mashead where fheadcode='$val'"; //delete any that match id
$resdel = mysqli_query($mycon, $mysqldel); //send the query to mysql
}
if ($num > 0) {
//print the logs that were deleted
echo "<meta http-equiv=\"refresh\" content=\"0;URL=account_heads.php\">";
echo ("<script language=\"JavaScript\" type=\"text/JavaScript\">\n");
echo ("alert(\"$num\"+' records deleted!');\n");
echo ("</script>\n");
}
} else { //no boxes checked
echo ("<script language=\"JavaScript\" type=\"text/JavaScript\">\n");
echo ("alert('No record selected!');\n");
echo ("</script>\n");
}
}
?>
|