當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。