Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Kreso</title>
- </head>
- <body>
- <?php
- class model
- {
- function pohranaPodataka()
- {
- require 'data.php';
- $podaci=$data;
- return $podaci;
- }
- }
- class view
- {
- function ispisPodataka($podaci)
- {
- echo '<a href="https://kresosusec.com.hr">'.'Početna'.'</a>';
- echo '<table border="2">';
- echo '<tr><td>'.' '.'<td>'.
- 'Ime'.'<td>'.
- 'Prezime'.'<td>'.
- 'Datum'.'<td>'.
- 'Placeno'.'<tr>';
- foreach($podaci as $key=>$val)
- {
- echo '<tr><td>'.$key.'<td>'.
- $val['ime'].'<td>'.
- $val['prezime'].'<td>'.
- datum($val['datum']).'<td>';
- echo '<select>';
- if($val['placeno']=='Da')
- {
- echo '<option>'.'Da'.'</option>';
- echo '<option>'.'Ne'.'</option>';
- }
- elseif($val['placeno']=='Ne')
- {
- echo '<option>'.'Ne'.'</option>';
- echo '<option>'.'Da'.'</option>';
- }
- else
- {
- echo '<option>'.'Greska'.'</option>';
- }
- echo '</select>';
- }
- echo '</table>';
- }
- }
- class controler
- {
- public $_Model;
- public $_View;
- function __construct()
- {
- $this->_Model=new model();
- $this->_View=new view();
- }
- function start()
- {
- $podaci= $this->_Model->pohranaPodataka();
- $this->_View->ispisPodataka($podaci);
- }
- }
- $pokreni=new controler();
- $pokreni->start();
- #prostor za funkcije
- function datum($subject)
- {
- $delimiter='/[-]/';
- $polje= preg_split($delimiter, $subject);
- return $polje[2].' '.$polje[1].' '.$polje[0];
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement