- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在选择框时显示客户信息。我在我的 View 中选择输入,当我选择从选择框中选择任何客户时,在下面列出他的属性(property)信息。我怎么能那样?
我在下面显示我的代码:
Assets 表:
CREATE TABLE `estate` (
`estateId` int(11) NOT NULL AUTO_INCREMENT,
`estateType` int(11) DEFAULT NULL COMMENT 'mülk türü ev, villa v.b',
`estateCentare` varchar(6) COLLATE utf8_bin DEFAULT NULL,
`estateRoom` varchar(2) COLLATE utf8_bin DEFAULT NULL COMMENT 'adet',
`estateSalon` varchar(2) COLLATE utf8_bin DEFAULT NULL COMMENT 'adet',
`estateBathroom` varchar(2) COLLATE utf8_bin DEFAULT NULL COMMENT 'adet',
`estateHeating` int(11) DEFAULT NULL COMMENT 'ısıtma turu tablosu',
`estateCity` int(11) DEFAULT NULL COMMENT 'city Tablosu',
`estateAddress` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`estateCoord` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`estateGarden` tinyint(1) DEFAULT NULL COMMENT 'evin bahçesi var yok',
`estateBalcony` tinyint(1) DEFAULT NULL COMMENT 'balkon adet',
`estatePackage` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`estatePackageDate` datetime DEFAULT NULL,
`estatePackageUser` int(11) DEFAULT NULL,
`estateCreateDate` datetime DEFAULT NULL,
`estateCreateUser` int(11) DEFAULT NULL,
`estateEditDate` datetime DEFAULT NULL,
`estateEditUser` int(11) DEFAULT NULL,
`estateDue` decimal(5,0) DEFAULT NULL,
PRIMARY KEY (`estateId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
在列出他的特性信息时,cosId 将等于 estateId。
Controller :
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Property extends CI_Controller {
public function index()
{
$this->lang->load('content', $this->session->userdata('people_lang'));
$viewData = new stdClass();
$viewData->customers = $this->db->get("customer")->result();
$this->load->view('property', $viewData);
}
}
?>
查看:
<section class="panel">
<header class="panel-heading">
PROPERTY / ESTATE
<span class="tools pull-right">
<a href="javascript:;" class="fa fa-chevron-down"></a>
<a href="javascript:;" class="fa fa-times"></a>
</span>
</header>
<div class="panel-body">
<h5>Property / Estate Management</h5>
<div class="form-group" hidden>
<label class="col-sm-2 col-sm-2 control-label">User Who Add:</label>
<div class="col-sm-10">
<input type="text" name="docFileCreateUser" class="form-control" value="<?php echo $this->session->userdata("people_id"); ?>" readonly>
</div>
</div>
<div class="form-group">
<div class="col-lg-12">
<h5 class=""><i class="fas fa-handshake"></i> Choose Customer:</h5>
<select class="js-example-basic-single" name="docFileDocType" required="required">
<option value="" readonly>Select</option>
<?php
foreach($customers as $customer){ if ($customer->cosStatus == 1) { ?>
<option value="<?php echo $customer->cusId; ?>"><?php echo $customer->cosCode; ?> <?php echo $customer->cosName. '' .$customer->cosSurname ?></option>
<?php } }?>
</select>
</div>
</div>
</div>
<div class="panel-body">
<div class="adv-table">
<h4><?php echo $customer->cosName.' '.$customer->cosSurname;?> | Information of Current Payments:</h4>
<div class="panel-body">
<section id="no-more-tables">
<table class="table table-bordered table-striped table-condensed cf" id="dynamic-table">
<thead class="cf">
<tr>
<th>File ID</th>
<th>Customer Code</th>
<th>Name Surname</th>
<th>File Type</th>
<th>Description</th>
<th>Create Date</th>
<th>File</th>
</tr>
</thead>
<tbody>
<?php
foreach($documents as $docs){ if(($customer->cusId) == ($docs->docFileCusId)){ ?>
<tr>
<td data-title="File ID"><?php echo $docs->docFileId; ?></</td>
<td data-title="Customer Code"><?php echo $customer->cosCode; ?></td>
<td data-title="Name Surname"><?php echo $customer->cosName.' '.$customer->cosSurname; ?></</td>
<td data-title="File Type"><?php echo $docs->docFileDocType; ?></td>
<td data-title="Description"><?php echo $docs->docFileDesc; ?></td>
<td data-title="Create Date"><?php echo $docs->docFileCreateDate; ?></</td>
<td data-title="File"><a href="<?php echo base_url().'upload/file/customer/'.$docs->docFileDirectory;?>" download><?php echo $docs->docFileDirectory; ?></a> <i class="fa fa-download"></i></td>
</tr>
<?php } } ?>
</tbody>
</table>
</section>
</div>
</div>
</div>
</section>
最佳答案
在选择器上使用 OnChange 函数:
<select onChange="showInfo(this.value);" class="js-example-basic-single" name="docFileDocType" required="required">
JavaScript:
function showInfo(str){
$.ajax({
type: "POST",
data: { id: str },
url: "<?=base_url('property/getInfo');?>",
success: function(data) {
$('#divInfo').html(data);
}
});
}
Controller (getInfo):
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Property extends CI_Controller {
public function index(){
$this->lang->load('content', $this->session->userdata('people_lang'));
$viewData = new stdClass();
$viewData->customers = $this->db->get("customer")->result();
$this->load->view('property', $viewData);
}
public function getInfo(){
$id = $this->input->post('id');
$viewData->estate = $this->db->get_where("estate",['estateId'=>$id])->result();
$this->load->view('getInfo', $viewData);
}
}
?>
查看(getInfo)“小部分”:
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
<th>Column 6</th>
<th>Column 7</th>
<th>Column 8</th>
<th>Column 9</th>
<th>Column 10</th>
<th>Column 11</th>
<th>Column 12</th>
<th>Column 13</th>
<th>Column 14</th>
<th>Column 15</th>
<th>Column 16</th>
<th>Column 17</th>
<th>Column 18</th>
<th>Column 19</th>
<th>Column 20</th>
</tr>
<?php foreach($estates as $estate){?>
<tr>
<td><?php echo $estate->estateId; ?></</td>
<td><?php echo $estate->estateType; ?></</td>
<td><?php echo $estate->estateCentare; ?></</td>
<td><?php echo $estate->estateRoom; ?></</td>
<td><?php echo $estate->estateSalon; ?></</td>
<td><?php echo $estate->estateBathroom; ?></</td>
<td><?php echo $estate->estateHeating; ?></</td>
<td><?php echo $estate->estateCity; ?></</td>
<td><?php echo $estate->estateAddress; ?></</td>
<td><?php echo $estate->estateCoord; ?></</td>
<td><?php echo $estate->estateGarden; ?></</td>
<td><?php echo $estate->estateBalcony; ?></</td>
<td><?php echo $estate->estatePackage; ?></</td>
<td><?php echo $estate->estatePackageDate; ?></</td>
<td><?php echo $estate->estatePackageUser; ?></</td>
<td><?php echo $estate->estateCreateDate; ?></</td>
<td><?php echo $estate->estateCreateUser; ?></</td>
<td><?php echo $estate->estateEditDate; ?></</td>
<td><?php echo $estate->estateEditUser; ?></</td>
<td><?php echo $estate->estateDue; ?></</td>
</tr>
<?php } ?>
新 View (属性):
<section class="panel">
<header class="panel-heading">
PROPERTY / ESTATE
<span class="tools pull-right">
<a href="javascript:;" class="fa fa-chevron-down"></a>
<a href="javascript:;" class="fa fa-times"></a>
</span>
</header>
<div class="panel-body">
<h5>Property / Estate Management</h5>
<div class="form-group" hidden>
<label class="col-sm-2 col-sm-2 control-label">User Who Add:</label>
<div class="col-sm-10">
<input type="text" name="docFileCreateUser" class="form-control" value="<?php echo $this->session->userdata("people_id"); ?>" readonly>
</div>
</div>
<div class="form-group">
<div class="col-lg-12">
<h5 class=""><i class="fas fa-handshake"></i> Choose Customer:</h5>
<select class="js-example-basic-single" name="docFileDocType" required="required">
<option value="" readonly>Select</option>
<?php
foreach($customers as $customer){ if ($customer->cosStatus == 1) { ?>
<option value="<?php echo $customer->cusId; ?>"><?php echo $customer->cosCode; ?> <?php echo $customer->cosName. '' .$customer->cosSurname ?></option>
<?php } }?>
</select>
</div>
</div>
</div>
<div class="panel-body">
<div class="adv-table">
<h4><?php echo $customer->cosName.' '.$customer->cosSurname;?> | Information of Current Payments:</h4>
<div class="panel-body">
<section id="no-more-tables">
<table class="table table-bordered table-striped table-condensed cf" id="dynamic-table">
<thead class="cf">
<tr>
<th>File ID</th>
<th>Customer Code</th>
<th>Name Surname</th>
<th>File Type</th>
<th>Description</th>
<th>Create Date</th>
<th>File</th>
</tr>
</thead>
<tbody>
<?php
foreach($documents as $docs){ if(($customer->cusId) == ($docs->docFileCusId)){ ?>
<tr>
<td data-title="File ID"><?php echo $docs->docFileId; ?></</td>
<td data-title="Customer Code"><?php echo $customer->cosCode; ?></td>
<td data-title="Name Surname"><?php echo $customer->cosName.' '.$customer->cosSurname; ?></</td>
<td data-title="File Type"><?php echo $docs->docFileDocType; ?></td>
<td data-title="Description"><?php echo $docs->docFileDesc; ?></td>
<td data-title="Create Date"><?php echo $docs->docFileCreateDate; ?></</td>
<td data-title="File"><a href="<?php echo base_url().'upload/file/customer/'.$docs->docFileDirectory;?>" download><?php echo $docs->docFileDirectory; ?></a> <i class="fa fa-download"></i></td>
</tr>
<?php } } ?>
</tbody>
</table>
</section>
</div>
</div>
</div>
<div id="divInfo"></div>
</section>
希望这对您有所帮助。
关于javascript - Codeigniter - 当选择客户并向他们显示信息时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51192214/
我有一个名为 flightbooking 的表。该表由字段组成,包括标有“R”或“C”的状态、已保留和已取消。 我想弄清楚的是允许删除状态为“C”的记录,但如果下一行的状态为“R”,则不应删除。 [编
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 可以用事实和引用来回答它. 1年前关闭。 Improve this
研究 PHP/Gearman。我试图了解 Gearman 服务器/进程如何确定什么构成“有效”客户端。 在我看过的文档中,文档显示了许多连接到 Gearman 服务器的客户端。但是,我没有找到任何描述
HBase案例:客户/订单 假设HBase 用于存储客户和订单信息。有两种核心记录类型被摄取:客户记录类型和订单记录类型。 客户记录类型将包含您通常期望的所有内容: 客户编号 客户名称
当运行配方时出现问题并且客户端运行中途挂起时,安装的 Chef 客户端将无法使用。 然后,您可以退出机器、重新启动、清理 Chef pid 文件等,但每次启动 Chef 客户端时都会显示以下消息: C
我正在用Java开发游戏,目前进展顺利。我想尽早实现多人游戏,因此我在此基础上进行构建,而不是在具有大量不同功能的情况下将整个游戏移植到多人游戏中。 我想使其成为客户端/服务器应用程序。 现在,我确定
我正在尝试以编程方式修改 magento 上的现有客户数据,但出现错误,希望有人可以帮助我。 require_once('../app/Mage.php'); ini_set("error_repor
我正在学习 JQuery。我需要创建一个自定义控件。该控件基本上将呈现一些 HTML。有时,我只想获取 HTML。我希望使用以下语法: // Put generated html inside of
我正在尝试以编程方式修改 magento 上的现有客户数据,但出现错误,希望有人可以帮助我。 require_once('../app/Mage.php'); ini_set("error_repor
我想选择表格的一行并插入到另一个现有表格中。(我用的是php和MySql,两张表除了id和timestamp外,其他列都是一样的) 我试着做一个手推车。我希望当有人付款时,从“carret”中选择该客
我想使用 JXTA 实现客户端-服务器架构。服务器部分的配置也将是 3 层。有谁知道开始这个项目的好地方吗? 提前致谢。 最佳答案 JXTA 处理 p2p 连接。这与客户端-服务器方法相反。 据我了解
我需要创建一个 Stripe 客户并为他们订阅一个计划。我查看了 Stripe.js,似乎虽然您可以获得 token ,但除此之外它没有提供任何东西。有可用于节点和 PHP 的库,但为什么不能用于 J
我有一个数据库设计要求,它变得越来越复杂,我需要找出最佳的处理方法。 目前,我有“联系人”,也有“公司”。一个公司可以有多个联系人,但一个联系人只能属于一个公司。这形成了明显的 1:n 关系。但是,联
http://ecc.galengrover.com/programs/facility-rentals/ 在那个页面上,只有那个页面我有一个奇怪的问题。在内容框上方,“所有区域”一词出现在其他文本的
所以,我让这个 CSS 预加载器正常工作。但是,我在将其添加到我的网站时遇到了一些困难。有人可以帮助我理解代码的实现,以允许预加载器成为网站加载前查看的第一个元素。此时预加载器将淡出。预加载器的代码如
考虑以下场景: 有一个 Windows 服务托管一个 WCF 服务。 WCF 服务在客户端和位于不同物理机器上的 AppFabric 服务器之间提供接口(interface)。它检索对象,对其进行计算
当前端的订单历史页面 (*/sales/order/history/) 只显示一条短消息时,这个问题首先被意识到:您没有下订单。 经过一番调试,发现问题出在这个函数上: Mage::getSingle
我的公司是一些项目的定制开发商店,有些较大,有些较小。目前,我们通过电子邮件处理所有客户通信。所以我们通过电子邮件发送设计文档,他们将其标记并发送回去。然后我们推出了他们产品的测试版,他们通过电子邮件
我有一个小部件 View 如下: 公共(public)类 RemoteNumView 扩展了 FrameLayout { 我如何调用 Roboguice 就像在 RoboActivity 中一样?如下
我有一个包含客户编号、客户名称和商品编号的 MySQL 表。它比这稍微复杂一点,但我尝试稍微简化它并删除敏感数据。 当前表 Unique Customer Number | Customer Name
我是一名优秀的程序员,十分优秀!