Malam mas,, sy pendatang baru mw ikt tanya ni.. buat code PHP ttg retail toko, saat dengan auto input saat saya memasukan kode pada menu kasir nya... sy ingin wktu saya memasukan kode langsung keluar nama, harga dll, dan bisa lgsung di submit n masuk ke database...

dan saya mengalami masalah pada template saya yang menggunakan template bootstrap yang menggunakan JQuery 2.1.4 sedangkan Auto input file nya,, Link Auto Input File nya : http://www.4shared.com/zip/zvH-Ao1xba/JQuery-set-input-value.html?cau2=403tNull&ua=WINDOWS

Kode PHP saya :
<!DOCTYPE html>
<html>
<head>
  <title>ShopFLO - Casier</title>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.5 -->
  <link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css">
  <!-- iCheck -->
  <link rel="stylesheet" href="../../plugins/iCheck/flat/blue.css">
  <!-- Morris chart -->
  <link rel="stylesheet" href="../../plugins/morris/morris.css">
  <!-- jvectormap -->
  <link rel="stylesheet" href="../../plugins/jvectormap/jquery-jvectormap-1.2.2.css">
  <!-- Date Picker -->
  <link rel="stylesheet" href="../../plugins/datepicker/datepicker3.css">
  <!-- Daterange picker -->
  <link rel="stylesheet" href="../../plugins/daterangepicker/daterangepicker-bs3.css">
  <!-- bootstrap wysihtml5 - text editor -->
  <link rel="stylesheet" href="../../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
</head>

<body class="hold-transition skin-blue sidebar-mini" onload="setInterval('displayServerTime()', 1000);">
<?php
  include("../../koneksi.php");
  SESSION_START();
  
  if(!isset($_SESSION['user_id'])){
    header('location:../../index.html');
  }else{
    $user = $_SESSION['user_id'];
    $sql = "SELECT * FROM t_master WHERE user = '$user'";
    $hasil = mysql_query($sql);
    $baris = mysql_fetch_array($hasil);
  }
?>
<div class="wrapper">

  <header class="main-header">
    <!-- Logo -->
    <a href="home.php" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><b>FLO</b></span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><b>Shop</b>FLO</span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- Messages: style can be found in dropdown.less-->
          <li class="dropdown messages-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-group"></i>
              <span class="label label-success"><?php $OL = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM t_login WHERE status = 'Online' ")); echo "$OL[0]";?></span>
            </a>
            <ul class="dropdown-menu">
              <li>
                <!-- inner menu: contains the actual data -->
                <ul class="menu">
                  <?php
                    $result_online = mysql_query("SELECT * FROM t_login WHERE status = 'Online' ORDER BY level DESC");
                    while($online = mysql_fetch_array($result_online))
                    {
                      echo "<li>";
                      echo "<a href='#''>";
                      echo "<div class='pull-left'>";
                      echo "<img src='../../dist/img/user2-160x160.jpg' class='img-circle' alt='User Image'>";
                      echo "</div>";
                      echo "<h4>";
                      $temp_real = mysql_fetch_array(mysql_query("SELECT * FROM t_master WHERE user = '$online[0]'"));
                      echo "<i class='fa fa-circle text-success'></i> $temp_real[1]";
                      echo "<small><i class='fa fa-clock-o'></i>Now</small>";
                      echo "</h4>";
                      echo "$temp_real[2]";
                      echo "</a>";
                      echo "</li>";
                    }

                    $result_offline = mysql_query("SELECT * FROM t_login WHERE status = 'Offline'");
                    while($offline = mysql_fetch_array($result_offline))
                    {
                      echo "<li>";
                      echo "<a href='#''>";
                      echo "<div class='pull-left'>";
                      echo "<img src='../../dist/img/user2-160x160.jpg' class='img-circle' alt='User Image'>";
                      echo "</div>";
                      echo "<h4>";
                      $temp_real = mysql_fetch_array(mysql_query("SELECT * FROM t_master WHERE user = '$offline[0]'"));
                      echo "$temp_real[1]";
                      echo "<small><i class='fa fa-clock-o'></i>Now</small>";
                      echo "</h4>";
                      echo "$temp_real[2]";
                      echo "</a>";
                      echo "</li>";
                    }
                  ?>
                  <!-- end message -->
                </ul>
              </li>
            </ul>
          </li>
          <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <img src="<?php echo "$baris[4]";?>" class="user-image" alt="User Image">
              <span class="hidden-xs"><?php echo"$baris[1]"; ?></span>
            </a>
            <ul class="dropdown-menu">
              <!-- User image -->
              <li class="user-header">
                <img src="<?php echo "$baris[4]";?>" class="img-circle" alt="User Image">

                <p>
                  <?php echo"$baris[1]  -  $baris[2]" ?>
                  <small><?php $tahun = substr($baris[3], 0, 4); $bulan = substr($baris[3], 5, 2); if ($bulan=="01")  $namabulan="Januari"; elseif ($bulan=="02")  $namabulan="Februari"; elseif ($bulan=="03")  $namabulan="Maret"; elseif ($bulan=="04")  $namabulan="April"; elseif ($bulan=="05")  $namabulan="Mei"; elseif ($bulan=="06")  $namabulan="Juni"; elseif ($bulan=="07")  $namabulan="Juli"; elseif ($bulan=="08")  $namabulan="Agustus"; elseif ($bulan=="09")  $namabulan="September"; elseif ($bulan=="10")  $namabulan="Oktober"; elseif ($bulan=="11")  $namabulan="November"; elseif ($bulan=="12")  $namabulan="Desember"; echo"$baris[2] since $namabulan $tahun" ?></small>
                </p>
              </li>
              <!-- Menu Footer-->
              <li class="user-footer">
                <div class="pull-left">
                  <a href="profile.php" class="btn btn-default btn-flat">Profile</a>
                </div>
                <div class="pull-right">
                  <a href="../../logout.php" class="btn btn-default btn-flat">Sign out</a>
                </div>
              </li>
            </ul>
          </li>
          <!-- Control Sidebar Toggle Button -->
          <li>
            <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->
      <div class="user-panel">
        <div class="pull-left image">
          <img src="<?php echo "$baris[4]";?>" class="img-circle" alt="User Image">
        </div>
        <div class="pull-left info">
          <p><?php echo"$baris[1]"; ?></p>
          <a href="#"><i class="fa fa-circle text-success"></i> <?php $status = mysql_fetch_array(mysql_query("SELECT * FROM t_login WHERE user = '$user'")); echo"$status[3]"; ?></a>
        </div>
      </div>

      <!-- search form 
      <form action="#" method="get" class="sidebar-form">
        <div class="input-group">
          <input type="text" name="q" class="form-control" placeholder="Search...">
              <span class="input-group-btn">
                <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
        </div>
      </form>
      /.search form -->
      
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu">
        <li class="header">MAIN NAVIGATION</li>
        <li>
          <a href="home.php">
            <i class="fa fa-dashboard active"></i> <span> Dashboard</span>
          </a>
        </li>
        <li  class="active">
          <a href="#">
            <i class="fa fa-files-o"></i>
            <span> Casier</span>
          </a>
        </li>
        <li>
          <a href="stock.php">
            <i class="fa fa-th"></i> <span> Stock</span>
          </a>
        </li>
        <li class="treeview">
          <a href="#">
            <i class="fa fa-tasks"></i>
            <span> Restock</span>
            <i class="fa fa-angle-left pull-right"></i>
          </a>
          <ul class="treeview-menu">
            <li><a href="#"><i class="fa fa-circle-o"></i> Restock</a></li>
            <li><a href="suplier.php"><i class="fa fa-circle-o"></i> Suplier</a></li>
          </ul>
        </li>
        <li class="">
          <a href="#">
            <i class="fa fa-group"></i>
            <span> Member</span>
          </a>
        </li>
        <li class="">
          <a href="#">
            <i class="fa fa-bar-chart"></i>
            <span> Graph</span>
          </a>
        </li>
        <li class="">
          <a href="#">
            <i class="fa fa-edit"></i> <span> Resume</span>
          </a>
        </li><li class="">
          <a href="#">
            <i class="fa fa-video-camera"></i> <span> Record</span>
          </a>
        </li>
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Casier
        <small>#1</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="home.php"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active"><a href="#">Casier</a></li>
      </ol>
    </section>
    <!--Start Main content -->
    <section class="content">

      <div class="box">
        <div class="box-header with-border">
          <h3 class="box-title"><?php print date('d F Y');?> - <span id="clock"><?php print date('H:i:s'); ?></span></h3>

        </div>
        <div class="box-body">
          <table border="0" width="100%">
            <tr>
              <th width="5%">Code : </th>
              <td width="15%">
                <?php $tgl = date('d'); $bln = date('m'); $thn = date('y'); $jam = date('H'); $mnt = date('i'); $nmd = substr($baris[1], 0, 1); $nmb = substr($baris[1], -1, 1); echo"$tgl$bln$nmd$thn$jam$nmb$mnt";?>
              </td>
              <th width="7%">Member : </th>
              <td width="12%">
                <input type="radio" name="chpas" value="yes" required="" onchange="document.getElementById('member').style.display='block';document.getElementById('membertxt').setAttribute('required','');"/>&nbsp Yes &nbsp &nbsp
                <input type="radio" name="chpas" value="no" onchange="document.getElementById('member').style.display='none';document.getElementById('membertxt').removeAttribute('required');" checked/>&nbsp No
              </td>
              <td width="8%"></td>
              <th width="7%"></th>
              <td width="10%"></td>
              <td width="5%"></td>
              <td width="13%"></td>
              <td width="10%"></td>
              <td width="8%"></td>
            </tr>
            <tr>
              <th colspan="3"></th>
              <td colspan="8">
                <div id="member" style="display:none">
                  <div class="form-group input-group">
                    <select class="" name="membertxt" id="jenis" required>
                      <option value="">- Member FLO -</option>
                      <?php
                        $sql = mysql_query("SELECT * FROM t_member");
                        while ($member = mysql_fetch_array($sql)) {
                          echo "<option value='$member[0]'>$member[0] - $member[1]</option>";
                        }
                      ?>
                    </select>
                  </div>
                </div>
              </td>
            </tr>
            <tr>
              <th colspan="4"></th>
              <th style="font-size: 24px">Total. </th>
              <th colspan="6" style="font-size: 50px; color: RED">Rp. 30.000,-</th>
            </tr>
          </table>

          <form action="casier.php" method="post">
            <table rules="none" border="2" bordercolor="#EEF2F7" width="100%">
              <tr>
                <th width="5%" style="height: 40px">&nbsp; Qty</th>
                <th width="15%">&nbsp; Item Code</th>
                <th width="18%">&nbsp; Information</th>
                <th width="8%">&nbsp; Type</th>
                <th width="7%">&nbsp; Piece</th>
                <th width="10%">&nbsp; Price</th>
                <th width="5%">Disc</th>
                <th width="15%">&nbsp; Total Price</th>
                <th width="16%" rowspan="2">&nbsp;&nbsp;&nbsp;&nbsp;<a href="#"><button type="submit" class="btn btn-success" name="submit"><h4>&nbsp;&nbsp;&nbsp;Add List&nbsp;&nbsp;&nbsp;</h4></button></a></th>
              </tr>
              <tr>
                <th style="height: 40px">&nbsp;&nbsp;<input type="number" name="qtytxt" placeholder="Qty" value="1" style="width: 35px"></input></th>
                <th><input type="text" name="codetxt" id="codetxt" placeholder="Code" style="width: 140px"></input> &nbsp;</th>
                <th><input type="text" name="itemtxt" id="itemtxt" placeholder="Item Name" style="width: 165px" readonly="true"></input></th>
                <th><input type="text" name="typetxt" id="typetxt" placeholder="Type" style="width: 65px" readonly="true"></input></th>
                <th><input type="text" name="piecetxt" id="piecetxt" placeholder="Pcs" style="width: 55px" readonly="true"></input></th>
                <th>Rp. <input type="text" name="pricetxt" id="pricetxt" placeholder="#####" style="width: 60px" readonly="true"></input></th>
                <th><input type="text" name="disctxt" id="disctxt" placeholder="0.0%" style="width: 25px" readonly> %</input></th>
                <th>Rp. <input type="text" name="totpricetxt" placeholder="#####" style="width: 90px" readonly=""> </input></th>
              </tr>
            </table>
          </form> 
        </div>
        <!-- /.box-body -->
        <div class="box-footer">
          Footer
        </div>
        <!-- /.box-footer-->
      </div>
      <!-- /.box -->

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="pull-right hidden-xs">
      <b>Version</b> 2.3.2
    </div>
    <strong>Copyright &copy; 2014-2015 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights
    reserved.
  </footer>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Create the tabs -->
    <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
      <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
      <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
    </ul>
    <!-- Tab panes -->
    <div class="tab-content">
      <!-- Home tab content -->
      <div class="tab-pane" id="control-sidebar-home-tab">
        <h3 class="control-sidebar-heading">Recent Activity</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript::;">
              <i class="menu-icon fa fa-birthday-cake bg-red"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                <p>Will be 23 on April 24th</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript::;">
              <i class="menu-icon fa fa-user bg-yellow"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>

                <p>New phone +1(800)555-1234</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript::;">
              <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>

                <p>nora@example.com</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript::;">
              <i class="menu-icon fa fa-file-code-o bg-green"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>

                <p>Execution time 5 seconds</p>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

        <h3 class="control-sidebar-heading">Tasks Progress</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript::;">
              <h4 class="control-sidebar-subheading">
                Custom Template Design
                <span class="label label-danger pull-right">70%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript::;">
              <h4 class="control-sidebar-subheading">
                Update Resume
                <span class="label label-success pull-right">95%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-success" style="width: 95%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript::;">
              <h4 class="control-sidebar-subheading">
                Laravel Integration
                <span class="label label-warning pull-right">50%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript::;">
              <h4 class="control-sidebar-subheading">
                Back End Framework
                <span class="label label-primary pull-right">68%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

      </div>
      <!-- /.tab-pane -->
      <!-- Stats tab content -->
      <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
      <!-- /.tab-pane -->
      <!-- Settings tab content -->
      <div class="tab-pane" id="control-sidebar-settings-tab">
        <form method="post">
          <h3 class="control-sidebar-heading">General Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Report panel usage
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Some information about this general settings option
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Allow mail redirect
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Other sets of options are available
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Expose author name in posts
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Allow the user to show his name in blog posts
            </p>
          </div>
          <!-- /.form-group -->

          <h3 class="control-sidebar-heading">Chat Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Show me as online
              <input type="checkbox" class="pull-right" checked>
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Turn off notifications
              <input type="checkbox" class="pull-right">
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Delete chat history
              <a href="javascript::;" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
            </label>
          </div>
          <!-- /.form-group -->
        </form>
      </div>
      <!-- /.tab-pane -->
    </div>
  </aside>
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 2.1.4 -->
<script src="../../plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.5 -->
<script src="../../bootstrap/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="../../plugins/morris/morris.min.js"></script>
<!-- Sparkline -->
<script src="../../plugins/sparkline/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="../../../../plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="../../plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- jQuery Knob Chart -->
<script src="../../plugins/knob/jquery.knob.js"></script>
<!-- daterangepicker -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
<script src="../../plugins/daterangepicker/daterangepicker.js"></script>
<!-- datepicker -->
<script src="../../plugins/datepicker/bootstrap-datepicker.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="../../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- Slimscroll -->
<script src="../../plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../../plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/app.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="../../dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>

<script type="text/javascript">
//set timezone
<?php date_default_timezone_set('Asia/Jakarta'); ?>
//buat object date berdasarkan waktu di server
var serverTime = new Date(<?php print date('Y, m, d, H, i, s, 0'); ?>);
//buat object date berdasarkan waktu di client
var clientTime = new Date();
//hitung selisih
var Diff = serverTime.getTime() - clientTime.getTime();    
//fungsi displayTime yang dipanggil di bodyOnLoad dieksekusi tiap 1000ms = 1detik
function displayServerTime(){
    //buat object date berdasarkan waktu di client
    var clientTime = new Date();
    //buat object date dengan menghitung selisih waktu client dan server
    var time = new Date(clientTime.getTime() + Diff);
    //ambil nilai jam
    var sh = time.getHours().toString();
    //ambil nilai menit
    var sm = time.getMinutes().toString();
    //ambil nilai detik
    var ss = time.getSeconds().toString();
    //tampilkan jam:menit:detik dengan menambahkan angka 0 jika angkanya cuma satu digit (0-9)
    document.getElementById("clock").innerHTML = (sh.length==1?"0"+sh:sh) + ":" + (sm.length==1?"0"+sm:sm) + ":" + (ss.length==1?"0"+ss:ss);
}
</script>

<!--Menampilkan data yang akan dipilih-->
<script language="javascript" src="../../dist/js/lala.js"></script>

<script language="javascript">
  $(document).ready(function() {
    $("#codetxt").keyup(function() {
      var nisp = $('#codetxt').val();   
      $.post('load_data.php', // request ke file load_data.php
      {parent_id: nisp},
      function(data){
        $('#itemtxt').val(data[0].nama);
        $('#typetxt').val(data[0].jenis);
        $('#piecetxt').val(data[0].satuan);  
        $('#pricetxt').val(data[0].harga_jual);
        $('#disctxt').val(data[0].disc);      
      },'json'
      );
    });
  });
</script>

</body>
</html>

dan ini buat Load Data nya :
<?php
	include('../../koneksi.php');
	
	$sql="SELECT kode, nama, jenis, satuan, harga_jual, disc FROM t_item WHERE kode = '$_POST[parent_id]'";
	$response = array(); // siapkan respon yang nanti akan di convert menjadi JSON
	$query = mysql_query($sql);		
	if($query){
		if(mysql_num_rows($query) > 0){
			while($row = mysql_fetch_object($query)){
				// masukan setiap baris data ke variable respon
				$response[] = $row; 
			}
		}else{
			$response['error'] = 'Data kosong'; // memberi respon ketika data kosong
		}
	}else{
		$response['error'] = mysql_error(); // memberi respon ketika query salah
	}
	die(json_encode($response)); // convert variable respon menjadi JSON, lalu tampilkan 
?>

Tolong bantuan nya buat para master dan senior disini,, thanks
Silahkan login untuk menjawab!
Saya ingin tanya .saya ada 2 tabel yang satu no.perkiraan dan 1 lagi tabel transaksi.
di table perkiraan ada:
no.perkiraan debet kredit
100.000 Kas 0 0
100.001 Kas jakarta 0 0
100.002 Kas kecil 0 0
220.000 Bank 0 0
220.001 Bank BCA 0 0
220.002 Bank BNI 0 0

lalu saya buta transaksi seperti ini pada tabel transaksi :
NoPerkiraan Nama Perkiraan Debet Kredit
100.001 Kas Jakarta Rp.75.000 0
220.001 Bank BCA Rp.75.000
100.002 Kas Kecil Rp.50.000
220.002 Bank BNI Rp.50.000

Pertanyaa saya :
1.bagaimana jika dipanggil dari niperkiraan 100.000 s/d 100.000
yang tampil datanya 100.001 dan 100.002
2.jika dipanggil 100.001 s/d 100.001
yang tampil hanya 100.001 atau
jika dipanggil 100.002 s/d 100.002
yang tampil hanya 100.002 atau
jika dipanggil 100.001 s/d 100.002
yang tampil hanya 100.001 dan 100.002
3.jika dipanggil dari no.perkiraan 220.000 s/d 220.000 maka yang tampil adalah 220.001 dan 220.002
jika dipanggil 220.001 s/d 220.001 yang tampil 220.001 saja

Demikian,mohon penjelasan programnya yang mengharapkan banget dan saya buat dengan php mysql Xampp

Terima kasih
Salihin.untar@g-synergy.com
Silahkan login untuk menjawab!

tampil jenis kategori

sada · Feb 4, 2016
saya ingin menanyakan gimana cara menampilkan kategori berita beserta linknya di index,, mohon dibantu
Silahkan login untuk menjawab!
<?php
if(isset($_POST)){
$id_ujian = $_POST;
$insertQuery = "INSERT INTO tabel_soal SET id_ujian = '".$id_ujian."' , pertanyaan = '".$_POST."' ";
$insertSql = $obj->insertLastId($insertQuery);

$array = array('A','B','C','D','E');
foreach ($array as $jawab){
if($jawab == $_POST ){
$insertQuery1 = "INSERT INTO tabel_pil_jawaban SET id_soal = '".$insertSql."' , jawaban = '".$_POST[$jawab]."', status = '1' ";
$insertSql1 = $obj->insertLastId($insertQuery1);
}else{
$insertQuery2 = "INSERT INTO tabel_pil_jawaban SET id_soal = '".$insertSql."' , jawaban = '".$_POST[$jawab]."', status = '0' ";
$insertSql2 = $obj->insertLastId($insertQuery2);
}
}
echo "<script type='text/javascript'>window.location=('?page=Tambah_Soal&ujian=".$id_ujian."&status=sukses');</script>";
}
if(isset ($_GET)) {
$id_ujian = $_REQUEST;
foreach ($obj->getById('*','id_ujian',$id_ujian,'tabel_ujian') as $ujian);
if(empty($ujian)){
echo "<script type='text/javascript'>window.location=('?page=Home');</script>";
}else{
//ambil jumlah soal terakhir
$query = "SELECT count(*) as total FROM tabel_soal WHERE id_ujian = '".$id_ujian."'";
foreach ($obj->getCostume($query)as $jumSoal);

?>
<div class="row" id="notivi-id" style="display:none;">
<div class="col-md-6 col-md-offset-3">
<div id="notivasi" class="alert alert-dismissible text-center" role="alert">
<div class="message"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="alert alert-info" role="alert">
<h4><span class="glyphicon glyphicon-plus" aria-hidden=true></span> Tambahkan Soal Untuk Ujian <?php echo $ujian; ?> </h4>
</div>
</div>
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">Soal Ke = <?php echo $jumSoal+1; ?></div>
<div class="panel-body">

<form method="POST" action="?page=Tambah_Soal">
<div class="form-group">
<label for="exampleInputEmail1">Pertanyaan :</label>
<textarea name="tanya" class="form-control" rows="3" required></textarea>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Pilihan Jawaban :</label>
</div>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>

<script>

$(document).ready(function(){

$('#add').click(function(){

var inp = $('#box');

var i = $('input').size() + 1;

$('<div id="box' + i +'"><input type="text" id="name" class="name" name="name' + i +'" placeholder="input pilihan jawaban"/><img src="http://findicons.com/files/icons/753/gnome_desktop/64/gnome_edit_delete.png" title="Hapus" width="32" height="32" border="0" align="top" class="add" id="remove" /> </div>').appendTo(inp);

i++;

});


$('body').on('click','#remove',function(){

$(this).parent('div').remove();

});

});

</script>

</head>

<body>

<div class="bachors">

<div id="box">
<input name="name" type="text" id="name" class="name" placeholder="Input pilihan jawaban" required>
<img src="https://upload.wikimedia.org/wikipedia/commons/5/52/Fairytale_button_add.png" title="Tambah" width="32" height="32" border="0" align="top" class="add" id="add" />
</div>
</body>

</div>
<form action="" method="post" name="name">
<input type="hidden" name="id_ujian" value="<?php echo $id_ujian;?> ">
<button type="submit" name="simpan" class="btn btn-primary">Simpan</button>
</form>
</div>
</div>
<script>
$(document).ready(function() {
function pesan_tampil(clas,message){
$("#notivasi").addClass(clas);
$(".message").append(message);
$("#notivi-id").show();
$("#notivi-id").addClass('animated bounceInDown');
setTimeout(function(){
$("#notivi-id").slideUp();
}, 4000);
}
<?php
if(isset ($_GET)) {
if($_GET=='sukses') {
echo "pesan_tampil('alert-success','<strong>Success!!..</strong> Soal Ujian Telah ditambahkan');";
}else if($_GET=='gagal'){
echo "pesan_tampil('alert-warning','<strong>Maaf!!..</strong> Gagal Menambahkan Data');";
}
}

?>
});
</script>

<?php
}
}else{
echo "<script type='text/javascript'>window.location=('?page=Home');</script>";
}
?>
Silahkan login untuk menjawab!
bli putu.. mo tny ttg audio untuk kuis berbasis php (melanjutkan pertnyaan sy yg dulu)..
kan dulu bikin kuis basis php, itu udah jadi.. nah semisal mo nambahin suara pada kuis itu gm ya bli putu? misal pertnyaan 1 jika ada gambarnya akan nampilin gambar, tapi jika ada musiknya maka akan memutar musiknya.. ini nanti dikenali dari ekstensi file ada.. misal ekstensi JPG akan nampilin gambar, jika MP3 mutar audio..
saya cari plugin2 tapi rata2 semua nampilin interface player.. yg saya inginkan agar langsung main saja tanpa interface.. mohon bantuannya bli putu..
suksma sebelum dan ssudahnya..

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
misi, numpang tanya saya mempunyai tabel t_soal (no,soal,a,b,c,d dan kunci ) kemudian ada t_score (no,jawaban_anda,kunci,status) yang mau saya tanyakan, agar data inputan t_soal bisa terinput ke t_score itu bagaimna ? baru belajar php saya, kali aja ada yg berminat membantu saya, untuk codingan php'a terimakasih
//untuk halaman index'a

<?php
 
    include 'konek.php';
 
    session_start();
 
    $query = mysql_query("select * from t_soal") or die (mysql_error());
 
    //$_SESSION['soal'] = mysql_fetch_array($query);
 
    $_SESSION['soal'] = array();
 
    $_SESSION['no'] = 1;
 
    $_SESSION['score'] = 0;
 
    $_SESSION['option'] = array();
 
    $_SESSION['jawab'] = array();
 
    $i=0;
 
    while($row = mysql_fetch_assoc($query)){
 
        $_SESSION['soal'][] = $row;
 
        $_SESSION['option'][] = array($_SESSION['soal'][$i]['a'], $_SESSION['soal'][$i]['b'], $_SESSION['soal'][$i]['c'], $_SESSION['soal'][$i]['d']);
 
        $i++;
 
    }
 
    if(isset($_SESSION['soal'])){
 
        header("location:tes.php");
 
    }
 
?>
// untuk tes.php
<?php
 
    session_start();
 
    $soal = $_SESSION['soal'];
 
    $no = $_SESSION['no'];
 
    if(isset($_POST['next'])){
 
        $_SESSION['jawab'][] = $_POST['option'];
 
        if($_POST['option'] == $soal[$no-2]['kunci']){
 
            $_SESSION['score'] = $_SESSION['score'] + 10;
 
        }
 
    }
 
    if(isset($soal[$no-1])){
 
?>
 
<!DOCTYPE html>
 
<html>
 
<head>
 
    <title>Latihan Soal</title>
 
</head>
 
<body>
 
<a href="index.php"></a>
 
    <form action="" method="POST">
 
        <p>
 
        <?php
 
            echo $no.". "; $_SESSION['no']++;
 
            echo $soal[$no-1]['soal'];
 
            $jawaban = $_SESSION['option'][$no-1];
 
            shuffle($jawaban);
 
        ?>
 
        </p>
 
        <?php
 
            for ($i=0; $i < 4; $i++) {
 
        ?>
 
            <input type="radio" name="option" value="<?php echo $jawaban[$i]; ?>" required/> <?php echo $jawaban[$i]; ?></br>
 
        <?php
 
            }
 
         ?>
 
        <input type="submit" name="next" value="next">
 
    </form>
 
</body>
 
</html>
 
<?php
 
    }else{
 
        header("location:score.php");
 
    }
 
?>
//untuk score.php

<?php
 
    include 'konek.php';
 
    session_start();
 
    $jawab = $_SESSION['jawab'];
 
?>
 
<!DOCTYPE html>
 
<html>
 
<head>
 
    <title>Hasil Test</title>
 
</head>
 
<body>
 
    <h1>Hasil Latihan</h1>
 
    <h2>SCORE ANDA: <?php echo $_SESSION['score']; ?></h2>
 
    <table border="1">
 
        <tr>
 
            <td>NO</td>
 
            <td>Jawaban Anda</td>
 
            <td>Kunci Jawaban</td>
 
            <td>Status</td>
 
        </tr>
 
        <?php
 
            $i = 0;
 
            $benar = $salah = 0;
 
            $sql = mysql_query("select * from t_score");
 
            while($key = mysql_fetch_array($sql)){
 
        ?>
 
        <tr>
 
            <td><?php echo $i+1; ?></td>
 
            <td><?php echo $jawab[$i] ?></td>
 
            <td><?php echo $key['kunci']; ?></td>
 
            <td>
 
                <?php
 
                    if ($jawab[$i] == $key['kunci']) {
 
                        echo "Benar";
 
                        $benar++;
 
                    }else{
 
                        echo "Salah";
 
                        $salah++;
 
                    }
 
                 ?>
 
            </td>
 
        </tr>
 
        <?php
 
                $i++;
 
            }
 
         ?>
 
    </table>
 
    <h3>Benar: <?php echo $benar; ?><br>
 
    Salah: <?php echo $salah; ?></h3>
 
    <a href="index.php">Kembali</a>
 
</body>
 
</html>

untuk ditampilkan di tabel score, bagaimna source code'a terimakasih
Silahkan login untuk menjawab!