コード例 #1
0
ファイル: promjena.php プロジェクト: ndekic/eGost
								  	<br /><hr /><br />
								  	<?php 
select("drzavljanstvo", $drzavljanstvo, $greska);
inputDate("datumRodjenja", $greska);
input("mjestoRodjenja", $greska);
select("drzavaRodjenja", $drzave, $greska);
?>
							  		<div class="row">
								  		<div class="col-lg-6"> 
								  			<?php 
select("vrstaIsprave", $isprave, $greska);
?>
								  		</div>
								  		<div class="col-lg-6"> 
								  			<?php 
inputNumber("brojIsprave", $greska);
?>
								  		</div>
								  	</div>
								  	<input type="hidden" name="sifra" value="<?php 
echo $entitet->sifra;
?>
" />
								  	<br /><br />
								  	<div class="btn-group btn-group-justified" role="group" aria-label="...">
										  <div class="btn-group" role="group">
										    <a href="<?php 
echo $putanja;
?>
index.php" type="button" class="btn btn-default" onclick="return confirm('Želi te li sigurno odustati?')">Odustani</a>
										  </div>
コード例 #2
0
ファイル: unos.php プロジェクト: ndekic/eGost
?>
		           				</div>
		           			</div>
							<?php 
input("adresa", $greska);
?>
		           			
		           			<div class="row">
		           				<div class="col-lg-10">
		           					<?php 
select("mjesto", $mjesto, $greska);
?>
		           				</div>
		           				<div class="col-lg-2">
		           					<?php 
inputNumber("postanskiBroj", $greska);
?>
		           				</div>
		           			</div>

								  	<br /><br />
								  	<div class="btn-group btn-group-justified" role="group" aria-label="...">
										  <div class="btn-group" role="group">
										    <a href="<?php 
echo $putanja;
?>
apartman/index.php" type="button" class="btn btn-default" onclick="return confirm('Želi te li sigurno odustati?')">Odustani</a>
										  </div>
										  <div class="btn-group" role="group">
										    <input type="submit" value="Unesi" class="btn btn-default">
										  </div>
コード例 #3
0
function sumOfMultiples($multiple1 = 3, $multiple2 = 5, $floor = 1, $ceiling = 1000)
{
    $sum = 0;
    $i = $floor;
    do {
        if ($i % $multiple1 == 0 || $i % $multiple2 == 0) {
            $sum += $i;
        }
        $i++;
    } while ($i < $ceiling);
    echo "The sum of all the multiples of {$multiple1} or {$multiple2} between {$floor} and {$ceiling} = {$sum}" . PHP_EOL;
}
// makes user give a number
function inputNumber()
{
    do {
        fwrite(STDOUT, 'Please enter a number.');
        $number = trim(fgets(STDIN));
    } while (!is_numeric($number));
    return $number;
}
// Prompt user for a sum floor, sum ceiling and two multiples
fwrite(STDOUT, 'Set First Multiple ');
$multiple1 = inputNumber();
fwrite(STDOUT, 'Set Second Multiple ');
$multiple2 = inputNumber();
fwrite(STDOUT, 'Set Sum Floor ');
$floor = inputNumber();
fwrite(STDOUT, 'Set Sum Ceiling ');
$ceiling = inputNumber();
sumOfMultiples($multiple1, $multiple2, $floor, $ceiling) . PHP_EOL;
コード例 #4
0
ファイル: for.php プロジェクト: j-beere/Codeup_Exercises
<?php

function forTheUser($min = 1, $max = 10, $inc = 1)
{
    for ($i = $min; $i <= $max; $i += $inc) {
        echo $i . PHP_EOL;
    }
}
function inputNumber()
{
    do {
        fwrite(STDOUT, 'Give Me a Real Number Bro ');
        $number = trim(fgets(STDIN));
    } while (!is_numeric($number));
    return $number;
}
// Prompt user for a starting number, ending number and increment,
fwrite(STDOUT, 'Set Low Number ');
$min = inputNumber();
fwrite(STDOUT, 'Set High Number ');
$max = inputNumber();
fwrite(STDOUT, 'Set Increment Number ');
$inc = inputNumber();
forTheUser($min, $max, $inc);
コード例 #5
0
ファイル: urediOglas.php プロジェクト: ndekic/containers
          <div class="row">
            <div class="col-md-12">
              <form action="<?php 
echo $_SERVER["PHP_SELF"];
?>
" method="POST" enctype="multipart/form-data">
                  <fieldset>
                    <?php 
input("naslov", $greska);
input("adresa", $greska);
inputNumber("latitude", $greska);
inputNumber("longitude", $greska);
inputNumber("kvadratura", $greska);
inputNumber("kapacitet", $greska);
inputNumber("popunjenost", $greska);
inputNumber("cijena", $greska);
?>
                    <input type="hidden" name="sifra" value="<?php 
echo $entitet->sifra;
?>
" />
                   
                    <div class="form-group">
                      <label for="slika">Fotografija</label>
                      <input type="file" id="slika" name="slika">
                      <p class="help-block">Profila slika operatora.</p>
                    </div>
                    
                    <div class="btn-group" role="group">
                        <input type="submit" value="Unesi" class="btn btn-default">
                    </div>