为什么我所有的按钮都不可点击?

时间:2017-08-11 01:59:27

标签: html button bootstrap-modal

问题:我的GUI上没有任何按钮可点击。

已经过了五天,我无法找到解决这个问题的方法。我无法点击表单上的任何按钮,因为我的所有按钮都是模态。有人可以查看我的代码吗?我非常需要你的帮助,希望你能帮助我。

这是我的代码:

<?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>

1 个答案:

答案 0 :(得分:1)

问题是你的HTML很乱。您打开 static void Main(string[] args) { Create.Characters(); Dragon BlackDrag = Create.BlackDrag; } } public class Create { public static Hero Dash { get; set; } public static Bandit Keith { get; set; } public static Bandit Leader { get; set; } public static Knight Leeroy { get; set; } public static Knight Seth { get; set; } public static Dragon BlueDrag { get; set; } public static Dragon RedDrag { get; set; } public static Dragon BlackDrag { get; set; } public static void Characters() { Dash = new Hero("Dash", 3, 10); Keith = new Bandit("Keith", 1, 5); Leader = new Bandit("Bandit Leader", 2, 8); Leeroy = new Knight("Leeroy", 3, 12); Seth = new Knight("Seth", 5, 15); BlueDrag = new Dragon("Blue Dragon", 7, 20, 2); RedDrag = new Dragon("Red Dragon", 8, 20, 3); BlackDrag = new Dragon("BlackDrag", 10, 25, 4); } } 代码,不要正确关闭它,或者关闭它不应该关闭的地方。 建议格式总是你的HTML。

问题1)您没有按照自举纪录片中的说明正确使用模式。请关注并阅读示例。以下是添加信息按钮的一个工作示例。(删除了一些form标签以用于隐藏目的。)

center

图片链接到我得到的内容:https://i.stack.imgur.com/o5AIG.png

问题2:我在第215行看到你正在使用 <!-- <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> ,这很好。之后,您正在使用mysqli函数?这些功能已过时。

相关问题