如何将用户的讨论保存在数据库中并在视图页面上显示
How to keep discussions of user in database and show them on view page
我的crm应用程序有一个问题,在我的应用程序中,我有一个包含用户详细信息的用户视图页面和一个添加后续按钮,其中有3个文本字段用于维护用户的后续记录,并在视图页面中显示dis后续详细信息。我怎样才能做到这一点?
这是我的视图.php页面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php require_once ("sqlremote.php");
$sql="Select * from ac_member order by rand() limit 15";
$res=$db->prepare($sql);
$res->execute();
$row = $res->fetch(PDO::FETCH_ASSOC)
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" type="text/css" href="css/default.css"/>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript">
document.onmousedown=disableclick;
status="Right Click Disabled";
Function disableclick(e)
{
if(event.button==2)
{
alert(status);
return false;
}
}
</script>
<style>
.top-section{height:87px; padding-bottom:10px;}
.logo{width:266px; height:87px; float:left;}
body {
background-image: url(images/hd_wall_4472.jpg);
</style>
</head>
<body oncontextmenu="return false">
<div class="logo"><a href="./"><img src="images/logo.png" alt="" width="200" height="78" border="0" /></a></div>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
<form action="process.php" method="post" class="register">
<fieldset class="row1">
<legend>Basic Information</legend>
<p>
<label>Date
</label>
<input name="fname" type="text" readonly="readonly" value="<?php echo $row['datepicker']?>"/>
<label>Full Name
</label>
<input type="text" readonly="readonly" value="<?php echo $row['fname'] ?>"/>
<label>Qualification
</label>
<input type="text" readonly="readonly" value="<?php echo $row['qualification'] ?>"/>
</p>
<p>
<label>Father Name
</label>
<input type="text" readonly="readonly" value="<?php echo $row['gname'] ?>"/>
<label>Email
</label>
<input name="contact" type="text" readonly="readonly" value="<?php echo $row['email'] ?>"/>
<label>Contact
</label>
<input name="contact" type="text" readonly="readonly" value="<?php echo $row['contact'] ?>"/>
</p>
<p>
<label>City
</label>
<input type="text" readonly="readonly" value="<?php echo $row['city'] ?>"/>
<label>Course
</label>
<input type="text" readonly="readonly" value="<?php echo $row['course'] ?>"/>
</p>
<div class="clear"></div>
</fieldset>
</br></br>
<fieldset class="row1">
<legend>Lead Info</legend>
<p>
<label>Lead Source
</label>
<input name="leadsource" type="text" readonly="readonly" value="<?php echo $row['leadsource']?>"/>
<label>Lead Source Type
</label>
<input type="text" readonly="readonly" value="<?php echo $row['leadsourcetype'] ?>"/>
</p>
<p>
<label>Lead Source Detail
</label>
<input type="text" readonly="readonly" value="<?php echo $row['leadsourcedetail'] ?>"/>
<label>Lead Score
</label>
<input name="leadscore" type="text" readonly="readonly" value="<?php echo $row['leadscore']?>"/>
</p>
<div class="clear"></div>
</fieldset>
<fieldset class="row2">
<legend>Followup Details</legend>
<p>
<input type="button" value="Add Followup" onClick="addRow('dataTable')" />
<input type="button" value="Remove Followup" onClick="deleteRow('dataTable')" />
</p>
<table id="dataTable" class="form" border="1">
<tbody>
<tr>
<p>
<td><input type="checkbox" required="required" name="chk[]" checked="checked" /></td>
<td>
<label>Followup</label>
<input type="text" required="required" name="BX_NAME[]">
</td>
<td>
<label for="BX_age">Followup Calldisposition</label>
<input type="text" required="required" name="BX_age[]">
</td>
<td>
<label for="BX_gender">Followup Comments</label>
<input type="text" name="BX_gender[]" required="required">
</td>
</p>
</tr>
</tbody>
</table>
<div class="clear"></div>
</fieldset>
<input class="submit" type="submit" value="Confirm »" />
<div class="clear"></div>
</form>
</br>
</body>
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=9046834;
var sc_invisible=1;
var sc_security="ec55ba17";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="free hit
counter" href="http://statcounter.com/" target="_blank"><img
class="statcounter"
src="http://c.statcounter.com/9046834/0/ec55ba17/1/"
alt="free hit counter"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
</html>
我不确定我是否正确理解你的问题。这是一个与数据库/查询相关的问题,还是一个被认为是最佳实践的战略问题?
我真的不确定你想在这里完成什么:)
Ah:)
所以实际上,你会先从你选择的地方获取你的数据。你已经在做了。
process.php:
if ($everythingisok) {
$res=$db->prepare("UPDATE ac_member SET bx_gender='".$_POST["BX_gender"]."', field2=etc... WHERE id = '".$_POST['id']."'");
$res->execute();
}
将数据存储到表中后,您可以将其添加到html/view:
<input type="text" name="BX_gender" value="<?php echo escape($row['bx_gender']);?>" required="required">
但是,我注意到您在输入名称中使用了方括号。这将导致通过的数据以数组的形式传递。我不知道你是不是故意这么做的
相关文章:
- 将日期时间作为 JSON 发送将无法在我的视图中正确显示
- FF视图源|脚本高亮显示为红色
- 有没有比在app.js上绑定模块名称更好的方法来动态加载视图模型和视图以显示模态
- 如何在MVC3中显示鼠标悬停在文本上的部分视图
- 如何应用带过滤器的ng if来过滤记录,并在同一页面中显示两个不同的视图
- 为什么我的视图没有显示在角度ui视图中
- 使用PhoneGap和jQuery Mobile在android设备上显示动态列表视图
- 使用Ruby数组使用JS在视图中进行迭代和显示
- 滑动视图 - 显示下一项的预览/片段
- 在剃须刀应用程序中将视图显示为灯箱
- ember.js如何为视图显示不同的筛选列表?复杂的设置
- ng重复视图显示与JSON数据不对应
- RedirectToAction之后没有视图显示
- ASP.. NET MVC控制器/视图显示本地时间
- 离子弹出窗口视图显示在离子模态视图后面
- WinJs列表视图显示:无带ID的tile
- 完整的日历视图显示goToDate分前,下和今天
- 如何从父数组视图显示子对象视图
- CouchApp视图显示将为空结果
- 在树状视图显示中只打开一个li节点