Example #1
0
    $where = $where . " and atskaites_veids = " . "'" . $a_veids . "'";
}
if ($piegadatajs != '0') {
    $where = $where . " and piegadatajs = {$piegadatajs}";
}
if ($registrator != 0) {
    $where = $where . " and lietotajs_veidoja = " . "'" . $registrator . "'";
}
if ($vieta != '0' && $vieta != '') {
    $where = $where . " and vieta = " . "'" . $vieta . "'";
}
if ($date_from != 0) {
    $where = $where . " and datums_uzmer >= '" . sqldate(datums($date_from)) . " 00:00'";
}
if ($date_to != 0) {
    $where = $where . " and datums_uzmer <= '" . sqldate(datums($date_to)) . " 23:59'";
}
$query = "SELECT * FROM g_registrs WHERE " . $where . " AND opcija != 'D' ORDER BY id ASC";
if ($SortDouble === "on") {
    $sub_query = "SELECT pavadzime FROM g_registrs WHERE " . $where . " AND opcija != 'D' GROUP BY pavadzime having count(pavadzime)> 1";
    $sub_query_SQL = mysql_query($sub_query);
    while ($sub_query_temps = mysql_fetch_assoc($sub_query_SQL)) {
        $sub_query_temp[] = $sub_query_temps;
    }
}
?>
<table border="0" align="center">
<font size="10">
<tr bgcolor=CCFFCC>
		<td align="center">ID</td>
		<td align="center">Atskaites veids</td>
Example #2
0
function laika_ievadisana($laiks_no, $laiks_lidz, $laiks_noh, $laiks_nom, $laiks_lidzh, $laiks_lidzm)
{
    if ($laiks_no && $laiks_lidz) {
        if (datums($laiks_no) != -1 && datums($laiks_lidz) != -1) {
            if (datums_laiks($laiks_no, $laiks_noh, $laiks_nom) < datums_laiks($laiks_lidz, $laiks_lidzh, $laiks_lidzm)) {
                return true;
            }
        }
    }
    if (!$laiks_no && !$laiks_lidz) {
        return true;
    }
}