<td><?php 
                    echo get_team($vo['blue_team'], 'name');
                    ?>
</td
			><?php 
                } else {
                    ?>
			<td>弃权</td><?php 
                }
                ?>

			<?php 
                if ($vo['red_team'] != '0') {
                    ?>
<td><?php 
                    echo get_team($vo['red_team'], 'name');
                    ?>
</td>
			<?php 
                } else {
                    ?>
			<td>弃权</td><?php 
                }
                ?>
			<td><?php 
                echo date('Y-m-d H:i:s', $vo['start_time']);
                ?>
</td>
			<td><?php 
                echo $vo["round"];
                ?>
    /**
     * Displays the widget settings controls on the widget panel.
     * Make use of the get_field_id() and get_field_name() function
     * when creating your form elements. This handles the confusing stuff.
     */
    function form($instance)
    {
        /* Set up some default widget settings. */
        $defaults = array('title' => 'Featured Team Member', 'display-options' => 'random-member', 'member-select' => '');
        $instance = wp_parse_args((array) $instance, $defaults);
        ?>

    <p>
      <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:', 'team-member-widget');
        ?>
</label>
      <input id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        echo $instance['title'];
        ?>
" class="widefat" />
    </p>

    <p>
      <label for="<?php 
        echo $this->get_field_id('display-option');
        ?>
">
        <?php 
        _e('Display Option:', 'team-member-widget');
        ?>
      </label>
      <select
        id="<?php 
        echo $this->get_field_id('display-option');
        ?>
"
        name="<?php 
        echo $this->get_field_name('display-option');
        ?>
"
        class="widefat" style="width: 100%;">

        <option value="all-members" <?php 
        if ('all-members' == $instance['display-option']) {
            echo 'selected="selected"';
        }
        ?>
>Show All Team Members</option>
        <option value="random-member" <?php 
        if ('random-member' == $instance['display-option']) {
            echo 'selected="selected"';
        }
        ?>
>Show Random Team Member</option>
        <option value="single-member" <?php 
        if ('single-member' == $instance['display-option']) {
            echo 'selected="selected"';
        }
        ?>
>Show One Team Member</option>
      </select>
    </p>


    <?php 
        if ($instance['display-option'] == 'single-member') {
            ?>

      <?php 
            $team = get_team();
            ?>
      <?php 
            if ($team) {
                ?>
 

    <p>
      <label for="<?php 
                echo $this->get_field_id('member-select');
                ?>
">
        <?php 
                _e('Member Select:', 'team-member-widget');
                ?>
      </label>

      <select
        id="<?php 
                echo $this->get_field_id('member-select');
                ?>
"
        name="<?php 
                echo $this->get_field_name('member-select');
                ?>
"
        class="widefat" style="width: 100%;">

        <?php 
                foreach ($team as $member_id => $member_name) {
                    ?>
        <option value="<?php 
                    echo $member_id;
                    ?>
" <?php 
                    if ($member_id == $instance['member-select']) {
                        echo 'selected="selected"';
                    }
                    ?>
><?php 
                    echo $member_name;
                    ?>
</option>
        <?php 
                }
                ?>
        
      </select>
    </p>

      <?php 
            } else {
                ?>
          <p>You must first add team members.</p>
      <?php 
            }
            ?>


    <?php 
        }
        ?>


  <?php 
    }
示例#3
0
$data['siteurl'] = $INI['system']['wwwprefix'];
$data['items'] = array();
//团购信息
$teams = DB::LimitQuery('team', array('condition' => array('`begin_time` < ' . time(), '`end_time` > ' . time()), 'order' => 'ORDER BY id DESC'));
$data['items'] = $teams;
//城市信息
$citys = option_category('city', true);
//商家信息
$allPartners = DB::LimitQuery('partner', array('condition' => array('id>0')));
$partners = array();
foreach ($allPartners as $v) {
    $partners[$v['id']]['title'] = $v['title'];
    $partners[$v['id']]['phone'] = $v['phone'];
    $partners[$v['id']]['address'] = $v['address'];
}
$output = get_team($data);
echo $output;
unset($output);
//$team 包含公共信息和每个团购的数据
function get_team($team)
{
    if (!$team) {
        return '';
    }
    $xmlitems = '';
    $id = 1;
    foreach ($team['items'] as $k => $v) {
        /*处理城市*/
        $city = Table::Fetch('category', $team['items'][$k]['city_id']);
        $city_name = $city['name'];
        if ($city['name'] == "") {
示例#4
0
}
$error = "";
if (empty($_GET['step'])) {
    $step = 1;
} else {
    $step = $_GET['step'];
}
if ($step == 1) {
    include_once 'view/auth/register-user.php';
} else {
    if ($step == 2) {
        if (!empty($_POST['team_name']) && !empty($_POST['team_password'])) {
            $form = $_POST;
            $form['team_password'] = md5($form['team_password']);
            require_once 'model/auth/get-team.php';
            $team = get_team($form);
            if ($team) {
                include_once 'view/auth/register-user-2.php';
            } else {
                include_once 'view/auth/register-user.php';
            }
        } else {
            include_once 'view/auth/register-user.php';
        }
    } else {
        if ($step = 3) {
            if (!empty($_POST['user_login']) && !empty($_POST['user_password']) && !empty($_POST['team_name'])) {
                if ($_POST['user_password'] != $_POST['user_password2']) {
                    $error = "Mot de passe non identiques";
                    $team['name'] = $_POST['team_name'];
                    include_once 'view/auth/register-user-2.php';
示例#5
0
			echo "<li>" . team_link_from_id($team) . "</li>";
		}
		?>
	</ul>
<? endif; ?>
<h4>Description</h4>
<p><?php 
echo $description;
?>
</p>
<? if(check_captain($player_id) and !check_participation(get_team($player_id),$sports_id)): ?>
	<a href="<?php 
echo URL::base();
?>
sport/join/<?php 
echo $sports_id;
?>
">Add your team to this sport</a> 
<? elseif(check_captain($player_id)): ?>
	<a href="<?php 
echo URL::base();
?>
sport/results/<?php 
echo $sports_id;
?>
/<?php 
echo get_team($player_id);
?>
">Report results from game</a>
<? endif; ?>
示例#6
0
文件: model.php 项目: echo0101/eScan
function handle_team_registration($bid, $pin, $extra_args = array())
{
    $team_registration = sanitized_team_registration();
    $user = get_user($bid);
    $tid = $user["tid"];
    $team = get_team($tid);
    $team_members = get_team_members($tid);
    // Choose appropriate action to perform.
    if (strcmp($team_registration["teamRegistrationAction"], "remove") == 0) {
        $userToRemove = get_user($team_registration["teamRegistrationBid"]);
        if ($userToRemove != null && $userToRemove["tid"] == $tid) {
            assign_user_to_team($userToRemove["bid"], PASSPORT_NO_TEAM_TID);
            log_entry(LOG_MODE_USER, LOG_USER_ACTION_REMOVE_TEAM_MEMBER, array("actorUid" => $user["uid"], "actorBid" => $user["bid"], "targetUid" => $user_to_add["uid"], "targetBid" => $user_to_add["bid"], "targetTid" => PASSPORT_NO_TEAM_TID, comment => addslashes(serialize($team_registration))));
            $team = get_team($tid);
            $team_members = get_team_members($tid);
            return array("view" => "team_registration_add", "args" => array("bid" => $bid, "pin" => $pin, "teamMemberJustRemoved" => $user_to_remove, "teamMembers" => $team_members, "team" => $team) + $extra_args);
        }
    } else {
        if (strcmp($team_registration["teamRegistrationAction"], "create") == 0) {
            if (valid_team_name($team_registration["teamName"])) {
                $tid = register_team($team_registration["teamName"], $user["uid"]);
                log_entry(LOG_MODE_USER, LOG_USER_ACTION_CREATE_TEAM, array("actorUid" => $user["uid"], "actorBid" => $user["bid"], "targetTid" => $tid, comment => addslashes(serialize($team_registration))));
                if ($tid == PASSPORT_NO_TEAM_TID) {
                    return array("view" => "team_registration_create", "args" => array("bid" => $bid, "pin" => $pin) + $extra_args);
                }
                assign_user_to_team($bid, $tid);
                log_entry(LOG_MODE_USER, LOG_USER_ACTION_ADD_TEAM_MEMBER, array("actorUid" => $user["uid"], "actorBid" => $user["bid"], "targetUid" => $user["uid"], "targetBid" => $user["bid"], "targetTid" => $tid, comment => addslashes(serialize($team_registration))));
                $team_members = get_team_members($tid);
                $team = get_team($tid);
                return array("view" => "team_registration_add", "args" => array("bid" => $bid, "pin" => $pin, "teamJustCreated" => true, "teamMembers" => $team_members, "team" => $team) + $extra_args);
            } else {
                return array("view" => "team_registration_create", "args" => array("bid" => $bid, "pin" => $pin, "teamNameInvalid" => true) + $extra_args);
            }
        } else {
            if (strcmp($team_registration["teamRegistrationAction"], "add") == 0) {
                $user = get_user($bid);
                $team = get_team($user["tid"]);
                $team_members = get_team_members($user["tid"]);
                if (count($team_members) < MAX_TEAM_MEMBERS) {
                    if (validate_login($team_registration["teamRegistrationBid"], $team_registration["teamRegistrationPin"])) {
                        $user_to_add = get_user($team_registration["teamRegistrationBid"]);
                        if ($user_to_add["tid"] == PASSPORT_NO_TEAM_TID) {
                            assign_user_to_team($user_to_add["bid"], $tid);
                            log_entry(LOG_MODE_USER, LOG_USER_ACTION_ADD_TEAM_MEMBER, array("actorUid" => $user["uid"], "actorBid" => $user["bid"], "targetUid" => $user_to_add["uid"], "targetBid" => $user_to_add["bid"], "targetTid" => $tid, comment => addslashes(serialize($team_registration))));
                            $team_members = get_team_members($user["tid"]);
                            return array("view" => "team_registration_add", "args" => array("bid" => $bid, "pin" => $pin, "teamMemberJustAdded" => $user_to_add, "teamMembers" => $team_members, "team" => $team) + $extra_args);
                        } else {
                            return array("view" => "team_registration_add", "args" => array("bid" => $bid, "pin" => $pin, "alreadyOnTeam" => true, "teamMembers" => $team_members, "team" => $team) + $extra_args);
                        }
                    } else {
                        return array("view" => "team_registration_add", "args" => array("bid" => $bid, "pin" => $pin, "teamMemberBad" => true, "teamMembers" => $team_members, "team" => $team) + $extra_args);
                    }
                } else {
                    return array("view" => "team_registration_add", "args" => array("bid" => $bid, "pin" => $pin, "teamFull" => true, "teamMembers" => $team_members, "team" => $team) + $extra_args);
                }
            }
        }
    }
    // No action specified, just need to show the user the current members.
    return array("view" => "team_registration_add", "args" => array("bid" => $bid, "pin" => $pin, "teamMembers" => $team_members, "team" => $team) + $extra_args);
}