由于这个MySQL语句,我已经获得了下表
SELECT * FROM expenses, income
WHERE expenses.projectname=income.projectname
AND expenses.task=income.task
Run Code Online (Sandbox Code Playgroud)
在此表中,一个项目有许多任务.因此项目,客户,项目开始和结束日期列无意义地重复.如何才能为所有任务显示一次?如何在这里应用PHP隐藏逻辑?下图显示了我需要实现的目标.通过MySQL查询检索数据.但是我怎样才能隐藏重复的不必要的值
这是CodeIgniter视图页面
<table class="table table-lg">
<thead >
<tr class="filters">
<th><input type="text" class="form-control" placeholder="Project" disabled></th>
<th><input type="text" class="form-control" placeholder="Employee" disabled></th>
<th><input type="text" class="form-control" placeholder="Task" disabled></th>
<th><input type="text" class="form-control" placeholder="Expense" disabled></th>
<th><input type="text" class="form-control" placeholder="Amount" disabled></th>
<th><input type="text" class="form-control" placeholder="Paid/Not" disabled></th>
<th><input type="text" class="form-control" placeholder="Client" disabled></th>
<th><input type="text" class="form-control" placeholder="Cost" disabled></th>
<th><input type="text" class="form-control" placeholder="Income " disabled></th>
<th><input type="text" class="form-control" placeholder="Date" disabled></th>
</tr>
</thead>
<tbody>
<?php
if(isset($view_data1) && is_array($view_data1) && …Run Code Online (Sandbox Code Playgroud) 以下代码用于在单击复选框时突出显示表记录.但是一旦我刷新了页面,突出显示的记录就会消失.如果页面刷新后我怎么能保持相同的突出显示记录?
<style>
.highlight {
background-color: yellow;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#Table input").click(function() {
if ($(this).is(":checked")) {
$(this).parent().parent().addClass("highlight");
} else {
$(this).parent().parent().removeClass("highlight");
}
});
});
</script>
<body>
<div class="col-lg-10">
<form name="f">
<table id="Table" border="1"><tr>
<td><input type="checkbox" name="cb1" id="cb1" value="y" /></td>
<td>Click me</td>
</tr><tr>
<td><input type="checkbox" name="cb2" id="cb2" value="y" /></td>
<td>Click me</td>
</tr><tr>
<td><input type="checkbox" name="cb3" id="cb3" value="y" /></td>
<td>Click me</td>
</tr></table>
</div>Run Code Online (Sandbox Code Playgroud)