hello guys ... i have a problem regarding on this error
1. Undefined index: d1 in C:\xampp\htdocs\final year project 2\collection.php on line 104
2. Undefined index: d1 in C:\xampp\htdocs\final year project 2\collection.php on line 120
3.Notice: Undefined index: d1 in C:\xampp\htdocs\final year project 2\collection.php on line 163
4.Notice: Undefined index: d2 in C:\xampp\htdocs\final year project 2\collection.php on line 164
my full line of code is this....
<?php
?>
<html>
<head>
<title>
final year project
</title>
<link href="style.css" media="screen" rel="stylesheet" type="text/css" />
<link href="menu.css" media="screen" rel="stylesheet" type="text/css" />
<!--sa poip up-->
<script src="argiepolicarpio.js" type="text/javascript" charset="utf-8"></script>
<script src="js/application.js" type="text/javascript" charset="utf-8"></script>
<link href="src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="lib/jquery.js" type="text/javascript"></script>
<script src="src/facebox.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="tcal.css" />
<script type="text/javascript" src="tcal.js"></script>
<script language="javascript">
function Clickheretoprint()
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=700, height=400, left=100, top=25";
var content_vlue = document.getElementById("content").innerHTML;
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('</head><body onLoad="self.print()" style="width: 700px; font-size:11px; font-family:arial; font-weight:normal;">');
docprint.document.write(content_vlue);
docprint.document.close();
docprint.focus();
}
</script>
</head>
<body background="bg.jpg">
<p><h2 align="center"><font face="Elephant" size=6 color="yellow">STRAWBERRY ACCOUNTING WEBSITE</font></h2></p>
<script type="text/javascript">
tday =new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
tmonth=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
function GetClock(){
d = new Date();
nday = d.getDay();
nmonth = d.getMonth();
ndate = d.getDate();
nyear = d.getYear();
nhour = d.getHours();
nmin = d.getMinutes();
nsec = d.getSeconds();
if(nyear<1000) nyear=nyear+1900;
if(nhour == 0) {ap = " AM";nhour = 12;}
else if(nhour <= 11) {ap = " AM";}
else if(nhour == 12) {ap = " PM";}
else if(nhour >= 13) {ap = " PM";nhour -= 12;}
if(nmin <= 9) {nmin = "0" +nmin;}
if(nsec <= 9) {nsec = "0" +nsec;}
document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+"";
setTimeout("GetClock()", 1000);
}
window.onload=GetClock;
</script>
<div id="clockbox"></div>
<center>
<div class="menu-bar">
<ul id="menu-bar">
<li class="active"><a href="home.php">Home</a></li>
<li><a href="sales.php">ReportAnalysis</a>
<ul>
<li><a rel="facebox" href="select_customer.php">Customer Ledger</a></li>
<li><a href="supplier.php">Suppliers</a></li>
<li><a href="products.php">Products</a></li>
<li><a href="#">Products Sub Menu 4</a></li>
</ul>
</li>
<li><a href="accountreceivables.php">AccountPayable</a>
<ul>
<li><a href="customer.php">Customer</a></li>
<li><a href="purchaseslist.php">list</a></li>
<li><a href="collection.php">collection</a></li>
<li><a href="#"></a></li>
</ul>
</li>
<li><a href="#">About</a></li>
<li><a href="logout.php">Logout</a>
</li>
</ul>
</div>
</center>
<div id="maintable"><div style="margin-top: -19px; margin-bottom: 21px;">
<br><a id="addd" href="home.php" style="float: none;">Back</a></br>
</div>
<form action="collection.php" method="get">
From : <input type="text" name="d1" class="tcal" value="" /> To: <input type="text" name="d2" class="tcal" value="" /> <input type="submit" value="Search"><a id="addd" href="javascript:Clickheretoprint()">Print</a>
</form>
<div class="content" id="content">
<div style="font-weight:bold; text-align:center;font-size:14px;margin-bottom: 15px;">
Collection Report from <?php echo $_GET['d1'] ?> to <?php echo $_GET['d2'] ?>
</div>
<table id="resultTable" data-responsive="table" style="text-align: left;">
<thead>
<tr>
<th width="17%"> Transaction ID </th>
<th width="8%"> Date </th>
<th width="25%"> Customer Name </th>
<th width="25%"> Invoice Number </th>
<th width="15%"> Amount </th>
<th width="10%"> Remarks </th>
</tr>
</thead>
<tbody>
<?php
$d1=$_GET['d1'];
$d2=$_GET['d2'];
$result = $db->prepare("SELECT * FROM collection WHERE date BETWEEN :a AND :b");
$result->bindParam(':a', $d1);
$result->bindParam(':b', $d2);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td>CTI-000<?php echo $row['transaction_id']; ?></td>
<td><?php echo $row['date']; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['invoice']; ?></td>
<td><?php
$dsdsd=$row['amount'];
echo formatMoney($dsdsd, true);
?></td>
<td><?php echo $row['remarks']; ?></td>
</tr>
<?php
}
?>
</tbody>
<thead>
<tr>
<th colspan="4" style="border-top:1px solid #999999"> Total </th>
<th colspan="2" style="border-top:1px solid #999999">
<?php
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {
$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}
return $number;
}
$d1=$_GET['d1'];
$d2=$_GET['d2'];
$results = $db->prepare("SELECT sum(amount) FROM collection WHERE date BETWEEN :a AND :b");
$results->bindParam(':a', $d1);
$results->bindParam(':b', $d2);
$results->execute();
for($i=0; $rows = $results->fetch(); $i++){
$ddd=$rows['sum(amount)'];
echo formatMoney($ddd, true);
}
?>
</th>
</tr>
</thead>
</table>
</div>
<div class="clearfix"></div>
</div>
</body>
</html>
hope u guys can solve it from me ...thanks :)