Müşteriler diye ayrı bir tablo oluşturuyosun daha sonra her müşteriye bir id yani müşteri numarası veriyosun..
Sonrasında forma kayıt eklerken birde müşteri numarasını ekleyip hangi müşterinin kaydı olduğunu ordan takip edebiliyorsun
Çok teşekkür ederim. Söylediğiniz gibi iki tablo oluşturdum.
müşteriler ve arizakayit diye.
Arama tamamlama metodunu kullanarak müşterinin kaydı varmı yokmu diye sorguluyorum.
Takıldığım nokta Arıza kaydı formuma müşterimi nasıl dahil edeceğim?
Form sayfam;
<?php include("baglanti.php"); ?>
<!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>Teknik Servis v1</title>
<link rel="stylesheet" href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css">
<script src="jquery/jquery-1.11.3.min.js"></script>
<script src="jquery/jquery-ui.min.js"></script>
<link rel="stylesheet" href="jquery/jquery-ui.css"/>
<script>
$(function(){
var $search = $('#search');
$search.autocomplete({
source: 'kapi.php',
focus: function(event, ui){
$search.val(ui.item.mus_telefon);
},
select: function(event, ui){
// window.location.href = 'https://www.google.com/#q=' + ui.item.mus_adi;
$search.val(ui.item.mus_telefon);
}
});
$search.data('.ui-autocomplete-loading')._renderItem = function( ul, item ){
var $li = $('<li>');
$li.html('<a href="#">' +
'<span class="username">' + item.mus_adi + '</span>' +
'</a>');
return $li.appendTo(ul);
};
});
</script>
<style>
body {
}
#genel {
width:800px;
height:600px;
margin:0 auto;
}
#form {
//margin-left:300px;
margin-top:30px;
}
#form label {
float:left;
padding:5px;}
//* search *//
#search {
width: 300px;
}
.ui-autocomplete li a {
overflow: hidden;
display: block;
}
.ui-autocomplete li a img {
float: left;
margin-right: 10px;
height: 40px;
}
.ui-autocomplete li a .username {
display: block;
font-size: 12px;
line-height: 17px;
background-color:#000;
}
.ui-autocomplete li a .email {
display: block;
font-size: 12px;
color: #999;
}
.ui-autocomplete-loading {
background: #fff url(ajax-loader.gif) no-repeat 97%;
}
//* search *//
</style>
</head>
<body>
<div id="genel">
<?php
$tarih = date("d.m.Y"); // Geçerli sistem tarihini almak için
$saat = date("H:i:s"); // Geçerli sistem saatini almak için
echo "Tarih : ".$tarih." - ";
echo "Saat : ".$saat;
?>
<form style="border:6px solid #00E7FF;" id="form" name="form" method="post" action="gonder.php">
<label for="textarea"></label>
<table width="800" border="0">
<tr>
<td colspan="3"><strong>Teknik Servis Kayıt</strong></td>
</tr>
<tr>
<td width="156"> </td>
<td width="9"> </td>
<td width="376"> </td>
</tr>
<tr>
<td><strong>Adı Soyadı</strong></td>
<td><strong>:</strong></td>
<td><label for="mus_adi"></label>
<input name="mus_adi" id="search" value="" type="text" size="25" title="Lütfen Müşteri Adı Yazınız!" required style="border:2px inset #00E7FF; padding:5px; "/>
</td>
</tr>
<tr>
<td><strong>Telefon</strong></td>
<td><strong>:</strong></td>
<td><label for="mus_telefon"></label>
<input name="mus_telefon" maxlength="11" title="Lütfen Telefon Numarası Yazınız!" type="text" id="telefon" size="25" value="0" required style="border:2px inset #00E7FF; padding:5px; "/></td>
</tr>
<tr>
<td><strong>Tarih</strong></td>
<td><strong>:</strong></td>
<td><label for="tarih"></label>
<input name="tarih" type="type" id="tarih" disabled="disabled" size="25" value="<?php echo "$tarih"; ?> - <?php echo "$saat"; ?>" style="border:2px inset #00E7FF; padding:5px; " />
<input name="tarih" type="type" id="tarih" hidden="visible" size="25" value="<?php echo "$tarih"; ?> - <?php echo "$saat"; ?>" style="border:2px inset #00E7FF; padding:5px; " /></td>
</tr>
<tr>
<td><strong>Not</strong></td>
<td><strong>:</strong></td>
<td><label for="nott"></label>
<textarea name="nott" id="nott" cols="40" rows="3" style="border:2px inset #00E7FF; padding:5px; "></textarea></td>
</tr>
<tr>
<td><strong>Arıza</strong></td>
<td><strong>:</strong></td>
<td>
<div style="padding:6px; font-weight:bold;">Lütfen Bir Arıza Bildirin!</div>
<input type='checkbox' name='ariza[]' value='Arıza Tespit' />Arıza Tespit</input></br>
<input type='checkbox' name='ariza[]' value='Bilgisayar Açılmıyor' />Bilgisayar Açılmıyor</input></br>
<input type='checkbox' name='ariza[]' value='Şarj Aleti Var' />Şarj Aleti Var</input></br></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><table width="345" border="0">
<tr>
<td width="222"> </td>
<td width="98"><input type="submit" name="submit" id="submit" value="Formu Gönder" /></td>
</tr>
</table></td>
</tr>
</table>
</form>
<div style="margin-top:10px; margin-left:300px;"><a href="musterikayit.php">Müşteri Ekle</a> - <a href="goster.php">Kayıtları Gör</a></div>
</div>
</body>
</html>Post Sayfam;
<!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>Teknik Servis v1</title>
<style type="text/css">
.onay
{
margin-left:auto; width:400px; height:auto; margin-right:auto; padding-top:100px;
}
</style>
</head>
<body>
<?php
include("baglanti.php");
$mus_adi = $_POST['mus_adi'];
$mus_telefon = $_POST['mus_telefon'];
$tarih = $_POST['tarih'];
$nott = $_POST['nott'];
$ariza = $_POST['ariza'];
if($ariza==''){
echo "<div class='onay'>Lütfen Bir Arıza Bildirin!</div><br>";
}
else if($_POST)
{
$checkbox = implode($_POST['ariza'],'<br> ');
mysql_query("insert into teknik (id, mus_id, mus_adi, mus_telefon, nott, ariza, tarih) values (Null, '$mus_id', '$mus_adi', '$mus_telefon', '$nott', '$checkbox' , '$tarih')");
echo "<div class='onay'>İşlem başarılı..</div>";
header("location:index.php");
}
else{
echo "<div class='onay'>İşlem başarısız..</div>";
}
?>
</body>
</html>