Yeas thats it traq.
ok to answer the questions,
What I want to accomplish is for a user to put in selected dates from calendar to query the database and whatever fields or information that is between those two dates are what needs to be showed on the client's side. So if a new client is added to the database and is within the dates selected, then that is what should show up.
I have tried to get forms etc but as I said,I dont know how to put it all together.
I would like someone to help me and say,eg,you need a form which does this,in the form this links to this part of the query db script,as said in original post,I am still very much a beginner. This is exciting for me but I'm getting stuck. All I have been able to do from a php page I put together was show all the field relating to eachother. Now i would like some assistance in being able to do as mentioned above.
The code I have at the moment is as follows
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript"
src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['corechart','table','piechart']}]}">
</script>
<script type="text/javascript">
google.setOnLoadCallback(pieChart);
function pieChart() {
var startdate = "";
var enddate = "";
if ($("#datepicker").hasClass('hasDatepicker')) {
startdate = $("#datepicker").datepicker('getDate');
}
if ($("#datepicker2").hasClass('hasDatepicker')) {
enddate = $("#datepicker2").datepicker('getDate');
}
var pieJsonData = $.ajax({
url: "overall_ban_pos_pie_date.php?startdate=" + startdate + "&enddate=" + enddate,
dataType:"json",
async: false
}).responseText;
var pieData = new google.visualization.DataTable(pieJsonData);
var pieChartWrapper = new google.visualization.ChartWrapper({
'chartType': 'PieChart',
'containerId': 'pie_div',
'dataTable':pieData,
'options': {
chartArea:{left:10,top:40,height:200,width:360},
width:300,
height:260,
title: "Neutral Percentage",
titleTextStyle:{fontSize:12},
tooltip:{showColorCode:true},
legend:{textStyle:{fontSize: 10},position:'left'},
pieSliceTextStyle:{fontSize: 10}
}
});
pieChartWrapper.draw();
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$("#datepicker").datepicker({dateFormat: "yy-mm-dd"});
});
$(document).ready(function() {
$("#datepicker2").datepicker({dateFormat: "yy-mm-dd"});
});
$("#pieChart").click(function(e) {
e.preventDefault();
pieChart();
});
</script>
</head>
<body style="font-size:62.5%;">
<form action="overall_ban_pos_pie_date.php" method="post">
Start Date: <input type="text" name="startdate" id="datepicker"/>
End Date: <input type="text" name="enddate" id="datepicker2"/>
<input type="submit" id="pieChart"/>
</form>
<div id="pie_div"></div>
</body>
<?php
$con = mysql_connect("localhost:33307","USER","PASS");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("leonetcrm", $con);
$result = mysql_query("SELECT vtiger_account.accountid, vtiger_crmentity.crmid, vtiger_account.account_no, vtiger_crmentity.createdtime
FROM leonetcrm.vtiger_account
INNER JOIN leonetcrm.vtiger_crmentity
ON vtiger_account.accountid=vtiger_crmentity.crmid");
echo "<table border='5'>
<tr>
<th>Account ID</th>
<th>Account Number</th>
<th>CRMID</th>
<th>Createdtime</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['accountid'] . "</td>";
echo "<td>" . $row['account_no'] . "</td>";
echo "<td>" . $row['crmid'] . "</td>";
echo "<td>" . $row['createdtime'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</html>
I copied this from the web,I need to take the piechart out,just want normal table format. Once I can get that sorted I think it will work.
Thanks for taking the time to assist.
Cheers
Harry
Bookmarks