Thursday, June 30, 2011

Churches that took PCSO money named



MANILA - The Philippine Charity Sweepstakes Office (PCSO) wants recipients of more than P6 million deducted from its charity funds to be held liable for violating the law.

PCSO board director, Atty. Aleta Tolentino, said a 2009 Commission on Audit report showed there were several checks representing the amount that were taken from the charity fund.
She said P1.44 million was given to the Archdiocese of Cotabato for the purchase of a service vehicle, P1.5 million went to the Zamboanga Archdiocesan Social Action Apostolate, P720,000 was given to Caritas Nueva Segovia, P1.125 million to the Roman Catholic Prelate of Isabela, Basilan and P1.7 million to the Diocese of Butuan.

Read More at Yahoo News

Learn More:

Earn With ClixSense

Join Now And Be Active. It's FREE



ClixSense is a free paid to click and paid advertising web site. Clixsense is one of the longest and trusted PTC being online since February 2007. If you want to earn a stable and legitimate extra income online i suggest you join Clixsense. Mind you i am not saying that you will become rich instantly when you join clixsense BUT! clixsense can give you a slow but steady lucrative income online. Joining clixsense will earn you $0.01 up to $0.02 per click per ad that you click. I know it doesn’t sound very appealing, $0.01 or $0.02 per ad is very small, but in a day there are about 6-7 ads per day that you can click,so if you click 7 ads per 7 times per week and 4 weeks per month you can earn about $4. Simple right? Its still not enough right? But if you become a premium member then this income of yours will increase for about 3 time smore. Also paying for upgrading is very cheap just $14.95 and it is credited for ONE YEAR! Other PTC sites would require you to pay $89-90 for a one year signup! Also every clicks that your referral does you will be credited $0.01 per ad and if your referral would choose to become premium you will be paid handsomely…

Also features like Browser toolbar with instant notification of new ads & Clixgrid makes Clixsense different from the rest. Clixgrid is picture grid that has many squares in it. Some of the squares hold prizes up to $5.Regular members get 20 chances and Premium members get 50 chances to click these squares to win!. The only thing you need to do is click one of the boxes and a new advertisement page will open and wait for the timer to finish and they will tell you if you win or not. Easy right? Also ClixSense offers one of the most lucrative affiliate programs in the PTC industry. Not only are you compensated for referring others you also get commissions whenever your direct referrals click on PTC Ads, purchase advertising or whenever they or their referrals upgrade to Premium through 8 levels! With multiple streams of income your earnings potential is unlimited!

Member Benefits:

*Browser Toolbar With Instant Notification of New Ads Available
*Earn Up To $0.02 Per Click and Up To $0.01 Per Referral Click
*Earn Even More With Affiliate Program
*Payments Via Check, Alertpay and PayPal
*Win Daily Prizes Up To $5.00
*Unlimited Direct Referrals
*Guaranteed Ads Daily

Requirements:
* A computer or laptop
* An email Yahoo or Gmail (You Choose!)
* 15-20 minutes of your time
* Upgrade for Premium for $14.95
* Patience,Perseverance & Strategy

Join Now And Be Active. It's FREE





Other Stuff You Want To Look At




Wednesday, June 29, 2011

Gloria Arroyo left P4-B debt, says PCSO

President Gloria Macapagal-Arroyo and her allies used the Philippine Charity Sweepstakes Office (PCSO) as their milking cow, leaving the agency P4 billion in debt, or close to a year’s worth of doles for the poor and the sick.

“They ran it to the ground,” said PCSO Chair Margarita Juico, who recently met with Inquirer editors and reporters.

Juico said the directors appointed by Arroyo to the PCSO board “comingled” the funds for operating expenses with those for charity work, thus allowing the agency to spend more than its budget, especially in the last two years in office of the appointees.

Under its charter, the PCSO is mandated to set aside 55 percent of its revenues (P29.5 billion in 2010) from numbers games, such as lotto, Scratch It, Keno online and sweepstakes for prize money; 30 percent for charity; and 15 percent for operating funds.

The hands of corruption has also reach the clergy as the news stated last night. During the term of the unpopular President Gloria Macapagal Arroyo, a number of bishops were given expensive cars. The budget of these cars requested by these bishops came from PCSO or the Philippine Charity Sweeptakes Office.

Read More at Philippine Daily Inquirer

Join Now And Be Active. It's FREE





Other Stuff You Want To Look At




Monday, June 27, 2011

The Reason Is You - Tiffany Alvord



I don't need a reason to smile
as I walk down the street
I don't need a reason for my heart
to feel complete
No another question
I tell you no one could take your place
I guess that maybe the answer is
written all over my face

Cause I've been,I've been
noticing you,noticing me
as I notice you
I think it's kinda funny
I will like you like I do
Baby I am crazy for you
So hot sparks are flying
this is love the way I'd chine in
Met you on the avenue
Never talk around at you
So hot sparks are flying
this is love the way I'd chine in
Met you on that avenue
I love to smile
And the reason is you ooooh

I don't need a reason
to dance under the stars
I don't need a reason
to blast a song in a car
No another question
awhile I glow when I see you
I guess that maybe the answer is
that I just wanna be with you

Cause I've been,I've been
noticing you,noticing me
as I notice you
I think it's kinda funny
I will like you like I do
Baby I am crazy for you
So hot sparks are flying
this is love the way I'd chine in
Met you on the avenue
Never talk around at you
So hot sparks are flying
this is love the way I'd chine in
Met you on that avenue
I love to smile
And the reason is you ooooh

You make me feel like
nothing in this world could
ever bring me down
You make me fell so special,so sweet
so perfect as we walk trough town
There is no aparrent reason
why I feel the way I do
But maybe then again
the reason is you

And I've been,I've been
noticing you,noticing me
as I notice you
I think it's kinda funny
I will like you like I do
Baby I am crazy for you
So hot sparks are flying
this is love the way I'd chine in
Met you on the avenue
Never talk around at you
So hot sparks are flying
this is love the way I'd chine in
Met you on that avenue
I love to smile
And the reason is you
The reason is you
the reason is you


Learn More:


Sunday, June 26, 2011

In One Day in London



Touring London in a day seems ridiculous at first, considering that it's a sprawling metropolis filled with treasures, but it can be done if you get an early start and have a certain discipline, plus a lot of stamina. Since Britain is the world's most famous kingdom, this "greatest hits" itinerary focuses on royal London, monumental London, and political London, with some great art thrown in to satisfy the inner soul. After an early morning trip to Westminster Abbey, you'll want to see London's greatest plaza, Trafalgar Square, take a grand "royal stroll," visit the National Gallery, and perhaps poke into Whitehall, seeing 10 Downing St. (home of the prime minister). A pint of lager in a Victorian pub and a night in a West End theater will cap your day very nicely. Start: Tube to Westminster.

1. Westminster Abbey

This early English Gothic abbey is the shrine of the nation, and most of England's kings and queens have been crowned here -- and many are buried here as well. We always like to get here when it opens at 9:30am before the crowds descend. Architecturally, its two highlights are the fan-vaulted Henry VII's Chapel (one of the loveliest in all of Europe) and the shrine to Edward the Confessor, containing the tombs of five kings and three queens. For a final look, walk over to the Poets' Corner, where everybody from Chaucer to Robert Browning, Dr. Samuel Johnson, and Alfred Lord Tennyson rests in peace.

As you emerge from Westminster Abbey, you confront the virtual symbol of London itself:

2. The Houses of Parliament & "Big Ben"

Guarded over by "Big Ben" (the world's most famous timepiece), the former royal Palace of Westminster shelters both the House of Lords and the House of Commons and has done so since the 11th century. Gaining admission to the debating chambers requires a long wait and a lot of red tape that the "1-Day Visitor" will have to forego, but at least you can admire the massive architectural pile from the outside before passing on your way.

If you feel you've missed something, duck into the Jewel Tower across the street, one of only two surviving buildings from the medieval Palace of Westminster. Here you can see an exhibition of the history of Parliament and even use a touch-screen computer that takes you on a virtual tour of both Houses of Parliament.

Continue walking north along Whitehall until you reach:

3. No. 10 Downing St.

Hang a left and look down Downing Street to number 10, flanked by policemen. Because of security concerns, it is no longer possible to walk down the street -- you can only look down it through the gates on Whitehall. The official residence of the prime minister isn't much of a sight and is rather modest, but it's been the home of everybody from Sir Winston Churchill to Margaret Thatcher. Today Gordon Brown and his family call it home. Although the building is hardly palatial, it's the most famous address in Britain, other than Buckingham Palace, and all visitors seem to want to take a peek.

After that look, continue north to:

4. Trafalgar Square

The hub of London, this is Britain's most famous square and the scene of many a demonstration. A 44m (144-ft.) granite statue of Horatio Viscount Nelson (1758-1805) dominates the square. As you walk around this square, noting the ferocious pigeons "dive-bombing," you'll know that you're in the very heart of London where thousands amass on New Year's Eve to ring in another year.

Right on this square, you can enter the:

5. National Gallery

On the north side of Trafalgar Square looms this massive gallery. All the big names, from Leonardo da Vinci to Rembrandt, from van Gogh to C├ęzanne, strut their stuff here. Displaying some of the most important art ever created, the panoramic galleries cover 8 centuries. This is one of the greatest art museums on the planet. On even the most rushed of schedules, you'll want to devote at least 1 1/2 hours to its galleries. Since everybody's taste in art differs, check out our Insider's tip under the National Gallery review. A computer makes it easy and convenient for you. Select 10 paintings you'd most like to see, and a computer will design your own map and print it out for you.

Directly north of Trafalgar Square, you enter the precincts of:

6. Covent Garden

The old fruit-and-vegetable market of Eliza Doolittle fame is long gone, and the market has been recycled into one of the most bustling and exciting sections of London today. Begin with a walk around the Piazza [SS], the center of Covent Garden. When architect Inigo Jones designed it in 1633, it became London's first square. To its south you'll see St. Paul's Church, which Jones called "the handsomest barn in England." Immediately to the southeast of St. Paul's you can enter the Jubilee Market and to its immediate east the London Transport Museum. After wandering around the gardens and after a heavy morning of sightseeing, even with a full English breakfast, you may be ready for lunch. For our pounds sterling, there is no better place for lunch in all of London than Covent Garden.

Take a Break -- Porters English Restaurant

We suggest a visit to our dear old friend, the Earl of Bradford, who owns and runs this venerable Covent Garden favorite. Try one of Lady Bradford's old English pies (ever had lamb and apricot?), and finish off with her fabled steamed pudding, made with ginger and banana. 17 Henrietta St., WC2. tel. 020/7836-6466. Tube: Covent Garden or Leicester Sq.

The day is marching on, and you should too if you want to take in more that London has to offer.

At Covent Garden, take the Tube to Charing Cross Station to the south of Covent Garden. After disembarking here, prepare yourself for one of the grandest strolls in all of Britain, walking west along:

7. The Mall & Buckingham Palace

A stroll along the Mall all the way west to Buckingham Palace is the most aristocratic walk in Britain. Passing King George IV's glorious Carlton House terrace on your right, you can enjoy the same view Elizabeth II sees when she rides in her gilded "fairy-tale" coach to open Parliament every year.

Whether you can actually go inside Buckingham Palace itself depends on the time of year. We've deliberately skipped the Changing of the Guard ceremony, which isn't held every day and is often difficult to schedule. It's an overrated attraction anyway.

After viewing Buckingham Palace, walk along Constitution Hill to the Tube stop at Hyde Park Corner. Once there, head east for one big final attraction for the afternoon:

8. The Tower of London

We prefer to visit this attraction later in the afternoon, when some of the hordes pouring out of tour buses have departed. A first-time visitor to London wouldn't dare miss this old symbol of blood and gore standing on the Thames for 900 years. Many famous Englishmen have lost their heads at the Tower. It's been a palace, a prison, and a royal mint, but mostly it's a living museum of British history. Since you don't have a lot of time, take one of the hour-long guided tours conducted by the much-photographed Beefeaters. They make the history of the Tower come alive with their often humorous and irreverent commentary.

After viewing the Tower, we suggest you head back to your hotel and take a much-needed break before descending on London by night.

We like to begin our evening with a pint in an evocative London pub. Try one of the best and also one of the most famous:

Take a Break -- Salisbury

This Art Nouveau pub is in the heart of the theater district. You can enjoy a drink and a quick pub dinner of home-cooked pies or freshly made salads before heading out to see the show of your choice. 90 St. Martin's Lane, WC2. tel. 020/7836-5863. Tube: Leicester Sq.

9. A Night at a London Theater

Unless you've got your heart set on seeing a big London hit, perhaps a musical, we suggest your one-and-only night in London be spent at Shakespeare's Globe Theatre. This is a replica of the Elizabethan original where the Bard premiered many of his plays. The productions, often performed in Elizabethan costume as in Shakespeare's days, are of the highest quality, often showcasing the talents of many of Britain's greatest thespians, both young and old.

Head back to your hotel for a well-earned night of rest and promise yourself you'll come back to London soon.
In One Day in London at Frommer's

Learn More:

Thursday, June 23, 2011

KeepVid: Download and Save Video


Do you want to keep videos from YouTube? That's right. You can do that using KeepVid. You can choose the format as shown in the above figure. Try it yourself and enjoy keeping videos from YouTube.

Learn More:


"Heartbreak" (Original Song) by Tiffany Alvord




It's like a battle cry
Calling out your name
Wishing you were here with me

Its so hard to think
Of letting you go,
Of letting you leave

And I will try to give you my all
Just as long as you promise me
You'll answer when I call, Oh oh

Just promise me you'll never break my heart
Just tell me that you'll make it safely home
Cause I know what its like, to feel alone, Oh oh
Just tell me that you know this isn't a mistake,
Cause I don't want to wait around, for the heartbreak

As the war goes on,
I just miss you more,
Wondering how long this will last

Thinking of tomorrow,
But holding on to the past

And I will try to give you my all
Just as long as you promise me
You'll answer when I call, Oh oh

Just promise me you'll never break my heart
Just tell me that you'll make it safely home
Cause I know what its like, to feel alone, Oh oh
Just tell me that you know this isn't a mistake,
Cause I don't want to wait around, for the heartbreak

And I dont know what to do,
Hold on or let go of you
And I know that your on the field,
But I need you to be my shield

And do the things you need to do,
I'll be waiting here, for you
And I know that your there to fight,
So just be brave you'll be alright

And I will try to give you my all
Just as long as you promise me
You'll answer when I call, Oh oh

Just promise me you'll never break my heart
Just tell me that you'll make it safely home
Cause I know what its like, to feel alone, Oh oh
Just tell me that you know this isn't a mistake,
Cause I don't want to wait around,
Yeah I dont want to wait around,
For the heartbreak

Learn More:


Wednesday, June 22, 2011

Brighter Than The Sun - Tiffany Alvord *Colbie Caillat* + D



Stop me on the corner
I swear you hit me like a vision
I, I, I wasn't expecting
But who am I to tell fate where it's supposed to go with it?
Don't you blink you might miss it
See we got a right to just love it or leave it
You find it and keep it
Cause it ain't every day you get the chance to say

Oh, this is how it starts, lighting strikes the heart
It goes off like a gun, brighter than the sun
Oh, it could be the stars, falling from the sky
Shining how we want, brighter than the sun

I never seen it, but I found this love I'm undefeated
You better leave, I'm better than anything I've ever had
Cause you're so damn beautiful read it
It's time and deliver it let's seal it
Boy we go together like peanuts and paydays and molly and reggae
And it ain't every day you get the chance to say

Oh, this is how it starts, lighting strikes the heart
It goes off like a gun, brighter than the sun
Oh, it could be the stars, falling from the sky
Shining how we want, brighter than the sun

Everything is like a way out, cause we shine down
Even when the light's out but I can see you glow
Got my head up in the rafters, got me happy ever after
Never felt this way before, ain't this way before

I swear you hit me like a vision
I, I, I wasn't expecting
But who am I to tell fate where it's supposed to go with it?

Oh, this is how it starts, lighting strikes the heart
It goes off like a gun, brighter than the sun
Oh, it could be the stars, falling from the sky
Shining how we want, brighter than the sun, yeah
Oho, yeah, oho
Oh, this is how it starts, lighting strikes the heart
It goes off like a gun, brighter than the sun
Oh, this is how it starts, lighting strikes the heart
It goes off like a gun, brighter than the sun
Oh, this is how it starts, lighting strikes the heart
It goes off like a gun, brighter than the sun
Oh, this is how it starts, lighting strikes the heart
It goes off like a gun, brighter than the sun
brighter than the sun

Download Link : http://www.4shared.com/audio/VjhDP7TW/Brighter_Than_The_Sun.html

Learn More:


Tuesday, June 21, 2011

The Ultimate Mind Reading Trick



The Ultimate Mind Reading Trick is very easy to make and also very easy to perform. The effect is considered an impromptu trick because it is always ready to go when you want to perform it. Because the ten cards that are needed for the trick are only about 3 1/2 inches by 2 inches it is very easy to carry with you and perform for anyone whenever you want. The magic trick can be performed for more than one person at once and is amazing whether you do it for one person or several people. Everything can be examined by the spectator(s) after the magic trick because there are no gimmicks and nothing to hide, it really is an amazing effect and it is my favorite magic trick to carry and perform for people.

Description:

You tell the spectator that you have 10 cards and that each card has the name of 10 different countries on it. You let the spectator examine the cards to see that there is a total of 100 countries and that they are all different and that there are 10 different countries on each card. You now ask the spectator to just think of any of the 100 countries and keep it a secret. Once the spectator has chosen a country you simply ask him/her to tell you what card has the country that was selected. Once the spectator tells you the card, you pick up all of the cards and hand them to the spectator and have them shuffled. Once the cards are shuffled you ask the spectator to turn the cards over so now the back side of the cards are facing up. You have the spectator place the cards down back side up so that both of you can see all of the countries that are listed on the cards. You ask the spectator to find the country that he/she is thinking about, but not to say it out loud and to continue to keep it a secret. Once the spectator has located the selected country, ask him/her to simply let you know what card it is located on. Each of the cards facing up at this point have 10 different countries listed on them. You pick up the card that the spectator indicates has the selected country and you instantly reveal the name of the country that was chosen.

Order One Now For $10.00


Learn More:

Friday, June 17, 2011

Rebecca Black Video Off Youtube



Who may not know Rebecca Black? The 13 year old Youtube sensation known for her song Friday. I was able to watch the video which they say it is notoriously bad. If you were not able to watch it, you may have lost your chance because Rebecca's family have taken down the video. According to the news, the family decided to take down the video because Ark Music Factory, the company they hired to make it, is wrongfully exploiting the song and Rebecca's image.

Ark controls the video's YouTube account. Last week Ark briefly charged users $2.99 for three-day viewing rights of the video. It seems Rebecca and her family did not "get down" with the fee. "Friday" fans have taken to Twitter to express their remorse over "Friday's" funeral with the hashtags #sadfriday and #nothingcomesafterthursday.

Read More...

Learn More:

Survey Monkey



It's Saturday actually but I don't want to be unproductive so I opened my laptop and browse the net. Planning to watch on youtube. Maybe UFC or anything exciting. I don't know what came into my mind but I opened Alexa to check my ranking (not good actually) and it came to my attention what is this fucking SurveyMonkey. Well, I know what is this survey thing. A bunch of questionnaires you have to answer for you to generate certain percentage for, let's say a case study. Anyway, I decided to follow the site.

Actually it is really a tool. This survey monkey site helps you maximize your effort by utilizing its tools which in turn it provides you an statistical result that will help you decide the choice with most favorable result.

Here is what they say about Survey Monkey.

"Survey Monkey cuts out the busy work of collecting data and help us keep our foodies engaged and satisfied."
Alexa Malott
Community Manager at Foodbuzz

"SurveyMonkey makes scheduling practices and organizing travel 1,000 times easier."
Craig Bankowski
Palo Alto Elite Volleyball Club

"SurveyMonkey makes gathering student feedback and organizing campus events almost too easy"
Anne Ho
Graduate Teaching Assistant/Student at USF

"SurveyMonkey helps me get the insight of a big marketing machine at the speed and cost of a start-up"
Brady Wood
VP Marketing & Business Development at Shmoop

Take a tour at SurveyMonkey and see it for yourself. For those whom it may be applicable, just give a try. Signing up for BASIC is FREE.

Learn More:

Thursday, June 16, 2011

Future Tech: Wireless power



A few years ago we saw a demonstration by a team at Fulton Innovation of a product called eCoupled. Using the principle of electromagnetic induction, by which an electrical charge can be stimulated in a wire coil by placing another one nearby, the crazy boffins were able to display wireless power transfer.

Despite being high voltage, they said, it was safe, efficient and could be applied to any surface. The demo room consisted of a kitchen without plugs, but full of lights that could be stuck anywhere and a frying pan that heated up just by sitting it on the counter. Put a phone on the same counter and it began charging. Clearly, this was the future.
Fulton are still working on wireless power, but it's a different company that's beat it to the shops, Powermat – and its products are expensive for something that replaces a 50p mains plug.

The good news is that the Wireless Power Consortium are going to be finalising a standard for wireless power called Qi later this year, which should mean prices drop and manufacturers have the confidence to build the technology straight into devices, rather than requiring an adaptor.

If you think that's crazy, though, take a look at Airnergy by RCA. It's a tiny dongle that can turn Wi-Fi signals back into electricity for charging phone batteries and the like.

Source: techradar.com

Learn More:

Google Launches Tool for Online Reputation Management



"Me on the Web" is a tool introduced by Google which is now included on the dashboard. It is located between your account information and analytics. This tool is introduced by Google to help you manage the search results about You yourself and it is not inteded to be another privacy setting.

As Google explains, "Your online identity is determined not only by what you post, but also by what others post about you — whether a mention in a blog post, a photo tag or a reply to a public status update".

This new dashboard section will encourage you to keep your profile searchable within a few clicks by setting up a search alerts for data points associated with your Google profile like your
name or email address. This has long been achievable but now it is within a fewer clicks.

This new tool will provides you links to resources about managing online identity and removing unwanted content.

By using this tool, people can now now be searched publicly which may help them either to build their business and reputaion.


Start by setting up on Google's tool "Create a Google profile".

Learn More:

Thursday, June 9, 2011

Creating a Tile-Like Template in PHP



Having a template makes much easier for us to create an application, a website or any other. It allows us to concentrate more on the business logic because it leaves to the template how to display the data through the view section. In fact, I’m a fan of Struts, a framework used in java web application, and I utilize the tiles so much because it shuns me away from worrying about the display.

I used Netbeans version 6.9.1 for this tutorial. Just follow the instructions below and you have your project working.

STEP 1.
Create a project named php-blog (in fact, name it whatever you want). For now, strictly follow the folder hierarchy for us to better digest the idea. Here is how it looks like.


The idea is to group related codes according to what they do in the application.

STEP 2.
Create your FrontController and place it under the controller folder. As you may well know, the code for FrontController looks like this.

<?php
class FrontController{

    private static $instance;

    private function  __construct() {}

    public static function instance(){
        if(!defined("APP_DIR")){
            exit("Severe: Cannot proceed without access to application directory.");
        }

        if(!self::$instance){
            self::$instance = new self();
        }
        return self::$instance;
    }

    public function redirect(){
        $page = !empty($_GET["page"]) ? $_GET["page"] : "home";
        $action = !empty($_GET["action"]) ? $_GET["action"] : "default";

        $object = ucfirst($page) . "Controller";
        $file = APP_DIR . "/controller/" .  $page . "/" . $object . ".php";
        if(!is_file($file)){
            exit("Severe: Controller not found!");
        }

        require_once $file;
        $method = "do" . ucfirst($action);
        $controller = new $object();
        if(!method_exists($controller, $method)){
            exit("Severe: Action not found.");
        }
        
        $controller->$method();
        
        exit(0);
    }
}
?>

Here is how it looks like.

Never mind the account folder yet, we’ll go to that later as we go on.

STEP 3.
Here we go. Create your basetemplate and place it under your view folder. Design it as you may want it to look like. For the purpose of this post, I made it simple and understandable. Here’ what I did.
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <div>
            <?php
                // header
                include 'application/view/common/header.php';
                // menu
                include 'application/view/common/menu.php';
                
                // body
                include $template . '.php';

                // footer
                include 'application/view/common/footer.php';
            ?>
        </div>
    </body>
</html>
</div>
Here is how it looks like.

Never mind those other folders. I’ll show you what it does later.

STEP 4.
Create the common parts of a web page which I believe you are familiar with. They are the header, menu and the footer. Place it under the view folder, inside the common section. A little information about these pages are shown below.

header.php
<div style="height: 30px; border: 1px solid green; padding: 5px 0px 0px 5px;">
HEADER SECTION
</div>

menu.php

<div style="height: 30px; border: 1px solid green; padding: 5px 0px 0px 5px;">
MENU SECTION
</div>

footer.php
<div style="height: 30px; border: 1px solid green; padding: 5px 0px 0px 5px;">
FOOTER SECTION
</div>

Here is how it looks like.

Don’t mind the account folder yet. We’ll use that to display the account information.

STEP 5.
Create a template object and place it under the model folder. This is an abstract class and will be extended everytime you create a controller. The code will be like this.

<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

abstract class Template {
    //put your code here
    public function invokeTemplate($template){
        include_once APP_DIR . '/view/basetemplate.php';
    }
}
?>

Here is how it looks like.


STEP 6.
Create your account controller and the corresponding view of the function.

6a. Create your account controller and place it under the controller folder, inside the account section. Extend this controller to Template and create one function which will hold the dynamic body of the base template.
<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of AccountController
 *
 * @author
 */
include_once APP_DIR . '/model/Template.php';
class AccountController extends Template{

    public function doAccount(){
        $this->message = "Im on account method!";

    }

}
?>
Here is how it looks like.


6b. Create the corresponding view. The filename will be the same as the AccountController’s function doAccount eliminating the prefix do and appended with View. The dynamic body code looks like this.
<?php
    
    echo $this->message;
?>

Here is how it looks like.

STEP 7.
Update your index.php by including these lines of code to it. The index.php lies at the root so that it is the first page to be landed everytime you want a request.
<?php
define('APP_DIR', dirname(__FILE__) . "/application");
require_once 'application/controller/FrontController.php';
FrontController::instance()->redirect();
?>

The whole structure looks like this.


STEP 8.
Type in the address bar this url: http://yourhost:port/php-blog/index.php?page=account&action=account. What do you see? Right! You got you application working fine with a base template. The only thing that changes everytime is the body section because it is where you display your data. Just for formality sake, here is the output.


As you can see, the body prints the message from the account. Change the message and it is the only part that changes. Try including the one below.

Update accountView.php with these parameters:
<?php
 if(isset ($this->name) && $this->name != NULL){
 echo 'Hello, ' . $this->name;
}
?>
<form action="" method="POST">
  <input type="text" name="name" value=""/>
  <input type="submit" value="Submit"/>
</form>

Update AccountController’s doAccount function with these parameters:

<?php
/* 
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
* Description of AccountController
*
* @author 
*/
include_once APP_DIR . '/model/Template.php';
class AccountController extends Template{


  public function doAccount(){

    if(isset ($_POST['name'])){
     $this->name = $_POST['name'];
    }

    $template = APP_DIR . '/view/account/accountView';
    $this->invokeTemplate($template);
  }
}
?>
Save the changes and access the same url. What is the result? Place a value at the textbox and click submit. You must be able to see a greeting.

There are better ways to do this however it is good to know the basic. The foundation of complexity lies on the base and it is good to understand how certain frameworks behave.

Learn More:

Best Of Bread Songs



Here we go.

I just wanna share songs I love listening to. This songs were from Bread. Most of this songs have paved their way to success because of the persuasive and charismatic sounds. Love to here it. Download songs HERE

Those who had more than their fill of the likes of England Dan & John Ford Coley in the '70s had Bread to thank for the proliferation of such acts. Bread, led by David Gates, took all of the softer aspects of the post-'60s folk metamorphosis and none of the artistry. Songs like "Make It with You" and "Baby I'm A-Want You" were enormous hits, but nothing compared to the success of "If." Surveys would probably show that eight out of 10 weddings in the years after the song's debut had it squeezed somewhere in the ceremonial proceedings. Anthology doesn't really offer anything that some select surfing of adult easy listening stations doesn't already provide. It also shows that in the end, most of Bread's material, while a staple of the aural diet of many, ultimately has become stale as their namesake.

Learn More:

Jose Mari Chan Love Songs

Another love songs which I'm sure you'll love listening to. Songs from Jose Mari Chan.

Listen Here


Learn More:



Sunday, June 5, 2011

Modifying the FrontController to include the View Layer



Last time, what we did is to build a front controller which will be able to interpret the URL to invoke certain objects (controllers) and the functions of these controllers.

Yeah we are missing something. That is the view section. The view section is equally vital because it displays objects handed to it by the controller. Of course, the view section is styled according to the taste of the client/user. This can be done using CSS.

Anyway, the view section contains the least logic. As the name connotes, it is used to print data to the end user. But how can we include that to the FrontController? That's easy actually. Just add these lines of code to FrontController and BOOM! you got your view section included in the application.

$view = APP_DIR . "/" . $page . "/" . $action . ".php"; if(!is_file($view)){ exit("Severe: View section is not found!"); } include $view;

Modifying now the FronController.php will result to the code below.

<?php class FrontController{ public static function instance(){ if(!defined("APP_DIR")){ ext("Severe: Cannot proceed without access to application directory."); } } public function redirect(){ $page = !empty($_GET["page"]) ? $_GET["page"] : "home"; $action = !empty($_GET["action"] ? $_GET["action"] : "default"; $object = ucfirst($page) . "Controller"; $file = APP_DIR . "/" . $page . "/" . $object . ".php"; if(!is_file($file)){ exit("Severe: Controller not found!"); } require_once $file; $method = "do" . ucfirst($action); $controller = new $object(); if(!method_exists($controller, $method)){ exit("Severe: Action not found."); } $controller->$method();
//06-06-2011 - include view - start add $view = APP_DIR . "/" . $page . "/" . $action . ".php"; if(!is_file($view)){ exit("Severe: View section is not found!"); } include $view; //06-06-2011 - include view - end add
exit(0); } } ?>


You may now separate your view sections by creating a folder equal to the $page name and the view file name equal to the controller's function. Let's see, our previous sample is AccountController. Create a folder name on application directory (APP_DIR) called account. In that folder create a php file with file name printFNameView.php. Style it as you may want. When you invoke the address index.php?page=account&action=printFName,


the view section (printFName.php) will be displayed. Complete code will be provided with samples soon.

Learn More:

Thursday, June 2, 2011

FrontController for PHP



PHP is one powerful tool for building web application. Like in my previous work, PHP is their main choice of language when making a web site. Of course, the application is with the vital combination of javascript and CSS to make it presentable.

Constant research allowed me to see that there were a lot of PHP frameworks presented on the web. There were even comparison of each other and whose the best maybe. Take Zend for example. It offers you a lot. However, you must understand that there are functionalities that are unfamiliar to you which careful measures must be considered before implementation.

But I'm not against those frameworks because in reality, they were already tested and proven effective in rapid application development. In fact, they ease the work load double fold. I'm not in doubt of their capacity(frameworks) but of course I would like to learn how did they do it.

I understand that complex codes are very difficult to follow and understand so I'd like to throw a simplier solution to those developing website in PHP using the FrontController.

What is a FronController? It is simply the gateway to an application. All request must hit the front controller leaving it to decide what to do next. A web application typically has to set up sessions, connect to database, and delegate variety of request to controllers. And that's what FrontController has to do. What happens here is the program flow logic.

A simple representation of this is the code below:

index.php
<php
  session_start();
  $redirect = !empty($GET["page"] ? $_GET["page"] : "home";
  switch($redirect){
   case "home":
      include "pages/home.php";
      break;
   case "account":
      include "pages/account.php";
      break;     
  }
?>


A sort of procedural programming works, but the benefit of doing it in a object oriented fashion produces a more scalable and flexible controller architecture. Should the base be there, its up to you to make it more magical.

OOP Approach
index.php
<php
  define("APP_DIR", dirname(_FILE_) . "/pages");
  require_once "FrontController.php";
  FrontController::instance()->redirect();
?>
FrontController.php
<php
class FrontController{
 public static function instance(){
  if(!defined("APP_DIR")){
    ext("Severe: Cannot proceed without access to application 
        directory.");
  }
 }
 
 public function redirect(){
  $page = !empty($_GET["page"]) ? $_GET["page"] : "home";
  $action = !empty($_GET["action"] ? $_GET["action"] : "default";
  
  $object = ucfirst($page) . "Controller";
  $file = APP_DIR . "/" . $page . "/" . $object . ".php";
  if(!is_file($file)){
   exit("Severe: Controller not found!");
  } 
  
  require_once $file;
  $method = "do" . ucfirst($action);
  $controller = new $object();
  if(!method_exists($controller, $method)){
    exit("Severe: Action not found.");
  }

  $controller->$method();
  exit(0);
 }
}
?>
account/AccountController.php
<php
class AccountController{
 public function doPrintFName(){
   echo "Your are in AccountController with doPrintFName function";
 }
 public function doPrintLName(){
   echo "Your are in AccountController with doPrintLName function";
 }
}
?>
Now, invoke url adding this parameter: index.php?page=account&action=printFName. You should be able to see the message, Your are in AccountController with doPrintFName function. Invoke index.php?page=account&action=printLName, what can you see?

In here, I showed a very simple pattern how you can achieved a healthier PHP application with a pattern which helps you debug faster. There is a better way to achieve MVC pattern in PHP. I'll do it later...

Learn More:

There was an error in this gadget