• 15-10-2010, 17:46:01
    #1
    İ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.
  • 15-10-2010, 17:48:56
    #2
    nerde takıldınız onu yazın yardımcı olalım
  • 15-10-2010, 17:50:58
    #3
    Şimdi bir tane ürün girebiliyorum ama bunu nasıl arttıracağımı bilmiyorum. Yani tek UrunKodu ve Fiyat(bunu eklemeyi unutmuşum) bölümü var tek ID'ye çoklu ürün nasıl ekleyebilirim.
  • 15-10-2010, 18:14:40
    #4
    Kimlik doğrulama veya yönetimden onay bekliyor.
    mysql UPDATE arastirin..
  • 15-10-2010, 18:23:07
    #5

    Ürün Kodu girildiğinde Ürün ile ilgili diğer bilgilerin gelmesini ve çoklu giriş yapmak istiyorum. Yani tek ID'de birçok ürü olsun
  • 15-10-2010, 18:49:56
    #6
    ürün kodu üzerinden giriş yapın yine sorguları id üzerinden değilde ürün kodu üzerinden yapın yani where sorgusu urunkodu üzerine yapılandırılsın sorunu çözücektir böylece sabit bi ürünkodu ve o ürünkoduna ait çeşitli id lerde ürünler elde edersiniz
  • 15-10-2010, 19:16:17
    #7
    olmadı
  • 15-10-2010, 19:17:23
    #8
    <?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>&nbsp;</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>&nbsp; </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">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>İndirim:</td>
          <td><input type="text" name="Indirim" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>Vergi:</td>
          <td><input type="text" name="Vergi" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>Toplam Tutar:</td>
          <td><input type="text" name="ToplamTutar" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td align="right"><input type="submit" value="Sipariş Ekle" /></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p>&nbsp;</p>
    <?php include("alt.php");?>
    </body>
    </html>
    <?php
    mysql_free_result($Stok);
    
    mysql_free_result($Musteri);
    ?>
    Sayfanın kodları
  • 16-10-2010, 15:50:07
    #9
    yok mu yapabilen biri