I have solved this issue using ajax request - response. Thanks
Ambislm 0 Newbie Poster
I made a simple application that have a combobox which is loaded with database value and a textfield which should display text related to combo box selection. Name Number number1 1234 number2 2345 number2 5678 number3 2212
So combo box will have values number1, number2, number3. when user selects number1, i have to load textfield value with 1234 and if number2 is selected 2345,5678.
Below is my code which retrieves from database ... but problem is the value is loaded only when i press enter key instead of clicking submit button...
<head>
<title>Sample Numbers</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body >
<?php
$dbname = 'sample_db';
$db_user = 'xxx';
$db_pass = 'xxx';
$host = 'localhost';
$conn = mysql_connect($host, $db_user, $db_pass);
mysql_select_db($dbname);
$query = "select distinct Name from numbers";
$result = mysql_query($query, $conn) or die(mysql_error());
?>
<center>
<form name=callsubm>
<table>
<?php
if ($result) {
?>
<tr>
<td>Group Name:</td>
<td><select name="Name" id="Name" onchange="onComboChange();">
<?php
while ($row = mysql_fetch_assoc($result)) {
echo '<option value="' . $row['Name'] . '">' . $row['Name'] . '</option>';
}
}
?>
</select>
<?php
if (isset($_GET['Name'])) {
$array = array();
$query = "select Number from numbers where Name='" . $_GET['Name'] . "'";
$result = mysql_query($query, $conn) or die(mysql_error());
$i = 0;
if ($result) {
while ($row = mysql_fetch_assoc($result)) {
$array[] = $row['Number'];
$i++;
}
}
$total_numbers = implode(',', $array);
}
?>
<script type="text/javascript">
function showValues() {
var a=new Array();
<?php
for ($i = 0; $i < count($array); $i++) {
echo "a[$i]='" . $array[$i] . "';\n";
}
?>
alert(a.join());
document.getElementById("inTxt").value=a.join();
} …
Ambislm 0 Newbie Poster
This is my sample application which provides result as follows:
Array Values :
arr[0][0] :6
arr[0][1] :0
arr[0][2] :0
arr[1][0] :0
arr[1][1] :0
arr[1][2] :0
am using the jQuery Highcharts:
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'column'
},
title: {
text: document.chart.chartTitle.value
},
series: [{
name: 'USA',
data: [50, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
name: 'New York',
data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3]
}, {
name: 'London',
data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2]
}, {
name: 'Berlin',
data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1]
}]
});
I have to pass values in series such as:
name:'vehicle reporting'
data: [6,0,0 ]
name:'bill_count'
data: [0,0,0 ]
from that array[][] values. how can i convert those result into json format and pass it to jquery chart value?
can anyone provide me with any example.
Thanks in advance.
Ambislm 0 Newbie Poster
I have 3 combobox in my index.jsp file. I have filled first 2 combobox with data's from database... Now i have to fill 3rd combobox with the values which i have in java file such as:
private static String[] types = {
"Vehicle Reporting",
"Vehicle Revisits",
"RO - JDP Count"
};
private static String[] fields = {
"ro_count",
"ro_revisit_count",
"ro_jdp_count"
};
How i can assign this values to combobox:
<select name="hcountry" size="4">
<option value="usa" selected>United States</option>
</select>
Ambislm 0 Newbie Poster
I have 3 combobox in my index.jsp file. I have filled first 2 combobox with data's from database... Now i have to fill 3rd combobox with the values which i have in java file such as:
private static String[] types = {
"Vehicle Reporting",
"Vehicle Revisits",
"RO - JDP Count"
};
private static String[] fields = {
"ro_count",
"ro_revisit_count",
"ro_jdp_count"
};
where for each type i'll return field values...
can any one help how to do this task?
Ambislm 0 Newbie Poster
hi buddies,
I am much impressed by jQuery. I have enjoyed using it with javascript. But my doubt is whether we can integrate jQuery with java web applications?
If so can anyone provide some examples?
Thank You. :)
Ambislm 0 Newbie Poster
thanks Excizted, my problem is i cant understan how to pass variable values to next page using post method.. in my program am using GET method where am passing values in url such as:
echo "<a href=\"outgoing.php?optSingle=".$c."&beg=".$frmDate."&datEnd=".$toDate."&inTxt=".$incoming."&fl=".$fl."&page=1\" ><img style='border-style:none' src='img/dialed.gif'></a>";
echo "<a href=\"incoming.php?optSingle=".$c."&beg=".$frmDate."&datEnd=".$toDate."&inTxt=".$incoming."&flr=".$flr."&page=1\"><img style='border-style:none' src='img/e-received.gif'></a>";
echo "<a href=\"missed.php?optSingle=".$c."&beg=".$frmDate."&datEnd=".$toDate."&inTxt=".$incoming."&flr=".$missed."&page=1\"><img style='border-style:none' src='img/missedcalls.gif'></a>";
echo "<a href=\"consolidated.php?optSingle=".$c."&beg=".$frmDate."&datEnd=".$toDate."&inTxt=".$incoming."&flr=".$missed."&page=1\"><img style='border-style:none' src='img/consolidated.gif'></a>";
but how can i done using POST... am i clear? or still confusing?
can u give some example how on post-mysql ....
Ambislm 0 Newbie Poster
thanks Excizted...
my second issue solved.. but am using form in my index page where am using method='post'
index.php
<form name=callsubm method="post" onsubmit="return DoSubmit()" action="outgoing.php">
<table border="0" >
<!--From Date-->
<tr>
<td align="center">
From Date</td>
<td align="center" >
<input style="border-style: none;" type="text" name="beg" id="beg" size="15" ></td>
<td><img src="calender" alt="C" id='img1'>
<script language=javascript type="text/javascript">
var cal = new Zapatec.Calendar.setup({
inputField:"beg",
ifFormat:"%d-%m-%Y ",
button:"img1",
showsTime:false
});
</script>
</td>
</tr>
<!--End Date-->
<tr>
<td>
End Date</td>
<td align="center" >
<input style="border-style: none;" type="text" name="datEnd" id="datEnd" size="15" ></td>
<td><img src="calender" alt="C" id='img2'>
<script language=javascript type="text/javascript">
var cal = new Zapatec.Calendar.setup({
inputField:"datEnd",
ifFormat:"%d-%m-%Y ",
button:"img2",
showsTime:false
});
</script>
</td>
</tr>
<!--Time-->
<tr>
<td>
Time</td>
<td align="center" >
<input style="border-style: none;" name=time id=time type="text" size="15"></td>
<td><input type="image" id=time name=time src="Time.png"></td>
</tr>
<!--Extension -->
<tr>
<td>
Extension</td>
<td align="center">
<input style="border-style: none;" name=inTxt id=inTxt type="text" size="15"></td>
<td><input type="image" id=callBtn name=callBtn src="phone.png" >
</td>
</tr>
<!--Single-->
<tr align="center">
<td><p> </p> Single
<input class="submit" type=radio id=optSingle name=optSingle onclick=selectpage(name)>
</td>
<!--Datewise-->
<td><p> </p> Datewise
<input class="submit" type=radio checked id=optDat name=optDat onclick=selectpage(name)>
</td>
<td></td>
</tr>
</table>
<input TYPE=HIDDEN NAME="pageNum" value="1">
<input TYPE=HIDDEN NAME="rowsPerPage" value="10">
</form>
and am saving that using 'post' method into a variable in another file 'outgoing.php' as follows:
outgoing.php
<?php
$frmDate=trim($_POST['beg']);
$toDate=trim($_POST['datEnd']);
$time=trim($_POST['time']);
$incoming=$_POST['inTxt'];
$c=$_POST['optSingle'];
$c1=$_POST['optDat'];
$pageNum=$_POST['pageNum'];
$rowsPerPage=$_POST['rowsPerPage'];
$dat=$_POST['dat'];
$self = $_SERVER['PHP_SELF'];
// how many rows to show per page
$rowsPerPage = '10';
// by default we show first page
// if $_GET['page'] defined, use it as page number
if(isset($_GET['page'])) {
$pageNum = $_GET['page'];
}
// counting …
Ambislm 0 Newbie Poster
hi everyone,
i have 2 problems which makes me to stuck inbetween my application..
my first issue is:
i already used get method to pass variable values between pages which is working fine till now as follows:
$frmDate=trim($_GET);
$toDate=trim($_GET);
$time=trim($_GET);
$incoming=$_GET;
echo "<a href=\"outgoing.php?optSingle=".$c."&beg=".$frmDate."&datEnd=".$toDate."&inTxt=".$incoming."&flr=".$flr."&page=1\" ></a>";
but how can i use post method and pass values between pages...
My second issue:
i have used pagination in php.. am displaying 10 records per page and printind result as "1 - 10 records of 106 records".. but problem arises at last page where instead of "101 - 106 of 106 records" it showing as " 101 - 110 of 106 records"...
here is my code:
$query="SELECT * FROM calldetail WHERE (";
for($i=0;$i<count($r);$i++)
{
if ($r[$i][1]==null)
{
if ($i>0)
$query.=" OR";
$query.=" (CallTermination ='".$r[$i][0]."')";
}
else
{
if ($i>0)
$query.=" OR";
$query.=" (CallTermination BETWEEN '".$r[$i][0]."' AND '".$r[$i][1]."')";
}
} // end of for loop
$query.=") and CallFlag='L' AND CallDate BETWEEN '".$frmDate1."' AND '". $toDate1."' ORDER BY ";
if ($dat=='CallDate desc' or $dat=='CallDate asc')
$query.=$dat;
$query.=" LIMIT $offset, $rowsPerPage";
$c1='&optDat';
tab($query,$connection,$frmDate,$toDate,$incoming,$dat,$c1,$offset,$rowsPerPage,$pageNum,$row['CallFlag'],$dial,$receive);
$query="SELECT count(CallDate) as numrows FROM calldetail WHERE (";
for($i=0;$i<count($r);$i++) {
if ($r[$i][1]==null)
{
if ($i>0)
$query.=" OR";
$query.=" (CallTermination ='".$r[$i][0]."')";
}
else
{
if ($i>0)
$query.=" OR";
$query.=" (CallTermination BETWEEN '".$r[$i][0]."' AND '".$r[$i][1]."')";
}
} //end of for loop
$query.=")and CallFlag='L' AND CallDate BETWEEN '".$frmDate1."' AND '". $toDate1."' ORDER BY CallTermination ASC";
// how many rows we have in database
$result = …
Ambislm 0 Newbie Poster
Since am new to php i have the following doubt.
I have a combo box within a form in my home page.The combo box will display data from mysql database. When the user chooses an item, i have to pass it to an query and display the result in a textfield. I have done all these things.
But the problem is, when the user enters others details and selects the combo box value it automatically gets refreshed. i know this is because php is for server side. My coding is as follows:
<html>
<head>
<title>Call Reader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$dbname='callreader';
$db_user='root';
$db_pass='';
$host='localhost';
$conn = mysql_connect($host, $db_user, $db_pass);
mysql_select_db($dbname);
$query="select distinct Name from billing_numbers";
$result=mysql_query($query,$conn) or die(mysql_error());
?>
<center>
<form name=callsubm method="post">
<table border="0" >
<tr >
<td align="right">
From Date</td>
<td align="center" >
<input style="border-style: none;" type="text" name="beg" id="beg" size="15" ></td>
<td><img src="calender" alt="C" id='img1'>
<script language=javascript type="text/javascript">
var cal = new Zapatec.Calendar.setup({
inputField:"beg",
ifFormat:"%d-%m-%Y ",
button:"img1",
showsTime:false
});
</script>
</td>
</tr>
<tr>
<td>
End Date</td>
<td >
<input style="border-style: none;" type="text" name="datEnd" id="datEnd" size="15" ></td>
<td><img src="calender" alt="C" id='img2'>
<script language=javascript type="text/javascript">
var cal = new Zapatec.Calendar.setup({
inputField:"datEnd",
ifFormat:"%d-%m-%Y ",
button:"img2",
showsTime:false
});
</script>
</td>
</tr>
<tr>
<td>
Time</td>
<td >
<input style="border-style: none;" name=time id=time type="text" size="15"></td>
<td><input type="image" id=time name=time src="Time.png"></td>
</tr>
<?php
if($result)
{
?>
<tr>
<td>
Group:</td>
<td>
<select name="Name" id="Name" onchange='PrintCombo();' style="width:117px; font-size:12px; color:#006699;font-weight: bold;font-family:verdana;background-color:#ffffff;">
<?php
while($row=mysql_fetch_assoc($result)) {
echo '<option value="'.$row['Name'].'">'.$row['Name'].'</option>';
}
}
?>
</select>
<?php
if(isset($_POST['Name'])) …
Ambislm 0 Newbie Poster
thanks for everyone who shared their ideas with me. i solved this by
function printcombo()
{
document.form.submit();
}
Ambislm 0 Newbie Poster
can anyone give idea how i have to proceed further.
Ambislm 0 Newbie Poster
thanks for your reply rajan.
actually this is simply a part of my application. this is not the whole program. i don have any idea about ajax. but my homepage code is as follows. go through that you can understand what i want exactly.
<html>
<head>
<title>Call Reader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="calendar.css">
<link rel="stylesheet" type="text/css" media="all" href="themes/aqua.css" title="Calendar Theme-aqua.css" >
<script type="javascript" src="choosedate.js"></script>
<!-- import the calendar script -->
<script type="text/javascript" src="src/utils.js"></script>
<script type="text/javascript" src="src/calendar.js"></script>
<!-- import the language module -->
<script type="text/javascript" src="lang/calendar-en.js"></script>
<!-- other languages might be available in the lang directory; please check
your distribution archive. -->
<!-- import the calendar setup script -->
<script type="text/javascript" src="src/calendar-setup.js"></script>
</head>
<body onload=top()>
<center>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form name=callsubm method="get" onsubmit="return DoSubmit();" action="outgoing.php" >
<table border="0" >
<tr >
<td align="right">
From Date</td>
<td align="center" >
<input style="border-style: none;" type="text" name="beg" id="beg" size="15" ></td>
<td><img src="calender" alt="C" id='img1'>
<script language=javascript type="text/javascript">
var cal = new Zapatec.Calendar.setup({
inputField:"beg",
ifFormat:"%d-%m-%Y ",
button:"img1",
showsTime:false
});
</script>
</td>
</tr>
<tr>
<td>
End Date</td>
<td >
<input style="border-style: none;" type="text" name="datEnd" id="datEnd" size="15" ></td>
<td><img src="calender" alt="C" id='img2'>
<script language=javascript type="text/javascript">
var cal = new Zapatec.Calendar.setup({
inputField:"datEnd",
ifFormat:"%d-%m-%Y ",
button:"img2",
showsTime:false
});
</script>
</td>
</tr>
<tr>
<td>
Time</td>
<td >
<input style="border-style: none;" name=time id=time type="text" size="15"></td>
<td><input type="image" id=time name=time src="Time.png"></td>
</tr>
<tr>
<td>
Extension</td>
<td >
<input style="border-style: none;" name=inTxt id=inTxt type="text" size="15"></td>
<td><input type="image" id=callBtn name=callBtn src="phone.png" ></td>
</tr> …
Ambislm 0 Newbie Poster
finally succeded gettin the result from selected combo box value. but it happens only when i click the submit button... is there any other way to pass the result value directly to a textbox without clicking the submit button.
here is my code.
<html>
<head><title> Testing </title> </head>
<body>
<form method="post">
<p> Choose group </p>
<p>
<label for="Group">Group</label>
<?php
$dbname='callreader';
$db_user='root';
$db_pass='';
$host='localhost';
$conn = mysql_connect($host, $db_user, $db_pass);
mysql_select_db($dbname);
$query="select distinct Name from billing_numbers";
$result=mysql_query($query,$conn) or die(mysql_error());
if($result)
{
?>
<select id="Name" name="Name">
<?php
while($row=mysql_fetch_assoc($result))
{
echo '<option value="'.$row['Name'].'">'.$row['Name'].'</option>';
}
?>
</select>
<?php
}
?>
<input type="submit" value="submit" />
</p>
</form>
<?php
if(isset($_POST['Name']))
{
$query="select Number from billing_numbers where Name='".$_POST['Name']."'";
$result=mysql_query($query,$conn) or die(mysql_error());
echo '<b>';
echo "Group Name:" . $_POST['Name'] . "\n<br/>";
echo "Numbers:\n<br/>";
echo '<b/>';
if($result)
{
while($row=mysql_fetch_assoc($result))
{
echo $row['Number']."<br/>";
}
}
}
?>
</body>
</html>
please someone give some idea how to do that..
thanks
Ambislm 0 Newbie Poster
ya the logic rajarajan said was correct and already i thought that.. but d thing was i dono how to get the value from combobox.. whether we have to use javascript or we can directly get using option value
Ambislm 0 Newbie Poster
am new to php. my question is:
i have 5 items in adrop down list box . i have items related to that list in mysql database. i want to list those items in textbox from database when user selects an item from drop down list box.
example;
i have table as follows:
Name Numbers
Sam 042358
dev 785694
dev 34567
fid 345348
i have created list box wic displays name's..
now i have to retrieve the numbers which is stored under those name's..
could anyone give some idea how to do it..
here is d code i did:
<?php
$dbname='test;
$db_user='root';
$db_pass='';
$host='localhost';
$conn = mysql_connect($host, $db_user, $db_pass);
mysql_select_db($dbname);
//$result = mysql_query($query, $connection) or die('Dynamic query function: error making query');
$sql = mysql_query("SELECT distinct Name FROM billing_numbers orderby",$conn);
//echo "connection success";
//$result=mysql_fetch_array($sql);
?>
<select name="Make" onchange="sampledata(this.form.text1);"> <!--((this.selectedIndex == -1) ? null : team[this.selectedIndex-1]));">-->
<?php
while ($row = mysql_fetch_array($sql))
{
?>
<option
<?php
echo $_GET['Name']==$row['Name'] ? 'selected' : '';
?>
>
<?php
echo $row['Name'];
?>
</option>
<?php
}
thanks
Ambislm 0 Newbie Poster
Hi all,
i am developing an application that gets input from user and display the resultset inside 3 tabs(html). i am using mysql database... my problem here is when i try to paginate the result values it display 1st set of values. but when i click the 'next 10 record' link am getting an empty page.. i have attached my coding files.. can anyone suggest me how to do pagination inside the tabs?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CallDetails</title>
<script type="text/javascript" language="javascript" src="Incoming.js"> </script>
<script type="text/css"> </script>
</head>
<body>
<?php
// variable declaration for getting values from page
$extension = $_GET["extension"];
$startdate=$_GET["startdate"];
$enddate=$_GET["enddate"];
$type=$_GET["calltype"];
// variable decalration for database connection
$DBServer = "localhost";
$DBName = "callreader";
$DBUsername = "root";
$DBPassword = "";
//pagination starts
$rec_limit = 10;
//connection starts
$conn = mysql_connect($DBServer,$DBUsername,$DBPassword);
@mysql_select_db($DBName) or $Info = "Unable to open database";
/* Get total number of records */
$sql = "SELECT count(PK) FROM calldetail";
$retval = mysql_query( $sql, $conn ) or die('Error, query failed');
$row = mysql_fetch_array($retval,MYSQL_NUM);
$rec_count=$row[0];
if(isset($_GET{'page'}))
{
$page = $_GET{'page'} +1;
$offset = $rec_limit * $page;
}
else
{
$page=1;
$offset=0;
}
$left_rec=$rec_count - ($page * $rec_limit);
$sql = "SELECT PK,CallFlag,CallTrunk,CallTermination,CallStartTime,CallDuration,
CallPulse,CallDate,CalledNumber,CallOrigin,Cost,Currency FROM callreader.calldetail where CallFlag=" . $type . " and CallTermination=" . "'"
. $extension . "'" . " and CallDate between ". "'" . $startdate . "'" . " and " . "'"
. $enddate . "'";// . "limit $offset,$rec_limit";
// echo $sql;
$retval=mysql_query($sql,$conn);
if(!retval)
{
die('could not get data:' . mysql_error);
}
//$numrows=mysql_num_rows($result);
//$i=0;
//mysql_close($conn);
?>
<table border="1" cellspacing="1" cellpadding="1" width="100%" style="margin-top:5pt;">
<tr align="center" bgcolor="white" style="color:black; font-size: 10pt">
<th> PK </th>
<th> Call Flag </th>
<th> Call Trunk </th>
<th> Call Termination</th>
<th> Call StartTime </th>
<th> Call Duration </th>
<th> Call Pulse </th>
<th> Call date </th>
<th> Called Number </th>
<th> Call Origin </th>
<th> Cost </th>
<th> Currency </th>
</tr>
<?php
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{
$pk = $row['PK'];
$callflag = $row['CallFlag'];
$calltrunk = $row['CallTrunk'];
$callterminate = $row['CallTermination'];
$starttime = $row['CallStartTime'];
$duration = $row['CallDuration'];
$callpulse = $row['CallPulse'];
$calldate = $row['CallDate'];
$callednumber = $row['CalledNumber'];
$callorigin = $row['CallOrigin'];;
$cost = $row['Cost'];
$currency = $row['Currency'];
?>
<tr>
<td> <?php echo $pk ?> </td>
<td> <?php echo $callflag ?> </td>
<td> <?php echo $calltrunk ?> </td>
<td> <?php echo $callterminate ?> </td>
<td> <?php echo $starttime ?> </td>
<td> <?php echo $duration ?> </td>
<td> <?php echo $callpulse ?> </td>
<td> <?php echo $calldate ?> </td>
<td> <?php echo $callednumber ?> </td>
<td> <?php echo $callorigin ?> </td>
<td> <?php echo $cost ?> </td>
<td> <?php echo $currency ?> </td>
</tr>
<?php
}
?>
</table>
<?php
if( $page > 0 )
{
$last = $page - 2;
echo "<a href=\"index.php?page=$last\">Last 10 Records</a> |";
echo "<a href=\"index.php?page=$page\">Next 10 Records</a>";
}
else if( $page == 0 )
{
echo "<a href=\"$_PHP_SELF?page=$page\">Next 10 Records</a>";
}
else if( $left_rec < $rec_limit )
{
$last = $page - 2;
echo "<a href=\"$_PHP_SELF?page=$last\">Last 10 Records</a>";
}
mysql_close($conn);
?>
</body>
</html>
var url;
var http = getHTTPObject(); // We create the HTTP Object
function handleHttpResponse()
{
if (http.readyState == 4)
{
if(http.status==200)
{
var results=http.responseText;
if(dividname==0)
document.getElementById('incomingresult').innerHTML = results;
if(dividname==1)
document.getElementById('outgoingresult').innerHTML = results;
if(dividname==2)
document.getElementById('missedresult').innerHTML = results;
}
}
}
function requestCustomerInfo()
{
http.open("GET", url, true);
http.onreadystatechange = handleHttpResponse;
http.send(null);
}
function getHTTPObject()
{
var xmlhttp;
if(window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if (!xmlhttp)
{
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
}
return xmlhttp;
}
function getCallDetails(dividname)
{
var startdate=document.getElementById("startdt").value;
var enddate=document.getElementById("enddt").value;
var extension=document.getElementById("extension").value;
if(dividname==0)
url= "CallDetails.php?&startdate=" + startdate + "&enddate=" + enddate + "&extension=" + extension + "&calltype='L'";
if(dividname==1)
url= "CallDetails.php?&startdate=" + startdate + "&enddate=" + enddate + "&extension=" + extension + "&calltype='C'";
if(dividname==2)
url= "CallDetails.php?&startdate=" + startdate + "&enddate=" + enddate + "&extension=" + extension + "&calltype='M'";
requestCustomerInfo();
}
The attachment preview is chopped off after the first 10 KB. Please download the entire file.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> Call Reader Information</title>
<script type="text/javascript" language="javascript" src="DatePicker.js"></script>
<script type="text/javascript" language="javascript" src="Incoming.js"></script>
<script type="text/javascript">
var dividname;
function TabView(id, current)
{
if(typeof(TabView.cnt) == "undefined")
{
TabView.init();
}
current = (typeof(current) == "undefined") ? 0 : current;
this.newTab(id, current);
}
TabView.init = function()
{
TabView.cnt = 0;
TabView.arTabView = new Array();
}
TabView.switchTab = function(TabViewIdx, TabIdx)
{
TabView.arTabView[TabViewIdx].TabView.switchTab(TabIdx);
}
TabView.prototype.newTab = function(id, current)
{
var TabViewElem, idx = 0, el = '', elTabs = '', elPages = '';
TabViewElem = document.getElementById(id);
TabView.arTabView[TabView.cnt] = TabViewElem;
this.TabElem = TabViewElem;
this.TabElem.TabView = this;
this.tabCnt = 0;
this.arTab = new Array();
// Loop through the elements till the object with
// classname 'Tabs' is obtained
elTabs = TabViewElem.firstChild;
while(elTabs.className != "Tabs" )elTabs = elTabs.nextSibling;
el = elTabs.firstChild;
do
{
if(el.tagName == "A")
{
el.href = "javascript:TabView.switchTab(" + TabView.cnt + "," + idx + ");";
this.arTab[idx] = new Array(el, 0);
this.tabCnt = idx++;
}
}while (el = el.nextSibling);
// Loop throught the elements till the object with
// classname 'Pages' is obtained
elPages = TabViewElem.firstChild;
while (elPages.className != "Pages")elPages = elPages.nextSibling;
el = elPages.firstChild;
idx = 0;
do
{
if(el.className == "Page")
{
this.arTab[idx][1] = el;
idx++;
}
}
while (el = el.nextSibling);
this.switchTab(current);
// Update TabView Count
TabView.cnt++;
}
TabView.prototype.switchTab = function(TabIdx)
{
var Tab;
if(this.TabIdx == TabIdx)return false;
for(idx in this.arTab)
{
Tab = this.arTab[idx];
if(idx == TabIdx)
{
Tab[0].className = "ActiveTab";
Tab[1].style.display = "block";
Tab[0].blur();
}
else
{
Tab[0].className = "InactiveTab";
Tab[1].style.display = "none";
}
}
this.TabIdx = TabIdx;
//alert("Hello "+this.TabIdx)
dividname=TabIdx;
}
function init()
{
t1 = new TabView('TabView1');
t2 = new TabView('TabView2', 1);
}
</script>
<style type="text/css">
body,div,table
{
font:normal 11px Verdana, Arial, sans-serif;
}
.TabView
{
width : 1230px;
height : 454px;
border : 1px #CCC solid;
margin : 0px;
}
.TabView .Tabs
{
height : 25px;
display : block;
background : #FFF;
}
.TabView .Tabs a
{
display : block;
float : left;
width : 399px;
height : 25px;
line-height : 26px;
color : #3F87E2;
text-align : center;
font-weight : bold;
border : 1px black outset;
margin : 0px 1px;
text-decoration: none;
font-size : 11pt;
}
.TabView .Tabs a.ActiveTab
{
background : #3F87E2;
color : black;
border : 1px #FFF solid;
border-bottom : 1px #FFF solid;
}
.TabView .Tabs a.InactiveTab
{
}
.TabView .Pages
{
width : 100%;
overflow-y : scroll;
}
.TabView .Pages .Page
{
border : 1px #CCC solid;
height : 422px;
}
/* the table (within the div) that holds the date picker calendar */
.dpTable {
font-family: Helvetica, Arial;
font-size: 12px;
text-align: center;
color: #505050;
background-color: #ece9d8;
border: 1px solid #AAAAAA;
}
/* a table cell that holds a date number (either blank or 1-31) */
.dpTD {
border: 1px solid #ece9d8;
}
/* a table cell that holds a highlighted day (usually either today's date or the current date field value) */
.dpDayHighlightTD {
background-color: #CCCCCC;
border: 1px solid #AAAAAA;
}
/* the date number table cell that the mouse pointer is currently over (you can use contrasting colors to make it apparent which cell is being hovered over) */
.dpTDHover {
background-color: #aca998;
border: 1px solid #888888;
cursor: pointer;
color: red;
}
/* a table cell that holds the names of days of the week (Mo, Tu, We, etc.) */
.dpDayTD {
background-color: #CCCCCC;
border: 1px solid #AAAAAA;
color: white;
}
/* additional style information for the text that indicates the month and year */
.dpTitleText {
font-size: 12px;
color: gray;
font-weight: bold;
}
/* additional style information for the cell that holds a highlighted day (usually either today's date or the current date field value) */
.dpDayHighlight {
color: #4060ff;
font-weight: bold;
}
/* the forward/backward buttons at the top */
.dpButton {
font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
font-size: 10px;
color: gray;
background: #d8e8ff;
font-weight: bold;
padding: 0px;
}
/* the "This Month" and "Close" buttons at the bottom */
.dpTodayButton {
font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
font-size: 10px;
color: gray;
background: #d8e8ff;
font-weight: bold;
}
</style>
</head>
<body onload="init()">
<center>
<img src="call.gif" alt="SKS CallReaders">
</center>
<fieldset style="border-color: #3F87E2">
<legend style="font-size: 14pt; color:#3F87E2">
<b> Calls information: </b>
</legend>
<table>
<tr style="font-size:10pt">
<td><b> From Date </b></td>
<td><input type="text" name="startdt" id="startdt" size="10" > <img src="calendar.gif" alt="Calendar" id='img1' onclick="displayDatePicker('startdt', this);"><td>
</tr>
<tr style="font-size:10pt">
<td><b> End Date </b></td>
<td><input type="text" name="enddt" id="enddt" size="10" > <img src="calendar.gif" id='img2' alt="Calendar" onclick="displayDatePicker('enddt', this);"> </td>
</tr>
<tr style="font-size:10pt">
<td> <b>Extension</b></td>
<td> <input name="extension" id="extension" type="text" > </td>
<td> <input type="image" id="extension" name="extension" src="phoneimg.gif" onclick="getCallDetails(dividname)"></td>
</tr>
</table>
</fieldset>
<br/>
<fieldset style="border-color:#3F87E2;">
<legend style="font-size: 14pt; color:#3F87E2"> Call Details </legend>
<table style="width:50%;height:100%;">
<tr><td>
<br/>
<center>
<!--Begin TabView Block-->
<!--First Tab-->
<div class="TabView" id="TabView1" >
<!--Tabs-->
<div class="Tabs"><a>Incoming Calls</a> <a>Outgoing Calls</a> <a>Missed Calls</a></div>
<!--Pages-->
<div class="Pages">
<!Tab 1-->
<div class="Page" id="incomingresult" onmouseover="getCallDetails(0)"> </div>
<!--Tab 2-->
<div class="Page" id="outgoingresult" onmouseover="getCallDetails(1)"> </div>
<!-- Tab 3-->
Ambislm 0 Newbie Poster
hi all,
this s my first thread...
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 3
at calculator1$nextListener.mouseClicked(calculator1.java:1048)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
at java.awt.Component.processMouseEvent(Component.java:5520)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5282)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3984)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1791)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
can any one help me what that means... am new to java