function sql_addNetwork($myc, $s) { global $debug; $tblname = 'networks'; // // prvo insert novog networka (name je unique)... // $q = "INSERT INTO " . $tblname . " SET id='" . $s['id'] . "'"; if ($debug) { dbg("INSERT INTO", $q); } if (!mysql_query($q, $myc)) { print "<h4>MySQL: Can't add network " . $s['id'] . " to " . $tblname . "</h4>\n"; print mysql_error($myc) . "\n"; return false; } print "<pre>MySQL: Network " . $s['id'] . " added</pre>\n"; // // nakon inserta azuriranje podataka... // sql_updateNetwork($myc, $s); return true; }
print " openDialog( url , 'shownetwork' , 'width=300,height=300,resizable=yes,scrollbars=yes,status=yes' );\n"; print "</script>\n"; break; } switch ($dconf['dbtype']) { case 'mysql': sql_addNetwork($myc, $networkpost); break; } print "<h1>Network " . $networkpost['id'] . " added</h1>\n"; addlog(true, "Network " . $networkpost['id'] . " added"); break; case 'update': switch ($dconf['dbtype']) { case 'mysql': sql_updateNetwork($myc, $networkpost); break; } print "<h1>Network " . $networkpost['id'] . " updated</h1>\n"; addlog(true, "Network " . $networkpost['id'] . " updated"); break; case 'delete': switch ($dconf['dbtype']) { case 'mysql': sql_deleteNetwork($myc, $networkpost); break; } print "<h1>Network " . $networkpost['id'] . " deleted</h1>\n"; addlog(true, "Network " . $networkpost['id'] . " deleted"); break; }