Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $where = [];
- if( isset( $_POST['destination_search'] )){
- $where[] = "`destination` LIKE '%" . mysql_real_escape_string( $_POST['destination_search'] ) . "%'";
- }
- if( isset( $_POST['cargo_search'] )){
- $where[] = "`cargo` LIKE '%" . mysql_real_escape_string( $_POST['cargo_search'] ) . "%'";
- }
- if( isset( $_POST['dueDate_search_last'] )){
- $where[] = "`delivery_date` LIKE '%" . mysql_real_escape_string( $_POST['dueDate_search_first'] ) . "%'";
- }
- $whereStatement = "";
- if( count($where) > 0 )
- {
- $whereStatement = "AND" . implode( " AND ", $where );
- }
- $query_Recordset_table = "
- SELECT *
- FROM `jobs` WHERE bid_deadline >= CURDATE() AND status != 'Offer accepted'
- " . $whereStatement . "
- ORDER BY `destination` ASC";
- <form id="form_searchJobs" name="form1" method="post" action="">
- <input name="destination_search" type="text" class="bb-input bb-input-large" placeholder="Destination"> <br>
- <input type="text" name="cargo_search" placeholder="Cargo" class="bb-input bb-input-large"> <br>
- <input name="dueDate_search_first" type="text" id="Due_date_from" class="bb-input bb-input-small" placeholder="Due Date (from)"/> <input name="dueDate_search_last" type="text" id="Due_date_to" class="bb-input bb-input-small" placeholder="Due Date (to)"/>
- <input type="submit" name="search" id="search" class="button3" value="Search" />
- </form>
- if( isset( $_POST['dueDate_search_first'], $_POST['dueDate_search_last'] )){
- $where[] = "`delivery_date` BETWEEN '%" . mysql_real_escape_string( $_POST['dueDate_search_first'] ) . "%' AND '%" . mysql_real_escape_string( $_POST['dueDate_search_last'] ) . "%'";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement