Exemplo n.º 1
0
                $city_state_zip = explode(", ", $person["address"][1]);
                $vc->data['work_city'] = $city_state_zip[0];
                $vc->data['work_state'] = $city_state_zip[1];
                $vc->data['work_postal_code'] = $city_state_zip[2];
            }
            $vc->data['work_country'] = "United States of America";
        }
        # Contact's telephone numbers.
        if ($person["telephone"] != "000-000-0000") {
            $vc->data['office_tel'] = $person["telephone"][0];
        }
        $vc->data['home_tel'] = $person["homephone"][0];
        $vc->data['fax_tel'] = $person["fax"][0];
        #Contact's email addresses
        $vc->data['email1'] = $person["email"][0];
        $result = send_email($_REQUEST['email'], "vCard from " . $inst_name . " Directory", $vc->attach(), $contact_addy);
        $send = true;
    } else {
        $error = true;
        $message = "The username or email address you supplied was not in a valid format.";
    }
    require "templates/{$prefix}/vcard.html";
} else {
    if (isset($_REQUEST["username"])) {
        require "templates/{$prefix}/vcard.html";
    } else {
        $error = true;
        $message = "You need to supply a valid username to use the vCard feature.";
        require "templates/{$prefix}/vcard.html";
    }
}