コード例 #1
0
ファイル: activity_data.php プロジェクト: MelonGO/KMoving
function get_activity_data($num)
{
    $db = new MyDB();
    if (!$db) {
        echo $db->lastErrorMsg();
    } else {
    }
    $sql = <<<EOF
    SELECT * FROM Activity ORDER BY id LIMIT {$num},3;
EOF;
    $arrayList[] = array();
    $ret = $db->query($sql);
    $index = 0;
    while ($row = $ret->fetchArray(SQLITE3_ASSOC)) {
        $authorId = $row['authorId'];
        $authorName = get_authorName($db, $authorId);
        $title = $row['title'];
        $target = $row['target'];
        $content = $row['content'];
        $id = $row['id'];
        $menbers = get_members($db, $id);
        $arrayList[$index] = [$title, $target, $content, $authorName, $id, $menbers];
        $index++;
    }
    $db->close();
    return $arrayList;
}
コード例 #2
0
function add_member($new_member)
{
    $current_members = get_members();
    if (is_member_in_list($current_members, $new_member)) {
        return false;
    }
    add_member_to_file($new_member);
    return true;
}
コード例 #3
0
ファイル: index.php プロジェクト: jrichelsen/SeeTime
 global $check_token_exists;
 global $decode_body;
 $app->get('', $check_token_exists, function ($calendar_id) {
     get_calendar($calendar_id);
 });
 $app->put('', $check_token_exists, $decode_body, function ($calendar_id) {
     edit_calendar($calendar_id);
 });
 $app->delete('', $check_token_exists, function ($calendar_id) {
     delete_calendar($calendar_id);
 });
 $app->group('/members', function () use($app) {
     global $check_token_exists;
     global $decode_body;
     $app->get('', $check_token_exists, function ($calendar_id) {
         get_members($calendar_id);
     });
     $app->post('', $check_token_exists, $decode_body, function ($calendar_id) {
         add_member($calendar_id);
     });
     $app->group('/:username', function () use($app) {
         global $check_token_exists;
         global $decode_body;
         $app->get('', $check_token_exists, function ($calendar_id, $username) {
             get_member($username, $calendar_id);
         });
         $app->put('', $check_token_exists, $decode_body, function ($calendar_id, $username) {
             edit_member($username, $calendar_id);
         });
         $app->delete('', $check_token_exists, function ($calendar_id, $username) {
             delete_member($username, $calendar_id);
コード例 #4
0
ファイル: 3_10challenge.php プロジェクト: Taka-Haru/Challenge
<head>
<meta charset="UTF-8">
      <title>3_10challenge</title>
</head>
  <body>
    <!--課題10:先に$limit=2を定義しておき、
          課題9の処理のうち2人目($limitで定義した値の人数)までで
          foreachのループを抜けるようにする -->
    <?php 
function get_members()
{
    $busho = array("A" => array("1<br>", "織田信長<br>", "6月23日<br>", null), "B" => array("2<br>", "豊臣秀吉<br>", "2月6日<br>", "尾張国<br>"), "C" => array("3<br>", "徳川家康<br>", "1月31日<br>", "三河国<br>"));
    return $busho;
}
$profile = get_members();
$limit = 2;
foreach ($profile as $value) {
    foreach ($value as $key => $kwsk) {
        if ($key == 0 || $kwsk == null) {
            continue;
        }
        echo $kwsk;
    }
    if ($limit == $value[0]) {
        break;
    }
}
?>
  </body>
</html>
コード例 #5
0
          <h2 class="ui left aligned header">
            <i class="users icon"></i>
              <div class="content">
              Members 
               <div class="sub header member-total-<?php 
echo $post->ID;
?>
"><?php 
echo get_post_meta($post->ID, '_group_total', true);
?>
 runners</div>
            </div>
          </h2>
      
          <?php 
$members = get_members($post->ID);
foreach ($members as $member) {
    $thumb_file = get_user_meta($member->ID, 'pr_member_thumbnail_image', true);
    if (empty($thumb_file)) {
        $thumbnail = 'http://placehold.it/800x800';
    } else {
        $thumbnail = THUMB_DIR . '/' . $thumb_file;
    }
    ?>
          <div class="item">
            <a class="ui small image" href="<?php 
    echo home_url('member/' . $member->user_login);
    ?>
">
              <img src="<?php 
    echo $thumbnail;
コード例 #6
0
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<?php 
function get_members()
{
    return ["soonil", "hj", "somyung", "soyu"];
}
$temp = get_members();
for ($i = 0; $i < count($temp); $i++) {
    echo ucfirst($temp[$i]) . "<br>";
}
?>

	</body>
</html>
コード例 #7
0
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<?php 
function get_members()
{
    return ["soonil", "hj", "somyung", "soyu"];
}
var_dump(get_members());
?>

	</body>
</html>
コード例 #8
0
ファイル: 3_6challenge.php プロジェクト: Taka-Haru/Challenge
<!-- 課題6:引き数に1つのid(数値)をとり、
3人分のプロフィール(項目は課題5参照)をあらかじめ関数内で定義しておく。
引き数のid値により戻り値として返却するプロフィールを誰のものにするか選択する。
それ以降などは課題5と同じ扱いに -->


<?php 
function get_members($id)
{
    $a = array("1<br>", "織田信長<br>", "6月23日<br>", "姫路<br>");
    $b = array("2<br>", "豊臣秀吉<br>", "2月6日<br>", "大阪<br>");
    $c = array("3<br>", "徳川家康<br>", "1月31日<br>", "東京<br>");
    $profile = array($a, $b, $c);
    return $profile[$id - 1];
}
$yobidashi = get_members(1);
foreach ($yobidashi as $key => $value) {
    if ($key == 0) {
        continue;
    }
    echo $value;
}
?>
<!-- ※foreach文の所はfor文でも同じ処理は可能
      for($i=0;$i<3;$i++){
      $A = $yobidashi[$i];
      echo $A; -->
</body>

</html>
コード例 #9
0
 * twitter.com/robtranquillo
 * github.com/robtranquillo
 *
 * Version 1.0 / 03.09.2015
 *
 * Licence: public domain with BY (Attribution)
 */
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: text/plain');
# error_reporting(-1);
# ini_set('display_errors', 1);
# ini_set('display_startup_errors', 1);
$members_url = "http://ratsinfo.dresden.de/kp0041.php";
$parteinameFilter = array('(', ')', '.');
//Zeichen die aus Parteinamen gefiltert werden
$members = get_members($members_url);
if ($members === false) {
    echo 'Fehler beim Mitglieder holen';
} else {
    echo "\n Mandatsträger: " . count($members);
    print_r($members);
}
/*
 * Functionen um die Mitglieder des Stadtrats zu ermitteln
 */
function get_members($url)
{
    $html = get_html($url);
    if ($html === false) {
        echo 'connection error';
    } else {
コード例 #10
0
 public function addVideo($id = null)
 {
     if (IS_POST) {
         $data['video_title'] = I('video_title');
         $data['video_url'] = I('video_url');
         $data['flash_url'] = I('flash_url');
         $data['iframe_url'] = I('iframe_url');
         $data['video_tags'] = I('video_tags');
         $data['video_intro'] = I('video_intro');
         $data['picture_id'] = I('picture_id');
         $data['category_id'] = I('category_id');
         $users = I('video_users');
         if (!empty($users)) {
             $users = explode(',', $users);
             foreach ($users as $user) {
                 $group_id = get_usergroup($user);
                 if ($group_id == 6) {
                     $members = get_members($user);
                     $users = array_merge($users, $members);
                 }
             }
             foreach ($users as $user) {
                 $usernames = $usernames . get_nickname($user) . ',';
             }
         }
         $data['video_users'] = $usernames;
         $data['video_userids'] = implode(',', $users);
         $data['uid'] = $users[0];
         $Video = D('VideoVideo');
         $vmid = $Video->addVideo($data);
         $album['album_id'] = I('album_id');
         $album['video_id'] = $vmid;
         $VideoAlbumVideo = D('VideoAlbumVideo');
         $vavid = $VideoAlbumVideo->addVideo($album);
         if (false !== $vmid) {
             D('VideoUser')->addVideos($vmid, $users);
         }
         if (false !== $vmid) {
             $this->success('新增成功!', U('Video/VideoAlbum/videos/id/' . I('album_id')));
         } else {
             $error = $VideoAlbumVideo->getError();
             $this->error(empty($error) ? '未知错误!' : $error);
         }
     } else {
         $games = $this->getGames();
         $this->assign('games', $games);
         $categories = $this->getCategories();
         $this->assign('categories', $categories);
         $this->assign('album_id', $id);
         $countries = $this->getcountries();
         $this->assign('countries', $countries);
         $this->display();
     }
 }
コード例 #11
0
ファイル: index.php プロジェクト: 4x4falcon/browse
    echo '
   <tr valign="top">
   <td id="left">
   Nodes:
   </td>
   <td id="right">';
    echo get_nodes($object->{$object_type});
    echo '
   </td>
   </tr>';
}
?>

<?php 
if ($object_type == 'relation') {
    $tmp = get_members($object->{$object_type});
    if ($tmp != '') {
        echo '
   <tr valign="top">
   <td id="left">
   Ways:
   </td>
   <td id="right">';
        echo $tmp;
        echo '
   </td>
   </tr>';
    }
}
?>
コード例 #12
0
 public function edit($id = null)
 {
     if (IS_POST) {
         $data['id'] = I('id');
         $data['video_title'] = I('video_title');
         $data['video_url'] = I('video_url');
         $data['flash_url'] = I('flash_url');
         $data['iframe_url'] = I('iframe_url');
         $data['video_tags'] = I('video_tags');
         $data['video_intro'] = I('video_intro');
         $data['picture_id'] = I('picture_id');
         $data['category_id'] = I('category_id');
         $users = I('video_users');
         if (!empty($users)) {
             $users = explode(',', $users);
             foreach ($users as $user) {
                 $group_id = get_usergroup($user);
                 if ($group_id == 6) {
                     $members = get_members($user);
                     $users = array_merge($users, $members);
                 }
             }
             $users = array_unique($users);
             foreach ($users as $user) {
                 $usernames = $usernames . get_nickname($user) . ',';
             }
         }
         $data['video_users'] = $usernames;
         $data['uid'] = $users[0];
         $data['video_userids'] = implode(',', $users);
         $Video = D('VideoVideo');
         $id = $Video->updateVideo($data);
         if (!empty($users) && !empty($data['id'])) {
             D('VideoUser')->updateVideos($data['id'], $users);
         }
         if (false !== $id) {
             $this->success('新增成功!', U('index'));
         } else {
             $error = $Video->getError();
             $this->error(empty($error) ? '未知错误!' : $error);
         }
     } else {
         if (!$id) {
             $this->error('参数错误');
         }
         $video = D('VideoVideo')->find($id);
         $this->assign('video', $video);
         $games = $this->getGames();
         $this->assign('games', $games);
         $countries = $this->getcountries();
         $this->assign('countries', $countries);
         $categories = $this->getCategories();
         $this->assign('categories', $categories);
         $userids = explode(',', $video['video_userids']);
         foreach ($userids as $key => $uid) {
             $users[] = get_user($uid);
         }
         $this->assign('users', json_encode($users));
         $this->display();
     }
 }
コード例 #13
0
ファイル: emails.php プロジェクト: adriculous/enthusiast
      </table></form>
<?php 
    }
}
/*___________________________________________________________________MEMBERS_*/
if ($action == 'members') {
    $show_default = false;
    $show_form = true;
    $info = get_listing_info($_REQUEST['id']);
    $from = '"' . html_entity_decode($info['title'], ENT_QUOTES) . '" <' . $info['email'] . '>';
    if (isset($_POST['send']) && $_POST['send'] == 'yes') {
        $subject = '';
        $body = '';
        // get all members
        $members = get_members($_POST['id'], 'approved');
        foreach ($members as $mem) {
            if ($_POST['emailtemplate'] == 'no') {
                $sendthis = parse_email_text($_POST['emailsubject'], $_POST['emailbody'], $mem['email'], $_POST['id']);
                $subject = $sendthis['subject'];
                $body = $sendthis['body'];
            } else {
                $sendthis = parse_template($_POST['emailtemplate'], $mem['email'], $_POST['id']);
                $subject = $sendthis['subject'];
                $body = $sendthis['body'];
            }
            // use send_email function
            $success = send_email($mem['email'], $from, stripslashes($subject), stripslashes($body));
            if ($success !== true) {
                echo '<p class="error">Email sending to <i>' . $mem['email'] . '</i> failed. Please try sending to that address again.</p>';
            }
コード例 #14
0
        if (isset($_GET[$s])) {
            // if the field is set
            if ($_GET[$s] == 'all') {
                // if "all", use wildcard
                $sortarray[$s] = '%';
            } else {
                $sortarray[$s] = clean($_GET[$s]);
            }
            $sortselectednum++;
        } else {
            // use wildcard
            $sortarray[$s] = '%';
        }
    }
    $members = get_members($listing, 'approved', $sortarray, $start);
    $total = count(get_members($listing, 'approved', $sortarray));
}
// we need to show the showing dropdown/list selection if there are more fields
// to sort than is already selected
if (count($sortarray) > $sortselectednum) {
    $oldsort = $sort;
    // meh, variable overwriting
    require_once 'show_sort.php';
    $sort = $oldsort;
    // meh, variable overwriting
}
// are we hiding the members until every sorting field has been selected?
// if yes, exit the script now, we don't need to continue
if (isset($hide_members_until_final) && $hide_members_until_final) {
    if (count($sortarray) > $sortselectednum) {
        return;
コード例 #15
0
ファイル: send-reminders.php プロジェクト: elecnix/famesy
#
# Famesy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Famesy; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
setlocale(LC_ALL, 'fr_CA');
include '../config.php';
include '../functions.php';
header('Content-Type: text/plain');
$now = time();
$one_month = 30 * 24 * 60 * 60;
$members = get_members(false, null, 'nom');
$member = mysql_fetch_assoc($members);
$report = array();
$no_act = false;
$deactivate = true;
function get_unpaid_or_create_invoice($member)
{
    $invoices = get_unpaid_invoices($member['id']);
    if (sizeof($invoices) == 0) {
        if (!$no_act) {
            $invoice = create_invoice($member);
        }
    } else {
        $invoice = $invoices[0];
    }
    return $invoice;
コード例 #16
0
ファイル: artists.php プロジェクト: ekevans8/DB_Project
<?php 
                    } else {
                        ?>
<a class="btn btn-success btn-block" href="artists.php?action=addfavorite&id=<?php 
                        echo $details['artistId'];
                        ?>
">Add to favorites</a><br>
<?php 
                    }
                    ?>
<div class="panel panel-default">
  <div class="panel-heading"><h4>Members</h4></div>
  <div class="panel-body">
	<ul class="list-group">
<?php 
                    foreach (get_members($details['artistId']) as $member) {
                        echo '<li class="list-group-item"> Name: ' . $member['name'] . '<br>';
                        echo 'Join Date: ' . $member['joinDate'] . '<br>';
                        if (!empty($member['leaveDate'])) {
                            echo 'Leave Date: ' . $member['leaveDate'] . '<br>';
                        }
                        if (is_moderator($_SESSION['username'])) {
                            echo '<a href="artists.php?action=editmember&id=' . $details['artistId'] . '&memberId=' . $member['memberId'] . '">Edit Member</a><br>';
                            echo '<a href="artists.php?action=deletemember&id=' . $member['memberId'] . '">Remove Member</a>';
                        }
                        echo '</li>';
                    }
                    ?>
	</ul>
  </div>
</div>
コード例 #17
0
ファイル: index.php プロジェクト: elecnix/famesy
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Famesy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Famesy; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
require_once "../../functions.php";
include_once "../../header.php";
$show_disabled = $_REQUEST['disabled'] == 'on';
$show_mtype = $_REQUEST['type'];
$members = get_members($show_disabled, $show_mtype, $_REQUEST['sort']);
$row = mysql_fetch_assoc($members);
$title = "Membres de " . htmlspecialchars(config('name'));
?>

<style type="text/css">
a:link {color:black;}
.phone { 
	white-space: nowrap; 
}
.email { font-size: .7em; }
tr.disabled td, p.disabled { background: #ddd; }
tr.expired td,  p.expired  { background: #aaf; }
tr.neverpaid td, p.neverpaid { background: #d00; }
#legende, #navigation { margin:0; width:10em; float:right; clear:both; } 
#legende p { margin:0; padding:0 2px; }
コード例 #18
0
ファイル: members.php プロジェクト: adriculous/enthusiast
    } else {
        /////////////////////////////////////////////////////// PENDING
        $finalcount = 0;
        foreach ($owned as $id) {
            $info = get_listing_info($id);
            $qtycol = 6;
            if ($info['country'] == 0) {
                $qtycol--;
            }
            if ($info['additional'] != '') {
                $qtycol++;
            }
            $pending = get_members($id, 'pending');
            if (count($pending) > 0) {
                $finalcount += count($pending);
                $approved = count(get_members($id, 'approved'));
                ?>
            <form action="members.php" method="post" name="listing<?php 
                echo $id;
                ?>
">
            <input type="hidden" name="id" value="<?php 
                echo $id;
                ?>
" />
            <input type="hidden" name="action" value="multiple" />

            <table style="width: 100%;">

            <tr><th colspan="<?php 
                echo $qtycol;
コード例 #19
0
ファイル: array2.php プロジェクト: ssongtree/htdocs
              return ["유비", "관우", "장비"]; <br>
            } <br> <br>

            $members = get_members(); <br><br>

            for($i=0 ; $i<count($members); $i++){ <br>
              echo $members[$i]; <br>
            } <br>
          </td>
          <td>
            <?php 
function get_members()
{
    return ["유비", "관우", "장비"];
}
$members = get_members();
for ($i = 0; $i < count($members); $i++) {
    echo $members[$i] . '<br>';
}
?>
          </td>
        </tr>
      </table>

    </article>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <script src="/bootstrap/js/bootstrap.min.js"></script>
  </body>
コード例 #20
0
ファイル: members.php プロジェクト: neoclust/mmc
            $newmem = array_diff($members, $curmem);
            $delmem = array_diff($curmem, $members);
            foreach ($newmem as $new) {
                add_member($group, $new);
                callPluginFunction("addUserToGroup", array($new, $group));
            }
            foreach ($delmem as $del) {
                del_member($group, $del);
                callPluginFunction("delUserFromGroup", array($del, $group));
            }
            if (!isXMLRPCError()) {
                new NotifyWidgetSuccess(_("Group successfully modified"));
            }
            $members = get_members($group);
        } else {
            $members = get_members($group);
            # get an array with all user's attributes
            $users = get_users(true);
        }
    }
}
$diff = array();
foreach ($users as $user) {
    if (!in_array($user['uid'], $members)) {
        $diff[] = $user;
    }
}
if (count($forbidden)) {
    new NotifyWidgetWarning(_("Some users can't be removed from this group because this group is their primary group."));
}
$p = new PageGenerator(sprintf(_("Group members %s"), $group));