PHP Classes

Christmas Gift: Decide to buy a gift for you or another person

Recommend this page to a friend!
  Info   View files Example   Demos   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 285 All time: 7,552 This week: 455Up
Version License PHP version Categories
xmas-gift 1.7Proprietary License4HTML, Algorithms, PHP 5
Description 

Author

This class can be used to decide whether you should buy a gift for you or another person.

It implements an algorithm for asking questions to make a decision.

Depending on the answers, the class shows a link to jump to another step asking another question until it reaches a point of decision on whether to buy a gift or not.

Innovation Award
PHP Programming Innovation award nominee
December 2014
Number 8


Prize: One copy of DWebPro Standard License
Every year you ask yourself if you should give a gift to certain people or even to yourself when you are not sure if you really should.

This class implements a flow chart that helps you to decide whether you should give a gift by answering a set of questions.

Manuel Lemos
Picture of Roberto Aleman
  Performance   Level  
Name: Roberto Aleman <contact>
Classes: 19 packages by
Country: Venezuela Venezuela
Age: 49
All time rank: 1391 in Venezuela Venezuela
Week rank: 73 Up2 in Venezuela Venezuela Down
Innovation award
Innovation award
Nominee: 10x

Winner: 1x

Example

<?php
/* The Xmas Gift 1.0
Author: Roberto Aleman
License: Proprietary License
www.ventics.com
*/
require_once("the_xmas_gift.php");

$gift = new the_xmas_gift();

session_start();
if (!isset(
$_SESSION['count'])) { $_SESSION['count'] = 0;}
if (isset(
$_POST["reset"])) { $gift->reset(); }
   
?>
<DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Should i buy this?</title>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<div style="text-align:center">
<form action="index.php" method="post" enctype="application/x-www-form-urlencoded" name="reset" target="_self">
<input name="Reset" type="submit" value="Reset App"></form>
<br/>
<i class="fa fa-gift fa-5x"></i><br/><h1 style="text-align:center">Should i buy this?</h1>
<div style="text-align:center">At Christmas we seek to give something to family or friends, but , do we really need to buy that gift?
According to this list of questions will help you decide whether to buy The Christmas Gift!</div>
<?php

if (isset($_GET["id"])) { $gift->get_answer($_GET["id"]);}
else {
$gift->get_answer($_SESSION['count']);}

?></div>
</body>
</html>


  DEMOExternal page  
  Files folder image Files  
File Role Description
Plain text file data.php Data data
Plain text file index.php Example example script
Plain text file the_xmas_gift.php Class main class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:285
This week:0
All time:7,552
This week:455Up