<?php session_start(); if (!$_SESSION['admin']) { header("Location:login.php"); } require_once "head.php"; require_once "db_manage.php"; con_db(); $foodname = $_POST['foodname']; $foodtype = $_POST['foodtype']; $foodamount = $_POST['foodamount']; $line = 5; $pagenum = $_GET['page'] ? $_GET['page'] : 1; //total rows $totsql = "select count(*) from NonPerishableFoodinfro"; $totarr = mysql_fetch_row(mysql_query($totsql)); $pagetot = ceil($totarr[0] / $line); // limit the max page if ($pagenum >= $pagetot) { $pagenum = $pagetot; } $offset = ($pagenum - 1) * $line; //get all the data $sql = "select * from NonPerishableFoodinfro order by NPF_id limit {$offset},{$length}"; $rst = mysql_query($sql); echo "<center>"; echo "<h2>view the Nonperishable Food List | <a href='nfood_add.php'>Add Non-perishable Food</a></h2>"; echo "<table width='700px' border='1px'>"; echo "<tr>"; echo "<th>ID</th>";
<!-- mulai nulis isinya --> <div class="content-wrapper"> <div class="container"> <section class="content-header"> <h1></h1> </section> <?php $id_tutorial = $_GET['id']; $query_tutorial = "SELECT * FROM tutorial WHERE id_tutorial='{$id_tutorial}'"; $result_tutorial = mysql_query($query_tutorial); $row_tutorial = mysql_fetch_array($result_tutorial); if (isset($_POST['submit'])) { $judul = $_POST['judul']; $kategori = $_POST['kategori']; $isi = $_POST['isi']; if (con_db() != 0) { if ($pas == $pass) { $query = "UPDATE `tutorial` SET \n `judul` = '{$judul}',\n `kategori` = '{$kategori}',\n `isi` = '{$isi}' \n WHERE `id_tutorial` ='{$id_tutorial}';"; $result = mysql_query($query); if ($result) { ?> <div class="pad margin no-print"> <div class="callout callout-info" style="margin-bottom: 0!important;"> <h4><i class="fa fa-info"></i>nfo :</h4> Data Berhasil Ditambahkan ! </div> </div> <?php } else { ?> <div class="pad margin no-print">
} include '../include/koneksi.php'; function jam() { date_default_timezone_set('Asia/Jakarta'); $tgl = mktime(date("d"), date("m"), date("Y")); $date = date("Y-m-d", $tgl); return $jam = date("H:i:s"); } function tgl() { date_default_timezone_set('Asia/Jakarta'); $tgl = mktime(date("d"), date("m"), date("Y")); return $date = date("Y-m-d", $tgl); } if (con_db() != 1) { ?> <div class="pad margin no-print"> <div class="callout callout-danger" style="margin-bottom: 0!important;"> Database Belum Terhubung </div> </div> <?php } if ($_POST['name'] == "hapus" && $_POST['id'] != NULL) { $id = $_POST['id']; block_iklan($id); } elseif ($_POST['name'] == "block" && $_POST['id'] != NULL) { $id = $_POST['id']; block_admin($id); } elseif ($_POST['comentar'] != NULL && $_POST['id_user'] != NULL) {
<?php /** * Example of JSON data for calendar * * @package zabuto_calendar */ include_once 'ez_sql_core.php'; include_once 'ez_sql_mysql.php'; include 'conn.php'; //echo "sql="."insert into booking_details('booking_title','booking_date') values('$title','$dateval')"; $db =& con_db(); $results = $db->get_results("SELECT * FROM booking_details"); if ($results) { foreach ($results as $user) { $time = strtotime($user->booking_date); $newformat = date('Y-m-d', $time); $dates[] = array('date' => $newformat, 'badge' => false, 'title' => 'Example for ' . $newformat, 'body' => '<p class="lead">Information for this date</p><p>You can add <strong>html</strong> in this block</p>', 'footer' => 'Extra information'); if (!empty($_REQUEST['grade'])) { $dates[]['badge'] = false; $dates[]['classname'] = 'grade-' . rand(1, 4); } if (!empty($_REQUEST['action'])) { $dates[]['title'] = 'Action for ' . $newformat; $dates[]['body'] = '<p>The footer of this modal window consists of two buttons. One button to close the modal window without further action.</p>'; $dates[]['body'] .= '<p>The other button [Go ahead!] fires myFunction(). The content for the footer was obtained with the AJAX request.</p>'; $dates[]['body'] .= '<p>The ID needed for the function can be retrieved with jQuery: <code>dateId = $(this).closest(\'.modal\').attr(\'dateId\');</code></p>'; $dates[]['body'] .= '<p>The second argument is true in this case, so the function can handle closing the modal window: <code>myFunction(dateId, true);</code></p>'; $dates[]['footer'] = ' <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary" onclick="dateId = $(this).closest(\'.modal\').attr(\'dateId\'); myDateFunction(dateId, true);">Go ahead!</button>
function DeleteRegion($rid) { $rcode = ""; $con = con_db(); if ($con == -1) { echo "<script>alert('failure in connecting the database')</script>"; } $sql = "delete from Region where R_id='" . $rid . "'"; if (!mysql_query($sql, $con)) { echo "<script>alert('failing in deleting')</script>"; echo "<script>location='region.php'</script>"; } else { echo "<script>alert('DeletedSuccessfully')</script>"; echo "<script>location='region.php'</script>"; } mysql_close($con); }