num_rows); while ($row = mysqli_fetch_array($firmcheck)) { $firmid = $row["id"]; //echo "firmid:$firmid"; } $firmresult = mysqli_query($dbh,"SELECT id, name, address1, address2, address3, code, telephone, mobile, fax, email, website, postal_1, postal_2, postal_code, docex, description, imageid, listing_type FROM lawfirm WHERE id = '$firmid' AND listing_type='G'"); while ($row = mysqli_fetch_array($firmresult)) { $id = $row["id"]; $firmname = $row["name"]; $add1 = $row["address1"]; $add2 = $row["address2"]; $add3 = $row["address3"]; $code = $row["code"]; $telephone = $row["telephone"]; $mobile = $row["mobile"]; $fax = $row["fax"]; $email = $row["email"]; $website = $row["website"]; $postal_1 = $row["postal_1"]; $postal_2 = $row["postal_2"]; $postal_code = $row["postal_code"]; $docex = $row["docex"]; $description = nl2br($row["description"]); $imageid = $row["imageid"]; $listing_type = $row["listing_type"]; $tel1 = substr($telephone, 0, 3); $tel2 = substr($telephone, 3, 3); $tel3 = substr($telephone, 6, 4); $find[] = '“'; // left side double smart quote $find[] = '”'; // right side double smart quote $find[] = '‘'; // left side single smart quote $find[] = '’'; // right side single smart quote $find[] = '…'; // elipsis $find[] = '—'; // em dash $find[] = '–'; // en dash $find[] = '•'; $find[] = 'ü'; $find[] = 'ä'; $find[] = 'ö'; $find[] = 'Ö'; $find[] = 'ß'; $find[] = '� '; $find[] = 'á'; $find[] = 'â'; $find[] = 'ã'; $find[] = 'ù'; $find[] = 'ú'; $find[] = 'û'; $find[] = 'Ù'; $find[] = 'Ú'; $find[] = 'Û'; $find[] = 'Ü'; $find[] = 'ò'; $find[] = 'ó'; $find[] = 'ô'; $find[] = 'è'; $find[] = 'é'; $find[] = 'ê'; $find[] = 'ë'; $find[] = 'À'; $find[] = 'Á'; $find[] = 'Â'; $find[] = 'Ã'; $find[] = 'Ä'; $find[] = 'Å'; $find[] = 'Ç'; $find[] = 'È'; $find[] = 'É'; $find[] = 'Ê'; $find[] = 'Ë'; $find[] = 'Ì'; $find[] = 'Í'; $find[] = 'Î'; $find[] = 'Ï'; $find[] = 'Ñ'; $find[] = 'Ò'; $find[] = 'Ó'; $find[] = 'Ô'; $find[] = 'Õ'; $find[] = 'Ø'; $find[] = 'å'; $find[] = 'æ'; $find[] = 'ç'; $find[] = 'ì'; $find[] = 'í'; $find[] = 'î'; $find[] = 'ï'; $find[] = 'ð'; $find[] = 'ñ'; $find[] = 'õ'; $find[] = 'ø'; $find[] = 'ý'; $find[] = 'ÿ'; //$find[] = '€'; $replace[] = '"'; $replace[] = '"'; $replace[] = "'"; $replace[] = "'"; $replace[] = "..."; $replace[] = "-"; $replace[] = "-"; $replace[] = "-"; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $text = str_replace($find, $replace, $description); echo "

$firmname

"; echo "


"; echo "

About Us

$text


"; echo "

Practice Areas

    "; $cats = mysqli_query($dbh, "SELECT categoryid, category FROM lawfirmcategory, category WHERE lawfirmid = '$id' AND categoryid = category.id ORDER BY category ASC"); //get the number of rows in our result so we can use it in a for loop $numrows = (mysqli_num_rows ($cats)); // loop to create rows if($numrows >0){ while ($row = mysqli_fetch_array($cats)) { $special = $row["category"]; echo "
  • $special,
  • "; } } echo "
"; // echo ""; // // loop to create columns // $position = 1; // // // $i=0; // while ($row = mysqli_fetch_array($cats)) // { // if($position == 1) // { // echo ""; // } // $special = $row["category"]; // // echo ""; // $i++; // if($position == 3) // { // echo " "; // $position = 1; // // }else{ // $position++; // } // // } // $end = ""; // if($position != 1){ // for($z=(3-$position); $z>0 ; $z--) // { // //$end .= ""; // } // $end .= ""; // } // // echo $end."
$special
"; // echo "
"; echo "

"; $mobi1 = substr($mobile, 0, 3); $mobi2 = substr($mobile, 3, 3); $mobi3 = substr($mobile, 6, 4); $faxi1 = substr($fax, 0, 3); $faxi2 = substr($fax, 3, 3); $faxi3 = substr($fax, 6, 4); $itel = $tel1; $itel = substr($itel, 1); $imobi = $mobi1; $imobi = substr($imobi, 1); echo "

Contact Us

"; if ($telephone !== ''){echo "

Telephone:
Local: $tel1 $tel2 $tel3
International: +27 $itel $tel2 $tel3

";} if ($mobile !== ''){echo "Mobile:
Local: $mobi1 $mobi2 $mobi3
International: +27 $imobi $mobi2 $mobi3

";} if ($fax !== ''){echo "Fax:
$faxi1 $faxi2 $faxi3

";} //if ($listing_type == 'G'){echo "Email:
$email

";} if ($website !== ''){echo "Website:
$website

";} echo "Address:
$add1
"; if($add2){echo "$add2
";} if($add3){echo "$add3
$code

";} if($postal_1 !== ''){echo "Postal:
$postal_1
$postal_2
$postal_code

";} if($docex !== ''){echo "Docex:
$docex

";} echo " * Please mention AttorneysGuide.co.za when contacting $firmname


"; echo "

Map


"; $lawfirmid = $id; } //echo "
lawfirmid:$lawfirmid"; $listing = mysqli_query($dbh,"SELECT listing_type FROM lawfirm WHERE id = '$lawfirmid'"); while ($row1 = mysqli_fetch_array($listing)) { $listing_type = $row1["listing_type"]; } //echo "
lt:$listing_type"; if ($listing_type == 'G') { $news = mysqli_query($dbh,"SELECT * FROM news WHERE firmid = '$lawfirmid' ORDER BY id ASC"); $num_rows = mysqli_num_rows($news); if ($num_rows > 0) { echo "

Firm News


"; while ($row2 = mysqli_fetch_array($news)) { $id = $row2["id"]; $title = $row2["title"]; $content = $row2["content"]; $timestamp = $row2["timestamp"]; echo "
$title"; echo "
"; //echo "
"; echo "$content"; echo "
"; echo "
"; } } echo "
"; } if ($listing_type == 'G') { $jobs = mysqli_query($dbh,"SELECT * FROM jobs WHERE firmid = '$lawfirmid' AND archive = 'N' ORDER BY id ASC"); $num_rows = mysqli_num_rows($jobs); if ($num_rows > 0) { echo "

Firm Jobs


"; while ($row2 = mysqli_fetch_array($jobs)) { $id = $row2["id"]; $title = $row2["title"]; $renumeration = $row2["remuneration"]; $city = $row2["city"]; $job_type = $row2["job_type"]; $reference = $row2["reference"]; $job_description = $row2["job_description"]; $job_role = $row2["job_role"]; $qualification = $row2["qualification"]; $personal_attributes = $row2["personal_attributes"]; $contact_name = $row2["contact_name"]; $contact_telephone = $row2["contact_telephone"]; $contact_email = $row2["contact_email"]; echo "
$title
"; if ($job_description !== ""){echo "Job description:$job_description
";} if ($job_role!== ""){echo "Job role:$job_role
";} if ($qualification!== ""){echo "Qualification:$qualification
";} if ($personal_attributes!== ""){echo "Pesonal attributes:$personal_attributes
";} if ($city!== ""){echo "City:$city
";} if ($job_type!== ""){echo "Job type:$job_type
";} if ($renumeration!== ""){echo "Renumeration:$renumeration
";} if ($contact_name!== ""){echo "Contact person:$contact_name
";} if ($contact_telephone!== ""){echo "Telephone:$contact_telephone
";} if ($contact_email!== ""){echo "Email:$contact_email
";} if ($reference!== ""){echo "Reference:$reference
";} echo "
"; } } echo "
"; } if ($listing_type == 'G') { $firmid = mysqli_query($dbh,"SELECT userbid FROM attorney WHERE firmid = '$lawfirmid'"); $num_rows = mysqli_num_rows($firmid); if ($num_rows > 0) { echo "

Firm Attorneys


"; echo "
    "; while ($row2 = mysqli_fetch_array($firmid)) { $bid = $row2["userbid"]; } $attorneys = mysqli_query($dbh,"SELECT userbid, name, surname, imageid FROM attorney WHERE firmid = '$lawfirmid' ORDER BY name ASC"); $num_arows = mysqli_num_rows($attorneys); if ($num_arows > 0) { $find[] = 'ü'; $find[] = 'ä'; $find[] = 'ö'; $find[] = 'Ö'; $find[] = 'ß'; $find[] = '� '; $find[] = 'á'; $find[] = 'â'; $find[] = 'ã'; $find[] = 'ù'; $find[] = 'ú'; $find[] = 'û'; $find[] = 'Ù'; $find[] = 'Ú'; $find[] = 'Û'; $find[] = 'Ü'; $find[] = 'ò'; $find[] = 'ó'; $find[] = 'ô'; $find[] = 'è'; $find[] = 'é'; $find[] = 'ê'; $find[] = 'ë'; $find[] = 'À'; $find[] = 'Á'; $find[] = 'Â'; $find[] = 'Ã'; $find[] = 'Ä'; $find[] = 'Å'; $find[] = 'Ç'; $find[] = 'È'; $find[] = 'É'; $find[] = 'Ê'; $find[] = 'Ë'; $find[] = 'Ì'; $find[] = 'Í'; $find[] = 'Î'; $find[] = 'Ï'; $find[] = 'Ñ'; $find[] = 'Ò'; $find[] = 'Ó'; $find[] = 'Ô'; $find[] = 'Õ'; $find[] = 'Ø'; $find[] = 'å'; $find[] = 'æ'; $find[] = 'ç'; $find[] = 'ì'; $find[] = 'í'; $find[] = 'î'; $find[] = 'ï'; $find[] = 'ð'; $find[] = 'ñ'; $find[] = 'õ'; $find[] = 'ø'; $find[] = 'ý'; $find[] = 'ÿ'; //$find[] = '€'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; $replace[] = '�'; while ($row2 = mysqli_fetch_array($attorneys)) { $userbid = $row2["userbid"]; $name = $row2["name"]; $surname = $row2["surname"]; $imageaid = $row2["imageid"]; $cname = str_replace($find, $replace, $name); $csurname = str_replace($find, $replace, $surname); echo "
  •    $cname $csurname
    "; echo "
  • "; } } echo "
"; } } if ($listing_type == 'G') { $simage = mysqli_query($dbh,"SELECT id, firmid, imageid FROM social WHERE firmid = '$lawfirmid' ORDER BY id ASC"); $num_srows = mysqli_num_rows($simage); if ($num_srows > 0) { echo "

Social


"; echo "
"; } } echo "

« Back

"; ?>