Jumat, 19 Juli 2013

PHP Indonesia - Facebook: gan mau tan ya saya mau hapus scrip bagian ini ...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/
gan mau tan ya saya mau hapus scrip bagian ini ...
Jul 10th 2013, 14:04, by Gondo Malaikat

Gondo Malaikat 2:04pm Jul 10
gan mau tan ya saya mau hapus scrip bagian ini Kg: <select name="kg" size=1>
<option value="1kg"> 1kg </option>
<option value="2kg"> 2kg </option>
<option value="3kg"> 3kg </option></select> kalu scrip ini saya hapus perkaliannya gk bsa jalan,,, gmna cranya klo scrip ini saya hapus maka per kaliaannya bisa tetp bejalan ini scrip komplitnya <html>
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="header">
<br>
<marquee behavior="alternate" style="font-family: impact;font-size:30px;color:#000000;" align="top" direction="right">
<h1 align="center"></h1
></marquee>
</div>
<div id="leftbar">
<div class="menu">
<ul>
<a href="index.php"><img src="image/5.png" height="80" width="100"></a>
<a href="tips.php"><img src="image/1.png" height="80" width="100"></a>
<a href="ikan_order.php"><img src="image/2.png" height="60" width="100"></a>
<a href="order_benih.php"><img src="image/3.png" height="60" width="100"></a>
<a href="HARGA_IKAN.php"><img src="image/7.jpg" height="60" width="100"></a>
<a href="HARGA_BENIH.php"><img src="image/6.jpg" height="60" width="100"></a><br>
<a href="kontak.php"><img src="image/4.png" height="60" width="100"></a>
</ul>
</div>
</div>
<div id="contain">
<script>
function cek()
{
var huruf=/^[A-Za-z]{1,}$/;
var angka=/^[0-9]{1,}$/;

var nama=document.forms["dform"]["nama"].value;
var no_hp=document.forms["dform"]["no_hp"].value;
if (nama==null || nama=="" )
{
alert(" Nama Tidak Boleh kosong");
return false;
}
else if (no_hp==null || no_hp=="" )
{
alert(" no_hp Tidak Boleh kosong");
return false;
}
else if(!huruf.test(nama))
{
alert(" Nama Harus Huruf");
return false;
}
else if(!angka.test(no_hp))
{
alert(" no_telp Harus Angka");
return false;
}
else
{
return true;
}
}
</script>
<script language="JavaScript">
function totalbayar()
{
var nama=(document.dform.nama.value);
var benih=(document.dform.benih.value);
var kg=(document.dform.kg.value);
var jml_kg=parseFloat(document.dform.ijml_kg.value);

var harga=0.0;
var total=0.0;
var diskon=0.0;
var totbay=0.0;

if ((benih =="nila")&& (kg=="1kg"))
{ harga=70000;} else if
((benih =="nila")&& (kg=="2kg"))
{ harga=40000;} else
if ((benih =="nila")&& (kg=="3kg"))
{ harga=100000;} else

if ((benih =="gurame")&& (kg=="1kg"))
{ harga=80000;} else
if ((benih =="gurame")&& (kg=="2kg"))
{ harga=50000;} else
if ((benih =="gurame")&& (kg=="3kg"))
{ harga=20000;} else

if ((benih =="mas")&& (kg=="1kg"))
{ harga=90000;} else
if ((benih =="mas")&& (kg=="2kg"))
{ harga=60000;} else
{ harga=30000;}

total=harga* jml_kg;

if (document.dform.ya.checked==true)
{ diskon =0.10*total;} else
{ diskon =0.0; }

totbay=total;

document.dform.oharga.value=eval(harga);
document.dform.total.value=eval(total);
document.dform.odiskon.value=eval(diskon);
document.dform.ototbay.value=eval(totbay);

}
</script>
<font face ="candara">
<form name ="dform" action="savebenih.php" onsubmit="return cek()" method="post">
<table border ="1" align ="center" width ="70%" cellpadding="0" cellspacing="0">
<tr> <td width="100%" colspan="2">
<h2 align ="center"> Pemesan </h2> </td> </tr>
<tr> <td width ="50%"> <pre>
Nama : <input type="text" size="20" name="nama">
Alamat : <input type="text" size="20" name="alamat">
No tlp : <input type="text" size="20" name="no_hp">

Nama Benih : <select name="benih" size=1>
<option>Pilih</option>
<option value="nila"> nilai </option>
<option value="gurame"> gurame </option>
<option value="mas"> mas </option></select>

Kg: <select name="kg" size=1>
<option value="1kg"> 1kg </option>
<option value="2kg"> 2kg </option>
<option value="3kg"> 3kg </option></select>

Jumlah : <input type="text" size="20" name="ijml_kg",ijml_kw,ijml_ton">
<input type="hidden" name="ya"></td> </pre>

<td width ="50%"> <pre>
Harga /KG:<input type="text" size="20" name="oharga">
Total :<input type="text" size="20" name="total">
</td>
</tr> <tr>
<td colspan="2"><center>
<input type="button" value="hitung" onClick="totalbayar()">
<input type="reset" value="reset">
<input name="simpan" type="submit" id="simpan" value="kirim"/>
</center>
</td></tr>
</table>
</form>
</div>
</body>
</html><div id="footer">
<p align="center">BBI Balai Benih Ikan</p>
</div>

Veetoe Adewinata 2:10pm Jul 10
Mbok nulisnya di Pastebin aja gan -___-

Gondo Malaikat 2:20pm Jul 10
mohon bntuannya

Wisnu Adi Screamo 2:42pm Jul 10
Mungkin kesalahan terdapat di script ini : var jml_kg=parseFloat (document.dform.ijml_kg.valu

Gondo Malaikat 2:45pm Jul 10
solusinya gan

Wisnu Adi Screamo 2:49pm Jul 10
Ganti kodenya jadi : var jml_kg=parseFloat (document.dform.ijml_kg.value);

Wisnu Adi Screamo 2:52pm Jul 10
Atau, bsok saya coba script punya mas ini di komp saya. kalau sudah bisa saya beri scriptnya

Gondo Malaikat 2:53pm Jul 10
ok gnn saya tunggu

Wisnu Adi Screamo 2:58pm Jul 10
Itu <select name="kg">nya mau di hapus?

Gondo Malaikat 3:02pm Jul 10
iya gn kalu itu saya hapus perkaliannya gk bisajalan gn,, pertanyaan nya <select name="kg"> saya hapus hasil perkaliannya biar tetap berjalan

Wisnu Adi Screamo 3:04pm Jul 10
Ok, akan saya usahakan. besok mungkin jam 09:30 - 10:30 selesai.

Gondo Malaikat 3:05pm Jul 10
ok gn think you a tunggu besok gann

Ahmad Teguh Satria 3:06pm Jul 10
itu prasaan ga bisa dibandingin deh, $a == "kg"

Ahmad Teguh Satria 3:07pm Jul 10
prasaan pake fungsi str apa gitu yg buat bandingin, ga bisa samadengan 2 kali, prasaan sih...

Wisnu Adi Screamo 3:07pm Jul 10
@gondo : ya

Al Ghurahy 4:14pm Jul 10
Kg: <select name="kg" size=1>
<option value="1kg"> 1kg </option>
<option value="2kg"> 2kg </option>
<option value="3kg"> 3kg </option></select>

yg diatas ini mau dihapus?

kl gitu ini juga harus dihapus:

var kg=(document.dform.kg.value);

karena ngelink ke element select nya, trus semua IF yg pake variable kg == "1kg" atau 2kg 3kg itu juga dihapus.

kg uda kaga boleh dipake.

Wisnu Adi Screamo 3:20am Jul 11
Script berikut udah bisa untuk aritmatikanya, tinggal di tambahin acuan buat harga.
Misal harga nila persatuannya berapa, gitu....
ini kodenya :

<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="header">
<br>
<marquee behavior="alternate" style="font-family: impact;font-size:30px;color:#000000;" align="top" direction="right">
<h1 align="center"></h1
></marquee>
</div>
<div id="leftbar">
<div class="menu">
<ul>
<a href="index.php"><img src="image/5.png" height="80" width="100"></a>
<a href="tips.php"><img src="image/1.png" height="80" width="100"></a>
<a href="ikan_order.php"><img src="image/2.png" height="60" width="100"></a>
<a href="order_benih.php"><img src="image/3.png" height="60" width="100"></a>
<a href="HARGA_IKAN.php"><img src="image/7.jpg" height="60" width="100"></a>
<a href="HARGA_BENIH.php"><img src="image/6.jpg" height="60" width="100"></a><br>
<a href="kontak.php"><img src="image/4.png" height="60" width="100"></a>
</ul>
</div>
</div>
<div id="contain">
<script>
function cek()
{
var huruf=/^[A-Za-z]{1,}$/;
var angka=/^[0-9]{1,}$/;

var nama=document.forms["dform"]["nama"].value;
var no_hp=document.forms["dform"]["no_hp"].value;
if (nama==null || nama=="" )
{
alert(" Nama Tidak Boleh kosong");
return false;
}
else if (no_hp==null || no_hp=="" )
{
alert(" no_hp Tidak Boleh kosong");
return false;
}
else if(!huruf.test(nama))
{
alert(" Nama Harus Huruf");
return false;
}
else if(!angka.test(no_hp))
{
alert(" no_telp Harus Angka");
return false;
}
else
{
return true;
}
}
</script>
<script language="JavaScript">
function totalbayar()
{
var nama=(document.dform.nama.value);
var benih=(document.dform.benih.value);
var jml_kg=parseFloat(document.dform.ijml_kg.value);

var harga=0.0;
var total=0.0;
var diskon=0.0;
var totbay=0.0;

total=harga *ya;

if (document.dform.ya.checked==true)
{ diskon =0.10*total;} else
{ diskon =0.0; }

totbay=total;

document.dform.oharga.value=eval(harga);
document.dform.total.value=eval(total);
document.dform.odiskon.value=eval(diskon);
document.dform.ototbay.value=eval(totbay);

}
</script>
<font face ="candara">
<form name ="dform" action="savebenih.php" onsubmit="return cek()" method="post">
<table border ="1" align ="center" width ="70%" cellpadding="0" cellspacing="0">
<tr> <td width="100%" colspan="2">
<h2 align ="center"> Pemesan </h2> </td> </tr>
<tr> <td width ="50%"> <pre>
Nama : <input type="text" size="20" name="nama">
Alamat : <input type="text" size="20" name="alamat">
No tlp : <input type="text" size="20" name="no_hp">

Nama Benih : <select name="benih" size=1>
<option>Pilih</option>
<option value="nila"> nilai </option>
<option value="gurame"> gurame </option>
<option value="mas"> mas </option></select>

Jumlah : <input type="text" size="20" name="ijml_kg">
<input type="hidden" name="ya"></td> </pre>

<td width ="50%"> <pre>
Harga /KG:<input type="text" size="20" name="oharga">
Total :<input type="text" size="20" name="total">
</td>
</tr> <tr>
<td colspan="2"><center>
<input type="button" value="hitung" onClick="totalbayar()">
<input type="reset" value="reset">
<input name="simpan" type="submit" id="simpan" value="kirim"/>
</center>
</td></tr>
</table>
</form>
</div>
</body>
</html><div id="footer">
<p align="center">BBI Balai Benih Ikan</p>
</div>

Wisnu Adi Screamo 3:24am Jul 11
Fixed dari kode di atas, tapi harga masih kayak per kilo, tinggal di edit harga dan di tambahkan sedikit script :

<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="header">
<br>
<marquee behavior="alternate" style="font-family: impact;font-size:30px;color:#000000;" align="top" direction="right">
<h1 align="center"></h1
></marquee>
</div>
<div id="leftbar">
<div class="menu">
<ul>
<a href="index.php"><img src="image/5.png" height="80" width="100"></a>
<a href="tips.php"><img src="image/1.png" height="80" width="100"></a>
<a href="ikan_order.php"><img src="image/2.png" height="60" width="100"></a>
<a href="order_benih.php"><img src="image/3.png" height="60" width="100"></a>
<a href="HARGA_IKAN.php"><img src="image/7.jpg" height="60" width="100"></a>
<a href="HARGA_BENIH.php"><img src="image/6.jpg" height="60" width="100"></a><br>
<a href="kontak.php"><img src="image/4.png" height="60" width="100"></a>
</ul>
</div>
</div>
<div id="contain">
<script>
function cek()
{
var huruf=/^[A-Za-z]{1,}$/;
var angka=/^[0-9]{1,}$/;

var nama=document.forms["dform"]["nama"].value;
var no_hp=document.forms["dform"]["no_hp"].value;
if (nama==null || nama=="" )
{
alert(" Nama Tidak Boleh kosong");
return false;
}
else if (no_hp==null || no_hp=="" )
{
alert(" no_hp Tidak Boleh kosong");
return false;
}
else if(!huruf.test(nama))
{
alert(" Nama Harus Huruf");
return false;
}
else if(!angka.test(no_hp))
{
alert(" no_telp Harus Angka");
return false;
}
else
{
return true;
}
}
</script>
<script language="JavaScript">
function totalbayar()
{
var nama=(document.dform.nama.value);
var benih=(document.dform.benih.value);
var jml_kg=parseFloat(document.dform.ijml_kg.value);

var harga=0.0;
var total=0.0;
var diskon=0.0;
var totbay=0.0;

total=harga *jml_kg;

if (document.dform.ya.checked==true)
{ diskon =0.10*total;} else
{ diskon =0.0; }

if ((benih =="nila")&& (jml_kg=="1"))
{ harga=70000;} else if
((benih =="nila")&& (jml_kg=="2"))
{ harga=40000;} else
if ((benih =="nila")&& (jml_kg=="3"))
{ harga=100000;} else

if ((benih =="gurame")&& (jml_kg=="1"))
{ harga=80000;} else
if ((benih =="gurame")&& (jml_kg=="2"))
{ harga=50000;} else
if ((benih =="gurame")&& (jml_kg=="3"))
{ harga=20000;} else

if ((benih =="mas")&& (jml_kg=="1"))
{ harga=90000;} else
if ((benih =="mas")&& (jml_kg=="2"))
{ harga=60000;} else
{ harga=30000;}

totbay=total;

document.dform.oharga.value=eval(harga);
document.dform.total.value=eval(total);
document.dform.odiskon.value=eval(diskon);
document.dform.ototbay.value=eval(totbay);

}
</script>
<font face ="candara">
<form name ="dform" action="savebenih.php" onsubmit="return cek()" method="post">
<table border ="1" align ="center" width ="70%" cellpadding="0" cellspacing="0">
<tr> <td width="100%" colspan="2">
<h2 align ="center"> Pemesan </h2> </td> </tr>
<tr> <td width ="50%"> <pre>
Nama : <input type="text" size="20" name="nama">
Alamat : <input type="text" size="20" name="alamat">
No tlp : <input type="text" size="20" name="no_hp">

Nama Benih : <select name="benih" size=1>
<option>Pilih</option>
<option value="nila"> nilai </option>
<option value="gurame"> gurame </option>
<option value="mas"> mas </option></select>

Jumlah : <input type="text" size="20" name="ijml_kg">
<input type="hidden" name="ya"></td> </pre>

<td width ="50%"> <pre>
Harga /KG:<input type="text" size="20" name="oharga">
Total :<input type="text" size="20" name="total">
</td>
</tr> <tr>
<td colspan="2"><center>
<input type="button" value="hitung" onClick="totalbayar()">
<input type="reset" value="reset">
<input name="simpan" type="submit" id="simpan" value="kirim"/>
</center>
</td></tr>
</table>
</form>
</div>
</body>
</html><div id="footer">
<p align="center">BBI Balai Benih Ikan</p>
</div>

Gondo Malaikat 4:53am Jul 11
ok gn saya coba dulu

Gondo Malaikat 5:00am Jul 11
gn kenapa totalnya gk bisa muncul gan

Wisnu Adi Screamo 7:30am Jul 11
tadi saya coba bisa

Gondo Malaikat 7:31am Jul 11
saya coba gak bsa tu gan,,hasil nya 0 tuh

Gondo Malaikat 7:34am Jul 11
saya coba gak bsa tu gan,,hasil nya 0 tuh

Wisnu Adi Screamo 7:57am Jul 11
itu 0 karena belum di set harganya, silahkan tambahkan coding untuk harganya.

Gondo Malaikat 7:58am Jul 11
ooo tk coba dulu gan

Gondo Malaikat 8:01am Jul 11
hrga yg ada di scrip itu di rubah ya gan

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar