将db值传递到模式框

时间:2019-04-02 16:40:15

标签: javascript php jquery html

我创建了一个查看模块,当用户单击查看按钮时,会弹出一个模式。出于某种原因,当我单击“查看”按钮时,该按钮不起作用,基本上没有任何反应。

这是我的fetch.php:

while($row = mysqli_fetch_array($result))
{
    $output .= '<tr>
                <td>'.$row["req_date"].'</td>
                <td>'.$row["reqname"].'</td>
                <td>'.$row["natureofreq"].'</td>
                <td>'.$row["postitle"].'</td>
                <td>'.$row["critlevel"].'</td>
                <td>'.$row["deadline"].'</td>
                <td>'.$row["account"].'</td>
                <td>'.$row["newaccname"].'</td>
                <td>'.$row["lob"].'</td>
                <td>'.$row["site"].'</td>
                <td style="color:' . $colors[$row["status"]] . ';">' .$row["status"] . '</td>
                <td>
                    <form method="post" action="update-work-status.php">
                        <input type="hidden" name="reqnumber" value="'.$row['reqnumber'].'" />
                        <button class="fa fa-check" style="color: green" type="submit" name="approve" value=""></button><button class="fa fa-close" style="color: red" type="submit" name="decline" value=""></button>
                    </form>
                </td>
                <td><a href="records.php?reqnumber='.$row['reqnumber'] .'"><i class="fa fa-edit" style="color: black; font-size: 25px;"></i></a></td>
                <td><a href="#samstrover<?php echo $row["id"]; ?>" data-toggle="modal" class="btn btn-warning"><span class="fa fa-pencil"></span> View</a></td>
                </tr>
                    <?php
                        require("viewdata.php");
                        $a++;
        ';
}

这是我的模式框(viewdata.php)的第一行:

<div class="modal fade" id="samstrover<?php echo $row['id']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

请注意,fetch纯粹是PHP,我只是使用以下代码在HTML页面上声明了它:

<div id="result"></div>

谢谢。

0 个答案:

没有答案