<form name="form1" method="post" action="pilih_kandidat.php">
<table width="1002" border="10" align="center" >
<tr>
<td><p align="center" class="style21"><strong>.::</strong> <strong><span class="style13">DATA KARYAWAN</span></strong> <strong>::.</strong></span></p>
<table width="978" border="1" align="center" bordercolor="#0033FF" class="style22" >
<tr bgcolor="#666666" class="style4">
<td width="43" ><div align="center" class="style18" >Pilih</div></td>
<td width="115" ><div align="center" class="style18" >Nip</div></td>
<td width="152" ><div align="center" class="style18" >Nama</div></td>
<td width="192" ><div align="center" class="style18" >Alamat</div></td>
<td width="77" ><div align="center" class="style18" >JK</div></td>
<td width="145" ><div align="center" class="style18" >Jabatan</div></td>
<td width="129" ><div align="center" class="style18" >Devisi</div></td>
<td width="70" ><div align="center" class="style18" >Gol</div></td>
</tr>
<?php
$koneksi=mysql_connect("localhost", "root", "")
or die ("Gagal konek server".mysql_error());
mysql_select_db("spk",$koneksi)
or die ("Database gagal dibuka".mysql_error());
$hal = $_GET[hal];
if(!isset($_GET['hal'])){
$page = 1;
} else {
$page = $_GET['hal'];
}
$max_results = 10;
$from = (($page * $max_results) - $max_results);
$no=1;
$sql = "SELECT karyawan.nip,karyawan.nama,karyawan.alamat,karyawan.jk,jabatan.jabat,jabatan.devisi,jabatan.golongan
FROM karyawan JOIN jabatan ON karyawan.nip=jabatan.nip ORDER BY karyawan.nip asc LIMIT $from, $max_results ";
$qry = mysql_query($sql, $koneksi)
or die ("Query Gagal ".mysql_error());
while($data=mysql_fetch_array($qry)){
?>
<tr>
<td align="center"><input type="checkbox" name="chk[]" id="chk" value="<?=$data['nip'];?>"/></td>
<td><div align="left" class="style38 style10"><?php echo $data['nip']; ?></div></td>
<td><div align="center" class="style24"><?php echo $data['nama']; ?></div></td>
<td><div align="center" class="style24"><?php echo $data['alamat']; ?></div></td>
<td><div align="center" class="style24"><?php echo $data['jk']; ?></div></td>
<td><div align="center" class="style24"><?php echo $data['jabat']; ?></div></td>
<td><div align="center" class="style24"><?php echo $data['devisi']; ?></div></td>
<td><div align="center" class="style24"><?php echo $data['golongan']; ?></div></td>
</tr>
<?php $no=$no+1;} ?>
</table>
<input type="submit" name="submit" value="Pilih !!" id="submit">
<div align="center" class="style18">
<?php
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM
karyawan"),0);
$total_pages = ceil($total_results / $max_results);
if($hal > 1){
$prev = ($page - 1);
echo "<a style='text-decoration:none' class='style18' href=$_SERVER[PHP_SELF]?hal=$prev> <-Prev </a> ";
}
for($i = 1; $i <= $total_pages; $i++){
if(($hal) == $i){
echo "$i ";
} else {
echo "<a style='text-decoration:none' class='style5' href=$_SERVER[PHP_SELF]?hal=$i>$i</a> ";
}
}
if($hal < $total_pages){
$next = ($page + 1);
echo "<a style='text-decoration:none' class='style18' href=$_SERVER[PHP_SELF]?hal=$next>Next-></a>";
}
echo "</center>";
?>
</span></div></td>
</tr>
</table>
</form>
dan ini proses insert data ke tabel lain<?php
include "config.php";
$id = $_POST [chk];
$banyaknya = count($id);
if($_POST['submit'])
{
for ($i=0; $i<$banyaknya; $i++)
{
$sql = "insert into kandidat (nip) value ('$id')";
$trus = mysql_query($sql);
}
if ($trus)
{
print "Record berhasil diInsert<br>";
print "<a href=data_kandidat.php>Klik disini untuk kembali</a>";
}
}
?>
* Trigger structure for table `detail_pengadaan` */
DELIMITER $$
/*!50003 DROP TRIGGER*//*!50032 IF EXISTS */ /*!50003 `t_insert_pengadaan` */$$
/*!50003 CREATE */ /*!50017 DEFINER = 'root'@'localhost' */ /*!50003 TRIGGER `t_insert_pengadaan` AFTER INSERT ON `detail_pengadaan` FOR EACH ROW BEGIN
update barang set brg_stok = brg_stok + new.dada_qty WHERE brg_id = new.brg_id;
END */$$
DELIMITER ;
/* Trigger structure for table `detail_tau` */
DELIMITER $$
/*!50003 DROP TRIGGER*//*!50032 IF EXISTS */ /*!50003 `t_insert_tau` */$$
/*!50003 CREATE */ /*!50017 DEFINER = 'root'@'localhost' */ /*!50003 TRIGGER `t_insert_tau` AFTER INSERT ON `detail_tau` FOR EACH ROW BEGIN
update barang set brg_stok = brg_stok - new.dtau_qty WHERE brg_id = new.brg_id;
END */$$
DELIMITER ;
Mohon bantuannya, terimakasih..... <form class="block-content form" action="add_company_profile.php" method="post">
<h1>Company Profile<a href="http://localhost/ABMS/halaman_master.php"><img src="images/icons/fugue/navigation-180.png" width="16" height="16"> Back</a></h1>
<div class="block-header">Register New Tenant</div>
<div class="columns">
<div class="colx2-left">
<fieldset>
<legend>Profile</legend>
<table cellpadding="3" class="table-padding">
<tr title="Required">
<td><b>Company Name</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="nama_perusahaan" validation="isNotEmpty" title="Full name" style="width:300px" value="" /></td>
</tr>
<tr title="Required">
<td><b>Address</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="alamat" validation="isNotEmpty" title="Full name" style="width:300px" value="" /></td>
</tr>
<tr title="Required">
<td><b>Email</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="email" validation="isNotEmpty" title="Full name" style="width:300px" value="" /></td>
</tr>
<tr title="Required">
<td><b>Website</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="website" validation="isNotEmpty" title="Full name" style="width:300px" value="" /></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Important</legend>
<table cellpadding="3" class="table-padding">
<tr title="Required">
<td><b>NPWP</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="npwp" validation="isNotEmpty" title="Full name" style="width:300px" value="" /></td>
</tr>
<tr title="Required">
<td><b>Tanggal Pengukuhan</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="tanggal_pengukuhan" validation="isNotEmpty" title="Full name" style="width:300px" value="" /></td>
</tr>
</table>
</fieldset>
</div>
<div class="colx2-right">
<fieldset>
<legend>Number</legend>
<table cellpadding="3" class="table-padding">
<tr>
<td><b>Telephone</b></td>
<td>:</td>
<td><input type="text" name="telephone" value="" /></td>
</tr>
<tr>
<td><b>Fax</b></td>
<td>:</td>
<td><input type="text" name="fax" value="" /></td>
</tr>
<tr>
<td><b>Contact Person</b></td>
<td>:</td>
<td><input type="text" name="kontak_person" value="" /></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Logo</legend>
<table cellpadding="3" class="table-padding">
<tr>
<td><b>Logo</b></td>
<td>:</td>
<td><input type="hidden" name="MAX_FILE_SIZE" value = "800000" />
<br>
<input name="photo" type="file" id="photo" size="30" /></td>
</tr>
</table>
</fieldset>
</div>
</div>
<div class="block-footer" style="height:30px;">
<div class="float-right">
<button type="submit"><img src="images/icons/fugue/tick-octagon.png" width="16" height="16"> Save</button>
<button type="reset" class="grey" onclick="this.form.reset();"><img src="images/icons/fugue/arrow-circle.png" width="16" height="16"> Reset</button>
<button type="reset" class="red" onclick="document.location.href='http://localhost/jadi/tenant.php';"><img src="images/icons/fugue/cross-white.png" width="16" height="16"> Cancel</button>
</div>
</div>
</form>
<?php
mysql_connect ("localhost", "root", "rahasia");
mysql_select_db ("abms");
$nama = htmlspecialchars($_POST['nama_perusahaan']);
$alamat = htmlspecialchars($_POST['alamat']);
$tlp = htmlspecialchars($_POST['telephone']);
$fax = htmlspecialchars($_POST['fax']);
$email = htmlspecialchars($_POST['email']);
$website = htmlspecialchars($_POST['website']);
$kontak = htmlspecialchars($_POST['kontak_person']);
$npwp = htmlspecialchars($_POST['npwp']);
$tgl = htmlspecialchars($_POST['tanggal_pengukuhan']);
if (empty($nama))
{die ("isikan nama perusahaan");}
elseif (empty($npwp))
{die ("isikan nomor npwp");}
else
{
$cekdata = "select nama_perusahaan from company_profile where nama_perusahaan='$nama'";
$ada = mysql_query($cekdata) or die(mysql_error());
if(mysql_num_rows($ada)>0)
{die ("nama telah terdaftar");}
else {
if (!empty($_FILES['photo']["tmp_name"]))
{
$namafolder = "photo/";
$jenis_gambar = $_FILES['photo']['type'];
if ($jenis_gambar=="image/jpeg" || $jenis_gambar=="image/jpg" || $jenis_gambar=="image/gif" || $jenis_gambar=="image/png")
{
$photo = $namafolder . basename($_FILES['photo']['name']);
if (!move_uploaded_file($_FILES['photo']['tmp_name'], $photo))
{ die("Gambar gagal dikirim"); }
} else { die("Jenis gambar yang anda kirim salah. Harus .jpg .gif .png"); }
}
mysql_query ("insert into company_profile values('$nama','$alamat','$tlp','$fax','$email','$website','$kontak','$npwp','$tgl','$photo') ");
echo "<h1>Berhasil</h1>";
echo "<br>";
}
}
?>
SELECT calon_siswa.namalengkap,calon_siswa.tempatlahir,calon_siswa.tgllahir,siswaseleksi.no_seleksi,keahlian.nm_keahlian,lolos.ket FROM calon_siswa INNER JOIN siswaseleksi ON calon_siswa.no_daftar = siswaseleksi.no_daftar INNER JOIN keahlian ON calon_siswa.kd_keahlian = keahlian.kd_keahlian INNER JOIN lolos ON siswaseleksi.no_seleksi = lolos.no_seleksi
WHERE siswaseleksi.no_seleksi like '%$no_seleksi%' lolos.ket='DITERIMA' " ;
$result = mysql_query($sql);
if(mysql_num_rows($result) > 0){
?>