Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ispit Index.php
- <!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>Tablica</title>
- </head>
- <body>
- <?php
- require 'data.php';
- echo '<table border="2">';
- echo '<tr><th>'.' '.'<th>'.
- 'Ime'.'<th>'.
- 'Prezime'.'<th>'.
- 'Datum'.'<th>'.
- 'Placeno'.'<tr>';
- foreach($data 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>'.'Greška pri unosu'.'</option>';
- }
- echo '</select>';
- }
- echo '</table>';
- function datum($subject)
- {
- $delimiter='/[-]/';
- $polje= preg_split($delimiter, $subject);
- return $polje[0].' '.$polje[1].' '.$polje[2];
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement