Choose a file to view:
controller.php
index.php
model.php
view.php
or go back to the demo
<?php class CostView { // Knows how to display the model in various ways private $costModel; public function __construct(CostModel $cm ) { $this->costModel = $cm; } public function askForBid() { $html = "<div>Please enter your info to get a bid on your project:</div><br/>"; $html .= "<form action='' method='post'>"; $html .= "<table>"; $html .= " <tr>"; $html .= " <td>"; $html .= " Base hourly rate ($/hr):"; $html .= " </td>"; $html .= " <td>"; $html .= " <input type='' value='75' name='baseFee' readonly/>"; $html .= " </td>"; $html .= " </tr>"; $html .= " <tr>"; $html .= " <td>"; $html .= " Select the project size:"; $html .= " </td>"; $html .= " <td>"; $html .= " <select name='projectType'>"; $html .= " <option value='small'>Small</option>"; $html .= " <option value='medium'>Medium</option>"; $html .= " <option value='large'>Large</option>"; $html .= " </select>"; $html .= " </td>"; $html .= " </tr>"; $html .= " <tr>"; $html .= " <td>"; $html .= " How many hours to think it will take:"; $html .= " </td>"; $html .= " <td>"; $html .= " <input type='text' name='projectDuration'/>"; $html .= " </td>"; $html .= " </tr>"; $html .= " <tr>"; $html .= " <td>"; $html .= " "; $html .= " </td>"; $html .= " <td>"; $html .= " <input type='submit' name='submit' value='Submit'/>"; $html .= " </td>"; $html .= " </tr>"; $html .= "</table>"; $html .= "</form>"; return $html; } function showEstimate() { $html = "<div>Based on the complexity of your project, it will cost $". $this->costModel->get() ."</div><br/>"; $html .= "<div><a href='mvc_demo.php'>Try again?</a></div>"; return $html; } } ?>