通过模态

时间:2017-03-07 05:58:40

标签: php html mysql dreamweaver

Hello社区我只是想知道是否有人可以帮助我,我已经四处寻找我的答案,但我不确定我应该做些什么。

我正在尝试将我的SQL数据投影到一个模态中,如果我将它全部保存在一个表中,我可以将它全部工作但我正在尝试更美观的方式。

(使用DreamWeaver编辑这是我的确切代码,用于很多php函数)

 <?php require_once('../Connections/OnboardingForms.php'); ?>
 <?php
 if (!function_exists("GetSQLValueString")) {
 function GetSQLValueString($theValue, $theType, $theDefinedValue = "",      $theNotDefinedValue = "") 
 {
   if (PHP_VERSION < 6) {
     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
   }

   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

   switch ($theType) {
case "text":
  $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  break;    
case "long":
case "int":
  $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  break;
case "double":
  $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  break;
case "date":
  $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  break;
case "defined":
  $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  break;
   }
   return $theValue;
 }
 }

 mysql_select_db($database_OnboardingForms, $OnboardingForms);
 $query_OnboardingForms = "SELECT * FROM Onboarding";
 $OnboardingForms = mysql_query($query_OnboardingForms, $OnboardingForms) or die(mysql_error());
 $row_OnboardingForms = mysql_fetch_assoc($OnboardingForms);
 $totalRows_OnboardingForms = mysql_num_rows($OnboardingForms);
 ?>

 <!doctype  >


     

 <table cellpadding="0" cellspacing="0" width="500">

 <thead>
 <th>ID</th>
 <th>Company Name</th>
 <th>First Name</th>
 <th>Surname</th>
 <th>View</th>
 </thead>

 <?php do { ?>
 <tbody>

 <tr>
 <td><?php echo $row_OnboardingForms['OnboardingID']; ?></td>
 <td><?php echo $row_OnboardingForms['CompanyName']; ?></td>
 <td><?php echo $row_OnboardingForms['FirstName']; ?></td>
 <td><?php echo $row_OnboardingForms['Surname']; ?></td>
 <td><button data-toggle="modal" data-target="#view<?php echo $row_OnboardingForms['OnboardingID']; ?>" id="" type="button" class="btn" </button></td>
 </tr>

 </tbody>
 <?php } while ($row_OnboardingForms = mysql_fetch_assoc($OnboardingForms)); ?>
 </table>


 <!-- Modal Here -->
 <div id="view<?php echo $$row_OnboardingForms['ID']; ?>" class="modal fade" role="dialog">
 <div class="modal-dialog">

 <div class="modal-content">

 <div class="modal-body">

 <table>
 <tbody>
 <td><?php echo $row_OnboardingForms['OnboardingID']; ?></td>
 <td><?php echo $row_OnboardingForms['CompanyName']; ?></td>
 <td><?php echo $row_OnboardingForms['FirstName']; ?></td>
 <td><?php echo $row_OnboardingForms['Surname']; ?></td>
 </tbody>
 </table>

 </div>

 </div>

 </div>
 </div>

是否有人能够帮助我解决这个问题或指出我正确的方向。

我也在使用DreamWeaver。

提前谢谢。

0 个答案:

没有答案