Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Cleaner code with latest UI
  • Loading branch information
shashank-ssriva authored Feb 6, 2017
1 parent b01cc3f commit 4b29691
Show file tree
Hide file tree
Showing 10 changed files with 2,018 additions and 2,030 deletions.
171 changes: 85 additions & 86 deletions ajaxShow_date.php
Original file line number Diff line number Diff line change
@@ -1,88 +1,87 @@
<html>
<head>
<title> Send Mail </title>
<script language="javascript">

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

<?php
$dbhandle = mysqli_connect("localhost", "root", "123456","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 cellspacing="2" cellpadding="2">


<tr>
<th align="left">
<font color="DarkSlateGray" face="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Employee ID : </font></th>
<head>
<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>
<th>Employee ID:</th>
<td>
<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="id" style="background-color: PowderBlue;font-weight: bold;border: 0;" size="1" 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>



<tr>
<th align="left"><font color="DarkSlateGray" face="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bill Submission Date :</th>


<td>
<select name="dateval" style="background-color: PowderBlue;font-weight: bold;border: 0;" size="1" >
<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>





</table>
<br>
<center><input type="button" name="next" class="hvr-buzz" value=" See History " style="background-color: PaleGreen;font-weight: bold;font-size: 13pt;" onMouseOver="this.style.backgroundColor='Red'" onMouseOut="this.style.backgroundColor='PaleGreen'" onClick="myresult()"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value=" Back " style="background-color: PaleGreen;font-weight: bold;font-size: 13pt;" onMouseOver="this.style.backgroundColor='Red'" onMouseOut="this.style.backgroundColor='PaleGreen'" onClick="home()"/> </center>

</form>
</body>

</html>

<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>
205 changes: 100 additions & 105 deletions ajaxUpdate_record.php
Original file line number Diff line number Diff line change
@@ -1,109 +1,104 @@
<? 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'];
//$amt=(int)$amt;
$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:16px Tahoma;color:Red'><b>Details regarding Date -<font color="blue">"<? echo $date ?>"</font> and Board Time -<font color="blue">"<? echo $brdtm ?>"</font> has been updated now. </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>
<? 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'];
//$amt=(int)$amt;
$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>
<th> Rate</th>
<th> </th>
<th> </th>
</tr>
</thead>
<?
$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" 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>
<td><center><input type="text" value="<? echo $row{2} ?>" id="<? echo $amt ?>" ></center></td>
<td><center><input type="text" value="<? echo $row{3} ?>" id="<? echo $rate ?>" readonly></center></td>
<td><center><input type="button" class="pure-button pure-button-primary" id='<? echo $update ?>' value="UPDATE" onClick="update()"></center></td>
<?
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>
<?
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;
}
?>


</table>


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

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

?>
</form>
</body>

</html>




</html>
Loading

0 comments on commit 4b29691

Please sign in to comment.