Monday, September 30, 2013

Weather Forecast 

We add Weather forecast in our website.before book an event visitor can view weather report.it share location of the visitor and display weather report

WEATHER FORECAST

<!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;background:url('../img/bg.jpg') repeat #e1f0f6;">

                <div id="weather">
                    <!-- The stylesheet -->
                    <link rel="stylesheet" href="./weatherforecast/assets/css/weather.css" />

                    <!-- Google Fonts -->
                    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Playball|Open+Sans+Condensed:300,700" />
                    <ul id="scroller">
                        <!-- The forecast items will go here -->
                    </ul>

                    <a href="#" class="arrow previous">Previous</a>
                    <a href="#" class="arrow next">Next</a>

                </div>

                <p class="location"></p>

                <div id="clouds"></div>

                <!-- JavaScript includes - jQuery, moment.js and our own script.js -->
                <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.0.0/moment.min.js"></script>
                <script src="weatherforecast/assets/js/script.js"></script>
            </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>

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>


Sunday, September 29, 2013

Ajax search for your website

This is how it's looks like in our website.when visitor type any keywords it gives suggestions like google search.visitor doesn't has to reload any anything.this search increase performance in your web site.

this is how its looks like

CSS

/* BASIC RESET */
body, div, img, p { padding:0; margin:0; }
a img { border:0 }

/* HTML ELEMENTS */
body { font-family:"Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif; background-color:#efefef; background-image:url(../images/bg.jpg); }

/* COMMON CLASSES */
.break { clear:both; }

/* SEARCH FORM */
#searchform { margin:50px 200px; font-size:18px; }
#searchform div { color:#eeeeee; }
#searchform div input { font-size:18px; padding:5px; width:320px; }
#suggestions{ position: relative; left:235px; width:320px; display:none; }

/* SEARCHRESULTS */
#searchresults { border-width:1px; border-color:#919191; border-style:solid; width:320px; background-color:#a0a0a0; font-size:10px; line-height:14px; }
#searchresults a { display:block; background-color:#e4e4e4; clear:left; height:56px; text-decoration:none; }
#searchresults a:hover { background-color:#b7b7b7; color:#ffffff; }
#searchresults a img { float:left; padding:5px 10px; }
#searchresults a span.searchheading { display:block; font-weight:bold; padding-top:5px; color:#191919; }
#searchresults a:hover span.searchheading { color:#ffffff; }
#searchresults a span { color:#555555; }
#searchresults a:hover span { color:#f1f1f1; }
#searchresults span.category { font-size:11px; margin:5px; display:block; color:#ffffff; }
#searchresults span.seperator { float:right; padding-right:15px; margin-right:5px;
background-image:url(../images/shortcuts_arrow.gif); background-repeat:no-repeat; background-position:right; }
#searchresults span.seperator a { background-color:transparent; display:block; margin:5px; height:auto; color:#ffffff; }

JS
google.load("jquery", "1.3.1");
google.setOnLoadCallback(function()
{
// Safely inject CSS3 and give the search results a shadow
var cssObj = { 'box-shadow' : '#888 5px 10px 10px', // Added when CSS3 is standard
'-webkit-box-shadow' : '#888 5px 10px 10px', // Safari
'-moz-box-shadow' : '#888 5px 10px 10px'}; // Firefox 3.5+
$("#suggestions").css(cssObj);

// Fade out the suggestions box when not active
$("input").blur(function(){
$('#suggestions').fadeOut();
});
});

function lookup(inputString) {
if(inputString.length == 0) {
$('#suggestions').fadeOut(); // Hide the suggestions box
} else {
$.post("rpc.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
$('#suggestions').fadeIn(); // Show the suggestions box
$('#suggestions').html(data); // Fill the suggestions box
});
}
}

PHP
<p id="searchresults">
<?php
// PHP5 Implementation - uses MySQLi.
// mysqli('localhost', 'yourUsername', 'yourPassword', 'yourDatabase');
$db = new mysqli('localhost', 'root', '', 'sep');

if(!$db) {
// Show error if we cannot connect.
echo 'ERROR: Could not connect to the database.';
} else {
// Is there a posted query string?
if(isset($_POST['queryString'])) {
$queryString = $db->real_escape_string($_POST['queryString']);

// Is the string length greater than 0?
if(strlen($queryString) >0) {
$query = $db->query("SELECT * FROM animals WHERE description LIKE '%" . $queryString . "%' GROUP BY type LIMIT 8");

if($query) {
// While there are results loop through them - fetching an Object.
while ($result = $query ->fetch_object()) {
echo '<span class="category">'.$result->type.'</span>';
        echo '<img src="'.$result->thumbpath.'" alt="" width="64px"/>';
echo "<a href=\"test.html\">";
       
        $name = $result->name;
        if(strlen($name) > 35) {
        $name = substr($name, 0, 35) . "...";
        }        
        echo '<span class="searchheading">'.$name.'</span>';
       
        $description = $result->description;
        if(strlen($description) > 80) {
        $description = substr($description, 0, 80) . "...";
        }
       
        echo '<span>'.$description.'</span></a>';
        }
} else {
echo 'ERROR: There was a problem with the query.';
}
} else {
// Dont do anything.
} // There is a queryString.
} else {
echo 'There should be no direct access to this script!';
}
}
?>
</p>

HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<div>
<form id="searchform">
<div>
What are you looking for? <input type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" />
</div>
<div id="suggestions"></div>
</form>
</div>
</body>
</html>
_________________________________________________________________________________
this is how the search result displays



SEARCH RESULT

<?php session_start(); ?>
<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"/>
        <script type="text/javascript" src="js/jquery-1.4.min.js"></script>
        <script type="text/javascript" src="js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="js/expand.js"></script>
        <title>Dehiwala Zoo - දෙà·„ිවල à·Æ’තà·Å Ã ·€Ã ·Ã ¶¯Ã ·Å Ã¢€Ã ¶ÂºÃ ·Ã ¶±Ã ¶Âº - Sri Lanka</title>
        <script type="text/javascript" src="js/common.js"></script>
        <link rel="stylesheet" href="css/screen.css" type="text/css" media="all" />
    </head>
    <body>
        <?php
        include './controllers/db.php';

        $animalid=$_GET["id"];
        $searchresult=  mysql_query("select * from animals where id='$animalid'" );
         while (($row = mysql_fetch_array($searchresult))) {
            $imagepath = $row['path'];
            $detail = $row['description'];
            $type= $row['type'];
            $sename= $row['name'];
        }
        ?>
        <?php include('models/header.php') ?>
        <?php include('models/scroll.php') ?>
        <div class="menubar">
            <?php include('models/mainmenu.php') ?>
        </div>
        <div class="wrapper" style="background-color: transparent">
            <center>
                <link rel="stylesheet" type="text/css" href="css/normalize.css" />
                <link rel="stylesheet" type="text/css" href="css/demo.css" />
                <link rel="stylesheet" type="text/css" href="css/book.css" />
                <script src="js/modernizr.custom.js"></script>
                <ul class="align" style="margin:20px;">
                            <li>
                                <figure class='book'>

                                    <!-- Front -->

                                    <ul class='hardcover_front'>
                                        <li>
                                            <img src="<?php echo "images/".$imagepath; ?>" alt="" width="100%" height="100%">
                                        </li>
                                        <li></li>
                                    </ul>

                                    <!-- Pages -->

                                    <ul class='page'>
                                        <li></li>
                                        <li>
                                            <h1 style="font-size: 20px; color: #009F00"> Type : <u><?php echo $type;?></u></h1>
                                            <h1 style="font-size: 20px;"><?php echo $sename.":".$detail?></h1>
                                        </li>
                                        <li></li>
                                        <li></li>
                                        <li></li>
                                    </ul>

                                    <!-- Back -->

                                    <ul class='hardcover_back'>
                                        <li></li>
                                        <li></li>
                                    </ul>
                                    <ul class='book_spine'>
                                        <li></li>
                                        <li></li>
                                    </ul>
                                </figure>
                            </li>
                        </ul>
            </center>
        </div>
        <div class="content_main_line"></div>
        <div align="center" class="footer"><?php include('models/sitemap.php') ?>
        </div>
    </body>

</html>

Saturday, September 28, 2013

The Do’s and Don’ts of Teamwork

As a 3rd year undergraduate of SLIIT(Specialized in Software Engineering),we have a one year Software Engineering project.first we have to form a group of 4 developers.These are some guidelines we followed and that would help you to gain success in your group projects also.

Getting to Know One Another

This may sound elementary, but many teams screw this up. One thing you will eventually learn is that team members have very different abilities, motivations and personalities. For example, there will be some team members that are totally involved, and others that just want to disappear. If you let people disappear, they become dead weight and a source of resentment and frustration. You must not let this happen!
Here is something that you should try to take to heart (but will be very hard for many to accept): When team members disappear, it is not entirely their fault. It is your fault too. Take someone who is introverted. They find it stressful to talk in a group. They like to think things through before they start talking. They consider others' feelings and don't want to tell them when they are wrong. In a group full of extroverts, this person cannot find a way to participate: it is not in their nature to fight for attention. It is the extroverts' responsibility to consciously include the introvert, to not talk over them, to not take the floor away from them. If you want the team to succeed, you have to accept that you must actively manage others. If you think "Why should I do that? It's their responsibility to carry their own weight. I'm doing my part, they should do theirs" you are dead meat: you will need all the human resources at your disposal.
One of the first things you should do as a group is make sure everybody knows everybody's name. Don't just introduce yourselves once because some people will immediately forget the names or never quite hear them the first time. So make sure that everyone has written down everybody's name. Then go on to talk about each other -- what major, where you live on campus, who you know, etc.
Since teams are not (just) social groups, it is also important to get an idea about what each person is good at, and what resources they can bring to bear. For example, one person might have a conveniently large apartment where the group can meet. Another might have great computer skills, useful for creating presentations and typing papers.
One thing to realize is that when teams are new, each individual is wondering about their identity in the group. Identity is a combination of personality, behavior, competencies, and position in the social structure of the group. Some people will fight for dominance. Some want to be seen as smart. Others play the role of comedian. Others want to be liked. As you watch this process occur, it is helpful to think that much of what people do is not so much a choice as a need or a habit. The person who seems hellbent on dominating everyone has a strong need to do this, and won't feel comfortable not doing it. Thinking this way will help you to be less judgmental, which in turn will help you to avoid unproductive hatreds. Remember: it is just a team, not a marriage.

Vision

If the word "vision" makes you want to puke, think instead "what are we really trying to accomplish? Besides the explicit tasks, what are our real goals?". For example, for a class team, does the team want to do whatever it takes to get an A? Or is having a comfortable workload more important? Does the team want to really get involved with each other socially, or keep interactions to just what's required to do the work? Does the team want an atmosphere of military efficiency, or do they want to horse around and have a good time?
A useful exercise is to create a vision statement. This is basically a short paragraph that says what you're about, what your strategy is, what you are ultimately trying to accomplish. Think of it as a description of your positioning in the market place.
The best vision statements are usually those that synthesize each individual’s team-member's personal vision for what they are trying to accomplish, not just in the team but in their careers. In other words, each person should separately figure out what they think the team should accomplish, then the group should get together and see if there are any common elements out of which you can build a single, coherent vision that each person can commit to. The reason why it is helpful to use common elements of the individual visions is that part of the purpose of writing a vision statement is to provide common direction and to motivate team members. But if nobody believes in the vision statement, it will just be words on a piece of paper. It has to be real to be useful.

Structure

It is difficult for teams to succeed without a leader. So you should designate someone to play that role. However, you don't need to make the leader omnipotent. There are certain task & maintenance functions that need to be performed, and you can have one person do all of them, or you can split up the job among different people.
One key function is that of facilitator/coordinator. This is a person who calls meetings, keeps people on track, and pays attention to group processes. For example, the facilitator makes sure that everyone is involved and notices when someone is upset. Here are some of the things that successful facilitators try to do:
  • focus team on task
  • engage participation from all members
  • protect individuals from personal attack
  • suggest alternative procedures when the team is stalled
  • summarize and clarify the team's decisions
Here are some tips for accomplishing these goals:
  • stay neutral
  • don't let the meeting run too long, even if it's going well (or people will try to avoid coming next time)
  • express out loud what seems to be happening (e.g., "nobody seems to be saying much since Jenny suggested ... ")
  • don't let snide comments, put downs, etc slide by without comment
  • after a person has been quiet for awhile, ask them for their opinion
Another key function is that of boundary manager. This is a person who serves as liaison between the team and the rest of the world (the team's "stakeholders"). In the context of class teams, this person interacts with the professor, and keeps an eye out for what the other teams are doing, they also make themselves aware of the obligations that team members have to others (like boyfriends/girlfriends, part-time jobs, etc). The boundary manager is responsible for learning who the key stakeholders are (a stakeholder is someone who affects the team, or is affected by the team), and working out a strategy for dealing with them (e.g., sucking up to the professor).
Finally, there is the project manager. The project manager organizes the work plan and sees that it is implemented. In the context of class teams, there might be different project managers for each assignment, or a single one that organizes all the assignments. Project managers need to be able to take a whole task, such as a paper assignment, and break it down into bite sized pieces that can be doled out to people to do. Project managers have to be able to figure out time budgets and get people to do their part at the right time.

Process

Meetings can be useless if not done right. One simple thing that helps a lot is having an agenda. Having a written agenda makes it easier for the facilitator to steer things back to the task. Otherwise, if, say, two popular and dominant people in the group start talking about sports, it may difficult for a third party who is not as socially central to bring them back. But if there is an agreed-upon agenda and an agreed-upon length of meeting, a facilitator can say 'I don't know about you guys, but I really want to get out here at 5: if we really want to talk about all the things on the agenda we kind of have to get going...'.
The first item on any agenda should usually be a "check-in" which is where the facilitator asks each person how things are going and whether there is anything on their minds that needs to be discussed.
For certain kinds of meetings it is useful to go into brainstorming mode. Brainstorming is a process of generating ideas (e.g., for a paper). There are certain dos and don'ts for good brainstorming:
  • don't evaluate until much later in the process. accept all ideas, no matter how stupid they appear
  • encourage mental hitchhiking (building on other's ideas)
  • don't stop at the first silence. just wait a bit, no matter how uncomfortable
  • for hard problems, it helps to summarize the problem, then let people think on their own and write down some answers, then get together and pool them on a blackboard
  • after you get a bunch of ideas, ask each person to vote for two or three of them. Take all the ideas that get at least one vote, and start classifying them according to similarity. This will usually get you down to just a few basic types of ideas, which you can then make decisions about.
There will be many situations in which you need to give feedback to others in the team. Like, they have just written a draft of a team paper, and you need to suggest changes and point out problems. When you give feedback it is extremely important to avoid any negative comment that would seem to be about the person, rather than the work or the behavior. You should also focus on yourself and your objection rather than on them and their problem. For example, you might say "I don't understand why on this page we jump from this topic to that, and then come back to the first topic" instead of "You made a mistake on this page" or "You are not being logical here". The moment you say "You" people's defenses go up.
It is very important that teams assess their performance from time to time. Most teams start out ok, and then drift away from their original goals and eventually fall apart. This is much less likely to happen if from time to time, the team facilitator or leader asks everyone how they are feeling about the team, and does a public check of the performance of the team against the mission/vision statement.

Wednesday, September 18, 2013

PHP and HTML Radio Buttons


PHP and HTML Radio Buttons


A Radio Button is a way to restrict users to having only one choice. Examples are : Male/Female, Yes/No, or answers to surveys and quizzes.
Here's a simple from with just two radio buttons and a Submit button:
A Form with Radio Buttons
You can find the code for the page above in the files you downloaded, in the scripts folder. The file is called radioButton.php. Open it up in your text editor. If you want to copy and paste it, click below.
Make sure you save your work as radioButton.php, as that's where we're posting the Form – to itself.
To get the value of a radio button with PHP code, again you access the NAME attribute of the HTML form elements. In the HTML above, the NAME of the Radio buttons is the same – "gender". The first Radio Button has a value of "male" and the second Radio Button has a value of female. When you're writing your PHP code, it's these values that are returned. Here's some PHP code. Add it to the HEAD section of your HTML:
<?PHP
$selected_radio = $_POST['gender'];
print $selected_radio;
?>
This is more or less the same code as we used for the text box! The only thing that's changed (apart from the variable name) is the NAME of the HTML form element we want to access – "gender". The last line just prints the value to the page. Again, though, we can add code to detect if the user clicked the Submit button:
if (isset($_POST['Submit1'])) {
$selected_radio = $_POST['gender'];
print $selected_radio;
}
Again, this is the same code you saw earlier – just access the form element called 'Submit1' and see if it is set. The code only executes if it is.
Try out the code. Select a radio button and click Submit button. The choice you made is printed to the page - either "male" or "female". What you will notice, however, when you try out the code is that the dot disappears from your selected radio button after the Submit is clicked. Again, PHP is not retaining the value you selected. The solution for radio Buttons, though, is a little more complex than for text boxes
Radio buttons have another attribute - checked or unchecked. You need to set which button was selected by the user, so you have to write PHP code inside the HTML with these values - checked or unchecked. Here's one way to do it:
The PHP code:
<?PHP
$male_status = 'unchecked';
$female_status = 'unchecked';
if (isset($_POST['Submit1'])) {
$selected_radio = $_POST['gender'];
if ($selected_radio = = 'male') {
$male_status = 'checked';
}
else if ($selected_radio = = 'female') {
$female_status = 'checked';
}
}
?>
The HTML FORM code:
<FORM name ="form1" method ="post" action ="radioButton.php">
<Input type = 'Radio' Name ='gender' value= 'male'
<?PHP print $male_status; ?>
>Male
<Input type = 'Radio' Name ='gender' value= 'female'
<?PHP print $female_status; ?>
>Female
<P>
<Input type = "Submit" Name = "Submit1" VALUE = "Select a Radio Button">
</FORM>
Did we say a little more complex? OK, it's much more complex than any code you've written so far! Have a look at the PHP code inside the HTML first:
<?PHP print $female_status; ?>
This is just a print statement. What is printed out is the value inside of the variable. What is inside of the variable will be either the word "checked" or the word "unchecked". Which it is depends on the logic from our long PHP at the top of the page. Let's break that down.
First we have two variables at the top of the code:
$male_status = 'unchecked';
$female_status = 'unchecked';
These both get set to unchecked. That's just in case the page is refreshed, rather than the Submit button being clicked.
Next we have our check to see if Submit is clicked:
if (isset($_POST['Submit1'])) {
}
Exactly the same as before. As is the next line that puts which radio button was selected into the variable:
$selected_radio = $_POST['gender'];
We then need some conditional logic. We need to set a variable to "checked", so we have an if, else … if construction:
if ($selected_radio == 'male') {
}
else if ($selected_radio == 'female') {
}
All we're doing is testing what is inside of the variable called $selected_radio. If it's 'male' do one thing; if it's 'female', do another. But look at what we're doing:
if ($selected_radio == 'male') {
$male_status = 'checked';
}
else if ($selected_radio = = 'female') {
$female_status = 'checked';
}
If the 'male' button was clicked then set the $male_status variable to a value of 'checked'. If the 'female' option button was clicked then set the $female_status variable to a value of 'checked'.
So the code works because of the values inside of two variables: $male_status and$female_status.

Tuesday, September 17, 2013


The HTML ACTION attribute and PHP


You don't have to submit your form data to the same PHP page, as we've been doing. You can send it to an entirely different PHP page. To see how it works, try this:
Create the following page, and call it basicForm2.php. This is your HTML. Notice the ACTION attribue.
<html>
<head>
<title>A BASIC HTML FORM</title>
</head>
<body>
<Form name ="form1" Method ="POST" Action ="submitForm.php">
<INPUT TYPE = "TEXT" VALUE ="username" Name ="username">
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">
</FORM>
</body>
</html>

Now create the following page, and call it submitForm.php:
<?PHP
$username = $_POST['username'];
if ($username == "letmein") {
print ("Welcome back, friend!");
}
else {
print ("You're not a member of this site");
}
?>
In the PHP script above, notice how there's no HTML tags. And we've left out the code that checks if the Submit button was clicked. That's because there's no PHP left in the first page. The code only gets executed IF the Submit is clicked.
Posting form data to a different PHP script is a way to keep the HTML and PHP separate. But there is a problem with it, which you will have noticed: the script gets executed on a new page. That means your form will disappear!

Sunday, September 15, 2013

PHP Submit buttons


PHP Submit buttons


In the previous section, you saw how to get text from a textbox when a Submit button on a form was clicked. However, when you first load the page the text still displays.
The reason why the text displays when the page is first loaded is because the script executes whether the button is clicked or not. This is the problem you face when a PHP script is on the same page as the HTML, and is being submitted to itself in the ACTION attribute.
To get round this, you can do a simple check using another IF Statement. What you do is to check if the Submit button was clicked. If it was, then run your code. To check if a submit button was clicked, use this:
if ( isset( $_POST['Submit1'] ) ) { }
Now that looks a bit messy! But it actually consists of three parts:
if ( ) { }
isset( )
$_POST['Submit1']
You know about the if statement. But in between the round brackets, we have isset( ). This is an inbuilt function that checks if a variable has been set or not. In between the round brackets, you type what you want isset( ) to check. For us, this is $_POST['Submit']. If the user just refreshed the page, then no value will be set for the Submit button. If the user did click the Submit button, then PHP will automatically return a value. Change you script from the previous page to the following and try it out:
if (isset($_POST['Submit1'])) {
$username = $_POST['username'];
if ($username == "letmein") {
print ("Welcome back, friend!");
}
else {
print ("You're not a member of this site");
}
}
Make a note of where all those messy round, square and curly brackets are. Miss one out and you'll get an error!