Witam. Uzywam ponizszego skryptu na potrzeby generowania konfiguracji dla serwerow radius. Wszystko ladnie chodzi, natomiast nie jest uwzgledniana opcja taryf nocnych. Czy ktos ma pomysl jak to zrobic? Czyli np zeby o godzinie 23:01 radius uwzglednil takze taryfy nocne, oraz zeby downceil i upceil wciagnely sie wlasnie z taryf nocnych jezeli klient takowe ma.
{result = SELECT LOWER(nodes.name) AS name, inet_ntoa(nodes.ipaddr) AS ip , nodes.passwd AS passwd, SUM(tariffs.downceil) AS downceil, SUM(tariffs.upceil) AS upceil from nodes left join nodeassignments on nodes.id = nodeassignments.nodeid left join assignments on nodeassignments.assignmentid = assignments.id left join tariffs on assignments.tariffid = tariffs.id left join customers on assignments.customerid = customers.id where customers.status = 3 and (assignments.datefrom <= UNIX_TIMESTAMP( ) OR assignments.datefrom = 0) and (assignments.dateto > UNIX_TIMESTAMP( ) OR assignments.dateto = 0) and nodes.passwd != '' group by nodes.name;}\ {for (r=0; r<number(result); r++)}{if (result[r].passwd != "")}\ "{result[r].name}"{"\t\tCleartext-Password := "}"{result[r].passwd}" {"\t\t\tFramed-IP-Address = "}{result[r].ip}, {"\t\t\tMikrotik-Rate-Limit = "}{result[r].upceil"k"}/{result[r].downceil"k"} {/if}{/for}\
Pozdrawiam.