/    Sign up×
Community /Pin to ProfileBookmark

Search and show data from three tables according to input from 3 inputs

<form name=”search” action=”” enctype=”multipart/form-data”>
<table width=”100px” border=”0″ cellpadding=”2″ class=”table” style=”float:left;”>
<tr align=”center” valign=”middle” bgcolor=”#CCCCCC”>
<td><strong>From Date</strong></td>
<td><input type=”text” name=”from_date1″ id=”from_date1″ readonly=”1″ />
<script type=”text/javascript”>
function catcalc(cal) {
var date = cal.date;
var time = date.getTime()
// use the _other_ field
var field = document.getElementById(“from_date1”);
if (field == cal.params.inputField) {
field = document.getElementById(“from_date1”);
}
//field.value = date2.print(“%d-%m-%Y”);
}
Calendar.setup({
inputField : “from_date1”, // id of the input field
ifFormat : “%Y-%m-%d”, // format of the input field
showsTime : false,
timeFormat : “24”,
onUpdate : catcalc
});
</script>

</td>
<td><strong>To Date</strong></td>
<td><input type=”text” name=”to_date1″ id=”to_date1″ readonly=”1″ />
<script type=”text/javascript”>
function catcalc(cal) {
var date = cal.date;
var time = date.getTime()
// use the _other_ field
var field = document.getElementById(“to_date1”);
if (field == cal.params.inputField) {
field = document.getElementById(“to_date1”);
}
}
Calendar.setup({
inputField : “to_date1”, // id of the input field
ifFormat : “%Y-%m-%d”, // format of the input field
showsTime : false,
timeFormat : “24”,
onUpdate : catcalc
});

</script>
</td>
<td><strong>Employee Type</strong></td>
<td>
<select name=”emp_type_id1″ id=”emp_type_id1″>
<option value=”0″>—Select—</option>

<option value=”1″>Executive</option>
<option value=”2″>Non-Executive</option>
</select>
</td>
<td><input name=”Search” type=”submit” value=”Search”/></td>

</tr>
</table>
</form>

Here i want that user will search according to the three fields and clicking on search button will show the employee names .But the data has to retrieved from 3 tables, as my from-date and to_date is in another table and employee-type is in another table and employee-name is in another table, but in three tables emp_id is common.

And i want to show the data in the same page.

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @lee_help spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...