2010-07-01 19:48:07 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
2010-07-06 08:07:28 -04:00
|
|
|
function contact_profile_assign($current) {
|
2010-07-01 19:48:07 -04:00
|
|
|
|
|
|
|
$o = '';
|
2010-07-06 08:07:28 -04:00
|
|
|
$o .= "<select id=\"contact_profile_selector\" name=\"profile_assign\" />";
|
2010-07-01 19:48:07 -04:00
|
|
|
|
2010-07-06 08:07:28 -04:00
|
|
|
$r = q("SELECT `profile-name` FROM `profile` WHERE `uid` = %d",
|
2010-07-01 19:48:07 -04:00
|
|
|
intval($_SESSION['uid']));
|
|
|
|
|
|
|
|
if(count($r)) {
|
|
|
|
foreach($r as $rr) {
|
|
|
|
$selected = (($rr['profile-name'] == $current) ? " selected=\"selected\" " : "");
|
|
|
|
$o .= "<option value=\"{$rr['profile-name']}\" $selected >{$rr['profile-name']}</option>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$o .= "</select>";
|
|
|
|
return $o;
|
|
|
|
}
|
|
|
|
|