コード例 #1
0
ファイル: oop.php プロジェクト: Andrius-B/akademija
$date2 = '2014-10-26 9:13';
$bid3 = "Bert";
$value3 = 15.5;
$date3 = '2015-10-26 15:00';
$Bids = array(new Bid($bid1, $value1, $date1), new Bid($bid2, $value2, $date2), new Bid($bid3, $value3, $date3));
echo "<dl>";
echo "<dt>{$Auction1->getArticle()}</dt>\n    <dd><p>{$Auction1->getAnotation()}</p>\n    <p>Price: {$Auction1->getPrice()}&euro;</p>\n    <p>Ended {$Auction1->getDate()}</p>\n    <p><ul>\n        <li>{$Bids[2]->getName()}; {$Bids[2]->getValue()}&euro;; {$Bids[2]->getDate()}; Sold;</li>\n        <li>{$Bids[1]->getName()}; {$Bids[1]->getValue()}&euro;; {$Bids[1]->getDate()}</li>\n        <li>{$Bids[0]->getName()}; {$Bids[0]->getValue()}&euro;; {$Bids[0]->getDate()}</li>\n    </ul></p>\n    </dd>";
$name1 = "Miguel Howard";
$mail1 = "*****@*****.**";
$gender1 = "male";
$Users[0] = new User($name1, $mail1, $gender1);
$article = "Linen Jacket";
$anotation = "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.";
$price = 135;
$time = "2015-10-29 12:00";
$Auction1 = new Auction($article, $price, $anotation, $time);
$bid1 = "Miguel";
$value1 = 140;
$date1 = '2015-10-28 13:58';
$Bids[0] = new Bid($bid1, $value1, $date1);
$bid2 = "Rush";
$value2 = 155;
$date2 = '2014-10-29 9:13';
$Bids[1] = new Bid($bid2, $value2, $date2);
echo "<dt>{$Auction1->getArticle()}</dt>\n    <dd><p>{$Auction1->getAnotation()}</p>\n    <p>Price: {$Auction1->getPrice()}&euro;</p>\n    <p>Ends {$Auction1->getDate()}</p>\n    <p><ul>\n        <li>{$Bids[1]->getName()}; {$Bids[1]->getValue()}&euro;; {$Bids[1]->getDate()}</li>\n        <li>{$Bids[0]->getName()}; {$Bids[0]->getValue()}&euro;; {$Bids[0]->getDate()}</li>\n    </ul></p>\n    </dd>";
echo "</dl>";
$Users[] = new User("Andrius Bankauskas", "*****@*****.**", "male");
$Bids[1] = new Bid("ThankYou", "5", "2015-10-29 12:00");
$Auction1->setArticle("Buy food")->setAnotation("very tasty!")->setPrice("5")->setDate("2015-10-29 12:00");
echo "<dt>{$Auction1->getArticle()}</dt>\n    <dd><p>{$Auction1->getAnotation()}</p>\n    <p>Price: {$Auction1->getPrice()}&euro;</p>\n    <p>Ends {$Auction1->getDate()}</p>\n    <p><ul>\n        <li>{$Bids[1]->getName()}; {$Bids[1]->getValue()}&euro;; {$Bids[1]->getDate()} Sold!</li>\n        <li>{$Bids[0]->getName()}; {$Bids[0]->getValue()}&euro;; {$Bids[0]->getDate()}</li>\n    </ul></p>\n    </dd>";
echo "</dl>";