Jump to content

rashmi_k28

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by rashmi_k28

  1. function checkForm(TheForm) { if (document.example.date2.disabled == true) { if (document.example.date1.value == "yyyy-mm-dd") { var msg = "date not chosen from calendar icon"; alert(msg); return false; } } else{ if (document.example.date1.value == "yyyy-mm-dd" || document.example.date2.value == "yyyy-mm-dd") { var msg = "start or end date not chosen from calendar icon"; alert(msg); return false; } if(document.example.date1.value > document.example.date2.value){ var msg = "choose proper date-Start date is greater than end date"; alert(msg); return false; } if(document.example.date1.value == document.example.date2.value){ var msg = "choose proper date-Start and end date is equal"; alert(msg); return false; } if (document.example.opt2[3].checked && document.example.date2.value != "yyyy-mm-dd") { var msg="select only Start date- duration option not available"; alert(msg); return false; } } } <FORM NAME="example" class="frm" onreset="disableField()" onSubmit="return checkForm(this);" action="a.php">
  2. When I query the timestamp | 2008-08-08 06:40:01 | | 2008-08-08 06:50:01 | | 2008-08-08 07:00:02 | | 2008-08-08 07:10:01 | | 2008-08-08 07:20:01 | | 2008-08-08 07:30:02 | | 2008-08-08 07:40:01 | | 2008-08-08 07:50:01 | | 2008-08-08 08:00:02 | | 2008-08-08 08:10:02 | | 2008-08-08 08:20:05 | | 2008-08-08 08:30:01 | | 2008-08-08 08:40:01 | | 2008-08-08 08:50:05 | | 2008-08-08 09:00:02 | | 2008-08-08 09:10:01 | | 2008-08-08 09:20:01 | | 2008-08-08 09:30:01 | | 2008-08-08 09:40:02 | | 2008-08-08 09:50:01 | | 2008-08-08 10:00:01 | | 2008-08-08 10:10:01 | +---------------------+ But previous date timestamp may differ with the seconds 2008-08-07 09:10:01 | | 2008-08-07 09:20:01 | | 2008-08-07 09:30:01 | | 2008-08-07 09:40:01 | | 2008-08-07 09:50:01 | | 2008-08-07 10:00:01 | | 2008-08-07 10:10:01 | | 2008-08-07 10:20:01 | | 2008-08-07 10:30:01 | | 2008-08-07 10:40:01 | | 2008-08-07 10:50:01 | | 2008-08-07 11:00:02 | | 2008-08-07 11:10:01 | | 2008-08-07 11:20:01 | | 2008-08-07 11:30:01 | | 2008-08-07 11:40:01 | | 2008-08-07 11:50:02 | | 2008-08-07 12:00:01 | | 2008-08-07 12:10:01 | | 2008-08-07 12:20:01 | But When I use this timestamp to query the data from table, Due to the seconds mistach the first value is missed out. So how can i avoid it using the query excluding the seconds If i use timestamp as 2008-08-07 12:20 then last value is missed out. It is considered as 2008-08-07 12:20:00 select timestamp, fieldname from table where timestamp <= ('".$time."') and timestamp >= date_sub('".$time."',interval 1 day) group by timestamp order by timestamp.
  3. yes, There is 4 radio button and one submit button. When radio button 4th option selected, I have to open somepage.html in another window. When radio button 1-3 option selected, it should open in same page.
  4. Hi, I have a query like this select timestamp, name from table where timestamp <= ('".$time."') and timestamp >= date_sub('".$time."',interval 1 day) group by timestamp order by timestamp. All the records between these are fetched due to seconds in the timestamp. The timestamp is difference of 10 minutes and seconds can be 01 or 02 so on. Due to this seconds difference the value fetched is less by 1 for the day. How to exclude the seconds and query for the 1 day interval difference
  5. How to open the page in another window when radio button value 4 is selected. When other option is selected open in same window.
  6. How to open one page in new window and another in same window using radio button. <FORM NAME="example" class="frm" onreset="disableField()" target=_blank onSubmit="return checkForm(this);" action="a.php"> There are 4 radio buttons I have to open option 4 in another page and option 1,2,3 in same window
  7. In the below code how can I optimize the query. Yhe fieldname has more than 3 rows for the particular id. The while loop takes longer time to open the page if there are more records. So how can I optimize the query so that speed increases $result = mysql_query("select * from table1"); $no_of_rows += mysql_num_rows($result); while($r = mysql_fetch_array($result)){ $fieldname = ''; $res = mysql_query("select distinct(filed) from table2 where id='".$r[0]."'"); while($row = mysql_fetch_array($res)){ $fieldname .= $row[0]."\n"; } array_push($records, "$r[0]#$r[1]#$r[2]#$r[3]#$r[4]#$r[5]#$fieldname"); }
  8. function CP_addDisabledDates(start, end){ if(arguments.length==1){ end=start; } if(start==null && end==null){return;} if(this.disabledDatesExpression!=""){ this.disabledDatesExpression+= "||"; } if(start!=null){ start = parseDate(start); start=""+start.getFullYear()+LZ(start.getMonth()+1)+LZ(start.getDate()); } if(end!=null){ end=parseDate(end); end=""+end.getFullYear()+LZ(end.getMonth()+1)+LZ(end.getDate()); } if(start==null){ this.disabledDatesExpression+="(ds<="+end+")"; } else if(end ==null){ this.disabledDatesExpression+="(ds>="+start+")"; } else{ this.disabledDatesExpression+="(ds>="+start+"&&ds<="+end+")"; } } I am getting an error as NULL is null or not an object
  9. select timestamp, ifnull(avg(100 - pkt),-1) from tablename where timestamp <= ('".$time."') and timestamp >= date_sub('".$time."',interval 1 day) group by timestamp; But I should include minutes and hour along with date. Now i am using the query like this
  10. How to find the records from current time to the 1 day interval excluding the seconds of the timestamp
  11. Hi The code below works in firefox and not in IE. Please anyone guide me how to make firefox and IE compactible. The tree structure doesnot work insidec<td>i internet explorer. <html> <head> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> #containerul, #containerul ul{ text-align:left; margin:0; /* Removes browser default margins applied to the lists. */ padding:0; /* Removes browser default padding applied to the lists. */ } #containerul li{ margin:0 0 0 30px; /* A left margin to indent the list items and give the menu a sense of structure. */ padding:0; /* Removes browser default padding applied to the list items. */ list-style-type:none; /* Removes the bullet point that usually goes next to each item in a list. */ } #containerul .symbols{ /* Various styles to position the symbols next to the items in the menu. */ float:left; width:12px; height:1em; background-position:0 50%; background-repeat:no-repeat; } </style> <script type="text/javascript"> var temp, temp2, cookieArray, cookieArray2, cookieCount; function initiate(){ cookieCount=0; if(document.cookie){ cookieArray=document.cookie.split(";"); cookieArray2=new Array(); for(i in cookieArray){ cookieArray2[cookieArray[i].split("=")[0].replace(/ /g,"")]=cookieArray[i].split("=")[1].replace(/ /g,""); } } cookieArray=(document.cookie.indexOf("state=")>=0)?cookieArray2["state"].split(","):new Array(); temp=document.getElementById("containerul"); for(var o=0;o<temp.getElementsByTagName("li").length;o++){ if(temp.getElementsByTagName("li")[o].getElementsByTagName("ul").length>0){ temp2 = document.createElement("span"); temp2.className = "symbols"; temp2.style.backgroundImage = (cookieArray.length>0)?((cookieArray[cookieCount]=="true")?"url(minus.png)":"url(plus.png)"):"url(plus.png)"; temp2.onclick=function(){ showhide(this.parentNode); writeCookie(); } temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild) temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].style.display = "none"; if(cookieArray[cookieCount]=="true"){ showhide(temp.getElementsByTagName("li")[o]); } cookieCount++; } else{ temp2 = document.createElement("span"); temp2.className = "symbols"; temp2.style.backgroundImage = "url(page.png)"; temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild); } } } function showhide(el){ el.getElementsByTagName("ul")[0].style.display=(el.getElementsByTagName("ul")[0].style.display=="block")?"none":"block"; el.getElementsByTagName("span")[0].style.backgroundImage=(el.getElementsByTagName("ul")[0].style.display=="block")?"url(minus.png)":"url(plus.png)"; } function writeCookie(){ // Runs through the menu and puts the "states" of each nested list into an array, the array is then joined together and assigned to a cookie. cookieArray=new Array() for(var q=0;q<temp.getElementsByTagName("li").length;q++){ if(temp.getElementsByTagName("li")[q].childNodes.length>0){ if(temp.getElementsByTagName("li")[q].childNodes[0].nodeName=="SPAN" && temp.getElementsByTagName("li")[q].getElementsByTagName("ul").length>0){ cookieArray[cookieArray.length]=(temp.getElementsByTagName("li")[q].getElementsByTagName("ul")[0].style.display=="block"); } } } document.cookie="state="+cookieArray.join(",")+";expires="+new Date(new Date().getTime() + 365*24*60*60*1000).toGMTString(); } </script> <table><tr> <td width=200 align=center bgcolor=fff789><ul id="containerul"><li>View<ul><li>data1</li></ul></li></ul> <script type="text/javascript"> initiate(); // This must be placed immediately after the menu in order to format it properly. </script> <td width=200 align=center bgcolor=fff789><ul id="containerul"><li>View<ul><li>data2</li></ul></li></ul> <script type="text/javascript"> initiate(); // This must be placed immediately after the menu in order to format it properly. </script> </td> </tr></table> </body> </html>
  12. How to calculate the time taken to open a page in seconds
  13. Hi, How to generate the crystal report using php? I am not using OOP's concept
  14. Hi, How to increase the text in title. echo '<area shape="circle" coords="$xpoint[0],6" title="$val1">';
  15. Hi, How to select name where inpacket=NULL. select name from `table` where inpacket='NULL'; returns warning........
  16. In the code below if length is more than 1, I have to show two tables. The second table should get the top position as $toppos1=$toppos+260; But here second table comes inside the first table for($j=0;$j<$length;$j++){ $left=1420; $height=340; $toppos1=326; $ct=count($records); echo '<div style="position:absolute; LEFT:'.$left.'px; overflow:auto; overflow-x:hidden; height:'.$height.'px; WIDTH:1250px; TOP: '.$toppos1.'px" align=center>'; if($ct!=0){ echo '<TABLE borderColor=#006699 cellSpacing=1 cellPadding=1 overflow:auto; overflow-x:hidden; width="100%" border=1> <TBODY> <TR> <TD align=middle bgcolor=#006699 width=79><font size=20 color=#ffffff><b>Node</b></font></TD> <TD align=middle bgcolor=#006699 width=92><font size=20 color=#ffffff><b>IP</b></font></TD> </TR>'; for($i=0; $i<$ct; $i++){ $data = split(":", $records[$i]); $data1=explode(".",$data[0],2); if($i%2 == 0){ $color = '#ffffff'; }else{ $color = '#C5C7C8'; } echo "<tr>"; echo "<td width=60 align=center bgcolor=$color><font size=20>$data1[0]</font></td>"; echo "<td width=140 align=center bgcolor=$color><font size=20>$data[1]</font></td></tr>"; } } $toppos1=$toppos+260; } echo ‘</table></div>’;
  17. This code is working for all radio button when duration option is selected. I just want when only 4th radio button is selected i.e when value =4.
  18. Hi, I am using linux and /var/lib/php/session folder is empty. When I use the code session_start(); $xpoint = explode("%",$_SESSION["cx"]); session_destroy(); But still session folder is empty. Permission drwxrwx--- for the session folder. In php.ini file these configuration is set. ssion Support enabled Registered save handlers files user sqlite Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start On On session.bug_compat_42 Off Off session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 1000 1000 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.hash_bits_per_character 5 5 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /var/lib/php/session /var/lib/php/session session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid 0 0 Same configuration works on the difference machine.
  19. Hi, Is there any way to differentiate between 0 and 0.00. $a=0; $b=0.00; In a function I have to assign color function FCallback($aVal) { if( $aVal == 0 ) $c = "red"; elseif( $aVal == '0.00' ) $c = "black"; else $c="green"; return array(3,"",$c); } But if aVal is 0 and 0.00 same color is printed. Is there anyway to differentiate between the two.
  20. Hi, There is a piece of code where $time[$j] should be 2008-06-13 00:10:00 and 0#2008-06-13 00:50:00 $time[$i] should be 2008-06-13 00:40:00 and 2008-06-13 01:10:00 ie. when the status changes from 0 to 1, the timestamp should be assigned as when status was 0 initially. In the above code status was 0 at 2008-06-13 00:10:00. again it was 0 at 2008-06-13 00:50:00 <?php $stack = array(); $val = array(); $time = array(); $values=array("0#2008-06-13 00:10:00","0#2008-06-13 00:20:00","0#2008-06-13 00:30:00","1#2008-06-13 00:40:00","0#2008-06-13 00:50:00","1#2008-06-13 01:10:00"); foreach($values as $v){ $val1=split("#",$v); array_push($val,$val1[0]); array_push($time,$val1[1]); } //$val = array(0,0,1,0,1,0,0,1,0,0,1,0); //$val = array(0,0,0,0,0,1,1,1,1,0,1,1); $previous_value = $val[0]; $i = 0; foreach ($val as $value){ $this_value = $value; if($previous_value ==0 && $this_value ==1) array_push($stack, "$time[$j]#$time[$i]"); $previous_value = $this_value; $i++; $j=$i-1; } echo"<pre>"; print_r($val); print_r($stack); echo"</pre>"; Please tell me how to assign the timestamp from when it was 0.
  21. Hi, How to push into the array 0//Push 0 //Skip 0//skip 0//Skip 0//Skip 1// Push 1//Skip 1//Skip 1//Skip 0 //Push 1 //Push 1 //Skip If any change from 0 to 1 then push else skip that row. If next row has the same value then push into the array else skip that row.
  22. It is pointing to this path /var/lib/php/session. Session folder is empty. How to write into the session folder initially. I am using IE. I have used title tag for the tooltip and session_start(); is used How to store some sessions initially in the session folder.
  23. How to validate if radio button option ==4 and date2.disabled==false ,,,, alert message Duration option not available function checkForm(TheForm) { //if((document.example.opt2.value==4) && (document.example.date2.value != "yyyy-mm-dd")){ // var msg="select only Start date, duration option not available"; // alert(msg); // return false; // } if (document.example.date2.disabled == true) { if (document.example.date1.value == "yyyy-mm-dd") { var msg = "date not chosen from calendar icon"; alert(msg); return false; } } else{ if (document.example.date1.value == "yyyy-mm-dd" || document.example.date2.value == "yyyy-mm-dd") { var msg = "start or end date not chosen from calendar icon"; alert(msg); return false; } if(document.example.date1.value > document.example.date2.value){ var msg = "choose proper date-Start date is greater than end date"; alert(msg); return false; } if(document.example.date1.value == document.example.date2.value){ var msg = "choose proper date-Start and end date is equal"; alert(msg); return false; } } } <FORM NAME="example" class="frm" onSubmit="return checkForm(this); submit=”a.php”> <input type="radio" name="opt2" value="2" checked> Option 1<br><br> <input type="radio" name="opt2" value="3"> Option 2<br><br> <input type="radio" name="opt2" value="4"> Option 3<br><br>
  24. Hi, All the configuration is enabled. But var/lib/php/session folder is empty. In the code I have used session_start(). But still the folder is not updating. Permission are drwxrwx--- How to save some sessions in the directory
×
×
  • 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.