- File koneksi (inc.connect.php)
<?php
$host ="localhost";
$user ="root";
$passwd ="123456789";
$dbh ="n2online";
$connect=mysql_connect($host,$user,$passwd);
if (!$connect)
{
echo "Tidak bisa konek pada Server";
}
// memilih database pda server
mysql_select_db($dbh) or die ( " Database nggak ada tuh ");
?>
- File Input N2 (input_n2.php)
<form action="kpc.php?id=6" method="post" enctype="multipart/form-data" name="form1" onSubmit="MM_validateForm('asal_srt','','R','no_srt','','R','perihal','','R','keterangan','','R');return document.MM_returnValue">
<tr>
<td><table width="83%" border="0" bgcolor="#ffffff">
<tr valign="top">
<td height="40" colspan="3" valign="middle"><div align="center" class="style1">INPUT DATA KEUANGAN N2 </div>
<div align="justify">
<div align="right"></div>
</div> <div align="left"></div></td>
</tr>
<tr valign="top">
<td width="49%"><div align="left">Tanggal</div> </td>
<td width="1%">:</td>
<td width="50%"><? echo "$hari, $tgl $bln $thn" ?></td>
</tr>
<tr valign="top">
<td>Kode Pos </td>
<td>:</td>
<td ><? echo $username ?></td>
</tr>
<tr valign="top">
<td>Remmitance Penerimaan </td>
<td>:</td>
<td ><div align="left">
<input type="text" name="rs1">
</div></td>
</tr>
<tr valign="top">
<td>Remmitance Pengeluaran </td>
<td>:</td>
<td ><input type="text" name="rs2"></td>
</tr>
<tr valign="top">
<td>SOPP Penerimaan </td>
<td>:</td>
<td><input type="text" name="sopp1"></td>
</tr>
<tr valign="top">
<td>SOPP Pengeluaran </td>
<td>:</td>
<td><input type="text" name="sopp2"></td>
</tr>
<tr valign="top">
<td>IPOS Penerimaan</td>
<td>:</td>
<td><input type="text" name="ipos1"></td>
</tr>
<tr valign="top">
<td>IPOS Bea </td>
<td>:</td>
<td ><input type="text" name="ipos2"></td>
</tr>
<tr valign="top">
<td>IPOS PPN </td>
<td>:</td>
<td ><input type="text" name="ipos3"></td>
</tr>
<tr valign="top">
<td>Panjar Pensiun </td>
<td>:</td>
<td ><input type="text" name="p1"></td>
</tr>
<tr valign="top">
<td>Panjar ASABRI </td>
<td>:</td>
<td ><input type="text" name="p2"></td>
</tr>
<tr valign="top">
<td>Panjar Kantor Pos </td>
<td>:</td>
<td ><div align="left">
<label></label>
<input type="text" name="p3">
</div></td>
</tr>
<tr valign="top">
<td> </td>
<td> </td>
<td > </td>
</tr>
<tr valign="top">
<td><div align="left"></div></td>
<td> </td>
<td > <input type="submit" name="submit" value="Simpan"onclick="return confirm ('Apakah Anda yakin menginputkan data ini ?')" >
<input type="button" name="batal" value="Batal" onClick="document.location.href='kpc.php';">
<!--<br> <a href="javascript:void(0);" onclick="javascript:history.go(-1);">Back </a>--> </td>
</tr>
</table></td>
</tr>
</form> - File Simpan N2 (simpan_n2.php)
<?
//////////////////////////////////////////////////
// Created By Ari Kuswanto //
// Teknik Informatika III-B` //
// Politeknik Pos Indonesia //
/////////////////////////////////////////////////
?>
<?
include"inc/inc.connect.php";
include "TGL.php";
$back="<a href=\"javascript:history.bac k();\">Disini</a>";
$date= date("Y-m-d");
$kaping=$hari.","." ".$tgl." ".$bln." ".$thn;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>lowongan_kerja</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<br><br><br>
<?
if(!ereg("^[0-9]",$sopp1))
{
$output1="<li>Penulisan SOPP Penerimaan harus dengan Angka</li>";
}
else
{ $r1="a"; }
if(!ereg("^[0-9]",$sopp2))
{
$output2="<li>Penulisan SOPP Pengeluaran harus dengan Angka</li>";
}
else
{ $r2="a"; }
if(!ereg("^[0-9]",$rs1))
{
$output3="<li>Penulisan Remmitance Penerimaan harus dengan Angka</li>";
}
else
{ $r3="a"; }
if(!ereg("^[0-9]",$rs2))
{
$output4="<li>Penulisan Remmitance Pengeluaran harus dengan Angka</li>";
}
else
{ $r4="a"; }
if(!ereg("^[0-9]",$ipos1))
{
$output5="<li>Penulisan Ipos Penerimaan harus dengan Angka</li>";
}
else
{ $r5="a"; }
if(!ereg("^[0-9]",$ipos2))
{
$output6="<li>Penulisan IPOS Bea harus dengan Angka</li>";
}
else
{ $r6="a"; }
if(!ereg("^[0-9]",$ipos3))
{
$output7="<li>Penulisan IPOS Ppn harus dengan Angka</li>";
}
else
{ $r7="a"; }
if(!ereg("^[0-9]",$p1))
{
$output8="<li>Penulisan Panjar Pensiun harus dengan Angka</li>";
}
else
{ $r8="a"; }
if(!ereg("^[0-9]",$p2))
{
$output9="<li>Penulisan Panjar ASABRI harus dengan Angka</li>";
}
else
{ $r9="a"; }
if(!ereg("^[0-9]",$p3))
{
$output10="<li>Penulisan Panjar Kantor harus dengan Angka</li>";
}
else
{ $r10="a"; }
$pesan="<ul><font color='red'>
$output1
$output2
$output3
$output4
$output5
$output6
$output7
$output8
$output9
$output10
</font></ul>";
if($r1!='a' || $r2 !='a' || $r3 !='a' || $r4 !='a' || $r5 !='a' || $r6 !='a' || $r7 !='a' || $r8 !='a' || $r9 !='a' || $r10 !='a' )
{
echo "<center><h1>VALIDITAS TAMBAH DATA KEUANGAN N2 $username </h1></center>";
echo "$pesan <br><br>";
?>
© Klik <a href='kpc.php?id=5' onclick='history.back(1);'>di sini</a> untuk kembalike form input Data Keuangan.
<?
}
elseif($r1=='a' && $r2 =='a' && $r3 =='a' && $r4 =='a' && $r5 =='a' && $r6 =='a' && $r7 =='a' && $r8 =='a' && $r9 =='a' && $r10 =='a' )
{
$perintah=mysql_query("INSERT INTO kpc ( tanggal ,
kdpos, rsterima , rskeluar , soppterima , soppkeluar ,
ipos , bea , ppn , panjarpensiun , panjarasabri ,
panjarkantor )
VALUES (
'$date' , '$username', '$rs1', '$rs2', '$sopp1',
'$sopp2', '$ipos1', '$ipos2', '$ipos3', '$p1', '$p2',
'$p3'
);");
echo "<center><h1>Input Data KPC Sukses</h1></center>";
echo "<br><center><h3>Silahkan Anda Menginputkan Esok Hari</h3></center>";
echo "<br>";
?>
<?
}
?>
</body>
</html> - File Cetak Laporan (laporan_n2.php)
<?php
session_start();
include "inc/inc.connect.php";
include "inc/switch.php";
include "TGL.php";
if (!empty($username) and !empty($password) )
{
?>
<html>
<body>
<div align="center" class="style10">LAPORAN KEUANGAN N2</div>
<table width="873" height="216" border="0">
<tr>
<td width="365" valign="top"><p align="right"> </p> </td>
<td width="498"> </td>
</tr>
<tr>
<td height="69" valign="top"><table width="342" border="0">
<tr>
<td width="336"><div align="left">Tanggal Hari ini :
<font color="#FF6600"><? echo "$hari, $tgl $bln $thn" ?></font> </div></td>
</tr>
<tr>
<td><div align="left">
<table width="200" border="1" bordercolor="#000000">
<tr>
<td><div align="center"><strong>Kode Pos : <? echo $username ?> </strong></div></td>
</tr>
</table>
</div> </td>
</tr>
</table>
</p>
</p></td>
<td><p><img src="images/Poslogo.jpg" alt="ok" width="86" height="67" />
</p>
<p> </p></td>
</tr>
<tr>
<td colspan="2"><p align="left">Laporan Keuangan N2 ini adalah sebagai berikut : </p>
<div align="left">
<table width="841" border="1" cellpadding="1" cellspacing="1">
<tr bgcolor="#666666" align="center">
<td width="61" height="16" bgcolor="#33FF33"><span class="style7">Tanggal</span> </td>
<td width="85" bgcolor="#33FF33"><span class="style7">RS3</span> </td>
<td width="68" bgcolor="#33FF33"><span class="style7">RS4</span> </td>
<td width="74" bgcolor="#33FF33"><span class="style7">SOPP1</span></td>
<td width="57" bgcolor="#33FF33"><span class="style7">SOPP2</span></td>
<td width="68" bgcolor="#33FF33"><span class="style7">IPOS Terima </span></td>
<td width="72" bgcolor="#33FF33"><span class="style9">IPOS Bea </span> </td>
<td width="78" bgcolor="#33FF33"><span class="style9">IPOS PPN </span> </td>
<td width="81" bgcolor="#33FF33"><span class="style9">Pensiun</span></td>
<td width="80" bgcolor="#33FF33"><span class="style9">ASABRI</span></td>
<td width="83" bgcolor="#33FF33"><span class="style9">Kantor </span> </td>
</tr>
<?
include "inc/inc.connect.php";
include "inc/TGL.php";
$perintah=mysql_query("select * from kpc where kdpos='$username' order by tanggal desc");
while($row=mysql_fetch_array($perintah))
{
?>
<?
$sum = mysql_query("SELECT SUM(rsterima) AS ttlLaba FROM kpc where kdpos='$username'");
$ttl = mysql_fetch_array($sum);
$sum2 = mysql_query("SELECT SUM(rskeluar) AS ttlLaba2 FROM kpc where kdpos='$username'");
$ttl2 = mysql_fetch_array($sum2);
$sum3 = mysql_query("SELECT SUM(soppterima) AS ttlLaba3 FROM kpc where kdpos='$username'");
$ttl3 = mysql_fetch_array($sum3);
$sum4 = mysql_query("SELECT SUM(soppkeluar) AS ttlLaba4 FROM kpc where kdpos='$username'");
$ttl4 = mysql_fetch_array($sum4);
$sum5 = mysql_query("SELECT SUM(ipos) AS ttlLaba5 FROM kpc where kdpos='$username'");
$ttl5 = mysql_fetch_array($sum5);
$sum6 = mysql_query("SELECT SUM(bea) AS ttlLaba6 FROM kpc where kdpos='$username'");
$ttl6 = mysql_fetch_array($sum6);
$sum7 = mysql_query("SELECT SUM(ppn) AS ttlLaba7 FROM kpc where kdpos='$username'");
$ttl7 = mysql_fetch_array($sum7);
$sum8 = mysql_query("SELECT SUM(panjarpensiun) AS ttlLaba8 FROM kpc where kdpos='$username'");
$ttl8 = mysql_fetch_array($sum8);
$sum9 = mysql_query("SELECT SUM(panjarasabri) AS ttlLaba9 FROM kpc where kdpos='$username'");
$ttl9 = mysql_fetch_array($sum9);
$suma = mysql_query("SELECT SUM(panjarkantor) AS ttlLabaa FROM kpc where kdpos='$username'");
$ttla = mysql_fetch_array($suma);
Comments
Post a Comment