+function tpl_qrcode($in){
+ $data = "BEGIN:VCARD\n";
+ $data .= "N:{$in['name']};{$in['givenname']}\n";
+ if($in['mobile']) $data .= "TEL;CELL:{$in['mobile']}\n";
+ if($in['phone']) $data .= "TEL;WORK:{$in['phone']}\n";
+ if($in['homephone']) $data .= "TEL;HOME:{$in['homephone']}\n";
+ if($in['mail'][0]) $data .= "EMAIL:{$in['mail'][0]}\n";
+ $data .= "END:VCARD";
+ $data = rawurlencode($data);
+
+ return 'http://chart.apis.google.com/chart?cht=qr&chld=L|5&chs=500x500&chl='.$data.'&.png';
+}
+
+