Monday, September 30, 2013

Event Calendar 

You can add events to a calendar by retrieving data from a database.Topic is displays in the calendar.by clciking the topic visitor can view event details.

this is how it looks like



EVENT CALENDAR

<!DOCTYPE html5>
<?php include '../controllers/db.php'; ?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="icon" type="image/jpg" href="../images/static/icon.jpg"/>
        <link rel="stylesheet" type="text/css" href="../css/style.css"/>
        <link rel="stylesheet" type="text/css" href="../css/popupforms.css"/>
        <title>Dehiwala Zoo - You Are Invited</title>
        <link rel="stylesheet" type="text/css" href="../css/cssmenu.css"/>
        <link rel="stylesheet" type="text/css" href="../css/login.css"/>
        <link rel="stylesheet" type="text/css" href="../css/forms.css"/>
        <link href="../css/js-image-slider.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="../js/js-image-slider.js"></script>
        <script type="text/javascript" src="../js/jquery.pop.js"></script>
        <script type="text/javascript" src="../js/jquery.tipsy.js"></script>
        <script type="text/javascript" src="../js/jquery.colorbox.js"></script>
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <script src="js/jquery.colorbox.js"></script>
        <script>
            $(document).ready(function() {
                $(".iframeform").colorbox({iframe: true, width: "50%", height: "95%"});
            });
        </script>
    </head>
    <body>
        <!-- FB-->
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id))
                    return;
                js = d.createElement(s);
                js.id = id;
                js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));
        </script>
        <?php include('../models/header.php') ?>
        <?php include('../models/scroll.php') ?>
        <div class="menubar">
            <?php include('../models/mainmenu.php') ?>
        </div>
        <div class="wrapper"><br/>
            <div class="slider_out" style="height:auto;">
                <!--                <link href='../fullcalendar/fullcalendar.css' rel='stylesheet' />
                                <link href='../fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
                                <script src='../jquery/jquery-1.9.1.min.js'></script>
                                <script src='../jquery/jquery-ui-1.10.2.custom.min.js'></script>
                                <script src='../fullcalendar/fullcalendar.min.js'></script>-->

                <link href='eventcalander/fullcalendar/fullcalendar.css' rel='stylesheet' />
                <link href='eventcalander/fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
                <script src='eventcalander/jquery/jquery-ui-1.10.2.custom.min.js'></script>
                <script src='eventcalander/fullcalendar/fullcalendar.min.js'></script>

                <script>

                    $(document).ready(function() {


                        //var date = new Date();
                        //var d = date.getDate();
                        //var m = date.getMonth();
                        //var y = date.getFullYear();

                        $('#calendar').fullCalendar({
                            editable: false,
                            events: [
<?php
$qry = 'select * from calendar_event';
$res = mysql_query($qry);
while ($row = mysql_fetch_array($res)) {
    ?>
                                    {
                                        title: '<?php echo $row['event'] ?>',
                                        start: new Date(<?php echo $row['year'] ?>, <?php echo $row['month'] - 1 ?>, <?php echo $row['day'] ?>),
                                        //end: new Date(y, m, 29),
                                        url: 'eventdata.php?eventid=<?php echo $row['id']; ?>'
                                    },
<?php } ?>
                            ]
                        });

                    });

                </script>
                <style>

                    body {
                        margin-top: 40px;

                    }

                    #calendar {
                        width: 500px;
                        margin: 0 auto;
                    }

                </style>
                <div id='calendar'></div>
            </div>
            <center>
                <div><h4>Share with your friends</h4></div>
                <div class="fb-comments" data-href="https://www.facebook.com/groups/520296588010179/?fref=ts" data-width="500" data-num-posts="10"></div>
            </center>
        </div>
        <div class="content_main_up"></div>
        <div class="content_main_line"></div>
        <div class="content_main_up"></div>
        </div>
        <div align="center" class="footer">
            <?php include('../models/sitemap.php') ?>
        </div>
    </body>
</html>
_____________________________________________________________________________

EVENT DATA

<!DOCTYPE html5>
<?php include '../controllers/db.php'; ?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="icon" type="image/jpg" href="../images/static/icon.jpg"/>
        <link rel="stylesheet" type="text/css" href="../css/style.css"/>
        <link rel="stylesheet" type="text/css" href="../css/popupforms.css"/>
        <title>Dehiwala Zoo - You Are Invited</title>
        <link rel="stylesheet" type="text/css" href="../css/cssmenu.css"/>
        <link rel="stylesheet" type="text/css" href="../css/login.css"/>
        <link rel="stylesheet" type="text/css" href="../css/forms.css"/>
        <link href="../css/js-image-slider.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="../js/js-image-slider.js"></script>
        <script type="text/javascript" src="../js/jquery.pop.js"></script>
        <script type="text/javascript" src="../js/jquery.tipsy.js"></script>
        <script type="text/javascript" src="../js/jquery.colorbox.js"></script>
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <script src="js/jquery.colorbox.js"></script>
        <script>
            $(document).ready(function() {
                $(".iframeform").colorbox({iframe: true, width: "50%", height: "95%"});
            });
        </script>
    </head>
    <body>
        <?php include('../models/header.php') ?>
        <?php include('../models/scroll.php') ?>
        <div class="menubar">
            <?php include('../models/mainmenu.php') ?>
        </div>
        <div class="wrapper"><br/>
            <div class="slider_out" style="height:auto;">
               <?php
                include '../controllers/db.php';
                $eventtopic = '';
                $eventday = '';
                $eventmonth = '';
                $eventyear = '';
                $eventfrom = '';
                $eventuntil = '';

                $eventid = $_GET["eventid"];
                $eventresult = mysql_query("select * from calendar_event where id='$eventid'");
                while (($row = mysql_fetch_array($eventresult))) {
                    $eventtopic = $row['event'];
                    $eventdetails = $row['description'];
                    $eventday = $row['day'];
                    $eventmonth = $row['month'];
                    $eventyear = $row['year'];
                    $eventfrom = $row['time_from'];
                    $eventuntil = $row['time_until'];
                }
                ?>
                <center>
                    <table width="100%" height="auto" border="0">
                        <tr>
                            <td colspan="2" align="center"><h style="color: #009F00"><B><u>Event Details</u></B></h></td>
                        </tr>
                        <tr>
                            <td width="155">Event Topic</td>
                            <td width="413"><?php echo $eventtopic; ?></td>
                        </tr>
                        <tr>
                            <td>Description</td>
                            <td><?php echo $eventdetails; ?></td>
                        </tr>
                        <tr>
                            <td>Day</td>
                            <td><?php echo $eventday; ?></td>
                        </tr>
                        <tr>
                            <td>Month</td>
                            <td><?php echo $eventmonth; ?></td>
                        </tr>
                        <tr>
                            <td>Year</td>
                            <td><?php echo $eventyear; ?></td>
                        </tr>
                        <tr>
                            <td>Time From</td>
                            <td><?php echo $eventfrom; ?></td>
                        </tr>
                        <tr>
                            <td>Time Until</td>
                            <td><?php echo $eventuntil; ?></td>
                        </tr>
                    </table>
                </center>
            </div>

        </div>
        <div class="content_main_up"></div>
        <div class="content_main_line"></div>
        <div class="content_main_up"></div>
        </div>
        <div align="center" class="footer">
            <?php include('../models/sitemap.php') ?>
        </div>
    </body>
</html>


No comments:

Post a Comment