Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / var / www / html / sman1baleendah_sch_id-1111111111111 / functions / | server ip : 104.21.89.46 your ip : 172.70.179.45 H O M E |
Filename | /var/www/html/sman1baleendah_sch_id-1111111111111/functions/fungsi_info.php |
Size | 2.93 kb |
Permission | rwxrwxrwx |
Owner | root : root |
Create time | 06-May-2025 08:13 |
Last modified | 05-May-2025 16:21 |
Last accessed | 08-Jun-2025 08:39 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
if(!defined("CMSBalitbang")) {
die("<h1>Permission Denied</h1>You don't have permission to access the this page.");
}
/*********************************************************** berita ***************************************/
function info() {
include "koneksi.php";
$kd=$_GET['kode'];
$hal=$_GET['hal'];
if ($kd=='') {
$brs=20;
$kol=10;
$byk_result=mysql_query("select * from t_info");
$byk=mysql_num_rows($byk_result);
if ($byk<=$brs)
$jml=0;
else
{
$jml=floor($byk / $brs);
$sisa= $byk % $brs;
if ($sisa!=0)
$jml++;
}
if ($hal=="")
$awal=0;
else
$awal=$brs*($hal-1);
if ($hal=="") $hal=1;
$back=$hal-1;
$next=$hal+1;
if ($hal==1) $back=1;
if ($hal==$jml) $next=$jml;
$mulai=1;
$batas=$jml;
if ($jml>$kol)
$batas=$kol;
if ($hal>$kol) {
$mulai=1+$hal-$kol;
$batas=$hal;
}
$query = "SELECT * FROM t_info order by id DESC LIMIT ".$awal.",".$brs."";
$query_result_handle = mysql_query ($query)
or die (mysql_error());
// check that there is news
$num_of_rows = mysql_num_rows ($query_result_handle);
// tambah alan untuk delete multiple
if ($jml!=0) {
$info .= "<center><a href='index.php?id=info&hal=1' style='color:000000;text-decoration:none' title='Hal 1'>Awal </a>
<a href='index.php?id=info&hal=$back' style='color:000000;text-decoration:none' title='$back'>Sebelum </a> |";
for($i=$mulai;$i<=$batas;$i++)
{
if ($i==$hal)
$info .= "<b><a href='index.php?id=info&hal=$i' style='color:000000;text-decoration:none' title='Hal $i dari $byk Data'> $i </a></b> |";
else
$info .= "<a href='index.php?id=info&hal=$i' style='color:000000;text-decoration:none' title='Hal $i dari $byk Data'> $i </a> |";
}
$info .= "<a href='index.php?id=info&hal=$next' style='color:000000;text-decoration:none' title='$next'> Lanjut</a>
<a href='index.php?id=info&hal=$jml' style='color:000000;text-decoration:none' title='Hal $jml'> Akhir</a></center>
";
}
$info .="<ul>";
while ($row = mysql_fetch_array($query_result_handle))
{
$subject = $row[subject];
$info .= "<li><a href='index.php?id=info&kode=$row[id]' class='ver10' >$subject</a>";
}
$info .="</ul>";
}
else {
$sql="select * from t_info where id='".mysql_real_escape_string($kd)."'";
if(!$alan=mysql_query($sql)) die ("Pengambilan gagal");
$row=mysql_fetch_array($alan);
$info .= "<h3><center>$row[subject]</center></h3>
Tanggal : $row[postdate]<hr style='border: dashed 1px;'> ";
$info .= "$row[isi]<br><br><a href='index.php?id=info&kode=$kd' >Kembali ke Atas</a><br>";
$info .="<hr><br><b>Info Sekolah Lainnya :</b><br><ul>";
$sql="select * from t_info where id<>'".mysql_real_escape_string($kd)."' order by id desc limit 0,5";
if(!$query=mysql_query($sql)) die ("Pengambilan gagal1 berita ");
while ($row=mysql_fetch_array($query)) {
$info .="<li><a href='index.php?id=info&kode=$row[id]' class='ver10'>$row[subject]</a></li>";
}
$info .="</ul>";
}
return $info;
}
?>
if(!defined("CMSBalitbang")) {
die("<h1>Permission Denied</h1>You don't have permission to access the this page.");
}
/*********************************************************** berita ***************************************/
function info() {
include "koneksi.php";
$kd=$_GET['kode'];
$hal=$_GET['hal'];
if ($kd=='') {
$brs=20;
$kol=10;
$byk_result=mysql_query("select * from t_info");
$byk=mysql_num_rows($byk_result);
if ($byk<=$brs)
$jml=0;
else
{
$jml=floor($byk / $brs);
$sisa= $byk % $brs;
if ($sisa!=0)
$jml++;
}
if ($hal=="")
$awal=0;
else
$awal=$brs*($hal-1);
if ($hal=="") $hal=1;
$back=$hal-1;
$next=$hal+1;
if ($hal==1) $back=1;
if ($hal==$jml) $next=$jml;
$mulai=1;
$batas=$jml;
if ($jml>$kol)
$batas=$kol;
if ($hal>$kol) {
$mulai=1+$hal-$kol;
$batas=$hal;
}
$query = "SELECT * FROM t_info order by id DESC LIMIT ".$awal.",".$brs."";
$query_result_handle = mysql_query ($query)
or die (mysql_error());
// check that there is news
$num_of_rows = mysql_num_rows ($query_result_handle);
// tambah alan untuk delete multiple
if ($jml!=0) {
$info .= "<center><a href='index.php?id=info&hal=1' style='color:000000;text-decoration:none' title='Hal 1'>Awal </a>
<a href='index.php?id=info&hal=$back' style='color:000000;text-decoration:none' title='$back'>Sebelum </a> |";
for($i=$mulai;$i<=$batas;$i++)
{
if ($i==$hal)
$info .= "<b><a href='index.php?id=info&hal=$i' style='color:000000;text-decoration:none' title='Hal $i dari $byk Data'> $i </a></b> |";
else
$info .= "<a href='index.php?id=info&hal=$i' style='color:000000;text-decoration:none' title='Hal $i dari $byk Data'> $i </a> |";
}
$info .= "<a href='index.php?id=info&hal=$next' style='color:000000;text-decoration:none' title='$next'> Lanjut</a>
<a href='index.php?id=info&hal=$jml' style='color:000000;text-decoration:none' title='Hal $jml'> Akhir</a></center>
";
}
$info .="<ul>";
while ($row = mysql_fetch_array($query_result_handle))
{
$subject = $row[subject];
$info .= "<li><a href='index.php?id=info&kode=$row[id]' class='ver10' >$subject</a>";
}
$info .="</ul>";
}
else {
$sql="select * from t_info where id='".mysql_real_escape_string($kd)."'";
if(!$alan=mysql_query($sql)) die ("Pengambilan gagal");
$row=mysql_fetch_array($alan);
$info .= "<h3><center>$row[subject]</center></h3>
Tanggal : $row[postdate]<hr style='border: dashed 1px;'> ";
$info .= "$row[isi]<br><br><a href='index.php?id=info&kode=$kd' >Kembali ke Atas</a><br>";
$info .="<hr><br><b>Info Sekolah Lainnya :</b><br><ul>";
$sql="select * from t_info where id<>'".mysql_real_escape_string($kd)."' order by id desc limit 0,5";
if(!$query=mysql_query($sql)) die ("Pengambilan gagal1 berita ");
while ($row=mysql_fetch_array($query)) {
$info .="<li><a href='index.php?id=info&kode=$row[id]' class='ver10'>$row[subject]</a></li>";
}
$info .="</ul>";
}
return $info;
}
?>