Example #1
0
Za bojenje u crveno ispred reci stavite 'q' na posle reci 'Q'
<div id="add_text">
	<form method="post" action="process.php">
		<input type="text" name="motivacion" size="100">
		<input type="submit" name="dodaj_motivacion" value="Dodaj" class="graybtn">
	</form>
</div>
<?php 
$prep = new Motivation();
$motivation = $prep->getAll();
foreach ($motivation as $motiv) {
    $txt = str_replace("q", "<span style='background:red;'>", $motiv->text);
    $txt = str_replace("Q", "</span>", $txt);
    ?>
		<form action="process.php" method="post" id="<?php 
    echo $motiv->id;
    ?>
">
			<label for="motiv_status"><?php 
    if ($motiv->status == 1) {
        echo "<b style='color:yellow;'>AKTIVNA </b> | ";
    }
    echo $txt;
    ?>
</label>
			<input type="hidden" value="<?php 
    echo $motiv->id;
    ?>
" name="id">
			<input type="submit" name="update_motivation" value="Aktiviraj" class="graybtn">	
			<input type="submit" name="delete_motivation" value="Izbrisi" class="graybtn">	
Example #2
0
">
	  					<img src="images/main/<?php 
    echo $naslovSanitize . ".jpeg";
    ?>
"/>
	  				</a>
	  				<div class="text"><a href="<?php 
    echo $naslov;
    ?>
"><?php 
    echo $naslov;
    ?>
</a>
	  				</div>
	 			 </div>
				<?php 
}
?>
	</div>	<!-- end of #slider -->
</div><!-- end of #banner -->

<div id="motivation_quote">
	<h2>
	<?php 
$prep = new Motivation();
$motivation = $prep->getId("1", "status");
$txt = str_replace("q", "<span class='mq_span'>", $motivation->text);
$txt = str_replace("Q", "</span>", $txt);
echo "<h2>" . $txt . "</h2>";
?>
</div><!-- end of #motivation_quote -->
Example #3
0
    $kom->komentar_id = $_GET['dodajkom'];
    $kom->status = "1";
    $kom->update();
    header("Location: admin.php?id=2");
}
//brisanje komentara
if (isset($_GET['brisikom'])) {
    $db = Singleton::getInstance();
    $conn = $db->conn;
    $id = $_GET['brisikom'];
    $q = $conn->query("delete from komentari where komentar_id='{$id}'");
    header("Location: admin.php?id=2");
}
//dodavanje motivacije
if (isset($_POST['dodaj_motivacion'])) {
    $mot = new Motivation();
    $mot->text = $_POST['motivacion'];
    $mot->status = "0";
    $mot->insert();
    header("Location: admin.php?id=2&cat=dodaj_motivaciju.php");
}
//aktiviranje motivacije
if (isset($_POST['update_motivation'])) {
    $db = Singleton::getInstance();
    $conn = $db->conn;
    $prep = $conn->prepare("update motivation_quote set status=0");
    $prep->execute();
    $id = $_POST["id"];
    $a = $conn->prepare("update motivation_quote set status=1 where id={$id}");
    $a->execute();
    header("Location: admin.php?id=2&cat=dodaj_motivaciju.php");