$date_from = getPost('date_from', ''); $date_to = getPost('date_to', ''); if (!empty($_POST['page'])) { $page = $_POST['page']; $start = ($_POST['page'] - 1) * $limit; } $select = "select a.id from sms_files as a left join po_file as k on a.trans_no=k.trans_no "; $result = $conn->query($select); $rowcount = mysqli_num_rows($result); $limit = 10; $pages = $rowcount / $limit; if ((int) $pages < $pages) { $pages++; } $pages = (int) $pages; $where = whereMaker("", 'received', $phone_number, ''); if ($date_from != '' || $date_to != '') { if ($where != '') { $where .= " and "; } else { $where = " where"; } if ($date_from != '' && $date_to != '') { $where .= " date_sent >= '" . date("Y-m-d", strtotime($date_from)) . " 00:00:00' and date_sent <='" . date("Y-m-d", strtotime($date_to)) . " 23:59:59'"; } else { if ($date_from != '') { $where .= " date_sent like '" . date("Y-m-d", strtotime($date_from)) . "%' "; } else { $where .= " date_sent like '" . date("Y-m-d", strtotime($date_to)) . "%' "; } }
$date_to = getPost('date_to', ''); $type = "With PO"; if (!empty($_REQUEST['type'])) { $type = $_REQUEST['type']; } //echo $type; $limit = 10; $start = 0; $page = 1; if (!empty($_POST['page'])) { $page = $_POST['page']; $start = ($_POST['page'] - 1) * $limit; } $filter = "where status in ('Request Release','Ready for pick up','Receive Cash Request' ,'Received')"; $filter = whereMaker($filter, 'status', $status_type); $filter = whereMaker($filter, 'requestor', $requestor_id); if ($date_from != '' || $date_to != '') { $filter .= " and "; if ($date_from != '' && $date_to != '') { $filter .= " date_created >= '" . date("Y-m-d", strtotime($date_from)) . " 00:00:00' and date_created <='" . date("Y-m-d", strtotime($date_to)) . " 23:59:59'"; } else { if ($date_from != '') { $filter .= " date_created like '" . date("Y-m-d", strtotime($date_from)) . "%' "; } else { $filter .= " date_created like '" . date("Y-m-d", strtotime($date_to)) . "%' "; } } } $size = " style='border:none;background-color:transparent;font-size:18px;font-weight:normal; color: #555555;\n background-color: #fff;\n border: 1px solid #ddd;\n border-bottom-color: transparent;\n cursor: default;\n padding: 10px;'"; $size1 = " style='border:none;background-color:transparent;font-size:14px'"; $active_po = "class='active selected_tab' {$size}";
// $filter.=" date_created between '".date("Y-m",strtotime($date_from))."' and '".date("Y-m-d",strtotime($date_to))."'"; $filter .= " and "; if ($date_from != '' && $date_to != '') { $filter .= " approved_date >= '" . date("Y-m-d", strtotime($date_from)) . " 00:00:00' and approved_date <='" . date("Y-m-d", strtotime($date_to)) . " 23:59:59'"; } else { if ($date_from != '') { $filter .= " approved_date like '" . date("Y-m-d", strtotime($date_from)) . "%' "; } else { $filter .= " approved_date like '" . date("Y-m-d", strtotime($date_to)) . "%' "; } } } $filter = whereMaker($filter, 'requestor', $requestor_id); $filter = whereMaker($filter, 'company_name', $company_name); $filter = whereMaker($filter, 'supplier', $supplier_id); $filter = whereMaker($filter, 'secretary', $secretary_id); $SELECT_po = "select * from po_file" . $filter; echo "<tr>\n \t\t<th style='border:none;text-align:left'>Date Approved</th>\n \t<th colspan=10 style='text-align:left; border:none'>\n \t\t\t<table align=left>\n \t\t\t\t<tr>\n \t\t\t\t\t<td style='border:none'>\n \t\t\t\t\t\t<input title='parseMe' style='width:120px' id='date_from' name='date_from' value='{$date_from}'>\n \t\t\t\t\t\t<span id='date_from_cal' class='calendar-icon'></span>\n \t\t\t\t\t</td>\n \t\t\t\t\t<td style='padding:1px;border:none'>-</td><td style='border:none'>\n \t\t\t\t\t\t<input title='parseMe' style='width:120px' id='date_to' name='date_to' value='{$date_to}'>\n \t\t\t\t\t\t<span id='date_to_cal' class='calendar-icon'></span>\n \t\t\t\t\t</td>\n \t\t\t</table>\n \t\t</td>\n \t</tr>"; $select = "select concat(first_name,' ',last_name) as name,account_id from master_address_file where mas_status=1 and account_type='Account Executive' order by name"; $result1 = $conn->query($select); while ($row1 = $result1->fetch_assoc()) { $requestor[$row1['account_id']] = $row1['name']; } echo selectMakerEach('Requestor', 'requestor_id', $requestor, '', $requestor_id); $select = "select concat(first_name,' ',last_name) as name,account_id from master_address_file where mas_status=1 and account_type='secretary' order by name"; $result1 = $conn->query($select); while ($row1 = $result1->fetch_assoc()) { $secretary[$row1['account_id']] = $row1['name']; } $select = "select concat(first_name,' ',last_name) as name,account_id from master_address_file where mas_status=1 and account_type='engineer' order by name"; $result1 = $conn->query($select);