SHOW:
|
|
- or go back to the newest paste.
| 1 | - | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 1 | + | <!-- |
| 2 | KENAPA KAMU NGAK NULIS QUERY DI FUNGSI YANG PALING BAWAH | |
| 3 | KUKIRA KAMU MENGERTI KOMEN2 YANG KUKASI!!!! | |
| 4 | --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| 5 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
| 6 | <head> | |
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| 8 | <title>Untitled Document</title> | |
| 9 | </head> | |
| 10 | ||
| 11 | - | $C_TIM=$_POST["C_TIM"]; |
| 11 | + | |
| 12 | - | $HARI=$_POST["HARI"]; |
| 12 | + | |
| 13 | - | $TGL=$_POST["TGL"]; |
| 13 | + | |
| 14 | - | $KET=$_POST["KET"]; |
| 14 | + | $C_TIM=$_POST["C_TIM"]; |
| 15 | - | $KTP=$_POST["KTP"]; |
| 15 | + | $HARI=$_POST["HARI"]; |
| 16 | - | $NM=$_POST["NM"]; |
| 16 | + | $TGL=$_POST["TGL"]; |
| 17 | - | $TMPT_LHIR=$_POST["TMPT_LHIR"]; |
| 17 | + | $KET=$_POST["KET"]; |
| 18 | - | $TGL_LHIR=$_POST["TGL_LHIR"]; |
| 18 | + | $KTP=$_POST["KTP"]; |
| 19 | - | $PKERJAAN=$_POST["PKERJAAN"]; |
| 19 | + | $NM=$_POST["NM"]; |
| 20 | - | $ALAMAT=$_POST["ALAMAT"]; |
| 20 | + | $TMPT_LHIR=$_POST["TMPT_LHIR"]; |
| 21 | - | $NO_HP=$_POST["NO_HP"]; |
| 21 | + | $TGL_LHIR=$_POST["TGL_LHIR"]; |
| 22 | - | $TLP=$_POST["TLP"]; |
| 22 | + | $PKERJAAN=$_POST["PKERJAAN"]; |
| 23 | - | $ID_PEL=$_POST["ID_PEL"]; |
| 23 | + | $ALAMAT=$_POST["ALAMAT"]; |
| 24 | - | $NO_METER=$_POST["NO_METER"]; |
| 24 | + | $NO_HP=$_POST["NO_HP"]; |
| 25 | - | $TRIF_LM=$_POST["TRIF_LM"]; |
| 25 | + | $TLP=$_POST["TLP"]; |
| 26 | - | $DY_LM=$_POST["DY_LM"]; |
| 26 | + | $ID_PEL=$_POST["ID_PEL"]; |
| 27 | - | $TRIF_BR=$_POST["TRIF_BR"]; |
| 27 | + | $NO_METER=$_POST["NO_METER"]; |
| 28 | - | $DY_BR=$_POST["DY_BR"]; |
| 28 | + | $TRIF_LM=$_POST["TRIF_LM"]; |
| 29 | - | $TGNGN_NORMAL=$_POST["TGNGN_NORMAL"]; |
| 29 | + | $DY_LM=$_POST["DY_LM"]; |
| 30 | - | $GARDU=$_POST["GARDU"]; |
| 30 | + | $TRIF_BR=$_POST["TRIF_BR"]; |
| 31 | - | $TIANG=$_POST["TIANG"]; |
| 31 | + | $DY_BR=$_POST["DY_BR"]; |
| 32 | - | $NO_TOKEN=$_POST["NO_TOKEN"]; |
| 32 | + | $TGNGN_NORMAL=$_POST["TGNGN_NORMAL"]; |
| 33 | - | $NO_KSR=$_POST["NO_KSR"]; |
| 33 | + | $GARDU=$_POST["GARDU"]; |
| 34 | - | $NO_MAT=$_POST["NO_MAT"]; |
| 34 | + | $TIANG=$_POST["TIANG"]; |
| 35 | $NO_TOKEN=$_POST["NO_TOKEN"]; | |
| 36 | $NO_KSR=$_POST["NO_KSR"]; | |
| 37 | - | $randmin = "1111111111"; |
| 37 | + | $NO_MAT=$_POST["NO_MAT"]; |
| 38 | - | $randmin1 = "1234567891"; |
| 38 | + | |
| 39 | - | $randmax = "9999999999"; |
| 39 | + | |
| 40 | - | $rand1 = rand($randmin,$randmax); |
| 40 | + | $randmin = "1111111111"; |
| 41 | - | $rand2 = rand($randmin1,$randmax); |
| 41 | + | $randmin1 = "1234567891"; |
| 42 | - | $rand3 = rand($randmin,$randmin1); |
| 42 | + | $randmax = "9999999999"; |
| 43 | - | $rand4 = rand($randmax,$randmin1); |
| 43 | + | $rand1 = rand($randmin,$randmax); |
| 44 | - | $rand5 = rand($randmax,$randmin); |
| 44 | + | $rand2 = rand($randmin1,$randmax); |
| 45 | - | $KCT = $rand1.$rand2; |
| 45 | + | $rand3 = rand($randmin,$randmin1); |
| 46 | - | $KCT2 = $rand1.$rand3; |
| 46 | + | $rand4 = rand($randmax,$randmin1); |
| 47 | - | $CC = $rand1.$rand4; |
| 47 | + | $rand5 = rand($randmax,$randmin); |
| 48 | - | $FIT = $rand2.$rand3; |
| 48 | + | $KCT = $rand1.$rand2; |
| 49 | - | $PW = $rand2.$rand4; |
| 49 | + | $KCT2 = $rand1.$rand3; |
| 50 | - | $CT = $rand3.$rand4; |
| 50 | + | $CC = $rand1.$rand4; |
| 51 | - | $CT2 = $rand4.$rand5; |
| 51 | + | $FIT = $rand2.$rand3; |
| 52 | $PW = $rand2.$rand4; | |
| 53 | $CT = $rand3.$rand4; | |
| 54 | - | //query simpan yg panjang |
| 54 | + | $CT2 = $rand4.$rand5; |
| 55 | - | $aplg="INSERT INTO tm_plg VALUES ('$KTP','$NO_MAT','$C_TIM','$ID_PEL','$NO_METER','$NO_KSR','$NM','$TMPT_LHIR','$TGL_LHIR','$PKERJAAN','$ALAMAT','$NO_HP','$TLP','$KET',1,1)";
|
| 55 | + | |
| 56 | - | $bplg="INSERT INTO td_plg VALUES ('$ID_PEL','$NO_METER','$NO_TOKEN','$KTP','$HARI','$TGL','$TRIF_LM','$DY_LM','$TRIF_BR','$DY_BR','$TGNGN_NORMAL','$GARDU','$TIANG')";
|
| 56 | + | |
| 57 | - | $tkn="INSERT INTO t_token VALUES ('$NO_TOKEN','$C_TIM','$ID_PEL','$NO_METER','$KCT','$KCT2','$CT','$CT2','$CC','$FIT','$PW')";
|
| 57 | + | |
| 58 | - | $ksr="INSERT INTO t_kasir VALUES ('$NO_KSR','$C_TIM','$KTP',0)";
|
| 58 | + | |
| 59 | - | $mtr="INSERT INTO t_material VALUES ('$NO_MAT','$C_TIM','$KTP',0,0,0,0,0)";
|
| 59 | + | $stat=0; |
| 60 | $sql="select a.KTP from tm_plg a, td_plg b where a.KTP='$KTP' and NM='$NM' and a.KTP=b.KTP and b.ID_PEL=a.ID_PEL and b.NO_METER=a.NO_METER"; | |
| 61 | if(!adaIsinya($sql)){
| |
| 62 | - | echo $sql="select a.KTP from tm_plg a, td_plg b where a.KTP='$KTP' and NM='$NM' and a.KTP=b.KTP and b.ID_PEL=a.ID_PEL and b.NO_METER=a.NO_METER"; |
| 62 | + | |
| 63 | } | |
| 64 | echo "<br>$sql<br>stat=$stat"; | |
| 65 | ||
| 66 | $sql="select a.ID_PEL, a.NO_METER from td_plg a, tm_plg b where a.ID_PEL='$ID_PEL' and a.NO_METER='$NO_METER' and b.KTP=a.KTP"; | |
| 67 | - | echo $sql1="select a.ID_PEL, a.NO_METER from td_plg a, tm_plg b where a.ID_PEL='$ID_PEL' and a.NO_METER='$NO_METER' and b.KTP=a.KTP"; |
| 67 | + | |
| 68 | - | if(!adaIsinya($sql1)){
|
| 68 | + | |
| 69 | } | |
| 70 | echo "<br>$sql<br>stat=$stat"; | |
| 71 | ||
| 72 | - | echo $sql2="select a.NO_TOKEN from t_token a, td_plg b where a.NO_TOKEN='$NO_TOKEN' and a.NO_TOKEN=b.NO_TOKEN and b.ID_PEL=a.ID_PEL and a.NO_METER=b.NO_METER"; |
| 72 | + | $sql="select a.NO_TOKEN from t_token a, td_plg b where a.NO_TOKEN='$NO_TOKEN' and a.NO_TOKEN=b.NO_TOKEN and b.ID_PEL=a.ID_PEL and a.NO_METER=b.NO_METER"; |
| 73 | - | if(!adaIsinya($sql2)){
|
| 73 | + | |
| 74 | $stat++; | |
| 75 | } | |
| 76 | echo "<br>$sql<br>stat=$stat"; | |
| 77 | - | echo $sql3="select a.NO_KSR from t_kasir a, td_plg b, tm_plg c where a.NO_KSR='$NO_KSR' and a.NO_KSR=c.NO_KSR and b.ID_PEL=c.ID_PEL and b.NO_METER=c.NO_METER and c.KTP=a.KTP"; |
| 77 | + | |
| 78 | - | if(!adaIsinya($sql3)){
|
| 78 | + | $sql ="select a.NO_KSR from t_kasir a, td_plg b, tm_plg c where a.NO_KSR='$NO_KSR' and a.NO_KSR=c.NO_KSR and b.ID_PEL=c.ID_PEL and b.NO_METER=c.NO_METER and c.KTP=a.KTP"; |
| 79 | if(!adaIsinya($sql)){
| |
| 80 | $stat++; | |
| 81 | } | |
| 82 | - | echo $sql4="select a.NO_MAT from t_material a, td_plg b, tm_plg c where a.NO_MAT='$NO_MAT' and a.NO_MAT=c.NO_MAT and b.ID_PEL=c.ID_PEL |
| 82 | + | echo "<br>$sql<br>stat=$stat"; |
| 83 | ||
| 84 | - | if(!adaIsinya($sql4)){
|
| 84 | + | $sql="select a.NO_MAT from t_material a, td_plg b, tm_plg c where a.NO_MAT='$NO_MAT' and a.NO_MAT=c.NO_MAT and b.ID_PEL=c.ID_PEL |
| 85 | and b.NO_METER=c.NO_METER and c.KTP=a.KTP"; | |
| 86 | if(!adaIsinya($sql)){
| |
| 87 | $stat++; | |
| 88 | } | |
| 89 | echo "<br>$sql<br>stat=$stat"; | |
| 90 | - | $hsla=@mysql_query($aplg,$idkoneksi); |
| 90 | + | |
| 91 | - | $hslb=@mysql_query($bplg,$idkoneksi); |
| 91 | + | |
| 92 | - | $tkn=@mysql_query($tkn,$idkoneksi); |
| 92 | + | |
| 93 | - | $ksr=@mysql_query($ksr,$idkoneksi); |
| 93 | + | //query simpan yg panjang |
| 94 | - | $mtr=@mysql_query($mtr,$idkoneksi); |
| 94 | + | $aplg="INSERT INTO tm_plg VALUES ('$KTP','$NO_MAT','$C_TIM','$ID_PEL','$NO_METER','$NO_KSR','$NM','$TMPT_LHIR','$TGL_LHIR','$PKERJAAN','$ALAMAT','$NO_HP','$TLP','$KET',1,1)";
|
| 95 | $bplg="INSERT INTO td_plg VALUES ('$ID_PEL','$NO_METER','$NO_TOKEN','$KTP','$HARI','$TGL','$TRIF_LM','$DY_LM','$TRIF_BR','$DY_BR','$TGNGN_NORMAL','$GARDU','$TIANG')";
| |
| 96 | $tkn="INSERT INTO t_token VALUES ('$NO_TOKEN','$C_TIM','$ID_PEL','$NO_METER','$KCT','$KCT2','$CT','$CT2','$CC','$FIT','$PW')";
| |
| 97 | $ksr="INSERT INTO t_kasir VALUES ('$NO_KSR','$C_TIM','$KTP',0)";
| |
| 98 | $mtr="INSERT INTO t_material VALUES ('$NO_MAT','$C_TIM','$KTP',0,0,0,0,0)";
| |
| 99 | ||
| 100 | $hsla=@mysql_query($aplg,$idkoneksi); | |
| 101 | $hslb=@mysql_query($bplg,$idkoneksi); | |
| 102 | $tkn=@mysql_query($tkn,$idkoneksi); | |
| 103 | - | function adaIsinya($sql&$sql1&$sql2&$sql3&$sql4) |
| 103 | + | $ksr=@mysql_query($ksr,$idkoneksi); |
| 104 | $mtr=@mysql_query($mtr,$idkoneksi); | |
| 105 | - | //lakukan query |
| 105 | + | |
| 106 | - | //cari jumlahnya |
| 106 | + | |
| 107 | - | if($tot==0){
|
| 107 | + | |
| 108 | - | echo return FALSE; |
| 108 | + | |
| 109 | - | }else{
|
| 109 | + | die('done');
|
| 110 | - | echo return $tot; |
| 110 | + | |
| 111 | @mysql_close($idkoneksi); | |
| 112 | ||
| 113 | function adaIsinya($sql) | |
| 114 | {
| |
| 115 | $r=@mysql_query($sql); | |
| 116 | $tot=@mysql_num_rows($r); | |
| 117 | if($tot>0){
| |
| 118 | return $tot; | |
| 119 | } | |
| 120 | ||
| 121 | } | |
| 122 | ?> | |
| 123 | </body> | |
| 124 | </html> |