<?php
include_once("include/config.php");
include_once("include/auth.lib.php");
list($status, $user) = auth_get_status();
if($status == AUTH_LOGGED & auth_get_option("TRANSICTION METHOD") == AUTH_USE_LINK){
$link = "?uid=".$_GET['uid'];
}else $link = '';
switch($status){
case AUTH_LOGGED:
$query = "SELECT name,cel,tel1,tel2,tel3,tel4,tel5 FROM utenti WHERE stato = 'aperto'";
$result = mysql_query($query) or die (mysql_error());
$sost = array(',','-','.');
$txt = '';
while ($array = mysql_fetch_array($result,MYSQL_BOTH)) {
if(preg_match("/3[^ ]*/",$array['cel'],$matches)) {
foreach($matches as $match) {
$match = str_replace($sost,'',$match);
$txt .= $match.','.$array['name'].'<br>';
}
}
if(preg_match("/3[^ ]*/",$array['tel1'],$matches)) {
foreach($matches as $match) {
$match = str_replace($sost,'',$match);
$txt .= $match.','.$array['name'].' DIRETTIVO <br>';
}
}
if(preg_match("/3[^ ]*/",$array['tel12'],$matches)) {
foreach($matches as $match) {
$match = str_replace($sost,'',$match);
$txt .= $match.','.$array['name'].' DIRETTIVO <br>';
}
}
if(preg_match("/3[^ ]*/",$array['tel3'],$matches)) {
foreach($matches as $match) {
$match = str_replace($sost,'',$match);
$txt .= $match.','.$array['name'].' DIRETTIVO <br>';
}
}
if(preg_match("/3[^ ]*/",$array['tel4'],$matches)) {
foreach($matches as $match) {
$match = str_replace($sost,'',$match);
$txt .= $match.','.$array['name'].' DIRETTIVO <br>';
}
}
if(preg_match("/3[^ ]*/",$array['tel5'],$matches)) {
foreach($matches as $match) {
$match = str_replace($sost,'',$match);
$txt .= $match.','.$array['name'].' DIRETTIVO <br>';
}
}
}
echo $txt;
break;
case AUTH_NOT_LOGGED:
header("Refresh: 0;URL=index.php");
break; } ?>