2017-08-11 5 views
1

問題:私のGUI上のどのボタンもクリックできません。なぜ私が持っているボタンはすべてクリックできないのですか?

5日ほど経っていますが、私はこの問題を解決できません。私のボタンはすべてモーダルなので、自分のフォーム上の私のボタンをクリックすることはできません。誰か私のコードを確認してください。あなたが私を助けてくれることを願って、私はあなたに助けが必要でした。

<?php 
session_start(); 
include("../db_connection.php"); 
?> 
<?php 
include("get_specific_food.php"); 
?> 
<!DOCTYPE html> 
<html lang="en"> 

<head> 

    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <meta name="description" content=""> 
    <meta name="author" content=""> 
    <link href="bootstrap-4.0.0-alpha.6/dist/css/bootstrap.min.css" rel="stylesheet"> 
    <title>Home</title> 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> 
    <!-- Bootstrap Core CSS --> 
    <link href="css/bootstrap.min.css" rel="stylesheet"> 

    <!-- Custom CSS --> 

</head> 

<body> 

    <!-- Navigation --> 
    <?php 
    include("seller_navigation.php"); 
    ?> 

    <!-- Page Content --> 
    <div class="container"> 
     <div class="row"> 
       </div> 

      <div class="col-md-3"> 

       <div class="input-group"> 
     <input type="text" class="form-control" placeholder="Search"> 
     <span class="input-group-btn"> 
     <button class="btn btn-default" type="button"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button> 
     </span> 

       </div> 
      <br> 

       <?php 
       $seller_id = $_SESSION['seller_id']; 
       $image_query = mysqli_query($db, "SELECT s_image FROM seller 
       WHERE seller_id= '" . $_SESSION['seller_id'] . "' "); 

       $image = mysqli_fetch_assoc($image_query); 
       ?> 

      <?php $img = "upload/" . $_SESSION['seller_id'] . "." . $image['s_image']; ?> 
      <center><img class="rounded-circle" src="upload/<?php echo $image['s_image']; ?>" alt="Generic placeholder image" width="140" height="140"> 
      <p class="lead"><?php echo $_SESSION["s_fname"]; ?></p></center> 


       <!-- <p class="lead">Shop Name</p>--> 
        <center><p><button type="button" class="btn btn-default" data-toggle="modal" data-target="#mymodall"> 
         <span class='glyphicon glyphicon-plus-sign'></span> <b>Add an Information</b> 
        </button></center></p> 
       <!--<center>--> 
        <div class="modal fade" id="mymodall"> 
         <div class= "modal-dialog"> 
          <div class="modal-content"> 
           <div class="modal-header"> 


            <form action="db_add_selling_details.php" method="POST" enctype="multipart/form-data"></center> 
            <?php// $img = "upload/" . $_SESSION['seller_id'] . "." . $image['s_image']; ?> 
            <center><img class="rounded-circle" src="upload/<?php //echo $image['s_image']; ?>" alt="Generic placeholder image" width="140" height="140"><br><br> 

             <b>Add Profile Pic:</b><br><input style="background-color: #003333;" class="btn btn-info" name ="s_image" type="file"/> 
            </H5> 
           </div> 
           </center> 
           <div class="modal-body"> 

           <H5><b>Opening Time:</b><br><input type="text" class="form-control" name="opening_time" ><br> 
            <b>Days:</b><br><input type="text" class="form-control" name="opening_days" ><br> 
            <b>Order Cut off Time:</b><br><input type="text" class="form-control" name="order_cutoff" ><br> 
            <b>Delivery Time:</b><br><input type="text" class="form-control" name="seller_delivery_time"><br> 
            <b>Area Covered of Delivery:</b><br><input type="text" class="form-control" name="area_covered_delivery"><br> 
            <b>Delivery Fee:</b><br><input type="text" class="form-control" name="delivery_fee"> 
           </H5> 
            </div> 

          <div class="modal-footer"> 

           <input type ="submit" value="Add" class="btn btn-success" name="submit" /> 

            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
            </form> 
           </div> 

          </center> 

          </div> 

          </div> 
          </div> 
          </form> 



          <center><p><button type="button" class="btn btn-default" data-toggle="modal" data-target="#mymodal"> 
         <span class='glyphicon glyphicon-edit'></span> <b>Update Information</b> 
        </button></center></p> 
       <!--<center>--> 
        <div class="modal fade" id="mymodal"> 
         <div class= "modal-dialog"> 
          <div class="modal-content"> 
           <div class="modal-header"> 

            <?php 
             $seller_id = $_SESSION['seller_id']; 
             $user_query = mysqli_query($db, "SELECT seller.s_fname, seller.trade_name, seller.s_address, seller.s_image, selling_details.opening_time, selling_details.opening_days, selling_details.order_cutoff, selling_details.seller_delivery_time, selling_details.area_covered_delivery, selling_details.delivery_fee FROM seller INNER JOIN selling_details ON seller.seller_id=selling_details.seller_id 
             WHERE seller.seller_id=selling_details.seller_id and 
             seller.seller_id=".$_SESSION['seller_id']); 

             $user = mysqli_fetch_assoc($user_query); 
             ?> 
            <form action="db_selling_details.php" method="POST" enctype="multipart/form-data"></center> 
            <?php $img = "upload/" . $_SESSION['seller_id'] . "." . $user['s_image']; ?> 
            <center><img class="rounded-circle" src="upload/<?php echo $user['s_image']; ?>" alt="Generic placeholder image" width="140" height="140"> 
            <H5><b>Seller:</b><br><input type="text" class="form-control" name="s_fname" value="<?php echo $user['s_fname']; ?>"><br> 
             <b>Trade Name:</b><br><input type="text" class="form-control" name="trade_name" value="<?php echo $user['trade_name']; ?>"><br> 
             <b>Location:</b><br><input type="text" class="form-control" name="s_address" value="<?php echo $user['s_address']; ?>"><br> 
             <b>Change Profile Pic:</b><br><input style="background-color: #003333;" class="btn btn-info" name ="s_image" type="file"/> 
            </H5> 
           </div> 

           <div class="modal-body"> 

           <!--<center>--> 

           <!--<div class="well">--> 
           <H5><b>Opening Time:</b><br><input type="text" class="form-control" name="opening_time" value="<?php echo $user['opening_time']; ?>"><br> 
            <b>Days:</b><br><input type="text" class="form-control" name="opening_days" value="<?php echo $user['opening_days']; ?>"><br> 
            <b>Order Cut off Time:</b><br><input type="text" class="form-control" name="order_cutoff" value="<?php echo $user['order_cutoff']; ?>"><br> 
            <b>Delivery Time:</b><br><input type="text" class="form-control" name="seller_delivery_time" value="<?php echo $user['seller_delivery_time']; ?>"><br> 
            <b>Area Covered of Delivery:</b><br><input type="text" class="form-control" name="area_covered_delivery" value="<?php echo $user['area_covered_delivery']; ?>"><br> 
            <b>Delivery Fee:</b><br><input type="text" class="form-control" name="delivery_fee" value="<?php echo $user['delivery_fee']; ?>"> 
           </H5> 
            </div> 

          <div class="modal-footer"> 

           <input type ="submit" value="Save" class="btn btn-success" name="submit" /> 
            <!--<button type="button" class="btn btn-success" data-dismiss="modal">Save</button>--> 
            <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> 
            </form> 
           </div> 

          </center> 

          </div> 

          </div> 
          </div> 
          </form> 

          <center><p><button style="background-color: #003333;" type="buton" class="btn btn-info" data-toggle="modal" data-target="#mymodaly"> 
          <span class='glyphicon glyphicon-ruble'></span> <b>Sell Food Product</b> 
         </button></center></p> 
         <div class="modal fade" id="mymodaly"> 
         <div class= "modal-dialog"> 
         <div class="modal-content"> 
           <div class="modal-header"> 
            <h4><b><img class="rounded-circle" src="images/size.png" alt="Generic placeholder image" width="140" height="140"><br><br><center>Sell your<br> Product</center></b></h4> 
            <form action="db_add_food.php" method="POST" enctype="multipart/form-data"></center> 
            <H5><b>Food Name:</b><br><input type="text" class="form-control" name="food_name"><br> 
             <b>Price:</b><br><input type="number" class="form-control" name="f_price"><br> 
             <b>INGREDIENTS:</b><br><input type="text" class="form-control" name="f_ingredients"><br> 

             <b>Product Status:<br> <label class="radio-inline"><input type="radio" name="f_status" value="available">AVAILABLE</label> 
             <label class="radio-inline"><input type="radio" name="f_status" value="unavailable">UNAVAILABLE</label><br><br> 

             <b>Date Posted: <input placeholder="date" class="form-control" name="date_posted" type="date" class="validate" value="<?php echo date('Y-m-d'); ?>"><br> 
             <b>Change Photo:</b><br><input style="background-color: #003333;" class="btn btn-info" name="f_image" type="file"/> 

            </H5> 

              </div> 
           <div class="modal-footer"> 
            <input type ="submit" value="Add" class="btn btn-success" name="submit" /> 
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
          </form> 

        </div> 
        </div> 
        </div> 
        </div> 

     <!--dito ung search dati--> 



       </div> 
       <br><br> 

      <?php 


$query1=mysql_connect("localhost","root",""); 
mysql_select_db("ordering_system",$query1); 
global $food_id; 
$start=0; 
$limit=6; 

if(isset($_GET['food_id'])) 
{ 
    $food_id=$_GET['food_id']; 
    $start=($food_id-1)*$limit; 
} 


$query=mysql_query("select * FROM food_product WHERE seller_id= '" . $_SESSION['seller_id'] . "' LIMIT $start, $limit"); 


while($query2=mysql_fetch_array($query)) 
{ 

    echo "<div class='col-sm-3'><div class='panel panel-default' style='border-color:#003333;'> 
      <div class='panel-heading' style='color:white;background-color : #003333;'> 
      <center> 
    <textarea style='text-align:center;background-color: white;' class='form-control' rows='1' disabled>".$query2['food_name']."</textarea> 
      </center> 
      </div> 
      <div class='panel-body'> 
      <a class='fancybox-buttons' href='food_upload/".$query2['f_image']."' data-fancybox-group='button' title='Page ".$food_id."- ".$query2['food_name']."'> 

        <img src='food_upload/".$query2['f_image']."' class='img img-thumbnail' style='width:350px;height:150px;' /> 
        </a> 


        <center><h4> Price: &#8369; ".$query2['f_price']." </h4></center> 


       <button style='background-color: #003333;' type='buton' class='btn btn-info' data-toggle='modal' data-target='#mymodal1'> 
       <span class='glyphicon glyphicon-edit'></span> <b>Update</b> 
        </button> 
        <span class='pull-right'><b>".$query2['f_status']."</b></span> 


       <div class='modal fade' id='mymodal1<?php echo $food_id;?>'> 
       <div class= 'modal-dialog'> 
        <div class='modal-content'> 
         <div class='modal-header'> 

          <h4><b><img class='rounded-circle' src='images/adobe.jpg' alt='Generic placeholder image' width='140' height='140'><br><br><center>Update your<br> Product</center></b></h4> 

          <H5><b>Food Name:</b><br><input type='text' class='form-control' value='Adobo'><br> 
           <b>Price:</b><br><input type='text' class='form-control' value='Php50.00' /><br> 
           <b>INGREDIENTS:</b><br><textarea class='form-control'>Pork,soy,potato,paminta,sibuyas,bawang</textarea><br> 
           <b>Change Photo:</b><br><input style='background-color: #003333;' class='btn btn-info' type='file'/> 
             <br> 
           <div class='radio'> 
           <label><input type='radio' name='optradio'>Available</label> 
           </div> 
           <div class='radio'> 
           <label><input type='radio' name='optradio'>Unavailable</label> 
           </div> 

          </H5> 
         </div> 


        <div class='modal-footer'> 
          <button type='button' class='btn btn-success' data-dismiss='modal' onclick='UpdateFunction()'>Update</button> 
          <button type='button' class='btn btn-default' data-dismiss='modal'>Close</button> 

</div> 

</center> 

     </div> 
    </div> 

</div> 



      </div> 
      </div> 
     </div>"; 


} 

echo "<div class='container'>"; 
echo "</div>"; 




$food_id=NULL; 
$rows=mysql_num_rows(mysql_query("SELECT * FROM food_product WHERE seller_id = '" . $_SESSION['seller_id'] . "' ")); 
$total=ceil($rows/$limit); 

if($food_id>1) 
{ 
    echo "<a href='?food_id=".($food_id-1)." class='button'></a>"; 
} 
else if($food_id!=$total) 
{ 
    echo "<a href='?food_id=".($food_id+1)." class='button'></a>"; 
} 

echo "<ul class='pagination pagination-md'>"; 
     for($i=1;$i<=$total;$i++) 
     { 
      if($i==$food_id) { echo "<li class='current'>".$i."</li>"; } 

      else { echo "<li><a href='?food_id=".$i."'>".$i."</a></li>"; } 
     } 
echo "</ul>"; 
?> 

        <!--<center>--> 

    <!-- /.container --> 

<div class="container"> 

     <hr> 

     <!-- Footer --> 
     <footer> 
      <div class="row"> 
       <div class="col-lg-12"> 
        <p>Copyright &copy; 2017</p> 
       </div> 
      </div> 
     </footer> 

    </div> 
    <!-- /.container --> 

<script> 
function UpdateFunction() { 
    alert("Successfully Updated!"); 
} 
</script> 

<script> 
function CreateFunction() { 
    alert("Successfully Created!"); 
} 
</script> 


    <script src="js/jquery.js"></script> 

    <!-- Bootstrap Core JavaScript --> 
    <script src="js/bootstrap.min.js"></script> 

</body> 

</html> 
+0

@ Error-SyntacticalRemorse Sir私の質問を編集しました。すべてのボタンをクリックできません。 –

+0

このヒープコードではJavaScriptがかなり表示されません。 – Merigold

+0

@Merigoldどういう意味ですか?それとも? –

答えて

1

問題は、あなたのHTMLが厄介であるということである。

は、ここに私のコードです。 formタグを開いても、それを正しく閉じることはできません。また、閉じないでください。 アドバイス形式は常にあなたのhtmlです。

問題1)ブートストラップのドキュメンタリーに示されているように、モーダルを適切に使用しないでください。例を読んで読んでください。 追加情報ボタンの実例があります(ライセンス目的のために一部のcenterタグを削除しました)。私は何を得るに

 <!-- <p class="lead">Shop Name</p>--> 
    <p><button type="button" class="btn btn-default" data-toggle="modal" data-target="#mymodall"> 
       <span class='glyphicon glyphicon-plus-sign'></span> <b>Add an Information</b> 

    </button></center></p> 
     <!--<center>--> 
     <div class="modal fade" id="mymodall"> 
      <div class= "modal-dialog"> 
       <div class="modal-content"> 
        <div class="modal-header"> 
         <img class="rounded-circle" src="upload/<?php //echo $image['s_image']; ?>" alt="Generic placeholder image" width="140" height="140"><br><br> 

            <b>Add Profile Pic:</b><br><input style="background-color: #003333;" class="btn btn-info" name ="s_image" type="file"/> 
        </div> 
        <form action="db_add_selling_details.php" method="POST" enctype="multipart/form-data"> 
           <?php// $img = "upload/" . $_SESSION['seller_id'] . "." . $image['s_image']; ?> 
        <div class="modal-body"> 
          <H5><b>Opening Time:</b><br><input type="text" class="form-control" name="opening_time" ><br> 
           <b>Days:</b><br><input type="text" class="form-control" name="opening_days" ><br> 
           <b>Order Cut off Time:</b><br><input type="text" class="form-control" name="order_cutoff" ><br> 
           <b>Delivery Time:</b><br><input type="text" class="form-control" name="seller_delivery_time"><br> 
           <b>Area Covered of Delivery:</b><br><input type="text" class="form-control" name="area_covered_delivery"><br> 
           <b>Delivery Fee:</b><br><input type="text" class="form-control" name="delivery_fee"> 
          </H5> 
        </div> 

        <div class="modal-footer"> 

          <input type ="submit" value="Add" class="btn btn-success" name="submit" /> 

          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
        </div> 
       </form> 
      </div> 
     </div> 
    </div> 

画像リンク:https://i.stack.imgur.com/o5AIG.png

問題2:私はちょうど前にライン215あなたは良いですmysqliを使用していることがわかり。その後、mysql_*機能を使用していますか?これらの機能は古くなっています。

+0

Sirまだクリックできない –

+0

私はそれをテストしました。それは私のためにうまく動作します。 jqueryとbootstrap.jsがよくリンクされていることを確認してください。テスト目的のために、https://getbootstrap.com/docs/3.3/getting-started/にあるヘッダのBootstrap CDNを挿入することもできます。そして、私に知らせてください。 –

関連する問題