⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lib.export.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
字号:
<?

/************************************************************************
UebiMiau is a GPL'ed software developed by 

 - Aldoir Ventura - aldoir@users.sourceforge.net
 - http://uebimiau.sourceforge.net

Fell free to contact, send donations or anything to me :-)
S鉶 Paulo - Brasil

Export to VCF:
Thanks to Vittore Zen <v.zen@tiscalinet.it>
*************************************************************************/



function convert2vcf($data) {
//
//mapping uebimiau key to vcf key
//

$ldap_key= array (
                "name" => "FN",
                "email" => "EMAIL;PREF;INTERNET",
                "street" => "ADR;WORK",
                "work" => "TITLE"
);

$ldapfile="BEGIN:VCARD\r\nVERSION:2.1\r\n";
     foreach ($data as $key => $value) {

if ((($key!="city") AND ($key!="state"))) {
     $testo=($key=="street") ? (";;".$data["street"].";".$data["city"].";;;".$data["state"]) : ($value);
     if (ereg("[@,\r,\(,\),;,:]",$value)) {
            $testo=urlencode($testo);
            $testo=ereg_replace("\+"," ",$testo);
            $testo=ereg_replace("%","=",$testo);
            $testo=chunk_split($testo,76,"=\r\n");
            $testo=substr($testo,0,strlen($testo)-3);
            $ldapfile.=$ldap_key[$key].";ENCODING=QUOTED-PRINTABLE:$testo\r\n";
            } else {
            $ldapfile.=$ldap_key[$key].":$testo\r\n";
            }                           }
     }

$ldapfile.="REV:".date("Ymd\This",time())."\r\n";

$ldapfile.="END:VCARD";
return $ldapfile;
}


function export2ou ($data) {
$file=convert2vcf($data);
$filename=(empty($data['name']))?"Address":$data['name'];
header ("Content-Type: application/outlook\r
Content-Disposition: attachment; filename=\"$filename.vcf\"\r
Content-Description: PHP Generated Data\r
");
print $file;
}







// Example of use

// A contact data
// $data=array(
//                "name" => "Mario Rossi",
//                 "email" => "my@email.com",
//                 "street" => "The address",
//                 "city" => "my city",
//                 "state" => "my state",
//                 "work" => "System Eng."
// );
//
//
//
// export2ou($data);
//
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -