Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Cleaned up entire code by removing vertical whitespaces (carriage returns) and applied proper indentation.
  • Loading branch information
shashank-ssriva authored Feb 8, 2017
1 parent c9af59a commit bc3900c
Show file tree
Hide file tree
Showing 15 changed files with 806 additions and 1,411 deletions.
178 changes: 73 additions & 105 deletions ajaxDelete_record.php
Original file line number Diff line number Diff line change
@@ -1,107 +1,75 @@
<? session_start(); ?><html>
<head>
<title> Bill Claim - Recors Status </title>

</head>
<body bgcolor="LightGray">
<form name="myForm" method="post">

<?php
$dbhandle = mysqli_connect("localhost", "root", "123456","cabBills")
or die("Unable to connect to MySQL");
if(isset($_SESSION['id'])){
// $brdtm = $_POST['brdtm'];
//$amt = $_POST['amt'];
$date = $_POST['date'];
//$sql="delete from temp_collectdata where brdtm='".$brdtm."' and amt=".$amt." and date='".$date."'";
$sql="delete from temp_collectdata where date='".$date."'";
$result= mysqli_query($dbhandle,$sql);

$sql1 = "SELECT * from temp_collectdata ";

$result1 = mysqli_query( $dbhandle, $sql1);



?>
<br>

<center> <div style ='font:16px Tahoma;color:Red'><b>Details regarding Date -<font color="blue">"<? echo $date ?>"</font> is permanently removed from the list. </b></div>
<br>

<center>

<table cellspacing="2" cellpadding="2" border="1">

<tr>

<th align="right" bgcolor="PeachPuff"><center>Date</center></th>

<th bgcolor="PeachPuff">Board Time</th>
<th bgcolor="PeachPuff"><center>Amount</center></th>
<th align="right" bgcolor="PeachPuff"><center>Rate</center></th>
<th align="right" bgcolor="PeachPuff"> <center> </center></th>
<th align="right" bgcolor="PeachPuff"> <center> </center></th>

</tr>

<?
$i=1;
while ($row = mysqli_fetch_array($result1,MYSQLI_NUM))
{
$date = "date".$i;
$brdtm="brdtm".$i;
$amt = "amt".$i;
$rate = "rate".$i;
$update = "update".$i;
$del = "del".$i;


<? session_start(); ?>
<html>
<head>
<title> Bill Claim - Recors Status </title>
</head>
<body bgcolor="LightGray">
<form name="myForm" method="post">
<?php
$dbhandle = mysqli_connect("localhost", "root", "mysql","cabBills")
or die("Unable to connect to MySQL");
if(isset($_SESSION['id'])){
// $brdtm = $_POST['brdtm'];
//$amt = $_POST['amt'];
$date = $_POST['date'];
//$sql="delete from temp_collectdata where brdtm='".$brdtm."' and amt=".$amt." and date='".$date."'";
$sql="delete from temp_collectdata where date='".$date."'";
$result= mysqli_query($dbhandle,$sql);
$sql1 = "SELECT * from temp_collectdata ";
$result1 = mysqli_query( $dbhandle, $sql1);
?>
<br>
<center> <div style ='font:16px Tahoma;color:Red'><b>Details regarding Date -<font color="blue">"<? echo $date ?>"</font> is permanently removed from the list. </b></div>
<br>
<center>
<table cellspacing="2" cellpadding="2" border="1">
<tr>
<th align="right" bgcolor="PeachPuff"><center>Date</center></th>
<th bgcolor="PeachPuff">Board Time</th>
<th bgcolor="PeachPuff"><center>Amount</center></th>
<th align="right" bgcolor="PeachPuff"><center>Rate</center></th>
<th align="right" bgcolor="PeachPuff"> <center> </center></th>
<th align="right" bgcolor="PeachPuff"> <center> </center></th>
</tr>
<?
$i=1;
while ($row = mysqli_fetch_array($result1,MYSQLI_NUM))
{
$date = "date".$i;
$brdtm="brdtm".$i;
$amt = "amt".$i;
$rate = "rate".$i;
$update = "update".$i;
$del = "del".$i;
?>
<tr>
<td> <center><input type="text" style="border: 0;" value="<? echo $row{0} ?>" id="<? echo $date ?>" size="10" readonly></center></th>
<td><center><input type="text" style="border: 0;" value="<? echo $row{1} ?>" id="<? echo $brdtm ?>" size="10" readonly></center></th>
<td><center><input type="text" style="border: 0;" value="<? echo $row{2} ?>" id="<? echo $amt ?>" size="4" ></center></th>
<td><center><input type="text" style="border: 0;" value="<? echo $row{3} ?>" id="<? echo $rate ?>" size="3" readonly></center></th>
<td><center><input type="button" id='<? echo $update ?>' style="background-color: PaleGreen;" onMouseOver="this.style.backgroundColor='Red'" onMouseOut="this.style.backgroundColor='PaleGreen'" value="UPDATE" onClick="update()"></center></td>
<?
if($i%2!=0){
?>
<td rowspan="2"><center><input type="button" id='<? echo $del ?>' style="background-color: PaleGreen;" onMouseOver="this.style.backgroundColor='Red'" onMouseOut="this.style.backgroundColor='PaleGreen'" value="DELETE" onClick="remove()"></center></td>
<?
}
?>

<tr>
<td> <center><input type="text" style="border: 0;" value="<? echo $row{0} ?>" id="<? echo $date ?>" size="10" readonly></center></th>

<td><center><input type="text" style="border: 0;" value="<? echo $row{1} ?>" id="<? echo $brdtm ?>" size="10" readonly></center></th>
<td><center><input type="text" style="border: 0;" value="<? echo $row{2} ?>" id="<? echo $amt ?>" size="4" ></center></th>
<td><center><input type="text" style="border: 0;" value="<? echo $row{3} ?>" id="<? echo $rate ?>" size="3" readonly></center></th>
<td><center><input type="button" id='<? echo $update ?>' style="background-color: PaleGreen;" onMouseOver="this.style.backgroundColor='Red'" onMouseOut="this.style.backgroundColor='PaleGreen'" value="UPDATE" onClick="update()"></center></td>
<?
if($i%2!=0){
?>
<td rowspan="2"><center><input type="button" id='<? echo $del ?>' style="background-color: PaleGreen;" onMouseOver="this.style.backgroundColor='Red'" onMouseOut="this.style.backgroundColor='PaleGreen'" value="DELETE" onClick="remove()"></center></td>

<?
}
?>
</tr>


<?

$i=$i+1;
</tr>
<?
$i=$i+1;
}
?>


</table>


</center>
<?
}
else{
?>
<H1><center><font color="red">Permission Denied !!!</font></center></h1>
<?
}

?>
</form>
</body>

</html>




?>
</table>
</center>
<?
}
else{
?>
<H1><center><font color="red">Permission Denied !!!</font></center></h1>
<?
}
?>
</form>
</body>
</html>
25 changes: 0 additions & 25 deletions ajaxShow_date.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,20 @@
<title>Bill Claims Management Application</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css">
<script language="javascript">

</script>
</head>
<body>
<form class="pure-form pure-form-stacked" name="myForm" method="post">

<?php
$dbhandle = mysqli_connect("localhost", "root", "mysql","cabBills")
or die("Unable to connect to MySQL");
$id = $_POST['id'];
$s1="select distinct id from employee";
$r1= mysqli_query($dbhandle,$s1);

$sql="select distinct pmtdt from employee where id='".$id."'";
$result1= mysqli_query($dbhandle,$sql);
$num=mysqli_num_rows($result1);

?>


<table class="pure-table pure-table-bordered">
<thead>
<tr>
Expand All @@ -31,57 +25,38 @@
<select name="id" onchange="sdate()">
<option selected value="<? echo $id ?>"> <? echo $id ?> </option>
<?

while ($row11 = mysqli_fetch_array($r1,MYSQLI_NUM))
{
?>

<option value="<? echo $row11{0} ?>"> <? echo $row11{0} ?> </option>
<?

}

?>
</select>
</td>


</tr>
</thead>

<tbody>

<tr>
<th>Bill Submission Date:</th>

<td>
<select name="dateval">
<option selected value="none">Choose Date</option>
<?

while ($row = mysqli_fetch_array($result1,MYSQLI_NUM))
{
?>

<option value="<? echo $row{0} ?>"> <? echo $row{0} ?> </option>
<?

}

?>
</select></td>
</tr>
</tbody>




</table>
<br>
<input type="button" class="pure-button pure-button-primary" value="See History" onClick="myresult()">
<input type="button" class="pure-button pure-button-primary" value="Back" onClick="home()"/>

</form>
</body>

</html>
30 changes: 2 additions & 28 deletions ajaxUpdate_record.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<? session_start(); ?><html>
<? session_start(); ?>
<html>
<head>
<title> Bill Claim - Recors Status </title>

</head>
<body bgcolor="LightGray">
<form name="myForm" method="post">

<?php
$dbhandle = mysqli_connect("localhost", "root", "mysql","cabBills")
or die("Unable to connect to MySQL");
Expand All @@ -16,29 +15,17 @@
$date = $_POST['date'];
//$sql="update temp_collectdata set brdtm='".$brdtm."' and round(amount,2)=".$amt." where date='".$date."'";
$sql="update temp_collectdata set amount=".$amt." where brdtm='".$brdtm."' and date='".$date."'";

mysqli_query($dbhandle,$sql);

$sql1 = "SELECT * from temp_collectdata ";

$result1 = mysqli_query( $dbhandle, $sql1);



?>
<br>

<center> <div style ='font:18px Tahoma;color:Red'><b>Entry for Date -<font color="blue">"<? echo $date ?>"</font> and Board Time -<font color="blue">"<? echo $brdtm ?>"</font> has been updated.</b></div>
<br>

<center>

<table class="pure-table pure-table-bordered">


<thead>
<tr>

<th> Date</th>
<th> Board Time</th>
<th> Amount </th>
Expand All @@ -57,10 +44,7 @@
$rate = "rate".$i;
$update = "update".$i;
$del = "del".$i;


?>

<tr>
<td><center><input type="text" value="<? echo $row{0} ?>" id="<? echo $date ?>" readonly ></center></td>
<td><center><input type="text" value="<? echo $row{1} ?>" id="<? echo $brdtm ?>" readonly></center></td>
Expand All @@ -71,23 +55,15 @@
if($i%2!=0){
?>
<td rowspan="2"><center><input type="button" class="pure-button pure-button-primary" id='<? echo $del ?>' value="DELETE" onClick="remove()"></center></td>

<?
}
?>
</tr>


<?

$i=$i+1;
}
?>


</table>


</center>
<?
}
Expand All @@ -96,9 +72,7 @@
<H1><center><font color="red">Permission Denied !!!</font></center></h1>
<?
}

?>
</form>
</body>

</html>
Loading

0 comments on commit bc3900c

Please sign in to comment.