<?php
//koneksi ke database
include "../konek.php";
//membaca data dari database
$result = mysql_query("select distinct album from foto ");
//menampilkan foto
$row=mysql_fetch_array($result);
$album=stripslashes($row['album']);
?>
<? $result1 = mysql_query("select * from foto where album='$album'"); ?>
<table border="0" style="text-align:center">
<tr>
<?php
$i = 1;
while($row1 = mysql_fetch_array($result1)){
?>
<td>
<a class="fancybox-buttons" data-fancybox-group="button" href="../gallery/upload/<?php echo $row1['nama_file'];?>" >
<img src="../gallery/upload/<?php echo $row1['nama_file'];?>" alt="" width="200" height="200" />
</a>
<?php echo $row1['deskripsi'];?><br>
</td>
<?php
if($i % 3 == 0){
echo '</tr><tr>';
}
$i++;
}
?>
</tr>
</table>
script ini keluar fotonya hanya satu album saja,,,album lain ga'<div id="bingkai_1">
<form name="info_barang_1" method="post">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<th colspan="2" align="center">Info Penjualan Barang</th>
</tr>
<tr>
<td>Tanggal :
<input type="text"
name="txtTanggal"
id="txtTanggal"
size="8"
maxlength="10"
value="<?=date('Y-m-d');?>"
onblur="LoadJual_1(); return false;"/>
</td>
<td>Total Penjualan Rp. :
<input type="text"
name="txtJual_1"
id="txtJual_1"
value="0"
size="15"
style="text-align:right"
readonly="readonly" />
</td>
</tr>
</table>
</form>
</div>
var recReq = getXmlHttpRequestObject();
var showdata_jual_1='txtJual_1'
function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if(window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert('Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.');
}
}
function LoadJual_1() {
document.getElementById( showdata_jual_1 ).value = 'Loading ...';
if (recReq.readyState == 4 || recReq.readyState == 0) {
recReq.open("GET", '/barang/report/info_jual_1.php', true );
recReq.onreadystatechange = function() {
if (recReq.readyState == 4 && recReq.status == 200 ) {
document.getElementById( showdata_jual_1 ).value = recReq.responseText;
}
}
recReq.send(null);
}
}
<?php
require_once( '.././opendb.php' );
$tgl = $_POST['txtTanggal'];
$sql = mysql_query( "SELECT SUM( tot_gab ) as tot_jual FROM trs WHERE tgl='$tgl'" );
while( $data = mysql_fetch_array( $sql ) ) {
echo $data['tot_jual'];
}
?>
<?php if( $_POST['btn_show'] == Show ) { ?>
<div id="info_jual"></div>
<? } else { ?>
<div id="bingkai_1">
<form name="info_barang_2" method="post">
<table cellpadding="1" cellspacing="1" width="100%">
<tr>
<th>Info Penjualan Barang</th>
</tr>
<tr>
<td align="center">
<input type="submit"
name="btn_show"
id="btn_show"
value="Show"
onclick="LoadJual_2(); return false;" />
</td>
</tr>
</table>
</form>
</div>
<? } ?>
var recReq = getXmlHttpRequestObject();
var showdata_jual_2='info_jual'
function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if(window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert('Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.');
}
}
function LoadJual_2() {
document.getElementById( showdata_jual_2 ).innerHTML = 'Loading ...';
if (recReq.readyState == 4 || recReq.readyState == 0) {
recReq.open("GET", '/barang/report/info_jual_2.php', true );
recReq.onreadystatechange = function() {
if (recReq.readyState == 4 && recReq.status == 200 ) {
document.getElementById( showdata_jual_2 ).innerHTML = recReq.responseText;
}
}
recReq.send(null);
}
}
<?php
require_once( '.././opendb.php' );
$sql = mysql_query( "SELECT SUM( tot_gab ) as tot_jual FROM trs" );
while( $data = mysql_fetch_array( $sql ) ) {
echo $data['tot_jual'];
}
?>
<?php
$host = "localhost";
$user = "root";
$pass = "rahasia";
$dbnm = "project";
$conn = mysql_connect($host, $user, $pass);
if ($conn) {
$open = mysql_select_db($dbnm);
if (!$open) {
die ("Database tidak dapat dibuka karena ".mysql_error());
}
} else {
die ("Server MySQL tidak terhubung karena ".mysql_error());
}
//akhir koneksi
#ambil data di tabel dan masukkan ke array
$query = "SELECT * FROM tenant ORDER BY kode";
$sql = mysql_query ($query);
$data = array();
while ($row = mysql_fetch_assoc($sql)) {
array_push($data, $row);
}
#setting judul laporan dan header tabel
$judul = "Tenant";
$header = array(
array("label"=>"Code Tenant", "length"=>30, "align"=>"L"),
array("label"=>"Company Name", "length"=>50, "align"=>"L"),
array("label"=>"Corporate Name", "length"=>30, "align"=>"L"),
array("label"=>"Location", "length"=>50, "align"=>"L"),
array("label"=>"Room", "length"=>30, "align"=>"L"),
array("label"=>"Water", "length"=>50, "align"=>"L"),
array("label"=>"Telephone", "length"=>30, "align"=>"L"),
array("label"=>"Fax", "length"=>50, "align"=>"L"),
array("label"=>"Email", "length"=>80, "align"=>"L"),
array("label"=>"Website", "length"=>30, "align"=>"L")
);
#sertakan library FPDF dan bentuk objek
require_once ("fpdf/fpdf.php");
$pdf = new FPDF();
$pdf->AddPage();
#tampilkan judul laporan
$pdf->SetFont('Arial','B','16');
$pdf->Cell(0,20, $judul, '0', 1, 'C');
#buat header tabel
$pdf->SetFont('Arial','','10');
$pdf->SetFillColor(255,0,0);
$pdf->SetTextColor(255);
$pdf->SetDrawColor(128,0,0);
foreach ($header as $kolom) {
$pdf->Cell($kolom['length'], 5, $kolom['label'], 1, '0',
$kolom['align'], true);
}
$pdf->Ln();
#tampilkan data tabelnya
$pdf->SetFillColor(224,235,255);
$pdf->SetTextColor(0);
$pdf->SetFont('');
$fill=false;
foreach ($data as $baris) {
$i = 0;
foreach ($baris as $cell) {
$pdf->Cell($header[$i]['length'], 5, $cell, 1, '0',
$kolom['align'], $fill);
$i++;
}
$fill = !$fill;
$pdf->Ln();
}
#output file PDF
$pdf->Output();
?>
<tr><td>Matakuliahr</td> <td><select name='kode_matakuliah' onChange='this.form.submit()'>;
<option value=0 selected></option>";
$sql=mysql_query("SELECT * FROM matakuliah ORDER BY nama_matakuliah");
while($data=mysql_fetch_array($sql)){
echo "<option value=$data[kode_jurusan]>$data[nama_matakuliah]</option>";}
id_persaratan nama kode
1 Surat Permohonan Dari Perusahaan rptka001
12 Foto Copy Pembayaran Dana Kompensasi (DPKK) rptka001
11 Foto Copy Paspor, VISA rptka001
10 Foto Copy KITAS rptka001
9 Foto Copy IMTA Terakhir rptka001
8 Foto Copy RPTKA Terakhir rptka001