Kamis, 20 Mei 2010

Kerja Praktek Step 2

<table width="100%" cellspacing=5>
<?php
include "config/koneksi.php";
include "config/fungsi_indotgl.php";
include "config/library.php";
include "config/class_paging.php";

// Bagian Home
if ($_GET[module]=='home'){
  echo "<tr><td align=center><img src=images/welcome.jpg><br><br></td></tr>";

  // Tampilkan 3 berita terbaru
  echo "<tr><td class=judul_head>&#187; Produk Hari Ini</td></tr>";
  $terkini= mysql_query("SELECT * FROM berita,user
                          WHERE user.id_user=berita.id_user
                          ORDER BY id_berita DESC LIMIT 3");
while($t=mysql_fetch_array($terkini)){
$tgl = tgl_indo($t[tanggal]);
echo "<tr><td class=isi_kecil>$t[hari], $tgl</td></tr>";
echo "<tr><td class=judul><a href=?module=detailberita&id=$t[id_berita]>$t[judul]</a></td></tr>";
echo "<tr><td class=isi_kecil>Ditulis Oleh : $t[nama_lengkap]</td></tr>";
    echo "<tr><td class=isi>";
  if ($t[gambar]!=''){
echo "<img src='admin/foto_berita/$t[gambar]' width=150 height=120 hspace=10 border=0 align=left>";
}

Senin, 17 Mei 2010

Program Matriks

import java.io.*;
//import Console.InputConsole.*;
public class Matriks_Utama{

// Fungsi Pengurangan Matriks
public static int[][] KurangiMatriks(int[][] Matriks1, int[][] Matriks2){
int[][] Hasil = new int[Matriks1.length][Matriks2.length];
for(int i=0;i<Hasil.length;i++){
for(int j=0;j<Hasil.length;j++){
Hasil[i][j] = Matriks1[i][j] - Matriks2[i][j];
}
}

   return Hasil;
}

    // Fungsi Menampilkan Hasil Operasi ke Monitor
 

Rabu, 05 Mei 2010

Kerja Praktek Step 1 / Action Admin

<?php
session_start();
include "../config/koneksi.php";
include "../config/library.php";

$module=$_GET[module];
$act=$_GET[act];


// Menghapus data
if (isset($module) AND $act=='hapus'){
  mysql_query("DELETE FROM ".$module." WHERE id_".$module."='$_GET[id]'");
  header('location:media.php?module='.$module);
}


// Input user
elseif ($module=='user' AND $act=='input'){
  $pass=md5($_POST[password]);
  mysql_query("INSERT INTO user(id_user,
                                password,
                                nama_lengkap,
                                email)
                      VALUES('$_POST[id_user]',
                                '$pass',
                                '$_POST[nama_lengkap]',
                                '$_POST[email]')");
  header('location:media.php?module='.$module);
}

Related Posts Plugin for WordPress, Blogger...