research by date
This commit is contained in:
parent
6e55d1c471
commit
89ceafaef5
@ -57,7 +57,7 @@ $snom = GETPOST('search_nom');
|
|||||||
$suser = GETPOST('search_user');
|
$suser = GETPOST('search_user');
|
||||||
$sttc = GETPOST('search_ttc');
|
$sttc = GETPOST('search_ttc');
|
||||||
$sall = GETPOST('search_all');
|
$sall = GETPOST('search_all');
|
||||||
|
$sdate = GETPOST('search_date');
|
||||||
$page = GETPOST('page', 'int');
|
$page = GETPOST('page', 'int');
|
||||||
|
|
||||||
$sortorder = GETPOST('sortorder');
|
$sortorder = GETPOST('sortorder');
|
||||||
@ -105,6 +105,11 @@ if ($suser) {
|
|||||||
if($sttc) {
|
if($sttc) {
|
||||||
$sql .= ' AND cf.total_ttc = ' . price2num($sttc);
|
$sql .= ' AND cf.total_ttc = ' . price2num($sttc);
|
||||||
}
|
}
|
||||||
|
if($sdate) {
|
||||||
|
$datearray = explode('/', $sdate);
|
||||||
|
$date = date('Y-m-d', mktime(0,0,0, $datearray[1], $datearray[0], $datearray[2]));
|
||||||
|
$sql .= ' AND cf.date_creation LIKE "' . $date . '%"';
|
||||||
|
}
|
||||||
if($sall) {
|
if($sall) {
|
||||||
$sql .= ' AND (cf.ref LIKE "%' . $db->escape($sall) . '%" ';
|
$sql .= ' AND (cf.ref LIKE "%' . $db->escape($sall) . '%" ';
|
||||||
$sql .= 'OR cf.note LIKE "%' . $db->escape($sall) . '%")';
|
$sql .= 'OR cf.note LIKE "%' . $db->escape($sall) . '%")';
|
||||||
@ -178,7 +183,7 @@ if ($resql) {
|
|||||||
'cf.date_creation',
|
'cf.date_creation',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'align="center"',
|
'',
|
||||||
$sortfield,
|
$sortfield,
|
||||||
$sortorder
|
$sortorder
|
||||||
);
|
);
|
||||||
@ -206,7 +211,10 @@ if ($resql) {
|
|||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input type="text" class="flat" name="search_ttc" value="' . $sttc . '">';
|
print '<input type="text" class="flat" name="search_ttc" value="' . $sttc . '">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td colspan="2" class="liste_titre" align="right">';
|
print '<td class="liste_titre">';
|
||||||
|
print '<input type="text" class="flat" name="search_date" value="' . $sdate . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="liste_titre" align="right">';
|
||||||
$src = DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png';
|
$src = DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png';
|
||||||
$value = dol_escape_htmltag($langs->trans('Search'));
|
$value = dol_escape_htmltag($langs->trans('Search'));
|
||||||
print '<input type="image" class="liste_titre" name="button_search" src="' . $src . '" value="' . $value . '" title="' . $value . '">';
|
print '<input type="image" class="liste_titre" name="button_search" src="' . $src . '" value="' . $value . '" title="' . $value . '">';
|
||||||
@ -249,11 +257,11 @@ if ($resql) {
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Amount
|
// Amount
|
||||||
print '<td align="right" width="100">';
|
print '<td>';
|
||||||
print price($obj->total_ttc);
|
print price($obj->total_ttc);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Date
|
// Date
|
||||||
print '<td align="center" width="100">';
|
print '<td>';
|
||||||
if ($obj->dc) {
|
if ($obj->dc) {
|
||||||
print dol_print_date($db->jdate($obj->dc), 'day');
|
print dol_print_date($db->jdate($obj->dc), 'day');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user