Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <?php
- error_reporting(0);
- foreach ($_POST['iddetail'] as $key => $iddetail) {
- $idpembelian = $_POST['idpembelian'][$key];
- $nameID = $_POST['nameID'][$key];
- $idproduk = substr($nameID, 0,3);
- $date = $_POST['date'][$key];
- $merk = substr($nameID, 3);
- $hargabeli = $_POST['hargabeli'][$key];
- $hargajual = $_POST['hargajual'][$key];
- $qty = $_POST['qty'][$key];
- $con1=!is_numeric($hargabeli);
- $con2=!is_numeric($hargajual);
- if(empty($iddetail) || empty($idpembelian) || empty($idproduk) || empty($merk) || empty($hargabeli) || empty($hargajual) || empty($qty)) {
- $err1=1;
- }else if (($con1) || ($con2)){
- $err2=1;
- }else{
- $err3;
- }
- }
- if($err1){
- echo ("<table align='center'><tr bgcolor='iceblue'><td align='center' width='1024'> <font face='calibri' color='white'>
- Data insert is uncomplete
- </table></tr></td>");
- }
- if($err2){
- echo ("<table align='center'><tr bgcolor='iceblue'><td align='center' width='1024'> <font face='calibri' color='white'>
- Input price must be numeric
- </table></tr></td>");
- }
- if($err3){
- echo ("<table align='center'><tr bgcolor='iceblue'><td align='center' width='1024'> <font face='calibri' color='white'>
- Your data has been save
- </table></tr></td>");
- }
- echo '</table>';
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment