if (count($orders) > 0) { $ord = " AND " . implode(" AND ", $orders); $_SESSION['client_search'] = $orders2; } } if (!$wg) { $wg = "c_shortname_c"; $jak = "asc"; } $razem = $db->GetOne("select count(*) as ile from wind_client WHERE c_type_e IN ('{$typ}', 'dw')" . $ord); $news = "SELECT * FROM wind_client WHERE c_type_e IN ('{$typ}', 'dw')" . $ord . " ORDER BY {$wg} {$jak}"; $sql = $db->SelectLimit($news, $count, $offset); naglowek('nip', 'c_nip_c'); naglowek('tt', 'c_name_c'); naglowek('sh', 'c_shortname_c'); naglowek('ph', 'c_phone_c'); if ($sql) { if (checkPerm('cli', 4)) { if ($sql->RecordCount() > 0) { while ($new = $sql->FetchRow()) { if ($new["c_id_s"] > 0) { print "<form method=\"post\" name=\"delete_client_" . $new["c_id_s"] . "\" action=\"client\">"; print hidden("del_client", $new["c_id_s"]); print hidden("typ", $new['c_type_e']); print "</form>"; } } } } } $sql->Move(0);
</center></td></tr> </form> </table> <?php } if ($list == 1) { $offset += 0; $count = 100; if (!$wg) { $wg = "o_name_c"; $jak = "asc"; } $razem = $db->GetOne("select count(*) as ile from wind_office"); $news = "SELECT * FROM wind_office ORDER BY {$wg} {$jak}"; $sql = $db->SelectLimit($news, $count, $offset); naglowek('tt', 'o_name_c'); if ($sql) { if ($sql->RecordCount() > 0) { while ($new = $sql->FetchRow()) { if ($new["o_id_s"] > 0) { print "<form method=\"post\" name=\"delete_office_" . $new["o_id_s"] . "\" action=\"office\">"; print hidden("del_office", $new["o_id_s"]); print "</form>"; } } } } $sql->Move(0); ?> <br> <table width='95%' cellpadding=0 cellspacing=0 border=1 bordercolor="#cfcfcf" rules="rows">
$orders2['s_phone'] = $s_phone; if (count($orders) > 0) { $ord = " AND " . implode(" AND ", $orders); $_SESSION['executive_search'] = $orders2; } } if (!$wg) { $wg = "e_shortname_c"; $jak = "asc"; } $razem = $db->GetOne("select count(*) as ile from wind_executive WHERE 1=1" . $ord); $news = "SELECT * FROM wind_executive WHERE 1=1" . $ord . " ORDER BY {$wg} {$jak}"; $sql = $db->SelectLimit($news, $count, $offset); naglowek('tt', 'e_name_c'); naglowek('sh', 'e_shortname_c'); naglowek('ph', 'e_phone_c'); if ($sql) { if (checkPerm('exec', 4)) { if ($sql->RecordCount() > 0) { while ($new = $sql->FetchRow()) { if ($new["e_id_s"] > 0) { print "<form method=\"post\" name=\"delete_executive_" . $new["e_id_s"] . "\" action=\"executive\">"; print hidden("del_executive", $new["e_id_s"]); print "</form>"; } } } } } $sql->Move(0); ?>
//radca ma dostęp tylko do spraw sądowych i komorniczych $ord .= ' AND ca_stage_e IN ("ep", "es", "ek")'; } if (!$wg) { $wg = "ca_number_i"; $jak = "desc"; } $razem = $db->GetOne("select count(*) as ile from wind_case WHERE 1=1" . $ord); $news = "SELECT *, c1.c_shortname_c as debtor, c2.c_shortname_c as creditor, cu_short_c, UNIX_TIMESTAMP(ca_input_d) as data\nFROM wind_case \nLEFT JOIN wind_users ON cu_id_s=ca_agent_id_k \nLEFT JOIN wind_client c1 ON c1.c_id_s=ca_debtor_id_k \nLEFT JOIN wind_client c2 ON c2.c_id_s=ca_creditor_id_k \nWHERE 1=1" . $ord . " GROUP BY ca_id_s ORDER BY {$wg} {$jak}"; //, SUM(pi_amount_f) as wplaty, (SUM(frn_amount_left_f)-SUM(pi_amount_f)) as pozostalo // LEFT JOIN wind_payin ON pi_case_id_k=ca_id_s $sql = $db->SelectLimit($news, $count, $offset); naglowek('date', 'ca_input_d'); naglowek('num', 'ca_number_c'); naglowek('pc', 'cu_short_c'); naglowek('dc', 'debtor'); naglowek('wc', 'creditor'); if ($sql) { if (checkPerm('case', 4)) { if ($sql->RecordCount() > 0) { while ($new = $sql->FetchRow()) { if ($new["ca_id_s"] > 0) { print "<form method=\"post\" name=\"delete_case_" . $new["ca_id_s"] . "\" action=\"case\">"; print hidden("del_case", $new["ca_id_s"]); print "</form>"; } } } } } $sql->Move(0); ?>