diff options
Diffstat (limited to 'view/contact_selectors.php')
-rw-r--r-- | view/contact_selectors.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/view/contact_selectors.php b/view/contact_selectors.php new file mode 100644 index 000000000..186a50e7a --- /dev/null +++ b/view/contact_selectors.php @@ -0,0 +1,21 @@ +<?php + + +function select_contact_profile($current) { + + $o = ''; + $o .= "<select id=\"contact_profile_selector\" name=\"profile_id\" />"; + + $r = q("SELECT `id` FROM `profile` WHERE `uid` = %d", + 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; +} + |