ANIL KUMAR PANIGRAHI 's Blog

Events calendar implementation in oscommerce using php code

Posted by: Anil Kumar Panigrahi in: ● May 8, 2010

Hi friends,

In this post i want to explain how to implement events calender in oscommerce. With using this we can schedule the products and we can display the which events/products are schedule in which date.

It looks like :

Events calender implementation in oscommerce using php code | Anil Labs

Events calender implementation in oscommerce using php code | Anil Labs

Call that function in any of your file like :

<?php
$year=date(‘Y’);$month=date(‘m’);
?>
<select id=”year” name=”year” onChange=”getResult();”>
<?php for($i=2000;$i<2020;$i++){ ?>
<option value=”<?php echo $i;?>” <?php if($i==$year){?> selected=”selected”<?php }?> ><?php echo $i;?></option>
<?php } ?>
</select>
<select id=”month” name=”month” onChange=”getResult();”>
<?php for($i=1;$i<=12;$i++){?>
<option value=”<?php echo $i;?>” <?php if($i==$month){?> selected=”selected”<?php }?>><?php echo $i;?></option>
<?php } ?>
</select>
</div>
<div id=”txtResult” align=”center”>
<?php
echo generate_calendar($year,$month);
?>

Implementation in  Ajax functionality:

<script language=”javascript” type=”text/javascript”>

function getResult()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert (“Browser does not support HTTP Request”)
return
}

year=document.getElementById(“year”).value;
month=document.getElementById(“month”).value;
//alert(year);
//alert(month);
document.getElementById(‘txtResult’).innerHTML = “Getting…”;
var url=”call.php”
url=url+”?year=”+year+”&month=”+month
//alert(url);
url=url+”&sid=”+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open(“GET”,url,true)
xmlHttp.send(null)
}

function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState==”complete”)
{
document.getElementById(“txtResult”).innerHTML=xmlHttp.responseText;
//document.getElementById(“hid”).value=xmlHttp.responseText;
}

}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject(“Msxml2.XMLHTTP”);
}
catch (e)
{
xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
}
return xmlHttp;
}

</script>

Demo for this function : http://labs.anil2u.info/events_calender.php

Share on Twitter

5 Comments to "Events calendar implementation in oscommerce using php code"

1 | physical therapist

15 de May de 2010 to ● 2:53 am

Great site. A lot of useful information here. I’m sending it to some friends!

2 | physical therapist

17 de May de 2010 to ● 6:31 am

This is such a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a prime resource for free. I truly loved reading your post. Thanks!

3 | physical therapist

20 de May de 2010 to ● 4:28 am

Great information! I’ve been looking for something like this for a while now. Thanks!

4 | Lena Higgins

27 de May de 2010 to ● 4:38 pm

If only more people would read this.

5 | sekhar

7 de July de 2010 to ● 9:00 pm

Great informations of php code collections. Thanks for sharing.

Write Comment

About Me

  Anil Kumar Panigrahi
  Software Engineer (PHP)
  Blogger & Founder of Anil Labs
  Baruva, India

You can share with me . . .

My Own Contributions

1) First contribution for codeigniter framework ( multi language support using google translate API ). we can get files from http://github.com/nyros/codeigniter_multilanguage


2) Audio and Video Streaming using FFMpeg and PHP -complete doc file : http://www.docstoc.com/docs/8300349/Audio-and-Video-Streaming

Twitter Updates

Follow me @anil2u
  • http://www.google.co.uk/ logo is changing with mouse move . . . - posted on 07/09/2010 10:57:33
  • True enemies are real friends . . . - posted on 06/09/2010 10:15:29
  • Just watched nice movie " Madrasapattinam ". - posted on 05/09/2010 16:20:48
  • We will always be thankful to our teacher for all the hard work and efforts they have put in, for educating us.- Happy teachers Day . . . :) - posted on 05/09/2010 05:39:13
  • Working on shipping cost functionality (UPS and USPS) for oscommerce shopping cart - posted on 01/09/2010 09:40:03