Beispiel #1
0
<?php

include 'Bidder.php';
include 'Article.php';
include 'Bid.php';
use Bidder\Bidder;
use Article\Article;
use Bid\Bid;
$bidder1 = new Bidder("Bert", "Rose", "*****@*****.**", "female");
$bidder2 = new Bidder("Rush", "Tommy", "*****@*****.**", "male");
$article = new Article("Gold Watch", "10", "New with tags: A brand-new, unused, and unworn item (including handmade items) in the original packaging\n    (such as the original box or bag) and/or with the original tags attached", '2015-10-26 15:45');
$bid1 = new Bid($bidder1, "12", '2015-10-25 12:22');
$bid2 = new Bid($bidder2, "13", '2014-10-26 9:13');
$bid3 = new Bid($bidder1, "15.50", '2015-10-26 15:00');
echo "<dl>";
echo "<dt>{$article->getArticle()}</dt>\n    <dd><p>{$article->getAnotation()}</p>\n    <p>Price: {$article->getPrice()}&euro;</p>\n    <p>Ended {$article->getDate()}</p>\n    <p><ul>\n        <li>{$bid3->getBidder()->getFirstName()}; {$bid3->getValue()}&euro;; {$bid3->getDate()}; Sold;</li>\n        <li>{$bid2->getBidder()->getFirstName()}; {$bid2->getValue()}&euro;; {$bid2->getDate()}</li>\n        <li>{$bid1->getBidder()->getFirstName()}; {$bid1->getValue()}&euro;; {$bid1->getDate()}</li>\n    </ul></p>\n    </dd>";
$bidder1->setFirstName("Miguel")->setLastName("Howard")->setMail("*****@*****.**")->setGender("male");
$article->setArticle("Linen Jacket")->setAnotation("It has a smooth chalk stripe pattern which gives the suit a refined look. The 6 buttons of his double\n    breasted jacket are all buttoned up with the exception of one, it adds a casual touch to an elegant look.<br>\n    The jacket is the same length all around, it has vents at either side, there's a pocket on either side and there's\n    a breast pocket which contains a stylish pocket square.")->setPrice("135")->setDate("2015-10-29 12:00");
$bid1->setBidder($bidder1)->setValue("140")->setDate('2015-10-28 13:58');
$bid2->setBidder($bidder2)->setValue("155")->setDate('2015-10-29 9:13');
echo "<dt>{$article->getArticle()}</dt>\n    <dd><p>{$article->getAnotation()}</p>\n    <p>Price: {$article->getPrice()}&euro;</p>\n    <p>Ended {$article->getDate()}</p>\n    <p><ul>\n        <li>{$bid2->getBidder()->getFirstName()}; {$bid2->getValue()}&euro;; {$bid2->getDate()}</li>\n        <li>{$bid1->getBidder()->getFirstName()}; {$bid1->getValue()}&euro;; {$bid1->getDate()}</li>\n    </ul></p>\n    </dd>";
echo "</dl>";
$bidder1->setFirstName("Zygimantas")->setLastName("Koncius")->setMail("*****@*****.**")->setGender("male");
$article->setArticle("Kebab")->setAnotation("Extremely tasty and fresh")->setPrice("50")->setDate("2015-10-29 22:00");
$bid1->setBidder($bidder1)->setValue("60")->setDate('2015-10-28 13:58');
$bid2->setBidder($bidder2)->setValue("70")->setDate('2015-10-29 9:13');
$bid3->setBidder($bidder1)->setValue("100")->setDate('2015-10-29 21:59');
echo "<dl>";
echo "<dt>{$article->getArticle()}</dt>\n    <dd><p>{$article->getAnotation()}</p>\n    <p>Price: {$article->getPrice()}&euro;</p>\n    <p>Ended {$article->getDate()}</p>\n    <p><ul>\n        <li>{$bid3->getBidder()->getFirstName()}; {$bid3->getValue()}&euro;; {$bid3->getDate()}; Sold;</li>\n        <li>{$bid2->getBidder()->getFirstName()}; {$bid2->getValue()}&euro;; {$bid2->getDate()}</li>\n        <li>{$bid1->getBidder()->getFirstName()}; {$bid1->getValue()}&euro;; {$bid1->getDate()}</li>\n    </ul></p>\n    </dd>";
$bidder1->setFirstName("Zygimantas")->setLastName("Koncius")->setMail("*****@*****.**")->setGender("male");
$article->setArticle("PC")->setAnotation("Extremely powerful, light and slim")->setPrice("420")->setDate("2015-10-31 23:59");
Beispiel #2
0
$person1 = new Person\Person();
$person1->setName("Bert Rose")->setEmail("*****@*****.**")->setGender("female");
$person2 = new Person\Person();
$person2->setName("Rush Tommy")->setEmail("*****@*****.**")->setGender("male");
$person3 = new Person\Person();
$person3->setName("Miguel Howard")->setEmail("*****@*****.**")->setGender("male");
$article1 = new Article\Article();
$article1->setArticle("Gold Watch")->setPrice(10)->setAnotation("New with tags: A brand-new, unused, and unworn item (including handmade items) in the original packaging\n    (such as the original box or bag) and/or with the original tags attached")->setDate('2015-10-26 15:45');
$articlesArray[] = $article1;
$article2 = new Article\Article();
$article2->setArticle("Silver Watch")->setPrice(5)->setAnotation("New with tags: A brand-new, unused, and unworn item (including handmade items) in the original packaging\n    (such as the original box or bag) and/or with the original tags attached")->setDate('2015-12-13 15:45');
$articlesArray[] = $article2;
$article3 = new Article\Article();
$article3->setArticle("Bronze Watch")->setPrice(2)->setAnotation("New with tags: A brand-new, unused, and unworn item (including handmade items) in the original packaging\n    (such as the original box or bag) and/or with the original tags attached")->setDate('2015-10-26 15:45');
$articlesArray[] = $article3;
$article4 = new Article\Article();
$article4->setArticle("Linen Jacket")->setAnotation("It has a smooth chalk stripe pattern which gives the suit a refined look. The 6 buttons of his double\n    breasted jacket are all buttoned up with the exception of one, it adds a casual touch to an elegant look.<br>\n    The jacket is the same length all around, it has vents at either side, there's a pocket on either side and there's\n    a breast pocket which contains a stylish pocket square.")->setPrice(135)->setDate("2015-10-29 12:00");
$articlesArray[] = $article4;
$bid1 = new Bid\Bid();
$bid1->setUser($person1)->setValue(12)->setArticle($article1)->setDate('2015-10-25 12:22');
$bidArr[$article1->getArticle()][] = $bid1;
$bid2 = new Bid\Bid();
$bid2->setUser($person2)->setValue(13)->setArticle($article1)->setDate('2015-10-25 12:22');
$bidArr[$bid2->getArticle()->getArticle()][] = $bid2;
$bid3 = new Bid\Bid();
$bid3->setUser($person1)->setValue(15.5)->setArticle($article1)->setDate('2015-10-25 12:22')->setSold('Sold');
$bidArr[$bid3->getArticle()->getArticle()][] = $bid3;
$bid4 = new Bid\Bid();
$bid4->setUser($person2)->setValue(6)->setArticle($article2)->setDate('2015-10-25 12:22');
$bidArr[$bid4->getArticle()->getArticle()][] = $bid4;
$bid5 = new Bid\Bid();