Jump to content

swethak

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

swethak's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I have done the javascript event calendar. And it works fine.In that code i add the drop down list to select the month based on that calendar will change .For that i use select tag and include option tags and i use the function as onChange="changedate()".But it will not effect.Plz tell that whats the mistake in my code. [javascript] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>sayhi</title> <link href="stylesheet.css" rel="stylesheet" type="text/css" /> <script language="JavaScript" type="text/javascript" src="events.js"></script> <script type="text/JavaScript" language="JavaScript"> var thisDate = 1; // Tracks current date being written in calendar var wordMonth = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var today = new Date(); // Date object to store the current date var todaysDay = today.getDay() + 1; // Stores the current day number 1-7 var todaysDate = today.getDate(); // Stores the current numeric date within the month var todaysMonth = today.getUTCMonth() + 1; // Stores the current month 1-12 var todaysYear = today.getFullYear(); // Stores the current year var monthNum = todaysMonth; // Tracks the current month being displayed var yearNum = todaysYear; // Tracks the current year being displayed var firstDate = new Date(String(monthNum)+"/1/"+String(yearNum)); // Object Storing the first day of the current month var firstDay = firstDate.getUTCDay(); // Tracks the day number 1-7 of the first day of the current month var lastDate = new Date(String(monthNum+1)+"/0/"+String(yearNum)); // Tracks the last date of the current month var numbDays = 0; var calendarString = ""; var eastermonth = 0; var easterday = 0; var date =0; var event8=""; var events1="hello"; events = new Array( ["Y", "11", "8", "2008", "1:00 AM", "12:59 PM", "beautiful day", "aweewwewweeweweww"], ["Y", "11", "22", "2008", "1:00 AM", "12:59 PM", "beautiful days", "wewewewewewqwewwew"], ["Y", "11", "8", "2008", "1:00 AM", "12:59 PM", "rrrrrrr", "rrrrrrr"], ["Y", "11", "22", "2006", "1:00 AM", "12:59 PM", "wwwwww", "wwwwww"], ["Y", "11", "8", "2006", "1:00 AM", "12:59 PM", "avvvvvvvvv", "avvvvvvvvv"], ["Y", "11", "22", "2005", "1:00 AM", "12:59 PM", "ssssssssss", "ssssssssss"], ["Y", "11", "8", "2005", "1:00 AM", "12:59 PM", "zzzzzzzzz", "zzzzzzzzz"], ["Y", "11", "22", "2009", "1:00 AM", "12:59 PM", "ddddddd", "ddddddd"], ["Y", "11", "8", "2009", "1:00 AM", "12:59 PM", "hhhhhhhh", "hhhhhhhh"], ["Y", "11", "22", "2010", "1:00 AM", "12:59 PM", "vvvvvvv", "vvvvvvv"], ["Y", "11", "8", "2010", "1:00 AM", "12:59 PM", "bbbbbbbb", "bbbbbbbb"], ["Y", "10", "1", "2011", "1:00 AM", "12:59 PM", "kkkkkkk", "kkkkkkk"], ["Y", "10", "2", "2011", "1:00 AM", "12:59 PM", "xxxxxxxxxx", "xxxxxxxxxx"], ["Y", "9", "9", "2007", "1:00 AM", "12:59 PM", "vvvvvvvvvv", "vvvvvvvvvv"], ["Y", "9", "8", "2007", "1:00 AM", "12:59 PM", "ccccccccccc", "ccccccccccc"], ["Y", "11", "2", "2006", "1:00 AM", "12:59 PM", "wbbbbbbbbbb", "wbbbbbbbbbb"], ["Y", "11", "3", "2006", "1:00 AM", "12:59 PM", "nnnnnnnnnnnnnn", "nnnnnnnnnnnnnn"], ["Y", "11", "22", "2005", "1:00 AM", "12:59 PM", "jjjjjjjjjj", "jjjjjjjjjj"], ["Y", "11", "8", "2005", "1:00 AM", "12:59 PM", "oooooo", "oooooo"], ["Y", "11", "22", "2004", "1:00 AM", "12:59 PM", "hhhhh", "hhhhh"], ["Y", "11", "8", "2004", "1:00 AM", "12:59 PM", "vbvbvn", "vbvbvn"], ["Y", "10", "22", "2008", "1:00 AM", "12:59 PM", "uuuuuu", "uuuuuu"], ["Y", "10", "8", "2008", "1:00 AM", "12:59 PM", "llkuiiu", "llkuiiu"], ["Y", "12", "22", "2008", "1:00 AM", "12:59 PM", "ghjhj", "ghjhj"], ["Y", "12", "8", "2008", "1:00 AM", "12:59 PM", "awee", "awee"], ["Y", "11", "23", "2008", "1:00 AM", "12:59 PM", "ewewqwewwew", "ewewqwewwew"], ["Y", "1", "1", "2006", "1:00 AM", "12:00 PM", "New Year's Day", "New Year's Day will be ushered in with great joy and celebration. Come as you are."], ["F", "1", "3", "2", "1:00 AM", "12:59 PM", "Martin Luther King Day", "Honors civil rights leader Rev Martin Luther King."], ["Y", "2", "2", "2008", "1:00 AM", "12:59 PM", "Groundhog Day", "If Philadelphia's groundhog 'Punxsutawney Phil' sees his shadow, there will be six more weeks of winter weather. If he does not see his shadow, there will be an early spring."], ["Y", "2", "14", "2005", "1:00 AM", "12:59 PM", "Valentine's Day", "Traditional celebration of love and romance, including the exchange of cards, candy, flowers, and other gifts."], ["F", "2", "3", "2", "1:00 AM", "12:59 PM", "President's Day", "Honors the birthdays of George Washington, Abraham Lincoln and other past American Presidents."], ["F", "3", "0", "0", "1:00 AM", "12:59 PM", "Easter", "Traditional celebration of the resurrection of Jesus Christ."], ["Y", "3", "17", "2005", "1:00 AM", "12:59 PM", "St. Patrick's Day", "A celebration of Irish heritage and culture, based on the Catholic feast of St. Patrick. Primary activity is simply the wearing of green clothing ('wearing of the green')."], ["Y", "3", "22", "2005", "1:00 AM", "12:59 PM", "World Water Day", "A day to promote appreciation of the world's most valuable commodity - water."], ["Y", "4", "1", "2005", "1:00 AM", "12:59 PM", "April Fool's Day", "A day to play tricks on or 'fool' family, friends, and coworkers, if so inclined. As Ecclesiastes says: 'There is a time for everything'; in this case, a time to be silly."], ["F", "5", "2", "1", "1:00 AM", "12:59 PM", "Mother's Day", "Honors mothers and motherhood (made a Federal Holiday by Presidential order)."], ["F", "5", "3", "7", "1:00 AM", "12:59 PM", "Armed Forces Day", "Celebrates the United States Army, Navy, Air Force and Marine Corps; formerly - each used to have separate days."], ["F", "5", "4", "2", "1:00 AM", "12:59 PM", "Memorial Day", "Honors the nation's war dead, and those we love who have passed away. Traditionally a time to decorate graves and remember those who have gone before us. Also marks traditional beginning of summer."], ["Y", "6", "14", "2005", "1:00 AM", "12:59 PM", "Flag Day", "Honors the American flag, encourages patriotism. Citizens are urged to fly the flag and study its traditions."], ["F", "6", "3", "1", "1:00 AM", "12:59 PM", "Father's Day", "Honors all Fathers and fatherhood."], ["Y", "7", "4", "2005", "1:00 AM", "12:59 PM", "Independence Day", "Celebrates our Declaration of Independence from England in 1776, usually called the Fourth of July."], ["F", "9", "1", "2", "1:00 AM", "12:59 PM", "Labor Day", "Celebrates the achievements of workers, giving them a day of rest - marks traditional end of summer."], ["F", "10", "2", "2", "1:00 AM", "12:59 PM", "Columbus' Day", "Honors the traditional discovery of the Americas by Christopher Columbus."], ["Y", "10", "31", "2005", "1:00 AM", "12:59 PM", "Halloween", "Celebrates All Hallow's Eve, decorations include jack o'lanterns, costume wearing parties, and candy - considered a pagan holiday by many Christians."], ["Y", "11", "11", "2005", "1:00 AM", "12:59 PM", "Veteran's Day", "Honors all veterans of the United States armed forces. A traditional observation is a moment of silence at 11 AM remembering those who fought for peace."], ["F", "11", "4", "5", "1:00 AM", "12:59 PM", "Thanksgiving", "A day to give thanks for your many blessings - traditionally for the Autumn harvest, and it marks the beginning of the 'holiday season'."], ["Y", "12", "25", "2009", "1:00 AM", "12:59 PM", "Christmas", "Celebration of the traditional day of Jesus' birth - God was made flesh and dwelt among us."] // Please omit the final comma after the ] from the last line above unless you are going to add another event at this time. ); function events1(event8) { return event8; } function prod(date1,date2) { x=date1; this.date2=date2; this.date1=date1; return x; } var events2=prod("hi","11"); var house1=new prod("hello","11"); document.write(daycounter); function changedate(buttonpressed) { if (buttonpressed == "prevyr") yearNum--; else if (buttonpressed == "nextyr") yearNum++; else if (buttonpressed == "prevmo") monthNum--; else if (buttonpressed == "nextmo") monthNum++; else if (buttonpressed == "nextmo1") { monthNum=document.getElementById("select3"); } else if (buttonpressed == "return") { monthNum = todaysMonth; yearNum = todaysYear; } if (monthNum == 0) { monthNum = 12; yearNum--; } else if (monthNum == 13) { monthNum = 1; yearNum++ } lastDate = new Date(String(monthNum+1)+"/0/"+String(yearNum)); numbDays = lastDate.getDate(); firstDate = new Date(String(monthNum)+"/1/"+String(yearNum)); firstDay = firstDate.getDay() + 1; createCalendar(); return; } function easter(year) { // feed in the year it returns the month and day of Easter using two GLOBAL variables: eastermonth and easterday var a = year % 19; var b = Math.floor(year/100); var c = year % 100; var d = Math.floor(b/4); var e = b % 4; var f = Math.floor((b+ / 25); var g = Math.floor((b-f+1) / 3); var h = (19*a + b - d - g + 15) % 30; var i = Math.floor(c/4); var j = c % 4; var k = (32 + 2*e + 2*i - h - j) % 7; var m = Math.floor((a + 11*h + 22*k) / 451); var month = Math.floor((h + k - 7*m + 114) / 31); var day = ((h + k - 7*m +114) % 31) + 1; eastermonth = month; easterday = day; } function createCalendar() { calendarString = ''; var daycounter = 0; calendarString +='<tr>'; calendarString +='<td class=\"tdpad\" colspan=\"2\">'; calendarString +='<table width=\"741\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">'; calendarString +='<tr>'; calendarString +='<td height=\"20\" colspan=\"4\" valign=\"top\"><a class=\"breadlink\" href=\"#\">Home</a> - Calender of Events</td>'; calendarString +='</tr>'; calendarString +='<tr>'; calendarString +='<td width=\"21%\" height=\"30\"><font class=\"calender\">'+ wordMonth[monthNum-1]+ yearNum+'</font></td>'; calendarString +='<td colspan=\"3\" align=\"right\">'; calendarString +='<input class=\"btn2\" type=\"submit\" name=\"Submit\" value=\"Import Events\" />'; calendarString +='<input class=\"btn2\" type=\"submit\" name=\"Submit2\" value=\"Open Window\" />'; calendarString +='</td>'; calendarString +='</tr>'; calendarString +='<tr>'; calendarString +='<td height=\"30\"><a href=\"#\" class=\"etext\">Month</a> - <a href=\"#\" class=\"etext\">Week</a> - <a href=\"#\" class=\"etext\">Day</a></td>'; calendarString +='<td width=\"47%\" align=\"center\">'; calendarString +='<a class=\"etext\" href=\"#\" onClick=\"changedate(\'prevmo\')\"><<< Previous</a>'; calendarString +='<select name=\"select3\" id=\"select3\" onChange=\"changedate(\'nextmo1\')\">'; calendarString +='<option value='+ wordMonth[monthNum-1]+'>'+ wordMonth[monthNum-1]+'</option>'; calendarString +='<option value='+ wordMonth[monthNum-2]+'>'+ wordMonth[monthNum-2]+'</option>'; calendarString +='<option value='+ wordMonth[monthNum-3]+'>'+ wordMonth[monthNum-3]+'</option>'; calendarString +='<option value='+ wordMonth[monthNum-4]+'>'+ wordMonth[monthNum-4]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-5]+'>'+ wordMonth[monthNum-5]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-6]+'>'+ wordMonth[monthNum-6]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-7]+'>'+ wordMonth[monthNum-7]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-8]+'>'+ wordMonth[monthNum-8]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-9]+'>'+ wordMonth[monthNum-9]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-10]+'>'+ wordMonth[monthNum-10]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-11]+'>'+ wordMonth[monthNum-11]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum]+'>'+ wordMonth[monthNum]+'</option>'; calendarString +='</select>'; calendarString +='<select name=\"select4\">'; calendarString +='<option>'+ yearNum+'</option>'; calendarString +='</select>'; calendarString +='<a class=\"etext\" href=\"#\" onClick=\"changedate(\'nextyr\')\">Next >>></a>'; calendarString +='</td>'; calendarString +='<td width=\"27%\">'; calendarString +='<a href=\"#\" class=\"etext\">Login</a> - <a href=\"#\" class=\"etext\">Search</a>'; calendarString +='<select name=\"select\">'; calendarString +='<option>Hi-Radar Events</option>'; calendarString +='</select>'; calendarString +='</td>'; calendarString +='<td>'; calendarString +='<input name=\"image\" type=\"image\" value=\"Submit\" src=\"images/search.gif\" />'; calendarString +='</td>'; calendarString +='</tr>'; calendarString +='</table>'; calendarString +='</td>'; calendarString += '</tr>'; calendarString += '<tr>'; calendarString += '<td style=\"padding-right:12px;\" height=\"26\" align=\"right\" ><a class=\"elink\" href=\"#\">View Open-Win</a> - <a class=\"elink\" href=\"#\">Manage Open-Win</a> - <a class=\"elink\" href=\"#\">Browse Open-Win</a> - <a class=\"elink\" href=\"#\">View My Bookmark</a></td>'; calendarString +='</tr>'; calendarString += '<table width="741" height="630" border="0" cellpadding="0" cellspacing="1">'; calendarString += '<tr>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Sunday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Monday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Tuesday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Wednesday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Thursday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Friday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Saturday</td>'; calendarString += '</tr>'; thisDate == 1; for (var i = 1; i <= 6; i++) { calendarString += '<tr>'; for (var x = 1; x <= 7; x++) { daycounter = (thisDate - firstDay)+1; thisDate++; if ((daycounter > numbDays) || (daycounter < 1)) { calendarString += '<td align=\"center\" bgcolor=\"#F2F8ED\" width=\"106\"> <\/td>'; } else { if (checkevents(daycounter,monthNum,yearNum,i,x) || ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum))){ if ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum)) { calendarString += '<td align=\"center\" bgcolor=\"#F2F8ED\" width=\"106\">&nbsp</td>'; } else{ var showevent=showevents(daycounter,monthNum,yearNum,"i","x"); calendarString += '<td align=\"center\" bgcolor=\"#F2F8ED\" width=\"106\">'+ showevent + daycounter + '<\/td>'; var showevent=showevents(daycounter,monthNum,yearNum,"i","x"); } } else { calendarString += '<td align=\"center\" bgcolor=\"#F2F8ED\" width=\"106\">' + daycounter + '<\/td>'; } } } calendarString += '<\/tr>'; } '<\/table>'; var object=document.getElementById('calendar'); object.innerHTML= calendarString; thisDate = 1; } function checkevents(day,month,year,week,dayofweek) { var numevents = 0; var floater = 0; for (var i = 0; i < events.length; i++) { document.write(events[0][0]); if (events[0][0] == "W") { if ((events[0][2] == dayofweek)) numevents++; } else if (events[0][0] == "Y") { if ((events[0][2] == day) && (events[0][1] == month) && (events[0][3] == year) ) numevents++; } else if (events[0][0] == "F") { if ((events[0][1] == 3) && (events[0][2] == 0) && (events[0][3] == 0) ) { easter(year); if (easterday == day && eastermonth == month) numevents++; } else { floater = floatingholiday(year,events[1],events[2],events[3]); if ((month == 5) && (events[1] == 5) && (events[2] == 4) && (events[3] == 2)) { if ((floater + 7 <= 31) && (day == floater + 7)) { numevents++; } else if ((floater + 7 > 31) && (day == floater)) numevents++; } else if ((events[0][1] == month) && (floater == day)) numevents++; } } else if ((events[0][2] == day) && (events[0][1] == month) && (events[0][3] == year)) { numevents++; } } if (numevents == 0) { return false; } else { return true; } } function showevents(day,month,year,week,dayofweek) { var theevent = ""; var floater = 0; var eventhan="ww"; for (var i = 0; i < events.length; i++) { if (events[0] != "") { // First we'll process recurring events (if any): if (events[0] == "Y") { if ((events[2]==day) && (events[1] == month) && (events[3] == year) ) { theevent += events[6] + '\n'; theevent += '\n -------------- \n\n'; return theevent; } } } } } function floatingholiday(targetyr,targetmo,cardinaloccurrence,targetday) { // Floating holidays/events of the events.js file uses: // the Month field for the Month (here it becomes the targetmo field) // the Day field as the Cardinal Occurrence (here it becomes the cardinaloccurrence field) // 1=1st, 2=2nd, 3=3rd, 4=4th, 5=5th, 6=6th occurrence of the day listed next // the Year field as the Day of the week the event/holiday falls on (here it becomes the targetday field) // 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday // example: "F", "1", "3", "2", = Floating holiday in January on the 3rd Monday of that month. // // In our code below: // targetyr is the active year // targetmo is the active month (1-12) // cardinaloccurrence is the xth occurrence of the targetday (1-6) // targetday is the day of the week the floating holiday is on // 0=Sun; 1=Mon; 2=Tue; 3=Wed; 4=Thu; 5=Fri; 6=Sat // Note: subtract 1 from the targetday field if the info comes from the events.js file // // Note: // If Memorial Day falls on the 22nd, 23rd, or 24th, then we add 7 to the dayofmonth to the result. // // Example: targetyr = 2052; targetmo = 5; cardinaloccurrence = 4; targetday = 1 // This is the same as saying our floating holiday in the year 2052, is during May, on the 4th Monday // var firstdate = new Date(String(targetmo)+"/1/"+String(targetyr)); // Object Storing the first day of the current month. var firstday = firstdate.getUTCDay(); // The first day (0-6) of the target month. var dayofmonth = 0; // zero out our calendar day variable. targetday = targetday - 1; if (targetday >= firstday) { cardinaloccurrence--; // Subtract 1 from cardinal day. dayofmonth = (cardinaloccurrence * 7) + ((targetday - firstday)+1); } else { dayofmonth = (cardinaloccurrence * 7) + ((targetday - firstday)+1); } return dayofmonth; } </script> </head> <body class="homebg" onload="changedate('return')"> <%@ include file="includes/header.jsp" %> <table width="781" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="intab" align="left" valign="top"><table width="765" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="tdpad2" align="left" valign="top"> <center> <table id="evtcal" border="0" cellpadding="0" cellspacing="0" width="584"> <tbody> <tr> <td style="padding: 3px;" align="center" bgcolor="#FFFFFF" valign="top" width="314"> <div id="calendar"><!-- Dynamically Filled --></div> </td> <td width="10"> </td> </tr> </tbody> </table> </center> </td> </tr> </table></td> </tr> </table> <%@ include file="includes/footer.jsp" %> </body> </html> [/javascript] Anybody could you plz advice what changes i have to make
  2. hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i have to made in my code [javascript] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>sayhi</title> <link href="stylesheet.css" rel="stylesheet" type="text/css" /> <script language="JavaScript" type="text/javascript" src="events.js"></script> <script type="text/JavaScript" language="JavaScript"> var thisDate = 1; // Tracks current date being written in calendar var wordMonth = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var today = new Date(); // Date object to store the current date var todaysDay = today.getDay() + 1; // Stores the current day number 1-7 var todaysDate = today.getDate(); // Stores the current numeric date within the month var todaysMonth = today.getUTCMonth() + 1; // Stores the current month 1-12 var todaysYear = today.getFullYear(); // Stores the current year var monthNum = todaysMonth; // Tracks the current month being displayed var yearNum = todaysYear; // Tracks the current year being displayed var firstDate = new Date(String(monthNum)+"/1/"+String(yearNum)); // Object Storing the first day of the current month var firstDay = firstDate.getUTCDay(); // Tracks the day number 1-7 of the first day of the current month var lastDate = new Date(String(monthNum+1)+"/0/"+String(yearNum)); // Tracks the last date of the current month var numbDays = 0; var calendarString = ""; var eastermonth = 0; var easterday = 0; var date =0; var event8=""; var events1="hello"; events = new Array( ["Y", "11", "8", "2008", "1:00 AM", "12:59 PM", "beautiful day", "aweewwewweeweweww"], ["Y", "11", "22", "2008", "1:00 AM", "12:59 PM", "beautiful days", "wewewewewewqwewwew"], ["Y", "11", "8", "2008", "1:00 AM", "12:59 PM", "rrrrrrr", "rrrrrrr"], ["Y", "11", "22", "2006", "1:00 AM", "12:59 PM", "wwwwww", "wwwwww"], ["Y", "11", "8", "2006", "1:00 AM", "12:59 PM", "avvvvvvvvv", "avvvvvvvvv"], ["Y", "11", "22", "2005", "1:00 AM", "12:59 PM", "ssssssssss", "ssssssssss"], ["Y", "11", "8", "2005", "1:00 AM", "12:59 PM", "zzzzzzzzz", "zzzzzzzzz"], ["Y", "11", "22", "2009", "1:00 AM", "12:59 PM", "ddddddd", "ddddddd"], ["Y", "11", "8", "2009", "1:00 AM", "12:59 PM", "hhhhhhhh", "hhhhhhhh"], ["Y", "11", "22", "2010", "1:00 AM", "12:59 PM", "vvvvvvv", "vvvvvvv"], ["Y", "11", "8", "2010", "1:00 AM", "12:59 PM", "bbbbbbbb", "bbbbbbbb"], ["Y", "10", "1", "2011", "1:00 AM", "12:59 PM", "kkkkkkk", "kkkkkkk"], ["Y", "10", "2", "2011", "1:00 AM", "12:59 PM", "xxxxxxxxxx", "xxxxxxxxxx"], ["Y", "9", "9", "2007", "1:00 AM", "12:59 PM", "vvvvvvvvvv", "vvvvvvvvvv"], ["Y", "9", "8", "2007", "1:00 AM", "12:59 PM", "ccccccccccc", "ccccccccccc"], ["Y", "11", "2", "2006", "1:00 AM", "12:59 PM", "wbbbbbbbbbb", "wbbbbbbbbbb"], ["Y", "11", "3", "2006", "1:00 AM", "12:59 PM", "nnnnnnnnnnnnnn", "nnnnnnnnnnnnnn"], ["Y", "11", "22", "2005", "1:00 AM", "12:59 PM", "jjjjjjjjjj", "jjjjjjjjjj"], ["Y", "11", "8", "2005", "1:00 AM", "12:59 PM", "oooooo", "oooooo"], ["Y", "11", "22", "2004", "1:00 AM", "12:59 PM", "hhhhh", "hhhhh"], ["Y", "11", "8", "2004", "1:00 AM", "12:59 PM", "vbvbvn", "vbvbvn"], ["Y", "10", "22", "2008", "1:00 AM", "12:59 PM", "uuuuuu", "uuuuuu"], ["Y", "10", "8", "2008", "1:00 AM", "12:59 PM", "llkuiiu", "llkuiiu"], ["Y", "12", "22", "2008", "1:00 AM", "12:59 PM", "ghjhj", "ghjhj"], ["Y", "12", "8", "2008", "1:00 AM", "12:59 PM", "awee", "awee"], ["Y", "11", "23", "2008", "1:00 AM", "12:59 PM", "ewewqwewwew", "ewewqwewwew"], ["Y", "1", "1", "2006", "1:00 AM", "12:00 PM", "New Year's Day", "New Year's Day will be ushered in with great joy and celebration. Come as you are."], ["F", "1", "3", "2", "1:00 AM", "12:59 PM", "Martin Luther King Day", "Honors civil rights leader Rev Martin Luther King."], ["Y", "2", "2", "2008", "1:00 AM", "12:59 PM", "Groundhog Day", "If Philadelphia's groundhog 'Punxsutawney Phil' sees his shadow, there will be six more weeks of winter weather. If he does not see his shadow, there will be an early spring."], ["Y", "2", "14", "2005", "1:00 AM", "12:59 PM", "Valentine's Day", "Traditional celebration of love and romance, including the exchange of cards, candy, flowers, and other gifts."], ["F", "2", "3", "2", "1:00 AM", "12:59 PM", "President's Day", "Honors the birthdays of George Washington, Abraham Lincoln and other past American Presidents."], ["F", "3", "0", "0", "1:00 AM", "12:59 PM", "Easter", "Traditional celebration of the resurrection of Jesus Christ."], ["Y", "3", "17", "2005", "1:00 AM", "12:59 PM", "St. Patrick's Day", "A celebration of Irish heritage and culture, based on the Catholic feast of St. Patrick. Primary activity is simply the wearing of green clothing ('wearing of the green')."], ["Y", "3", "22", "2005", "1:00 AM", "12:59 PM", "World Water Day", "A day to promote appreciation of the world's most valuable commodity - water."], ["Y", "4", "1", "2005", "1:00 AM", "12:59 PM", "April Fool's Day", "A day to play tricks on or 'fool' family, friends, and coworkers, if so inclined. As Ecclesiastes says: 'There is a time for everything'; in this case, a time to be silly."], ["F", "5", "2", "1", "1:00 AM", "12:59 PM", "Mother's Day", "Honors mothers and motherhood (made a Federal Holiday by Presidential order)."], ["F", "5", "3", "7", "1:00 AM", "12:59 PM", "Armed Forces Day", "Celebrates the United States Army, Navy, Air Force and Marine Corps; formerly - each used to have separate days."], ["F", "5", "4", "2", "1:00 AM", "12:59 PM", "Memorial Day", "Honors the nation's war dead, and those we love who have passed away. Traditionally a time to decorate graves and remember those who have gone before us. Also marks traditional beginning of summer."], ["Y", "6", "14", "2005", "1:00 AM", "12:59 PM", "Flag Day", "Honors the American flag, encourages patriotism. Citizens are urged to fly the flag and study its traditions."], ["F", "6", "3", "1", "1:00 AM", "12:59 PM", "Father's Day", "Honors all Fathers and fatherhood."], ["Y", "7", "4", "2005", "1:00 AM", "12:59 PM", "Independence Day", "Celebrates our Declaration of Independence from England in 1776, usually called the Fourth of July."], ["F", "9", "1", "2", "1:00 AM", "12:59 PM", "Labor Day", "Celebrates the achievements of workers, giving them a day of rest - marks traditional end of summer."], ["F", "10", "2", "2", "1:00 AM", "12:59 PM", "Columbus' Day", "Honors the traditional discovery of the Americas by Christopher Columbus."], ["Y", "10", "31", "2005", "1:00 AM", "12:59 PM", "Halloween", "Celebrates All Hallow's Eve, decorations include jack o'lanterns, costume wearing parties, and candy - considered a pagan holiday by many Christians."], ["Y", "11", "11", "2005", "1:00 AM", "12:59 PM", "Veteran's Day", "Honors all veterans of the United States armed forces. A traditional observation is a moment of silence at 11 AM remembering those who fought for peace."], ["F", "11", "4", "5", "1:00 AM", "12:59 PM", "Thanksgiving", "A day to give thanks for your many blessings - traditionally for the Autumn harvest, and it marks the beginning of the 'holiday season'."], ["Y", "12", "25", "2009", "1:00 AM", "12:59 PM", "Christmas", "Celebration of the traditional day of Jesus' birth - God was made flesh and dwelt among us."] // Please omit the final comma after the ] from the last line above unless you are going to add another event at this time. ); function events1(event8) { return event8; } function prod(date1,date2) { x=date1; this.date2=date2; this.date1=date1; return x; } var events2=prod("hi","11"); var house1=new prod("hello","11"); document.write(daycounter); function changedate(buttonpressed) { if (buttonpressed == "prevyr") yearNum--; else if (buttonpressed == "nextyr") yearNum++; else if (buttonpressed == "prevmo") monthNum--; else if (buttonpressed == "nextmo") monthNum++; else if (buttonpressed == "nextmo1") { monthNum=document.getElementById("select3"); } else if (buttonpressed == "return") { monthNum = todaysMonth; yearNum = todaysYear; } if (monthNum == 0) { monthNum = 12; yearNum--; } else if (monthNum == 13) { monthNum = 1; yearNum++ } lastDate = new Date(String(monthNum+1)+"/0/"+String(yearNum)); numbDays = lastDate.getDate(); firstDate = new Date(String(monthNum)+"/1/"+String(yearNum)); firstDay = firstDate.getDay() + 1; createCalendar(); return; } function easter(year) { // feed in the year it returns the month and day of Easter using two GLOBAL variables: eastermonth and easterday var a = year % 19; var b = Math.floor(year/100); var c = year % 100; var d = Math.floor(b/4); var e = b % 4; var f = Math.floor((b+ / 25); var g = Math.floor((b-f+1) / 3); var h = (19*a + b - d - g + 15) % 30; var i = Math.floor(c/4); var j = c % 4; var k = (32 + 2*e + 2*i - h - j) % 7; var m = Math.floor((a + 11*h + 22*k) / 451); var month = Math.floor((h + k - 7*m + 114) / 31); var day = ((h + k - 7*m +114) % 31) + 1; eastermonth = month; easterday = day; } function createCalendar() { calendarString = ''; var daycounter = 0; calendarString +='<tr>'; calendarString +='<td class=\"tdpad\" colspan=\"2\">'; calendarString +='<table width=\"741\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">'; calendarString +='<tr>'; calendarString +='<td height=\"20\" colspan=\"4\" valign=\"top\"><a class=\"breadlink\" href=\"#\">Home</a> - Calender of Events</td>'; calendarString +='</tr>'; calendarString +='<tr>'; calendarString +='<td width=\"21%\" height=\"30\"><font class=\"calender\">'+ wordMonth[monthNum-1]+ yearNum+'</font></td>'; calendarString +='<td colspan=\"3\" align=\"right\">'; calendarString +='<input class=\"btn2\" type=\"submit\" name=\"Submit\" value=\"Import Events\" />'; calendarString +='<input class=\"btn2\" type=\"submit\" name=\"Submit2\" value=\"Open Window\" />'; calendarString +='</td>'; calendarString +='</tr>'; calendarString +='<tr>'; calendarString +='<td height=\"30\"><a href=\"#\" class=\"etext\">Month</a> - <a href=\"#\" class=\"etext\">Week</a> - <a href=\"#\" class=\"etext\">Day</a></td>'; calendarString +='<td width=\"47%\" align=\"center\">'; calendarString +='<a class=\"etext\" href=\"#\" onClick=\"changedate(\'prevmo\')\"><<< Previous</a>'; calendarString +='<select name=\"select3\" id=\"select3\" onChange=\"changedate(\'nextmo1\')\">'; calendarString +='<option value='+ wordMonth[monthNum-1]+'>'+ wordMonth[monthNum-1]+'</option>'; calendarString +='<option value='+ wordMonth[monthNum-2]+'>'+ wordMonth[monthNum-2]+'</option>'; calendarString +='<option value='+ wordMonth[monthNum-3]+'>'+ wordMonth[monthNum-3]+'</option>'; calendarString +='<option value='+ wordMonth[monthNum-4]+'>'+ wordMonth[monthNum-4]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-5]+'>'+ wordMonth[monthNum-5]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-6]+'>'+ wordMonth[monthNum-6]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-7]+'>'+ wordMonth[monthNum-7]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-8]+'>'+ wordMonth[monthNum-8]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-9]+'>'+ wordMonth[monthNum-9]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-10]+'>'+ wordMonth[monthNum-10]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum-11]+'>'+ wordMonth[monthNum-11]+'</option>'; calendarString +='<option name='+ wordMonth[monthNum]+'>'+ wordMonth[monthNum]+'</option>'; calendarString +='</select>'; calendarString +='<select name=\"select4\">'; calendarString +='<option>'+ yearNum+'</option>'; calendarString +='</select>'; calendarString +='<a class=\"etext\" href=\"#\" onClick=\"changedate(\'nextyr\')\">Next >>></a>'; calendarString +='</td>'; calendarString +='<td width=\"27%\">'; calendarString +='<a href=\"#\" class=\"etext\">Login</a> - <a href=\"#\" class=\"etext\">Search</a>'; calendarString +='<select name=\"select\">'; calendarString +='<option>Hi-Radar Events</option>'; calendarString +='</select>'; calendarString +='</td>'; calendarString +='<td>'; calendarString +='<input name=\"image\" type=\"image\" value=\"Submit\" src=\"images/search.gif\" />'; calendarString +='</td>'; calendarString +='</tr>'; calendarString +='</table>'; calendarString +='</td>'; calendarString += '</tr>'; calendarString += '<tr>'; calendarString += '<td style=\"padding-right:12px;\" height=\"26\" align=\"right\" ><a class=\"elink\" href=\"#\">View Open-Win</a> - <a class=\"elink\" href=\"#\">Manage Open-Win</a> - <a class=\"elink\" href=\"#\">Browse Open-Win</a> - <a class=\"elink\" href=\"#\">View My Bookmark</a></td>'; calendarString +='</tr>'; calendarString += '<table width="741" height="630" border="0" cellpadding="0" cellspacing="1">'; calendarString += '<tr>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Sunday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Monday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Tuesday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Wednesday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Thursday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Friday</td>'; calendarString += '<td width=\"106\" height=\"26\" align=\"center\" bgcolor=\"#4F7637\" class=\"font\">Saturday</td>'; calendarString += '</tr>'; thisDate == 1; for (var i = 1; i <= 6; i++) { calendarString += '<tr>'; for (var x = 1; x <= 7; x++) { daycounter = (thisDate - firstDay)+1; thisDate++; if ((daycounter > numbDays) || (daycounter < 1)) { calendarString += '<td align=\"center\" bgcolor=\"#F2F8ED\" width=\"106\"> <\/td>'; } else { if (checkevents(daycounter,monthNum,yearNum,i,x) || ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum))){ if ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum)) { calendarString += '<td align=\"center\" bgcolor=\"#F2F8ED\" width=\"106\">&nbsp</td>'; } else{ var showevent=showevents(daycounter,monthNum,yearNum,"i","x"); calendarString += '<td align=\"center\" bgcolor=\"#F2F8ED\" width=\"106\">'+ showevent + daycounter + '<\/td>'; var showevent=showevents(daycounter,monthNum,yearNum,"i","x"); } } else { calendarString += '<td align=\"center\" bgcolor=\"#F2F8ED\" width=\"106\">' + daycounter + '<\/td>'; } } } calendarString += '<\/tr>'; } '<\/table>'; var object=document.getElementById('calendar'); object.innerHTML= calendarString; thisDate = 1; } function checkevents(day,month,year,week,dayofweek) { var numevents = 0; var floater = 0; for (var i = 0; i < events.length; i++) { if (events[0][0] == "W") { if ((events[0][2] == dayofweek)) numevents++; } else if (events[0][0] == "Y") { if ((events[0][2] == day) && (events[0][1] == month) && (events[0][3] == year) ) numevents++; } else if (events[0][0] == "F") { if ((events[0][1] == 3) && (events[0][2] == 0) && (events[0][3] == 0) ) { easter(year); if (easterday == day && eastermonth == month) numevents++; } else { floater = floatingholiday(year,events[1],events[2],events[3]); if ((month == 5) && (events[1] == 5) && (events[2] == 4) && (events[3] == 2)) { if ((floater + 7 <= 31) && (day == floater + 7)) { numevents++; } else if ((floater + 7 > 31) && (day == floater)) numevents++; } else if ((events[0][1] == month) && (floater == day)) numevents++; } } else if ((events[0][2] == day) && (events[0][1] == month) && (events[0][3] == year)) { numevents++; } } if (numevents == 0) { return false; } else { return true; } } function showevents(day,month,year,week,dayofweek) { var theevent = ""; var floater = 0; var eventhan="ww"; for (var i = 0; i < events.length; i++) { if (events[0] != "") { // First we'll process recurring events (if any): if (events[0] == "Y") { if ((events[2]==day) && (events[1] == month) && (events[3] == year) ) { theevent += events[6] + '\n'; theevent += '\n -------------- \n\n'; return theevent; } } } } } function floatingholiday(targetyr,targetmo,cardinaloccurrence,targetday) { // Floating holidays/events of the events.js file uses: // the Month field for the Month (here it becomes the targetmo field) // the Day field as the Cardinal Occurrence (here it becomes the cardinaloccurrence field) // 1=1st, 2=2nd, 3=3rd, 4=4th, 5=5th, 6=6th occurrence of the day listed next // the Year field as the Day of the week the event/holiday falls on (here it becomes the targetday field) // 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday // example: "F", "1", "3", "2", = Floating holiday in January on the 3rd Monday of that month. // // In our code below: // targetyr is the active year // targetmo is the active month (1-12) // cardinaloccurrence is the xth occurrence of the targetday (1-6) // targetday is the day of the week the floating holiday is on // 0=Sun; 1=Mon; 2=Tue; 3=Wed; 4=Thu; 5=Fri; 6=Sat // Note: subtract 1 from the targetday field if the info comes from the events.js file // // Note: // If Memorial Day falls on the 22nd, 23rd, or 24th, then we add 7 to the dayofmonth to the result. // // Example: targetyr = 2052; targetmo = 5; cardinaloccurrence = 4; targetday = 1 // This is the same as saying our floating holiday in the year 2052, is during May, on the 4th Monday // var firstdate = new Date(String(targetmo)+"/1/"+String(targetyr)); // Object Storing the first day of the current month. var firstday = firstdate.getUTCDay(); // The first day (0-6) of the target month. var dayofmonth = 0; // zero out our calendar day variable. targetday = targetday - 1; if (targetday >= firstday) { cardinaloccurrence--; // Subtract 1 from cardinal day. dayofmonth = (cardinaloccurrence * 7) + ((targetday - firstday)+1); } else { dayofmonth = (cardinaloccurrence * 7) + ((targetday - firstday)+1); } return dayofmonth; } </script> </head> <body class="homebg" onload="changedate('return')"> <%@ include file="includes/header.jsp" %> <table width="781" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="intab" align="left" valign="top"><table width="765" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="tdpad2" align="left" valign="top"> <center> <table id="evtcal" border="0" cellpadding="0" cellspacing="0" width="584"> <tbody> <tr> <td style="padding: 3px;" align="center" bgcolor="#FFFFFF" valign="top" width="314"> <div id="calendar"><!-- Dynamically Filled --></div> </td> <td width="10"> </td> </tr> </tbody> </table> </center> </td> </tr> </table></td> </tr> </table> <%@ include file="includes/footer.jsp" %> </body> </html> [/javascript] i want the daily,weekly calendar .plz suggest how i made changes into that code.
  3. Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to modify my code. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Calendar of Events</title> <style type="text/css"> #evtcal a:link {font: normal 12pt "Arial", "Helvetica", "Sans Serif"; color: #004400; text-decoration: none;} /* unvisited link */ #evtcal a:visited {font: normal 12pt "Arial", "Helvetica", "Sans Serif"; color: #004400; text-decoration: none;} /* visited link */ #evtcal a:hover {font: normal 12pt "Arial", "Helvetica", "Sans Serif"; color: #004400; text-decoration: underline;} /* mouse over link */ #evtcal a:active {font: normal 12pt "Arial", "Helvetica", "Sans Serif"; color: #004400; text-decoration: none;} /* selected link */ </style> <script language="JavaScript" type="text/javascript" src="events.js"></script> <script type="text/JavaScript" language="JavaScript"> /* Preload images script */ var myimages=new Array() function preloadimages(){ for (i=0;i<preloadimages.arguments.length;i++){ myimages=new Image(); myimages.src=preloadimages.arguments; } } /* The path of images to be preloaded inside parenthesis: (Extend list as desired.) */ preloadimages("images/PrevYrOff40x40.jpg","images/PrevYrOn40x40.jpg","images/PrevMoOff40x40.jpg","images/PrevMoOn40x40.jpg","images/NextYrOff40x40.jpg","images/NextYrOn40x40.jpg","images/NextMoOff40x40.jpg","images/NextMoOn40x40.jpg"); /*************************************************************************************** JavaScript Calendar - Digital Christian Design //Script featured on and available at JavaScript Kit: http://www.javascriptkit.com // Functions changedate(): Moves to next or previous month or year, or current month depending on the button clicked. createCalendar(): Renders the calander into the page with links for each to fill the date form filds above. ***************************************************************************************/ var thisDate = 1; // Tracks current date being written in calendar var wordMonth = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var today = new Date(); // Date object to store the current date var todaysDay = today.getDay() + 1; // Stores the current day number 1-7 var todaysDate = today.getDate(); // Stores the current numeric date within the month var todaysMonth = today.getUTCMonth() + 1; // Stores the current month 1-12 var todaysYear = today.getFullYear(); // Stores the current year var monthNum = todaysMonth; // Tracks the current month being displayed var yearNum = todaysYear; // Tracks the current year being displayed var firstDate = new Date(String(monthNum)+"/1/"+String(yearNum)); // Object Storing the first day of the current month var firstDay = firstDate.getUTCDay(); // Tracks the day number 1-7 of the first day of the current month var lastDate = new Date(String(monthNum+1)+"/0/"+String(yearNum)); // Tracks the last date of the current month var numbDays = 0; var calendarString = ""; var eastermonth = 0; var easterday = 0; function changedate(buttonpressed) { if (buttonpressed == "prevyr") yearNum--; else if (buttonpressed == "nextyr") yearNum++; else if (buttonpressed == "prevmo") monthNum--; else if (buttonpressed == "nextmo") monthNum++; else if (buttonpressed == "return") { monthNum = todaysMonth; yearNum = todaysYear; } if (monthNum == 0) { monthNum = 12; yearNum--; } else if (monthNum == 13) { monthNum = 1; yearNum++ } lastDate = new Date(String(monthNum+1)+"/0/"+String(yearNum)); numbDays = lastDate.getDate(); firstDate = new Date(String(monthNum)+"/1/"+String(yearNum)); firstDay = firstDate.getDay() + 1; createCalendar(); return; } function easter(year) { // feed in the year it returns the month and day of Easter using two GLOBAL variables: eastermonth and easterday var a = year % 19; var b = Math.floor(year/100); var c = year % 100; var d = Math.floor(b/4); var e = b % 4; var f = Math.floor((b+ / 25); var g = Math.floor((b-f+1) / 3); var h = (19*a + b - d - g + 15) % 30; var i = Math.floor(c/4); var j = c % 4; var k = (32 + 2*e + 2*i - h - j) % 7; var m = Math.floor((a + 11*h + 22*k) / 451); var month = Math.floor((h + k - 7*m + 114) / 31); var day = ((h + k - 7*m +114) % 31) + 1; eastermonth = month; easterday = day; } function createCalendar() { calendarString = ''; var daycounter = 0; calendarString += '<table width="312" border="1" cellpadding="0" cellspacing="1">'; calendarString += '<tr>'; calendarString += '<td align=\"center\" valign=\"center\" width=\"40\" height=\"40\"><a href=\"#\" onMouseOver=\"document.PrevYr.src=\'images\/PrevYrOn40x40\.jpg\';\" onMouseOut=\"document.PrevYr.src=\'images\/PrevYrOff40x40\.jpg\';\" onClick=\"changedate(\'prevyr\')\"><img name=\"PrevYr\" src=\"images\/PrevYrOff40x40\.jpg\" width=\"40\" height=\"40\" border=\"0\" alt=\"Prev Yr\"\/><\/a><\/td>'; calendarString += '<td align=\"center\" valign=\"center\" width=\"40\" height=\"40\"><a href=\"#\" onMouseOver=\"document.PrevMo.src=\'images\/PrevMoOn40x40\.jpg\';\" onMouseOut=\"document.PrevMo.src=\'images\/PrevMoOff40x40\.jpg\';\" onClick=\"changedate(\'prevmo\')\"><img name=\"PrevMo\" src=\"images\/PrevMoOff40x40\.jpg\" width=\"40\" height=\"40\" border=\"0\" alt=\"Prev Mo\"\/><\/a><\/td>'; calendarString += '<td bgcolor=\"#C8C896\" align=\"center\" valign=\"center\" width=\"128\" height=\"40\" colspan=\"3\"><b>' + wordMonth[monthNum-1] + ' ' + yearNum + '<\/b><\/td>'; calendarString += '<td align=\"center\" valign=\"center\" width=\"40\" height=\"40\"><a href=\"#\" onMouseOver=\"document.NextMo.src=\'images\/NextMoOn40x40\.jpg\';\" onMouseOut=\"document.NextMo.src=\'images\/NextMoOff40x40\.jpg\';\" onClick=\"changedate(\'nextmo\')\"><img name=\"NextMo\" src=\"images\/NextMoOff40x40\.jpg\" width=\"40\" height=\"40\" border=\"0\" alt=\"Next Mo\"\/><\/a><\/td>'; calendarString += '<td align=\"center\" valign=\"center\" width=\"40\" height=\"40\"><a href=\"#\" onMouseOver=\"document.NextYr.src=\'images\/NextYrOn40x40\.jpg\';\" onMouseOut=\"document.NextYr.src=\'images\/NextYrOff40x40\.jpg\';\" onClick=\"changedate(\'nextyr\')\"><img name=\"NextYr\" src=\"images\/NextYrOff40x40\.jpg\" width=\"40\" height=\"40\" border=\"0\" alt=\"Next Yr\"\/><\/a><\/td>'; calendarString += '<\/tr>'; calendarString += '<tr>'; calendarString += '<td bgcolor=\"#DDDDDD\" align=\"center\" valign=\"center\" width=\"40\" height=\"22\">Sun<\/td>'; calendarString += '<td bgcolor=\"#DDDDDD\" align=\"center\" valign=\"center\" width=\"40\" height=\"22\">Mon<\/td>'; calendarString += '<td bgcolor=\"#DDDDDD\" align=\"center\" valign=\"center\" width=\"40\" height=\"22\">Tue<\/td>'; calendarString += '<td bgcolor=\"#DDDDDD\" align=\"center\" valign=\"center\" width=\"40\" height=\"22\">Wed<\/td>'; calendarString += '<td bgcolor=\"#DDDDDD\" align=\"center\" valign=\"center\" width=\"40\" height=\"22\">Thu<\/td>'; calendarString += '<td bgcolor=\"#DDDDDD\" align=\"center\" valign=\"center\" width=\"40\" height=\"22\">Fri<\/td>'; calendarString += '<td bgcolor=\"#DDDDDD\" align=\"center\" valign=\"center\" width=\"40\" height=\"22\">Sat<\/td>'; calendarString += '<\/tr>'; thisDate == 1; for (var i = 1; i <= 6; i++) { calendarString += '<tr>'; for (var x = 1; x <= 7; x++) { daycounter = (thisDate - firstDay)+1; thisDate++; if ((daycounter > numbDays) || (daycounter < 1)) { calendarString += '<td align=\"center\" bgcolor=\"#888888\" height=\"30\" width=\"40\"> <\/td>'; } else { if (checkevents(daycounter,monthNum,yearNum,i,x) || ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum))){ if ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum)) { calendarString += '<td align=\"center\" bgcolor=\"#AAFFAA\" height=\"30\" width=\"40\">hello<a href=\"javascript:showevents(' + daycounter + ',' + monthNum + ',' + yearNum + ',' + i + ',' + x + ')\">' + daycounter + '<\/a><\/td>'; } else calendarString += '<td align=\"center\" bgcolor=\"#FFFFC8\" height=\"30\" width=\"40\"><a href=\"javascript:showevents(' + daycounter + ',' + monthNum + ',' + yearNum + ',' + i + ',' + x + ')\">' + daycounter + '<\/a><\/td>'; } else { calendarString += '<td align=\"center\" bgcolor=\"#DDFFFF\" height=\"30\" width=\"40\">' + daycounter + '<\/td>'; } } } calendarString += '<\/tr>'; } calendarString += '<tr><td colspan=\"7\" nowrap align=\"center\" valign=\"center\" bgcolor=\"#C8C896\" width=\"280\" height=\"22\"><a href=\"javascript:changedate(\'return\')\"><b>Show Current Date<\/b><\/a><\/td><\/tr><\/table>'; var object=document.getElementById('calendar'); object.innerHTML= calendarString; thisDate = 1; } function checkevents(day,month,year,week,dayofweek) { var numevents = 0; var floater = 0; for (var i = 0; i < events.length; i++) { if (events[0] == "W") { if ((events[2] == dayofweek)) numevents++; } else if (events[0] == "Y") { if ((events[2] == day) && (events[1] == month)) numevents++; } else if (events[0] == "F") { if ((events[1] == 3) && (events[2] == 0) && (events[3] == 0) ) { easter(year); if (easterday == day && eastermonth == month) numevents++; } else { floater = floatingholiday(year,events[1],events[2],events[3]); if ((month == 5) && (events[1] == 5) && (events[2] == 4) && (events[3] == 2)) { if ((floater + 7 <= 31) && (day == floater + 7)) { numevents++; } else if ((floater + 7 > 31) && (day == floater)) numevents++; } else if ((events[1] == month) && (floater == day)) numevents++; } } else if ((events[2] == day) && (events[1] == month) && (events[3] == year)) { numevents++; } } if (numevents == 0) { return false; } else { return true; } } function showevents(day,month,year,week,dayofweek) { var theevent = ""; var floater = 0; for (var i = 0; i < events.length; i++) { // First we'll process recurring events (if any): if (events[0] != "") { if (events[0] == "D") { } if (events[0] == "W") { if ((events[2] == dayofweek)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[6] + '\n'; theevent += 'Start Time: ' + events[4] + '\n'; theevent += 'Ending Time: ' + events[5] + '\n'; theevent += 'Description: ' + events[7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } if (events[0] == "M") { } if (events[0] == "Y") { if ((events[2] == day) && (events[1] == month)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[6] + '\n'; theevent += 'Start Time: ' + events[4] + '\n'; theevent += 'Ending Time: ' + events[5] + '\n'; theevent += 'Description: ' + events[7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } if (events[0] == "F") { if ((events[1] == 3) && (events[2] == 0) && (events[3] == 0) ) { if (easterday == day && eastermonth == month) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[6] + '\n'; theevent += 'Start Time: ' + events[4] + '\n'; theevent += 'Ending Time: ' + events[5] + '\n'; theevent += 'Description: ' + events[7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } else { floater = floatingholiday(year,events[1],events[2],events[3]); if ((month == 5) && (events[1] == 5) && (events[2] == 4) && (events[3] == 2)) { if ((floater + 7 <= 31) && (day == floater + 7)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[6] + '\n'; theevent += 'Start Time: ' + events[4] + '\n'; theevent += 'Ending Time: ' + events[5] + '\n'; theevent += 'Description: ' + events[7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } else if ((floater + 7 > 31) && (day == floater)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[6] + '\n'; theevent += 'Start Time: ' + events[4] + '\n'; theevent += 'Ending Time: ' + events[5] + '\n'; theevent += 'Description: ' + events[7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } else if ((events[1] == month) && (floater == day)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[6] + '\n'; theevent += 'Start Time: ' + events[4] + '\n'; theevent += 'Ending Time: ' + events[5] + '\n'; theevent += 'Description: ' + events[7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } } } // Now we'll process any One Time events happening on the matching month, day, year: else if ((events[2] == day) && (events[1] == month) && (events[3] == year)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[6] + '\n'; theevent += 'Start Time: ' + events[4] + '\n'; theevent += 'Ending Time: ' + events[5] + '\n'; theevent += 'Description: ' + events[7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } if (theevent == "") document.forms.eventform.eventlist.value = 'No events to show.'; } function floatingholiday(targetyr,targetmo,cardinaloccurrence,targetday) { // Floating holidays/events of the events.js file uses: // the Month field for the Month (here it becomes the targetmo field) // the Day field as the Cardinal Occurrence (here it becomes the cardinaloccurrence field) // 1=1st, 2=2nd, 3=3rd, 4=4th, 5=5th, 6=6th occurrence of the day listed next // the Year field as the Day of the week the event/holiday falls on (here it becomes the targetday field) // 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday // example: "F", "1", "3", "2", = Floating holiday in January on the 3rd Monday of that month. // // In our code below: // targetyr is the active year // targetmo is the active month (1-12) // cardinaloccurrence is the xth occurrence of the targetday (1-6) // targetday is the day of the week the floating holiday is on // 0=Sun; 1=Mon; 2=Tue; 3=Wed; 4=Thu; 5=Fri; 6=Sat // Note: subtract 1 from the targetday field if the info comes from the events.js file // // Note: // If Memorial Day falls on the 22nd, 23rd, or 24th, then we add 7 to the dayofmonth to the result. // // Example: targetyr = 2052; targetmo = 5; cardinaloccurrence = 4; targetday = 1 // This is the same as saying our floating holiday in the year 2052, is during May, on the 4th Monday // var firstdate = new Date(String(targetmo)+"/1/"+String(targetyr)); // Object Storing the first day of the current month. var firstday = firstdate.getUTCDay(); // The first day (0-6) of the target month. var dayofmonth = 0; // zero out our calendar day variable. targetday = targetday - 1; if (targetday >= firstday) { cardinaloccurrence--; // Subtract 1 from cardinal day. dayofmonth = (cardinaloccurrence * 7) + ((targetday - firstday)+1); } else { dayofmonth = (cardinaloccurrence * 7) + ((targetday - firstday)+1); } return dayofmonth; } </script> </head> <body style="background-color: transparent;" onload="changedate('return')"> <p align="center">Calendar of Events</p> <center> <table id="evtcal" border="0" cellpadding="0" cellspacing="0" width="584"> <tbody> <tr> <td style="padding: 3px;" align="center" bgcolor="#aaddff" valign="top" width="314"> <div id="calendar"><!-- Dynamically Filled --></div> You can move to a different month or year by clicking on the buttons or return to today's date by clicking "Show Current Date".</td> <td width="10"> </td> <td style="padding: 3px;" align="center" bgcolor="#ffffc8" valign="top" width="260"><b>Intructions:</b><br />Click a highlighted date on the calendar to see a list of events on that day in the box below.<br /><br /> <center><b><u>Events</u></b> <form id="eventform" name="eventform" action="#" method="get"> <textarea name="eventlist" cols="25" rows="11" wrap="soft">Auto filled when clicking on date.</textarea> </form> </center> </td> </tr> </tbody> </table> </center> <br /> <p style="font: normal 11px Arial" align="center">This free script provided by<br /> <a href="http://www.javascriptkit.com">JavaScript Kit</a></p> </body> </html> events.js [javascript] // This is the Database of Upcoming Events // Please Edit with Care. // // 8 Fields (surrounded by brackets[]) are used for EACH event: // ["Recurring", "Month", "Day", "Year", "StartTime", "EndTime", "Name", "Description"] // Each event field must be be surrounded by quotation marks followed by a comma ("",) EXCEPT the "Description" field. // The "Description" field is surrounded by quotation marks only (""). // // Each event has a comma after the closing bracket IF another event is below it on the next line down. // Note: The last event in this file should NOT have a comma after the closing bracket // // The Recurring field uses: // "D" = Daily; "W" = Weekly; "M" = Monthly; "Y" = Yearly; "F" = Floating Holiday // // One Time only events should leave the Recurring field blank // (ex. "") // // Daily events do NOT require that anything be in the Month Day and Year fields // Everything in the Month Day and Year fields will be ignored // // Weekly events should have the day of the week field set to 1 - 7 // 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday // // "F"loating events uses: // the Month field for the Month. // the Day field as the Cardinal Occurrence // 1=1st, 2=2nd, 3=3rd, 4=4th, 5=5th, 6=6th occurrence of the day listed next // the Year field as the Day of the week the event/holiday falls on // 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday // example: "F", "1", "3", "2", = Floating holiday in January on the 3rd Monday of that month. // // Note: Easter has it's own special formula so Please don't change anything related to Easter below // // "Y"early events are specific dates that never change - the Year field is ignored // example - Christmas is: "12","25","", events = new Array( ["Y", "1", "1", "2006", "1:00 AM", "12:00 PM", "New Year's Day", "New Year's Day will be ushered in with great joy and celebration. Come as you are."], ["F", "1", "3", "2", "1:00 AM", "12:59 PM", "Martin Luther King Day", "Honors civil rights leader Rev Martin Luther King."], ["Y", "2", "2", "2005", "1:00 AM", "12:59 PM", "Groundhog Day", "If Philadelphia's groundhog 'Punxsutawney Phil' sees his shadow, there will be six more weeks of winter weather. If he does not see his shadow, there will be an early spring."], ["Y", "2", "14", "2005", "1:00 AM", "12:59 PM", "Valentine's Day", "Traditional celebration of love and romance, including the exchange of cards, candy, flowers, and other gifts."], ["F", "2", "3", "2", "1:00 AM", "12:59 PM", "President's Day", "Honors the birthdays of George Washington, Abraham Lincoln and other past American Presidents."], ["F", "3", "0", "0", "1:00 AM", "12:59 PM", "Easter", "Traditional celebration of the resurrection of Jesus Christ."], ["Y", "3", "17", "2005", "1:00 AM", "12:59 PM", "St. Patrick's Day", "A celebration of Irish heritage and culture, based on the Catholic feast of St. Patrick. Primary activity is simply the wearing of green clothing ('wearing of the green')."], ["Y", "3", "22", "2005", "1:00 AM", "12:59 PM", "World Water Day", "A day to promote appreciation of the world's most valuable commodity - water."], ["Y", "4", "1", "2005", "1:00 AM", "12:59 PM", "April Fool's Day", "A day to play tricks on or 'fool' family, friends, and coworkers, if so inclined. As Ecclesiastes says: 'There is a time for everything'; in this case, a time to be silly."], ["F", "5", "2", "1", "1:00 AM", "12:59 PM", "Mother's Day", "Honors mothers and motherhood (made a Federal Holiday by Presidential order)."], ["F", "5", "3", "7", "1:00 AM", "12:59 PM", "Armed Forces Day", "Celebrates the United States Army, Navy, Air Force and Marine Corps; formerly - each used to have separate days."], ["F", "5", "4", "2", "1:00 AM", "12:59 PM", "Memorial Day", "Honors the nation's war dead, and those we love who have passed away. Traditionally a time to decorate graves and remember those who have gone before us. Also marks traditional beginning of summer."], ["Y", "6", "14", "2005", "1:00 AM", "12:59 PM", "Flag Day", "Honors the American flag, encourages patriotism. Citizens are urged to fly the flag and study its traditions."], ["F", "6", "3", "1", "1:00 AM", "12:59 PM", "Father's Day", "Honors all Fathers and fatherhood."], ["Y", "7", "4", "2005", "1:00 AM", "12:59 PM", "Independence Day", "Celebrates our Declaration of Independence from England in 1776, usually called the Fourth of July."], ["F", "9", "1", "2", "1:00 AM", "12:59 PM", "Labor Day", "Celebrates the achievements of workers, giving them a day of rest - marks traditional end of summer."], ["F", "10", "2", "2", "1:00 AM", "12:59 PM", "Columbus' Day", "Honors the traditional discovery of the Americas by Christopher Columbus."], ["Y", "10", "31", "2005", "1:00 AM", "12:59 PM", "Halloween", "Celebrates All Hallow's Eve, decorations include jack o'lanterns, costume wearing parties, and candy - considered a pagan holiday by many Christians."], ["Y", "11", "11", "2005", "1:00 AM", "12:59 PM", "Veteran's Day", "Honors all veterans of the United States armed forces. A traditional observation is a moment of silence at 11 AM remembering those who fought for peace."], ["F", "11", "4", "5", "1:00 AM", "12:59 PM", "Thanksgiving", "A day to give thanks for your many blessings - traditionally for the Autumn harvest, and it marks the beginning of the 'holiday season'."], ["Y", "12", "25", "2005", "1:00 AM", "12:59 PM", "Christmas", "Celebration of the traditional day of Jesus' birth - God was made flesh and dwelt among us."] // Please omit the final comma after the ] from the last line above unless you are going to add another event at this time. ); [/javascript]
  4. hi, i wrote a code to upload a resume in mysql database and download that one . But in my database name,type,size of the file stored but content of the file not stored. So in my database content filed is empty.plz tell that what's the problem in my code. <? include("db.php"); if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmpname']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'rb'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } $query = "INSERT INTO upload (name, size, type, content ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content')"; mysql_query($query) or die('Error, query failed'); echo "<br>File $fileName uploaded<br>"; } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 2</title> </head> <body> <form method="post" enctype="multipart/form-data"> <table width="350" border="0" cellpadding="1" cellspacing="1" class="box"> <tr> <td width="246"> <input type="hidden" name="MAX_FILE_SIZE" value="2000000"> <input name="userfile" type="file" id="userfile"> </td> <td width="80"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></td> </tr> </table> </form> </body> </html> And i got the errors as Warning: fread(): supplied argument is not a valid stream resource in e:\project\graphic\docu.php on line 11 Warning: fclose(): supplied argument is not a valid stream resource in e:\project\graphic\docu.php on line 13
  5. hi, i run the below code i got the following error and also display output normal way instead of xml entries.plz help that what's the mistake in my code <? header("Content-type: text/xml"); $host = "localhost"; $user = "root"; $pass = "root"; $database = "DataMiningdb"; $linkID = mysql_connect($host, $user, $pass) or die("Could not connect to host."); mysql_select_db($database, $linkID) or die("Could not find database."); $query = "SELECT * FROM vehicles ORDER BY vehicle_id DESC"; $resultID = mysql_query($query, $linkID) or die("Data not found."); $xml_output = "<?xml version=\"1.0\"?>\n"; $xml_output .= "<entries>\n"; for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){ $row = mysql_fetch_assoc($resultID); $xml_output .= "\t<entry>\n"; $xml_output .= "\t\t<vehicle_id>" . $row['vehicle_id'] . "</vehicle_id>\n"; // Escaping illegal characters $row['vehicle_make'] = str_replace("&", "&", $row['vehicle_make']); $row['vehicle_make'] = str_replace("<", "<", $row['vehicle_make']); $row['vehicle_make'] = str_replace(">", ">", $row['vehicle_make']); $row['vehicle_make'] = str_replace("\"", """, $row['vehicle_make']); $xml_output .= "\t\t<vehicle_make>" . $row['vehicle_make'] . "</vehicle_make>\n"; $xml_output .= "\t</entry>\n"; } $xml_output .= "</entries>"; echo $xml_output; ?> output: Warning: Cannot modify header information - headers already sent by (output started at F:\Facebook\furniture11\Data Mining1\public_html\xmlparsing.php:1) in F:\Facebook\furniture11\Data Mining1\public_html\xmlparsing.php on line 2 5 Bayliner 5 Bayliner 5 Bayliner 4 Bayliner 4 Bayliner 4 Bayliner 3 Baja Marine 3 Baja Marine 3 Baja Marine 2 Miscellaneous 2 Miscellaneous 2 Miscellaneous 1 Miscellaneous 1 Miscellaneous 1 Miscellaneous
  6. hi, i have below mentioned code is there.In that use XML.I didn't understand this code.What purpose this code can write?what is the functionality of below code.Any body please suggest the answer.... <? require_once 'lib/inc/functions.lib.php'; includeClasses('vehicle'); $oVeh = new VEHICLE; $RetVal = 1; $MsgXML = ''; $RVXML = ''; $GETXML = ''; $POSTXML = ''; if(count($_REQUEST) > 0) { $Type = isset($_REQUEST['Type']) ? $_REQUEST['Type'] : ''; $Page = isset($_REQUEST['Page']) ? $_REQUEST['Page'] : ''; $Vehicles = $oVeh->getVehicles($Page - 1, '`vehicle_dt_added` DESC', "`vehicle_type` = '{$Type}'"); if($Vehicles !== FALSE && count($Vehicles) > 0) { foreach ($Vehicles as $aVehicle) { $RVXML .= "<Vehicle>\n"; foreach ($aVehicle as $Key=>$Value) { $Key = str_replace(' ', '-', $Key); $Value = htmlentities($Value); $RVXML .= "<{$Key}>{$Value}</{$Key}>\n"; } $RVXML .= "</Vehicle>\n"; } $RVXML = "<Vehicles Total=\"".count($Vehicles)."\">\n{$RVXML}</Vehicles>\n"; } else { $RetVal = 0; $MsgXML = "<Message>No RV Vehicles found!</Message>\n"; } } else { $RetVal = -1; if(count($_SESSION['ERRORS']) > 0) $MsgXML = "<Message>".implode("\n", $_SESSION['ERRORS'])."<Message>\n"; else $MsgXML = "<Message>Some Error Occured!<Message>\n"; } if(count($_GET) > 0) { foreach ($_GET as $Key=>$Value) $GETXML .= "<{$Key}>{$Value}</{$Key}>\n"; $GETXML = "<GET>\n{$GETXML}</GET>\n"; } if(count($_POST) > 0) { foreach ($_POST as $Key=>$Value) $POSTXML .= "<{$Key}>{$Value}</{$Key}>\n"; $POSTXML = "<POST>\n{$POSTXML}</POST>\n"; } header('Content-type: text/xml'); echo "<Result Code=\"{$RetVal}\">\n".$MsgXML.$GETXML.$POSTXML.$RVXML."</Result>"; ?>
  7. Hi, When we give a url of a website they want to mine, then they hit submit button and then it go to that website and collect all the data, pics,text, video and then brings it back .could you plz help how to capture the images,data from the website.
  8. Hi, I used the file concept in my code.In that i got the error as permission denied .For that one of them gave the solution as use IUSR_<machine name>. Where that i use that one? I worked on IIS server.When i right click on the folder->go to properties->i saw the tabs of General,Sharing,websharing,Customize tabs only.In that next what action i can do to give the permissions to the file.Any please suggest that problem.
  9. Hi, when i run my code it gives error as fopen(lib/providers//provider.RVLogic.php): failed to open stream: Permission denied in F:\Facebook\furniture11\Data Mining\public_html\lib\inc\functions.lib.php Line 673 : trigger_error("Failed to open stream to $filename. Permission denied!", E_USER_ERROR); could you plz tell the solution for how to avoid that errors // Define Needed Function if(!function_exists('file_put_contents')) { if (!defined('FILE_USE_INCLUDE_PATH')) define('FILE_USE_INCLUDE_PATH', 1); if (!defined('LOCK_EX')) define('LOCK_EX', 2); if (!defined('FILE_APPEND')) define('FILE_APPEND', ; function file_put_contents($filename, $data, $flags = NULL) { //if(!file_exists($filename)) trigger_error("File $filename doesn't exist!", E_USER_ERROR); if(!isset($data)) trigger_error("No value provided for required parameter \$data!", E_USER_ERROR); if(empty($data) && $data != 0) trigger_error("Empty value passed for parameter \$data!", E_USER_ERROR); if (FALSE === ($fp = @fopen($filename, $flags & FILE_APPEND ? 'a' : 'wb', $flags & FILE_USE_INCLUDE_PATH))) { trigger_error("Failed to open stream to $filename. Permission denied!", E_USER_ERROR); return FALSE; } if ($flags & LOCK_EX) if (!flock($fp, LOCK_EX)) trigger_error("Exclusive lock to $file was not obtained!", E_USER_WARNING); $length = strlen($data); $bytes = 0; if (FALSE === ($bytes = @fwrite($fp, $data))) { trigger_error("Failed to write $length bytes to $filename!", E_USER_ERROR); return FALSE; } fclose($fp); if($bytes != $length) { trigger_error("Only $bytes of $length bytes were written to $filename! Possibly out of disk space.", E_USER_WARNING); return FALSE; } return $bytes; } } [code=php:0]
  10. Hi, In my phpmyadmin i logged with username and password.And create a new database.Thenafter i created the table and click on go button it gives error as " MySQL said: Documentation #1142 - CREATE command denied to user 'eminoso_sravani'@'127.0.0.1' for table 'wwwww' " plz tell the solution for that error.How can i give the privileges to create command.
  11. Hi i have a code for rotating image.But it worked for only image width=30 and height=30.And we give width=100 and height=100 it will not work in Firefox.plz tell what's the problem in my code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>javascript: Rotate Images</title> </head> <body style="background-color: white"> <form> <script type="text/javascript" > function rr_getPageXY(r_o) { if (rr_n4) { r_o.x = r_o.img.x || 0; r_o.y = r_o.img.y || 0; } else { var r_p = r_o.img; r_o.x = r_o.y = 0; while (r_p) { r_o.x += parseInt(r_p.offsetLeft); r_o.y += parseInt(r_p.offsetTop); r_p = r_p.offsetParent || null; } } }; function rr_getDiv(r_x) { return ( document.all? document.all[r_x] : rr_n4? document.layers[r_x] : document.getElementById? document.getElementById(r_x) : null ); } function RRObj(r_o, r_ang) { this.name = r_o; this.img = document.images[r_o]; rr_getPageXY(this); this.w = this.img.width; this.h = this.img.height; this.angle = r_ang; this.htm = ''; for (var r_i = this.h; r_i-- { for (var r_j = this.w; r_j-- { this.htm += '<div id="' + r_o + 'row' + r_i + 'col' + r_j + '"'+ ' style="position:absolute;'+ 'left:' + (this.x+r_j) + 'px;'+ 'top:' + (this.y+r_i) + 'px;'+ 'width:1px;height:1px;'+ (rr_n4? 'clip:rect(0, 1px 1px 0);">' : 'overflow:hidden;">')+ '<div style="position:absolute;'+ 'left:' + (-r_j) + 'px;'+ 'top:' + (-r_i) + 'px;">'+ '<img src="' + this.img.src+ '" '+ 'width="' + this.w + '" height="' + this.h + '">'+ '<\/div><\/div>'; } } } RRObj.prototype.rotateTo = function(r_ang) { this.angle = r_ang; var r_sin = Math.sin(r_ang = r_ang*Math.PI/180), r_cos = Math.cos(r_ang), r_cx = this.w>>1, r_cy = this.h>>1, r_o, r_z = 0; for (var r_i = this.h; r_i-- { for (var r_j = this.w; r_j-- { r_o = this.pxs[r_z++] || null; var r_x = r_j-r_cx, r_y = r_i-r_cy, r_xrot = Math.round(r_x*r_cos-r_y*r_sin+r_cx), r_yrot = Math.round(r_x*r_sin+r_y*r_cos+r_cy); if (rr_n4) r_o.moveTo(this.x+r_xrot, this.y+r_yrot); else if (r_o) { r_o.style.left = (this.x+r_xrot)+rr_px; r_o.style.top = (this.y+r_yrot)+rr_px; } } } } RRObj.prototype.swapImage = function(r_x) { //this.nimg.src = r_x; }; function SET_ROTATABLE() { var r_a = SET_ROTATABLE.arguments, r_htm = '', r_o; window.rr_n4 = !!document.layers; window.rr_px = (rr_n4 || !!(window.opera && !(r_o = document.documentElement || document.body) && !r_o.innerHTML))? '' : 'px'; window.rots = new Array(); for (var r_i = r_a.length-1; r_i > 0; r_i -= 2) { r_o = rots[rots.length] = rots[r_a[r_i-1]] = new RRObj(r_a[r_i-1], r_a[r_i]); r_htm += r_o.htm; if (rr_n4) r_o.img.src = spacer; else r_o.img.style.visibility = 'hidden'; } document.write((rr_n4? '<div style="position:absolute;"><\/div>\n' : '') + r_htm); for (r_i = rots.length; r_i-- { (r_o = rots[r_i]).pxs = new Array(r_o.w*r_o.h); for (var r_z = 0, r_j = r_o.h; r_j-- { for (var r_k = r_o.w; r_k--; r_z++) r_o.pxs[r_z] = rr_getDiv(r_o.name + 'row' + r_j + 'col' + r_k); } r_o.rotateTo(r_o.angle); } } </script> <center> <br /> <table cellpadding="24"> <tr> <td align="center"> <img id="newImg" src="furniture11/logo1.jpg" width="100" height="100"/> </td> <td> <tt><a href="javascript:void(0)" onclick="if (window.rots) rots.newImg.rotateTo(parseInt(document.forms[0].A.value));"> Rotate image by angle( </a></tt> <input name="A" type="text" size="4" value="270"> <tt><a href="javascript:void(0)" onclick="if (window.rots) rots.newImg.rotateTo(parseInt(document.forms[0].A.value));"> ) </a></tt> </td> </tr> </table> </center> <script type="text/javascript"> <!-- SET_ROTATABLE("newImg", 90); //--> </script> </form> </body> </html>
  12. Hi i have a code for rotating image.But it worked for only image width=30 and height=30.And we give width=100 and height=100 it will not work in Firefox.plz tell what's the problem in my code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>javascript: Rotate Images</title> </head> <body style="background-color: white"> <form> <script type="text/javascript" > function rr_getPageXY(r_o) { if (rr_n4) { r_o.x = r_o.img.x || 0; r_o.y = r_o.img.y || 0; } else { var r_p = r_o.img; r_o.x = r_o.y = 0; while (r_p) { r_o.x += parseInt(r_p.offsetLeft); r_o.y += parseInt(r_p.offsetTop); r_p = r_p.offsetParent || null; } } }; function rr_getDiv(r_x) { return ( document.all? document.all[r_x] : rr_n4? document.layers[r_x] : document.getElementById? document.getElementById(r_x) : null ); } function RRObj(r_o, r_ang) { this.name = r_o; this.img = document.images[r_o]; rr_getPageXY(this); this.w = this.img.width; this.h = this.img.height; this.angle = r_ang; this.htm = ''; for (var r_i = this.h; r_i-- { for (var r_j = this.w; r_j-- { this.htm += '<div id="' + r_o + 'row' + r_i + 'col' + r_j + '"'+ ' style="position:absolute;'+ 'left:' + (this.x+r_j) + 'px;'+ 'top:' + (this.y+r_i) + 'px;'+ 'width:1px;height:1px;'+ (rr_n4? 'clip:rect(0, 1px 1px 0);">' : 'overflow:hidden;">')+ '<div style="position:absolute;'+ 'left:' + (-r_j) + 'px;'+ 'top:' + (-r_i) + 'px;">'+ '<img src="' + this.img.src+ '" '+ 'width="' + this.w + '" height="' + this.h + '">'+ '<\/div><\/div>'; } } } RRObj.prototype.rotateTo = function(r_ang) { this.angle = r_ang; var r_sin = Math.sin(r_ang = r_ang*Math.PI/180), r_cos = Math.cos(r_ang), r_cx = this.w>>1, r_cy = this.h>>1, r_o, r_z = 0; for (var r_i = this.h; r_i-- { for (var r_j = this.w; r_j-- { r_o = this.pxs[r_z++] || null; var r_x = r_j-r_cx, r_y = r_i-r_cy, r_xrot = Math.round(r_x*r_cos-r_y*r_sin+r_cx), r_yrot = Math.round(r_x*r_sin+r_y*r_cos+r_cy); if (rr_n4) r_o.moveTo(this.x+r_xrot, this.y+r_yrot); else if (r_o) { r_o.style.left = (this.x+r_xrot)+rr_px; r_o.style.top = (this.y+r_yrot)+rr_px; } } } } RRObj.prototype.swapImage = function(r_x) { //this.nimg.src = r_x; }; function SET_ROTATABLE() { var r_a = SET_ROTATABLE.arguments, r_htm = '', r_o; window.rr_n4 = !!document.layers; window.rr_px = (rr_n4 || !!(window.opera && !(r_o = document.documentElement || document.body) && !r_o.innerHTML))? '' : 'px'; window.rots = new Array(); for (var r_i = r_a.length-1; r_i > 0; r_i -= 2) { r_o = rots[rots.length] = rots[r_a[r_i-1]] = new RRObj(r_a[r_i-1], r_a[r_i]); r_htm += r_o.htm; if (rr_n4) r_o.img.src = spacer; else r_o.img.style.visibility = 'hidden'; } document.write((rr_n4? '<div style="position:absolute;"><\/div>\n' : '') + r_htm); for (r_i = rots.length; r_i-- { (r_o = rots[r_i]).pxs = new Array(r_o.w*r_o.h); for (var r_z = 0, r_j = r_o.h; r_j-- { for (var r_k = r_o.w; r_k--; r_z++) r_o.pxs[r_z] = rr_getDiv(r_o.name + 'row' + r_j + 'col' + r_k); } r_o.rotateTo(r_o.angle); } } </script> <center> <br /> <table cellpadding="24"> <tr> <td align="center"> <img id="newImg" src="furniture11/logo1.jpg" width="100" height="100"/> </td> <td> <tt><a href="javascript:void(0)" onclick="if (window.rots) rots.newImg.rotateTo(parseInt(document.forms[0].A.value));"> Rotate image by angle( </a></tt> <input name="A" type="text" size="4" value="270"> <tt><a href="javascript:void(0)" onclick="if (window.rots) rots.newImg.rotateTo(parseInt(document.forms[0].A.value));"> ) </a></tt> </td> </tr> </table> </center> <script type="text/javascript"> <!-- SET_ROTATABLE("newImg", 90); //--> </script> </form> </body> </html>
  13. Hi, i want to add photos and delete photos using CMS.plz help for that.and also how to install the CMS.
  14. Hi, I have one normal picture is there.How to add the menu bar to the picture and take options as Halfsize, Normal size,Rotateleft ,save,close like that using javascript.plz tell that how to start logic.
  15. Hi, How to do bring front,bring back images using javascript.plz tell that logic.
×
×
  • 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.