25 ){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADRER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 5); curl_setopt($ch, CURLOPT_TIMEOUT, 5); $response = curl_exec($ch); curl_close($ch); if( $response ){ unlink("kolejka.xml"); $fp = fopen("kolejka.xml", "a+"); fwrite($fp, $response); fclose($fp); } } $response = file_get_contents("kolejka.xml"); $arr = preg_split("/|<\/services>/", $response); $arr = preg_split("/([^<>]+)<\/description>/", $v, $r); if( $r[1] ){ $for_index["TABELA"][$i]["nazwa"] = $r[1]; preg_match("/([0-9]+)<\/ticketsWaiting>/", $v, $r); $for_index["TABELA"][$i]["kod"] = $r[1]; preg_match("/([^<>]+)<\/lastValueCall>/", $v, $r); $for_index["TABELA"][$i]["ostatni"] = $r[1]; $i++; } } } $index_tpl = template($for_index, read_template("tpl/table.tpl")); $index_tpl = template_const($index_tpl); if( $_GET["src"] ){ echo " document.write('"; echo preg_replace("/[\r\n\t]+/", " ", $index_tpl); echo "'); "; } else { echo $index_tpl; } sql_disconnect(); ?>