Edit File: monitor.php
<?php date_default_timezone_set('Europe/Belgrade'); require_once('../configdb.php'); $datum = date("y.m.d"); $idfirme = $_GET['id']; $uplate = 0; $isplate = 0; $stanje = 0; $eu = $_GET['eu']; $eu = number_format($eu,2,'.',''); //number_format(1000.5, 2, '.', ''); $con=mysqli_connect($configdb['db_server'],$configdb['db_korisnik'],$configdb['db_lozinka'],$configdb['db_ime']); // Check connection if (mysqli_connect_errno()){ echo "Ne mogu se konektovati na bazu. " . mysqli_connect_error(); } $result = mysqli_query($con, "SELECT sum(uplata) as uplate from tiketi_osnovna where idfirme = '$idfirme' and datum = '$datum'"); while($row = mysqli_fetch_array($result)){ $uplate = $row['uplate']; } $result = mysqli_query($con, "SELECT sum(dobitak) as sdobitak from tiketi_osnovna where idfirme = '$idfirme' and datum = '$datum'"); while($row = mysqli_fetch_array($result)){ $isplate = $row['sdobitak']; } $result = mysqli_query($con, "SELECT sum(saldo) as fondi from fond where idfirme = '$idfirme'"); while($row = mysqli_fetch_array($result)){ $fond = $row['fondi']; } $result = mysqli_query($con, "SELECT sum(saldo) as jackpoti from jackpot where idfirme = '$idfirme'"); while($row = mysqli_fetch_array($result)){ $jackpot = $row['jackpoti']; } $stanje = number_format($uplate - $isplate,2); if ($uplate > 0 ){ if ($uplate <> $eu){ echo "<table style='align:center;font-size: xx-large;font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;width: 100%; text-align: left '> <tr> <td style='width:40%;'>UPLATE</td> <td id='upl' style='width:40%;text-align:right'>". $uplate ."</td> </tr> <tr> <td>ISPLATE</td> <td style='text-align:right'>". $isplate ."</td> </tr> <tr> <td>STANJE</td> <td style='text-align:right'>". $stanje ."</td> </tr> <tr> <td>JACKPOT</td> <td style='text-align:right'>". $jackpot ."</td> </tr> <tr> <td>FOND</td> <td style='text-align:right'>". $fond ."</td> </tr> </table>"; }else{ echo "0"; } }else{ echo "JOS NEMA UPLATA"; } ?>
Back