Page 301 - MDP2022-2
P. 301

}


                  function  park_eng(mode)  {
                                  $.post("http://localhost/park4.php",  {  mode:  mode  },
                                  function(result)  {
                                                  //alert(result);
                                  });
                  }


                  function  park_pro(mode)  {
                                  $.post("http://localhost/park5.php",  {  mode:  mode  },
                                  function(result)  {
                                                  //alert(result);
                                  });
                  }




                  </script>



                  </body>
                  </html>
                  2)  php
                  <?php
                  $conn  =  mysqli_connect("localhost",  "mdp",  "1234",  "library");
                  $result  =  mysqli_query($conn,  "select  state  from  booklist  where  name  =
                  '".$_POST["name"]."'");
                  $row  =  mysqli_fetch_assoc($result);


                  if($row['state']  ==  "0")  {  //대출  시작
                                  echo  "0";
                  }  else  if($row['state']  ==  "1")  {
                                  echo  "1";
                  }
   296   297   298   299   300   301   302   303   304   305   306