İyi günler,
Arkadaşlar php ile satış takip sistemi yapıyorum(yapmaya çalışıyorum) fakat sipariş sayfasını bir türlü yapamadım siparis diye tablom var tablo içeriği:
`SiparisID` int(11) NOT NULL AUTO_INCREMENT,
`UrunKodu` varchar(50) DEFAULT NULL,
`Vergi` decimal(10,2) DEFAULT NULL,
`Indirim` decimal(10,2) DEFAULT NULL,
`ToplamTutar` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`SiparisID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Yardımcı olacak arkadaşlara şimdiden teşekkürler.
Satış Sayfası Yardım
8
●447
- 15-10-2010, 18:14:40Kimlik doğrulama veya yönetimden onay bekliyor.mysql UPDATE arastirin..
- 15-10-2010, 19:17:23
<?php require_once('Connections/baglanti.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO siparisler (UrunKodu, Fiyat, Vergi, Indirim, ToplamTutar, Miktar) VALUES (%s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['UrunKodu'], "text"), GetSQLValueString($_POST['Fiyat'], "double"), GetSQLValueString($_POST['Vergi'], "double"), GetSQLValueString($_POST['Indirim'], "double"), GetSQLValueString($_POST['ToplamTutar'], "double"), GetSQLValueString($_POST['Miktar'], "int")); mysql_select_db($database_baglanti, $baglanti); $Result1 = mysql_query($insertSQL, $baglanti) or die(mysql_error()); } if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_baglanti, $baglanti); $query_Stok = "SELECT * FROM siparisler"; $Stok = mysql_query($query_Stok, $baglanti) or die(mysql_error()); $row_Stok = mysql_fetch_assoc($Stok); $totalRows_Stok = mysql_num_rows($Stok); $colname_Musteri = "-1"; if (isset($_GET['MusteriID'])) { $colname_Musteri = $_GET['MusteriID']; } mysql_select_db($database_baglanti, $baglanti); $query_Musteri = sprintf("SELECT * FROM musteriler WHERE MusteriID = %s", GetSQLValueString($colname_Musteri, "int")); $Musteri = mysql_query($query_Musteri, $baglanti) or die(mysql_error()); $row_Musteri = mysql_fetch_assoc($Musteri); $totalRows_Musteri = mysql_num_rows($Musteri); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Sipariş Ekle</title> <?php include("ust.php");?> <p> </p> <form action="<?php echo $editFormAction; ?>" method="POST" name="form1" id="form1"> <table width="50%" cellspacing="0"> <tr><th>Müşteri Bilgileri:</th><td></td></tr> <tr> <td>Müşteri Kodu:</td> <td><?php echo $row_Musteri['MusteriID']; ?></td> </tr> <tr> <td>Adı Soyadı:</td> <td><?php echo $row_Musteri['AdiSoyadi']; ?></td> </tr> <tr> <td>Adres:</td> <td><?php echo $row_Musteri['Adres']; ?></td> </tr> <tr> <td>Telefon:</td> <td><?php echo $row_Musteri['Telefon']; ?></td> </tr> <tr> <td>Vergi Dairesi / No</td> <td><?php echo $row_Musteri['VergiDairesi']; ?>V.D / <?php echo $row_Musteri['VergiNo']; ?></td> </tr> </table> <p> </p> <table width="100%" align="center"> <tr valign="baseline"> <td nowrap="nowrap" align="right">Ürün Kodu:</td> <td>Ürün Adı</td> <td>Ürün Açıklama</td> <td>Ölçüsü</td> <td>Miktarı</td> <td>Fiyat:</td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"><input type="text" name="UrunKodu" value="" size="32" /></td> <td><label> <input name="UrunAdi" type="text" id="UrunAdi" value="" /> </label></td> <td><label> <input type="text" name="UrunAciklama" id="UrunAciklama" value="" /> </label></td> <td><label> <input type="text" name="Olcusu" id="Olcusu" value="" /> </label></td> <td><label> <input type="text" name="Miktar" id="Miktar" value="" /> </label></td> <td><input type="text" name="Fiyat" size="32" value="" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"><input name="UrunKodu" type="text" id="UrunKodu" value="" size="32" /></td> <td><label> <input name="UrunAdi" type="text" id="UrunAdi" value="" /> </label></td> <td><label> <input type="text" name="UrunAciklama" id="UrunAciklama" value="" /> </label></td> <td><label> <input type="text" name="Olcusu" id="Olcusu" value="" /> </label></td> <td><label> <input type="text" name="Miktar" id="Miktar" value="" /> </label></td> <td><input type="text" name="Fiyat" size="32" value="" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td> </td> <td> </td> <td> </td> <td>İndirim:</td> <td><input type="text" name="Indirim" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td> </td> <td> </td> <td> </td> <td>Vergi:</td> <td><input type="text" name="Vergi" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td> </td> <td> </td> <td> </td> <td>Toplam Tutar:</td> <td><input type="text" name="ToplamTutar" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td> </td> <td> </td> <td align="right"> </td> <td> </td> <td align="right"><input type="submit" value="Sipariş Ekle" /></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1" /> </form> <p> </p> <?php include("alt.php");?> </body> </html> <?php mysql_free_result($Stok); mysql_free_result($Musteri); ?>Sayfanın kodları
