Postingan lainnya
data tidak ter input
<!DOCTYPE html>
<html>
<head>
<title>Sistem Baru</title>
<link rel="stylesheet" href="css/bootstrap.css" />
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/theme.css" />
<link rel="stylesheet" href="css/MoneAdmin.css" />
<link rel="stylesheet" href="css/font-awesome.css" />
<link rel="stylesheet" href="css/datepicker.css" />
</head>
<body>
<?php
$con=mysql_connect("localhost","root","");
if(!$con){
die("gagal konek".mysql_error());
}
$db=mysql_select_db("db_simpuskesmas",$con);
if(!$db){
die("gagal konek db".mysql_error());
}
if(isset($_POST['submit'])){
$tgl_pendaftaran=$_POST['tgl_pendaftaran'];
$nama=$_POST['nama'];
$nama_kk=$_POST['nama_kk'];
$no_nik=$_POST['no_nik'];
$tgl_lahir=$_POST['tgl_lahir'];
$alamat=$_POST['alamat'];
$jenis_kelamin=$_POST['jenis_kelamin'];
$bayar=$_POST['bayar'];
$rujukan=$_POST['rujukan'];
$hub_keluarga=$_POST['hub_keluarga'];
//echo "$tgl_pendaftaran, $nama, $no_nik, $tgl_lahir, $alamat, $jenis_kelamin, $bayar, $rujukan, $hub_keluarga";
//$query="insert into koding";
$query="insert into tb_pasien (tgl_pendaftaran, nama, nama_kk, no_nik, tgl_lahir, alamat, jenis_kelamin, bayar, rujukan, hub_keluarga) value('$tgl_pendaftaran','$nama','$nama_kk','$no_nik','$tgl_lahir','$alamat','$jenis_kelamin','$bayar','$rujukan','$hub_keluarga')";
$result=mysql_query($query,$con);
if($result==1)
{
echo "DATA TERSIMPAN";
}
else{
echo"value not| saved";
}
}
?>
<div class="box">
<header>
<h5 text-align="center">Input Data Pasien</h5>
</header>
<div class="body">
<form action="" method="post" class="form-horizontal">
<div class="form-group">
<label class="control-label col-lg-4">Tanggal Pendaftaran</label>
<div class="col-lg-4">
<input type="date" name="tgl_pendaftaran" value="" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Nama Pasien</label>
<div class="col-lg-4">
<input type="text" name="nama" value="" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Nama Kepala Keluarga</label>
<div class="col-lg-4">
<input type="text" name="nama_kk" value="" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Nomor KTP</label>
<div class="col-lg-4">
<input type="text" name="no_nik" value="" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Tanggal Lahir</label>
<div class="col-lg-4">
<input type="date" name="tgl_lahir" value="" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-4">Alamat</label>
<div class="col-lg-4">
<input type="textarea" name="alamat" value="" class="form-control" />
</div>
</div>
<div class="form-goup"><label class="control-label col-lg-4">Jenis Kelamin</label></div>
<div class="buying-selling-group" id="buying-selling-group">
<label class="btn btn-default buying-selling">
<input type="radio" name="jenis_kelamin">
<span class="radio-dot"></span>
<span class="buying-selling-word">L</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="jenis_kelamin">
<span class="radio-dot"></span>
<span class="buying-selling-word">P</span>
</label>
</div><br />
<div class="form-goup"><label class="control-label col-lg-4">Jenis Pembayaran</label></div>
<div class="buying-selling-group" id="buying-selling-group">
<label class="btn btn-default buying-selling">
<input type="radio" name="bayar">
<span class="radio-dot"></span>
<span class="buying-selling-word">BPJS PBI</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="bayar">
<span class="radio-dot"></span>
<span class="buying-selling-word">BPJS NON PBI</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="bayar">
<span class="radio-dot"></span>
<span class="buying-selling-word">BAYAR</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="bayar">
<span class="radio-dot"></span>
<span class="buying-selling-word">JAMKESDA</span>
</label>
</div><br />
<div class="form-goup"><label class="control-label col-lg-4">Rujukan</label></div>
<div class="buying-selling-group" id="buying-selling-group">
<label class="btn btn-default buying-selling">
<input type="radio" name="rujukan">
<span class="radio-dot"></span>
<span class="buying-selling-word">Rujukan PU</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="rujukan">
<span class="radio-dot"></span>
<span class="buying-selling-word">Rujukan KIA</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="rujukan">
<span class="radio-dot"></span>
<span class="buying-selling-word">Lainnya</span>
</label>
</div><br />
<div class="form-goup"><label class="control-label col-lg-4">Rujukan</label></div>
<div class="buying-selling-group" id="buying-selling-group">
<label class="btn btn-default buying-selling">
<input type="radio" name="hub_keluarga">
<span class="radio-dot"></span>
<span class="buying-selling-word">Istri</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="hub_keluarga">
<span class="radio-dot"></span>
<span class="buying-selling-word">Anak</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="hub_keluarga">
<span class="radio-dot"></span>
<span class="buying-selling-word">Lainnya</span>
</label>
</div><br />
<div class="form-actions no-margin-bottom" style="text-align:center;">
<input type="submit" name="submit" value="simpan" class="btn btn-primary"></div>
</form>
</div>
</div>
<div class="form-actions no-margin-bottom" style="text-align:center;">
<a class="btn btn-primary" href="index.php" role="button">Daftar Pasien</a></div>
</body>
</html>
<script src="js/jquery-2.0.3.min.js"></script>
<script src="/bootstrap-datepicker.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/modernizr-2.6.2-respond-1.1.0.min.js"></script>
mohon bantuannya gan, data dari jenis kelamin sampe kebawah gak ter input di database,, kenapa yaa ?
0
4 Jawaban:
fungsi mysql_query ngga pake parameter koneksi gan,
fungsi mysql_query("tulis kueri disini")
kalo agan pake mysqli_query, baru dikasih 2 parameter, 1 koneski, 1nya lagi querynya,
mysqli_query($koneksi, "tulis query disini")
0
coba periksa lagi koneksi nya bro,
0
udah dicoba, malah yg keinput cuma yg data type nya text, yg radio button gak kesimpen
0
Yaiyalah ga masuk orang gada value-nya
<label class="btn btn-default buying-selling">
<input type="radio" name="jenis_kelamin" value="P">
<span class="radio-dot"></span>
<span class="buying-selling-word">P</span>
</label>
<label class="btn btn-default buying-selling">
<input type="radio" name="jenis_kelamin" value="L">
<span class="radio-dot"></span>
<span class="buying-selling-word">L</span>
</label>
0