[insert_php] echo “test
“; [/insert_php]

[insert_php]
include(“func.inc”);
//dumpIncoming();
echo ”

“;
$lastmonth = date(“Y-m-d”, mktime(0, 0, 0, date(“m”)-1, date(“d”), date(“Y”)));
$lastyear = date(“Y-m-d”, mktime(0, 0, 0, date(“m”)-13, date(“d”), date(“Y”)));
$lastweek= date(“Y-m-d”, mktime(0, 0, 0, date(“m”), date(“d”)-7, date(“Y”)));
contactDatabase();
if(substr($_POST[‘view_which’], 0, 8)==”specDate”) {
$attendDate=gathermemberinfo2($_POST);
}
//
$queryString=gathermemberinfo($_POST[‘search’]);

$result = mysql_query($queryString);
$num_rows = mysql_num_rows($result);

$sql = mysql_query($queryString );
while($row = mysql_fetch_array($sql)){
foreach($row AS $key =—-> $val){
$key = “default_” . $key;
$$key = stripslashes($val);
}
}

$bus_type=$_POST[‘business_type’];
$type=$_POST[‘business_type’];
$category=$_POST[‘business_type’];
[/insert _php]


[insert_php] echo gather_hidden_fields(); [/insert _php]

[insert_php] echo gather_hidden_fields1($type); [/insert _php]
[insert_php]
echo ‘
‘; [/insert _php]

[insert_php] echo gather_hidden_fields1($type); ?–>
[insert_php]
if(!isset($_POST[‘business_type’])) {
$bus_type=”View All”; $category=”All Businesses”;$type=”View All”;
} else {
$bus_type=$_POST[‘business_type’];$type=$_POST[‘business_type’];$category=$_POST[‘business_type’];
}
echo dd_bus_type($bus_type); ?–>

Viewing [insert_php] echo $category; ?–>

[insert_php]
if(substr($_POST[‘view_which’], 0, 8)==”specDate”) {specialDate($_POST,$queryString,$num_rows,$lastmonth);
} else if(($_POST[‘view’]==”grid”) || (!isset($_POST[‘view’])) || ($_POST[‘view’]==””)) {
directory_grid($queryString,$num_rows,$lastmonth);
} else {directory_list($queryString,$lastmonth,$lastweek,$num_rows);}

echo ‘
‘;

function gathermemberinfo($search) {
$lastmonth = date(“Y-m-d”, mktime(0, 0, 0, date(“m”)-1, date(“d”), date(“Y”)));
$lastyear = date(“Y-m-d”, mktime(0, 0, 0, date(“m”)-13, date(“d”), date(“Y”)));
$lastweek= date(“Y-m-d”, mktime(0, 0, 0, date(“m”), date(“d”)-7, date(“Y”)));

if(!isset($_POST[‘view_which’])) {$where=”WHERE”; } else
if($_POST[‘view_which’]==”older”) {$where=”WHERE”; } else
if($_POST[‘view_which’]==”new”) {$where=”AND”; } else
if($_POST[‘view_which’]==””) {$where=”AND”;} else {$where=”AND”;}
$queryString = “select * from sdavisnetwork “;
if ($search != “”) {
$queryString .= ” WHERE “;
$where=” and “;
$count=”0″;
$queryString .= ” company LIKE ‘%$search%’ or first LIKE ‘%$search%’ or last LIKE ‘%$search%’ or email LIKE ‘%$search%'”;
} else {
$where=” WHERE “;
}

if((!isset($_POST[‘view_which’])) || ($_POST[‘view_which’]==””)) {
$queryString .= $where.” last_attend –>= ‘$lastmonth’ and misc2=’member’ “;
$countwhere=”1″;
} else if($_POST[‘view_which’]==”lastWeek”) {$queryString .= $where.” last_attend >= ‘$lastweek’ and misc2=’member’ “; $countwhere=”1″;
} else if($_POST[‘view_which’]==”new”) {$queryString .= $where.” last_attend >= ‘$lastmonth’ and misc2=’member’ “; $countwhere=”1″;
} else if ($_POST[‘view_which’]==”older”) {}
if($countwhere==”1″) {$where = ” and “;} else {$where = ” WHERE “;}
if(($_POST[‘business_type’]==””) || ($_POST[‘business_type’]==”View All”)){}
//$queryString .= $where.” misc3 = ‘$_POST[business_type]’ “; } /*and misc2=’member’*/
else
{$queryString .= $where.” misc3 like ‘%$_POST[business_type]%’ “; }
if((!isset($_POST[‘sort’])) || ($_POST[‘sort’]==”company”) || ($_POST[‘sort’]==””)) {$queryString .= ” order by company”;}
if($_POST[‘sort’]==”last”) {$queryString .= “order by last”;}
if($_POST[‘sort’]==”first”) {$queryString .= “order by first”;}
//echo $queryString;
return $queryString;
}
function gather_hidden_fields() { [/insert _php]


[insert_php] }

function gather_hidden_fields1($type) { [/insert _php]







[insert_php] }

function gather_hidden_fields2($type) {

echo ‘






‘;
}

function dd_bus_type($bus_type) {
databaseLocal();
$user_id = 118;
$text = ‘
“;
contactDatabase();
$user_id = $_SESSION[‘id’];
$text .=’ ‘;
return $text;
}

function directory_grid($queryString,$num_rows,$lastmonth) {
$rotate = 0;
$count =0;
$sql = mysql_query($queryString );

$result = mysql_query($queryString);
$num_rows = mysql_num_rows($result);

echo ‘

   Total Companies Found:  ‘.$num_rows.’

‘;
echo ‘

‘;

while($row = mysql_fetch_array($sql)){
foreach($row AS $key => $val){
$$key = stripslashes($val);
}
$count++;
$detail_1=”Details”;

if ($row[‘profile_img’]!=””) {
$profile_img=’‘;
} else {
$profile_img=’‘;
}

if ($row[‘logo_img’]!=””) {
$logo_img=’‘;
} else {
$logo_img=’ ‘;
}

if ($rotate == 0){ $class=”odd1″;} else {$class=”odd1″;}
if ($last_attend>=$lastweek) {$red1=’‘;$red2=”“;$attended=’‘;}
if ($last_save>$lastmonth) {$bold=”“; $bold2=”“;}

[/insert _php]

[insert_php]
if($last_attend –>= $lastmonth) { [/insert _php]

[insert_php]
} else {

echo $logo_img;
}
[/insert _php]

[insert_php]
if($last_attend –>= $lastmonth) {
echo ‘‘.$row[‘company’].’
‘;
}
else { echo $row[‘company’].’
‘;}
echo ”

“;

echo ‘

‘.$row[‘first’].’ ‘.$row[‘last’].’
‘;

if($row[‘address’]!=””) {
echo $row[‘address’].”,
“.$row[‘city’].”, “.$row[‘state’].” “.$row[‘zip’].”
“;
}
if($row[‘phone’]!=””) {
echo “Phone: “.$row[‘phone’].’
‘;
}

if($row[‘cell’]!=””) {
echo “Cell: “.$row[‘cell’].”
“;
}
echo ‘‘.$row[’email’].’

‘;

echo ‘‘;
if ($last_save==”0000-00-00″) { $this_last_save=”Never Updated”; }
else {$this_last_save=date_create($last_save); $this_last_save=date_format($this_last_save,”F d, Y”);}

echo ‘Last Attended: ‘;
$date=date_create($row[‘last_attend’]);
echo date_format($date,”F d, Y”).’
Profile Last Updated: ‘.$this_last_save;

echo ‘

‘;

if($last_attend >= $lastmonth) {

echo ‘‘.$profile_img.’‘;

} else {
echo $profile_img;
}

echo ‘

‘;

if($rotate==1) {$rotate=0;} else {$rotate=1;};
}
echo ‘

‘;

}
[/insert _php]