当前位置: 首页>>代码示例>>PHP>>正文


PHP Utility::OptionArray方法代码示例

本文整理汇总了PHP中Utility::OptionArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::OptionArray方法的具体用法?PHP Utility::OptionArray怎么用?PHP Utility::OptionArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utility的用法示例。


在下文中一共展示了Utility::OptionArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: current_teamcategory

function current_teamcategory($gid = '0')
{
    global $city;
    $a = array('/team/seconds.php' => '所有');
    $categorys = DB::LimitQuery('category', array('condition' => array('zone' => 'group', 'fid' => '0', 'display' => 'Y'), 'order' => 'ORDER BY sort_order DESC, id DESC'));
    $categorys = Utility::OptionArray($categorys, 'id', 'name');
    foreach ($categorys as $id => $name) {
        $a["/team/seconds.php?gid={$id}"] = $name;
    }
    $l = "/team/seconds.php?gid={$gid}";
    if (!$gid) {
        $l = "/team/seconds.php";
    }
    return current_link($l, $a, true);
}
开发者ID:norain2050,项目名称:zuituware,代码行数:15,代码来源:seconds.php

示例2: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();


$cid = $_GET["cateid"];

$condition = array(
	'zone' => 'group',
	'display' => 'Y',
);
if ($cid) { 
	$condition[] = " fid = ".$cid ;
}
$cate = DB::LimitQuery('category', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC',
));
if(!$cate) die('<option value="0">暂无细分类</option>');
$cates = Utility::OptionArray($cate, 'id', 'name');
die (Utility::Option($cates));


开发者ID:noikiy,项目名称:mdwp,代码行数:22,代码来源:category.php

示例3: array

        }
        Utility::Redirect(WEB_ROOT . "/manage/team/index.php");
    }
} else {
    $profile = Table::Fetch('leader', $login_user_id, 'user_id');
    //1
    $team = array();
    $team['user_id'] = $login_user_id;
    $team['begin_time'] = strtotime('+1 days');
    $team['end_time'] = strtotime('+2 days');
    $team['expire_time'] = strtotime('+3 months +1 days');
    $team['min_number'] = 10;
    $team['per_number'] = 1;
    $team['market_price'] = 1;
    $team['team_price'] = 1;
    //3
    $team['delivery'] = 'coupon';
    $team['address'] = $profile['address'];
    $team['mobile'] = $profile['mobile'];
    $team['fare'] = 5;
}
$groups = DB::LimitQuery('category', array('condition' => array('zone' => 'group')));
$groups = Utility::OptionArray($groups, 'id', 'name');
$cities = DB::LimitQuery('category', array('condition' => array('zone' => 'city')));
$cities = Utility::OptionArray($cities, 'id', 'name');
$partners = DB::LimitQuery('partner', array('order' => 'ORDER BY id DESC'));
$partners = Utility::OptionArray($partners, 'id', 'title');
$charities = DB::LimitQuery('charity', array('order' => 'ORDER BY id DESC'));
$charities = Utility::OptionArray($charities, 'id', 'name');
array_unshift($charities, "--Select--");
include template('manage_team_create');
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:create.php

示例4: current_team_category_child

function current_team_category_child($gid,$sid) {
	$categorys = DB::LimitQuery('category', array(
		'condition' => array( 'zone' => 'group','fid' => $gid,'display' => 'Y' ),
		'order' => 'ORDER BY sort_order DESC, id ASC',
	));
	$categorys = Utility::OptionArray($categorys, 'id', 'name');
	if($gid!=0){
		$a = array();
		foreach($categorys AS $id=>$name) {
			$num= Table::Count('team',array("sub_id"=>$id));
			if(option_yes('rewritecity')){
				$a["/{$city['ename']}?gid=$gid&sid=$id"] = $name.'('.$num.')';
			}else{
				$a["/index.php?gid=$gid&sid=$id"] = $name.'('.$num.')';
			}
		}
		if(option_yes('rewritecity')){
			$l = "/{$city['ename']}?gid=$gid&sid=$sid";
		}else{
			$l = "/index.php?gid=$gid&sid=$sid";
		}	
		return current_link($l, $a, true);
	}
}
开发者ID:noikiy,项目名称:mdwp,代码行数:24,代码来源:common.php

示例5: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
import('backup');
need_manager(true);
function _go_reload()
{
    redirect(WEB_ROOT . '/manage/misc/backup.php');
}
/* get tables */
$db_name = $INI['db']['name'];
$tables = DB::GetQueryResult("SHOW TABLE STATUS FROM `{$db_name}`", false);
/* end */
if (is_get()) {
    $results = DB::GetQueryResult("SHOW TABLE STATUS FROM `{$db_name}`", false);
    $option_table = Utility::OptionArray($results, 'name', 'name');
    die(include template('manage_misc_backup'));
}
$bftype = $_POST['bfzl'];
if ($bftype == "quanbubiao") {
    if (!$_POST['fenjuan']) {
        //不是分卷
        $sql = null;
        foreach ($tables as $one) {
            $table = $one['name'];
            $sql .= backup_make_header($table);
            $query = DB::Query("SELECT * FROM `{$table}`");
            while ($r = DB::NextRecord($query)) {
                $sql .= backup_make_record($table, $r);
            }
        }
开发者ID:norain2050,项目名称:zuituware,代码行数:31,代码来源:backup.php

示例6: need_login

need_login();
$order_id = $id = strval(intval($_GET['id']));
if(!$order_id || !($order = Table::Fetch('order', $order_id))) {
	die('404 Not Found');
}
if ( $order['user_id'] != $login_user['id']) {
	redirect( WEB_ROOT . "/team.php?id={$order['team_id']}");
}
if ( $order['state']=='unpay') {
	redirect( WEB_ROOT . "/team.php?id={$order['team_id']}");
}

$team = Table::FetchForce('team', $order['team_id']);
$partner = Table::Fetch('partner', $team['partner_id']);
$express = ($team['delivery']=='express');
if ( $express ) { $option_express = Utility::OptionArray(Table::Fetch('category', array('express'), 'zone'), 'id', 'name'); }

if ( $team['delivery'] == 'coupon' ) {
	$cc = array(
			'user_id' => $login_user['id'],
			'team_id' => $order['team_id'],
			'order_id' => $order['id'],
			);
	$coupons = DB::LimitQuery('coupon', array(
				'condition' => $cc,
				));
} else if ( $team['delivery'] == 'voucher' ) {
	$cc = array(
			'user_id' => $login_user['id'],
			'team_id' => $order['team_id'],
			'order_id' => $order['id'],
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:view.php

示例7: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager(true);
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    /* hot city convert */
    $cityname = preg_split('/[\\s,]+/', $_POST['hotcity'], -1, PREG_SPLIT_NO_EMPTY);
    $hotcity = array();
    $cities = DB::LimitQuery('category', array('condition' => array('name' => $cityname, 'zone' => 'city')));
    $oa = Utility::OptionArray($cities, 'name', 'id');
    $_POST['hotcity'] = array();
    foreach ($cityname as $one) {
        $_POST['hotcity'][] = $oa[$one];
    }
    /* merget */
    $INI = Config::MergeINI($INI, $_POST);
    $INI = ZSystem::GetUnsetINI($INI);
    /* end */
    $value = Utility::ExtraEncode($INI);
    $table = new Table('system', array('value' => $value));
    if ($system) {
        $table->SetPK('id', 1);
    }
    $flag = $table->update(array('value'));
    Session::Set('notice', '更新系统信息成功');
    Utility::Redirect(WEB_ROOT . '/manage/system/city.php');
}
$hotcity = Utility::GetColumn($hotcities, 'name');
$hotcity = join(', ', $hotcity);
开发者ID:BGCX262,项目名称:zuitu-svn-to-git,代码行数:31,代码来源:city.php

示例8: current_area_new

function current_area_new($city_id='0', $group_id='0', $pid='0', $sid='0', $oid='0', $direction='0') {
	global $city;
	$daytime = strtotime(date('Y-m-d'));
	$condition = array(
		'team_type' => 'normal',
		"begin_time <= '{$daytime}'",
		"end_time > '{$daytime}'",
	);
	if($sid) $condition['sub_id'] = $sid;
	if($pid) $condition[] = getprice($pid);
	if ($group_id) $condition['group_id'] = $group_id;
	$team_all = Table::Count('team', $condition);
//	$a = array(
//			"/team/indexTeam.php?group_id={$group_id}&pid={$pid}" => "所有({$team_all})",
//			);
	if($city_id=='0') { $a =  " <a href=\"/team/indexTeam.php?group_id={$group_id}&pid={$pid}&sid={$sid}&oid={$oid}&did={$direction}\" class=\"r_xz\">所有({$team_all})</a> "; }
	else { $a =  " <a href=\"/team/indexTeam.php?group_id={$group_id}&pid={$pid}&sid={$sid}&oid={$oid}&did={$direction}\">所有({$team_all})</a> "; }

    $categorys = DB::LimitQuery('category', array(
		'condition' => array( 'zone' => 'city','fid' => '0','display' => 'Y' ),
		'order' => 'ORDER BY sort_order DESC, id DESC',
	));
	$categorys = Utility::OptionArray($categorys, 'id', 'name');
	foreach($categorys AS $id=>$name) {
		if($id) $condition[100] = "((city_ids like '%@{$id}@%' or city_ids like '%@0@%') or city_id in(0,{$id}))";

		$team_num = Table::Count('team', $condition);
		if($id==$city_id) { $a .=  " <a href=\"/team/indexTeam.php?group_id={$group_id}&city_id={$id}&pid={$pid}&sid={$sid}&oid={$oid}&did={$direction}\" class=\"r_xz\">$name({$team_num})</a> "; }
		else { $a .=  " <a href=\"/team/indexTeam.php?group_id={$group_id}&city_id={$id}&pid={$pid}&sid={$sid}&oid={$oid}&did={$direction}\">$name({$team_num})</a> "; }
	}
	return $a;
}
开发者ID:noikiy,项目名称:mdwp,代码行数:32,代码来源:searchGoods.php

示例9: explode

$selector = $team['id'] ? 'edit' : 'create';

/**
 * 初始化分店
 * 
 
*/
$store_condition['open'] = 'Y';
if($team['partner_id'] > 0){
	$store_condition['partner_id'] = $team['partner_id'];
}
if(!empty($team['store_ids'])){
	$store_ids_arr = explode('@', $team['store_ids']);
	$format_store_ids_arr = array();
	foreach($store_ids_arr as $store_v){
		if(!empty($store_v)){
			$format_store_ids_arr[] = $store_v; 
		}
	}
	
	$store_ids_str = implode(',', $format_store_ids_arr);
}

$stores = DB::LimitQuery('store', array(
			'condition'=> $store_condition,
			'order' => 'ORDER BY id DESC',
			));
$stores = Utility::OptionArray($stores, 'id', 'name');

include template('manage_team_edit_map');
开发者ID:noikiy,项目名称:mdwp,代码行数:30,代码来源:edit_map.php

示例10: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_partner();
$partner_id = abs(intval($_SESSION['partner_id']));
$login_partner = Table::Fetch('partner', $partner_id);
$store = Table::Fetch('store', $login_partner['store_id']);
$now = time();
$condition = array('begin_time <= ' . $now, 'end_time >=' . $now);
//	判断登陆者身份
if ($login_partner['fid'] == 0) {
    // admin
    $condition['partner_id'] = $partner_id;
    $storeList = DB::LimitQuery('store', array('condition' => array('partner_id' => $partner_id)));
} else {
    //	doner
    $condition['partner_id'] = $login_partner['fid'];
    $condition[] = 'store_ids LIKE "%@' . $login_partner['store_id'] . '@%"';
    $storeList = DB::LimitQuery('store', array('condition' => array('id' => $login_partner['store_id'])));
}
$teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY id DESC'));
$teamss = Utility::OptionArray($teams, 'id', 'product');
include template('biz_multiverify');
开发者ID:noikiy,项目名称:mdwp,代码行数:23,代码来源:multiverify.php

示例11:

        <div class="left" >
            
          <div class="sect about">
           <div class="lead"><h4>把<?php echo $city['name']; ?>每天最新的精品团购信息发到您的邮箱。</h4></div>
            <div class="enter-address">
			  <p>立即邮件订阅每日团购信息,不错过每一天的惊喜。</p>
			  <div class="enter-address-c">
						<form  id="enter-address-form" action="/subscribe.php" method="post" class="validator">
						<div class="mail">
							<label>邮件地址:</label>
							<input id="enter-address-mail" name="email" style="height:22px; line-height:22px;" class="f-input f-mail" type="text" value="<?php echo $login_user['email']; ?>" size="20" require="true" datatype="email"/>
						  <p style="margin-left:5px; padding-left:0px; font-size:12px; ">&nbsp;请放心,我们和您一样讨厌垃圾邮件</p>
						</div>
						<div class="city">
							<label>选择城市:</label>
						  <select name="city_id" style="float:left"><?php echo Utility::Option(Utility::OptionArray($allcities, 'id', 'name'), $city['id']); ?></select>
						<br />
 <p><input id="enter-address-commit" type="submit" class="formbutton" value="马上订阅" /></p>
						</div>
                     
						</form>
			  </div>
					
                    
		    </div>
            <div class="intro-mail">
					<span>每日精品团购包括:餐厅、酒吧、KTV、SPA、美发、健身、瑜伽、演出、影院等。</span></div>
		  </div>
      
        </div>
         
开发者ID:noikiy,项目名称:mdwp,代码行数:30,代码来源:subscribe.php

示例12: if

                        

                        

					<?php if(option_yes('verifyregister')){?>

						<?php include template("block_block_captcha");?>

					<?php }?>

	  <div class="field city" style=" margin-bottom:0px; width:150px;">

                            <label id="enter-address-city-label" for="signup-city">所在城市</label>

							<select style="font-size:14px;" name="city_id" class="f-city"><?php echo Utility::Option(Utility::OptionArray($allcities,'id','name'), $city['id']); ?><option value='0'>其他</option></select>

                </div>

      <div class="autologin_login" style="width:250px; padding-left:0px; padding-top:0px; font-size:14px">

                            <input tabindex="3" type="checkbox" value="1" name="subscribe" id="subscribe" class="f-check" checked="checked" />

                            <label for="subscribe">订阅每日最新团购信息,可随时退订 </label>

                </div>

                        <div class="act" style="overflow:hidden;padding-left:40px;">

                            <input  style="font-size:14px; margin-bottom:15px;" type="submit" value="同意协议并注册" name="commit" id="signup-submit" class="formbutton"/>
开发者ID:noikiy,项目名称:mdwp,代码行数:25,代码来源:account_signup.php

示例13: current_team_category

function current_team_category($gid = '0')
{
    global $city;
    $city_id = $city['id'];
    $today = strtotime(date('Y-m-d'));
    $condition = array('team_type' => 'normal', "begin_time <= '{$today}'", "end_time > '{$today}'");
    $condition[] = "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))";
    $categorys = DB::LimitQuery('category', array('condition' => array('zone' => 'group', 'fid' => '0', 'display' => 'Y'), 'order' => 'ORDER BY sort_order DESC, id DESC'));
    $categorys = Utility::OptionArray($categorys, 'id', 'name');
    $a = array();
    foreach ($categorys as $id => $name) {
        $condition['group_id'] = $id;
        $num = Table::Count('team', $condition);
        if (option_yes('rewritecity')) {
            $a["/{$city['ename']}?gid={$id}"] = $name . '(' . $num . ')';
        } else {
            $a["/index.php?gid={$id}"] = $name . '(' . $num . ')';
        }
    }
    if (option_yes('rewritecity')) {
        $l = "/{$city['ename']}?gid={$gid}";
    } else {
        $l = "/index.php?gid={$gid}";
    }
    if (!$gid) {
        $l = "/index.php";
    }
    return current_link($l, $a, true);
}
开发者ID:norain2050,项目名称:zuituware,代码行数:29,代码来源:common.php

示例14: option_yes

                        </div>
						<div class="wholetip clear"><h3>2、联系信息</h3></div>
                      <div class="field mobile">
                          <label>手机号码</label>
                            <input style="background-color:#F2F2F2 " disabled  type="text" size="30" name="mobile" id="settings-mobile" class="number" value="<?php echo $login_user['mobile']; ?>" require="<?php echo option_yes('needmobile')?'true':'require'; ?>" datatype="mobile"   msg="您尚未绑定手机号 " <?php echo $login_user['mobilecode']=='yes'?'readonly':''; ?>/>
                          <span class="qtdl"><?php if(!$login_user['mobile']){?>
您尚未绑定手机号,<a href="http://www.milituan.net/account/setbinds.php">先去绑定手机号码</a>
<?php } else { ?>手机号码是我们联系您最重要的方式<?php }?>	</span>
                        </div>
                        <div class="field password">
                            <label>QQ</label>
                            <input type="text" size="30" name="qq" id="settings-qq" class="number" value="<?php echo $login_user['qq']; ?>" />
                        </div>
						<div class="field city">
                            <label>所在城市</label>
							<select name="city_id" class="f-city"><?php echo Utility::Option(Utility::OptionArray($allcities, 'id', 'name'), $login_user['city_id']); ?><option value='0'>其他</option></select>
                        </div>
						<div class="wholetip clear"><h3>3、派送信息</h3></div>
                        <div class="field username">
                            <label>真实姓名</label>
                            <input type="text" size="30" name="realname" id="settings-realname" class="f-input" value="<?php echo $login_user['realname']; ?>" />
							<span class="qtdl">真实姓名请与有效证件姓名保持一致,便于收取物品</span>
                        </div>
                        <div class="field username">
                            <label>收件地址</label>
                            <input type="text" size="30" name="address" id="settings-address" class="f-input" value="<?php echo $login_user['address']; ?>" />
                            <span class="qtdl">为了能及时收到物品,请按照格式填写:_省_市_县(区)_</span>
                        </div>
						                        <div class="field">
                            <label>邮政编码</label>
                            <input type="text" maxLength=6 size="10" name="zipcode" id="settings-zipcode" class="f-input number" value="<?php echo $login_user['zipcode']; ?>" />
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:account_settings.php

示例15:

				<form id="-user-form" method="post" action="/manage/team/edit.php?id=<?php 
echo $team['id'];
?>
" enctype="multipart/form-data" class="validator">
					<input type="hidden" name="id" value="<?php 
echo $team['id'];
?>
" />
					<div class="wholetip clear"><h3>1、基本信息</h3></div>
					<div class="field">
						<label>项目类型</label>
						<select name="team_type" class="f-input" style="width:160px;" onchange="X.team.changetype(this.options[this.options.selectedIndex].value);"><?php 
echo Utility::Option($option_teamtype, $team['team_type']);
?>
</select><select name="city_id" class="f-input" style="width:160px;"><?php 
echo Utility::Option(Utility::OptionArray($allcities, 'id', 'name'), $team['city_id'], '全部城市');
?>
</select>
						<select name="group_id" class="f-input" style="width:160px;"><?php 
echo Utility::OptionGroup($groups, $cgroups, $team['group_id']);
?>
</select>
					</div>
					<div class="field" id="field_limit">
						<label>限制条件</label>
						<select name="conduser" class="f-input" style="width:160px;"><?php 
echo Utility::Option($option_cond, $team['conduser']);
?>
</select>
						<select name="buyonce" class="f-input" style="width:160px;"><?php 
echo Utility::Option($option_buyonce, $team['buyonce']);
开发者ID:hhdem,项目名称:tuangala_v2,代码行数:31,代码来源:manage_team_edit.php


注:本文中的Utility::OptionArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。