Jump to content

[SOLVED] Can someone show me where I am wrong here?


elentz

Recommended Posts

First Thanks for even looking.  Here's my code

<!--
.head1 {background: #CC9933; height:32px; color: #FFFFFF; font-size: 10pt; font-weight: 500=medium; text-align: center}
.sub1 {background: #C8B588; height:22px; color: #FFFFFF; font-size: 9pt; font-weight: 500=medium; text-align: center}
.data1 {background: #ffffCC}
.data2 {background: #ffffCC}

/* End of style section. Generated by AceHTML at 16/08/03 10:14:34 */
-->

</head>
</style>
<script language="javascript" type="text/javascript" src="datetimepicker.js">

</script>

<BODY>
<H4>Paid Invoice Report </h4>
<H4>Enter the Start and End dates for the report.</h4>
<H4>Press the Submit Button to get the report.</h4>
<h4></h4>
<form action="/customstuff/reports/paidinvoicereport.php" method=POST>
Report Start Date:<input id="date1" type="text" size="25"><a href="javascript:NewCal('date1','mmddyyyy')"><img src="/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
Report End Date:<input id="date2" type="text" size="25"><a href="javascript:NewCal('date2','mmddyyyy')"><img src="/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a
<input type="submit" />
</form>
</BODY>
</html>

 

This html (i hope) will collect a starting date and an ending date using a JS I found, and it does put it into the text boxes.  When I hit the submit button the dates are not passed to the next page below:

 

 

$start=$_POST['date1'];
$end=$_POST['date2'];
echo $start;
echo $end;
//******Query to get the Invoice information*************
$sql =  "SELECT
vtiger_invoice.invoice_no,
vtiger_invoice.invoicedate,
vtiger_account.accountname,
vtiger_invoicecf.cf_614,
vtiger_invoicecf.cf_618,
vtiger_invoice.total,
vtiger_invoicecf.cf_532,
vtiger_invoicecf.invoiceid,
vtiger_invoicecf.cf_674
FROM
vtiger_invoice
Inner Join vtiger_account ON vtiger_invoice.accountid = vtiger_account.accountid
Inner Join vtiger_invoicecf ON vtiger_invoice.invoiceid = vtiger_invoicecf.invoiceid
WHERE
vtiger_invoice.invoicestatus =  'Paid' AND
Month(vtiger_invoicecf.cf_674) between '$start' and '$end'
ORDER BY
vtiger_invoicecf.cf_674 ASC";

 

If I were to manually insert dates into the Query the second page shows me what I want to see.  What is not happening is the passing of the date1 and date2 data.  The echo I have never shows anything.  Where have I gone wrong here?

 

Thanks

 

Ed

Thanks alot to both it is working almost perfectly.  With a little exception.  Using th date picker I am using I get an unexpected result in my query.  lets say I use the date picker to pick 06-15-2008 (june 15, 2008)  and the second date is 08-01-2008 (Aug 1, 2008)  I get all the records for the month of june , july and what there is of Aug.  The records come up from June 1 to 15 as well.  How come?  Anyone know?

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.