本文整理汇总了PHP中CForm::get_option方法的典型用法代码示例。如果您正苦于以下问题:PHP CForm::get_option方法的具体用法?PHP CForm::get_option怎么用?PHP CForm::get_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForm
的用法示例。
在下文中一共展示了CForm::get_option方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: if
<?
//----------------------------------------------------------------------------------------------
// MODIF
//----------------------------------------------------------------------------------------------
?>
<? if($a == 5) { ?>
<form id="form_modif" method="post" action="departement.php" enctype="multipart/form-data">
<p> <? echo CForm::get_hidden(55) ?> </p>
<p> <? echo CForm::get_hidden($id, 'id') ?> </p>
<fieldset>
<legend>Formulaire de modification de menu </legend>
<p id="menu">
<label>Pays</label>
<select name="pays">
<? echo CForm::get_option($pays, 'pays', 'code', 'nom', CTableUser::is_admin($_SESSION['idmbr']) ? '1' : ' idreda = ' . $_SESSION['idmbr']); ?>
</select>
<? echo CHtml::get_msginfo($error_signe['pays'])?>
</p>
<p>
<label>Titre </label>
<input name="nom" type="text" value="<? echo $nom ?>" />
<? echo CHtml::get_msginfo($error_signe['nom'])?> </p>
<p>
<input name="creer" type="submit" value="Modifier >>"/>
</p>
</fieldset>
</form>
<? }
?>
<!-- InstanceEndEditable --></div>
示例2: if
<?
//----------------------------------------------------------------------------------------------
// MODIF
//----------------------------------------------------------------------------------------------
?>
<? if($a == 5) { ?>
<form id="form_modif" method="post" action="<? echo $_SERVER['REQUEST_URI'] ?>" enctype="multipart/form-data">
<p> <? echo CForm::get_hidden(55) ?> </p>
<p> <? echo CForm::get_hidden($id, 'id') ?> </p>
<fieldset>
<legend>Formulaire de modification de menu </legend>
<p id="menu">
<label>Departement</label>
<select name="departement">
<? echo CForm::get_option($comVal['departement'], 'departement', 'id_dep', 'nom') ?>
</select>
</p>
<p>
<label>Commune </label>
<input name="nom" type="text" value="<? echo $comVal['nom_com'] ?>" />
<? echo CHtml::get_msginfo($error_signe['nom'])?> </p>
<p>
<label>Code postal </label>
<input name="cp" type="text" value="<? echo $comVal['CP'] ?>" />
<? echo CHtml::get_msginfo($error_signe['cp'])?> </p>
<p>
<label>Url </label>
<input name="url" type="text" value="<? echo $comVal['urlCommune'] ?>" />
<? echo CHtml::get_msginfo($error_signe['url'])?> </p>
<p>
示例3:
<p>
<label id="label_nom">Nom </label>
<input type="text" name="nom" id="nom" value="" />
</p>
<p>
<label id="label_prenom">Prénom </label>
<input type="text" name="prenom" id="prenom" value="" />
</p>
<p>
<label id="label_expediteur">Votre email </label>
<input type="text" name="expediteur" id="expediteur" value="" />
</p>
<p>
<label id="label_pays">Pays</label>
<select name="pays" id="pays">
<?php echo CForm::get_option($pays, "pays") ?>
</select>
</p>
<p>
<label id="label_sujet">Sujet</label>
<input type="text" name="sujet" id="sujet" value="" />
</p>
<p>
<label id="label_message">Message</label>
<textarea name="message" id="message"></textarea>
</p>
<p>
<label id="label_image">Code de sécurité</label>
<img src="/plug/captcha/secure.php?fake=<?php echo md5(microtime()); ?>" alt="CAPTCHA Image" />
</p>
<p>
示例4:
<p>
<label>Titre </label>
<input name="nom" type="text" value="<?=$nom ?>" />
<?=CHtml::get_msginfo($error_signe['nom'])?></p>
<p>
<label>Texte </label>
<select name="texId" tmt:message="Veuillez sélectionner le champ texte" tmt:required="false">
<option value="0">Aucun</option>
<?=CForm::get_option($texId, 'texte', 'id', 'nom', 1); ?>
</select>
</p>
<p>
<label>Pièce-jointe </label>
<select name="pieId" tmt:message="Veuillez sélectionner le champ piece" tmt:required="false">
<option value="0">Aucun</option>
<?=str_replace('../../userfiles/pieces_jointes/', '', CForm::get_option($pieId, 'hbpiecesjointes', 'id', 'piece', 1)); ?>
</select>
</p>
<p>
<label>Publier </label>
<input type="radio" name="etat" value="0" <?=CForm::get_checked($etat,0) ?> />non
<input type="radio" name="etat" value="1" <?=CForm::get_checked($etat,1) ?> />oui<?=CHtml::get_msginfo($error_signe['etat'])?></p>
<p>
<input name="creer" type="submit" value="Modifier >>"/>
</p>
</fieldset>
</form>
<?php } ?>
<!-- InstanceEndEditable --></div>
</div>
<hr class="clearfloat" />
示例5: if
?>
<?php if($a == 5) { ?>
<?php
$file_url = '/userfiles/image/galeries/'.$gal['dossier'].'/'.$image['image'];
?>
<form id="form_ajout" name="form_ajout" method="post" action="fichier-galerie.php" enctype="multipart/form-data">
<p> <?php echo CForm::get_hidden(55) ?> </p>
<fieldset>
<legend>Formulaire d'ajout de fichier </legend>
<p>
<label>Emplacement</label>
<select name="idgal">
<option value="0">Choisir une galerie</option>
<?php echo CForm::get_option($_SESSION['idgal'], 'galerie', 'id', 'nom', "1") ?>
</select>
<?php echo $error_signe['galerie']?>
</p>
<p>
<label>Fichier actuel</label>
<a href="<?php echo $file_url; ?>" target="_blank"><?php echo $file_url; ?></a>
</p>
<p>
<label>Fichier </label>
<input id="file" name="file" type="file" onchange="render_ziplabel(this)"/>
<?php echo $error_signe['nom']?>
<span id="zip_label" class="hide">
Dézipper
<span class="action" id="unzip_yes" onclick="javascript:set_zip_mode(1);">oui</span> |
<span id="unzip_no" class="action" onclick="javascript:set_zip_mode(0);">non</span>
示例6: if
<input name="nom" type="text" value="<?php echo $nom?>" />
<?php echo $error_signe['nom']?> </p>
<?php if(CTableUser::is_admin($_SESSION['idmbr'])) { ?>
<p>
<label>Rédacteur</label>
<select name="idreda">
<?php echo CForm::get_option($idreda, 'user', 'id', 'login', ' type = 1 OR type = 2') ?>
</select>
<?php echo $error_signe['idreda']?> </p>
<?php } ?>
<p>
<label>Visiteur</label>
<select name="idlecteur">
<option value="all" <?php echo CForm::get_selected($idlecteur, 'all'); ?>>publics</option>
<option value="0" <?php echo CForm::get_selected($idlecteur, '0'); ?>>tous les membres</option>
<?php echo CForm::get_option($idlecteur, 'user', 'id', 'login', ' type = 0 OR type = 3') ?>
</select>
<?php echo $error_signe['idreda']?> </p>
<p>
<p>
<label>Publier </label>
<input type="radio" name="etat" value="0" <?php echo CForm::get_checked($etat,0) ?> />
non
<input type="radio" name="etat" value="1" <?php echo CForm::get_checked($etat,1) ?> />
oui <?php echo $error_signe['etat']?></p>
<p>
<input name="creer" type="submit" value="Modifier >>"/>
</p>
</fieldset>
</form>
<?php } ?>
示例7:
<form id="form_ajout" method="post" action="envoi.php" enctype="multipart/form-data">
<p> <?php echo CForm::get_hidden(44) ?> </p>
<fieldset>
<legend>Formulaire d'ajout d'email</legend>
<p>
<label>Expéditeur </label>
<input name="expediteur" type="text" id="expediteur" value="<?php echo $expediteur ?>" readonly="true" />
<?php echo CHtml::get_msginfo($error_signe['expediteur'])?></p>
<p>
<label>Destinataire(s) </label>
<input name="destinataire" type="text" value="<?php echo $destinataire ?>" id="destinataire"/>
<?php echo CHtml::get_msginfo($error_signe['destinataire'])?></p>
<p>
<label>Texte </label>
<select name="id_texte">
<?php echo CForm::get_option($id_texte, "texte") ?>
</select>
<?php echo CHtml::get_msginfo($error_signe['id_texte'])?></p>
<p>
<label>Pièce jointe</label>
<input name="pj" type="text" value="<?php echo $pj ?>" id="pj"/>
<a href="../../userfiles/browser.php" target="browser" onclick="popup(this.href, this.target, 445, 480);return false">
<input type="button" name="parcourir" value="Parcourir"/>
</a> </p>
<p>
<label>Date d'envoi</label>
<input name="date" type="text" value="<?php echo $date ?>" id="date" onmousedown="javascript:openDate(this);"/>
</p>
<p>
<input name="creer" type="submit" value="Ajouter >>"/>
</p>
示例8: include
<div id="titre"><!-- InstanceBeginEditable name="titre" -->Exporter des contacts<!-- InstanceEndEditable --></div>
</div>
</div>
<div id="contentarea">
<div id="left"><?php include("../nav/menu_g.php"); ?></div>
<div id="center">
<div id="page"><!-- InstanceBeginEditable name="page" --><?php echo CHtml::get_toolbar() ?><!-- InstanceEndEditable --></div>
<div id="over"><!-- InstanceBeginEditable name="over" --><?php echo CHtml::get_msginfo($msginfo) ?><!-- InstanceEndEditable --></div>
<div id="main"><!-- InstanceBeginEditable name="main" -->
<form action="<?php echo $_SERVER["PHP_SELF"] ?>" method="post">
<p> <?php echo CForm::get_hidden(1) ?> </p>
<fieldset>
<p>
<label>Groupe de contacts</label>
<select name="id_groupe">
<?php echo CForm::get_option($id_groupe, 'groupe'); ?>
</select>
</p>
<p>
<label>Séparateur</label>
<select name="separateur">
<option value="PNT">Point Virgule (Pour Excell ...)</option>
<option value="VRG">Virgule (Pour Outlook ...)</option>
</select>
</p>
<p>
<input name="submit" type="submit" value="Exporter"/>
</p>
</fieldset>
</form>
</form>
示例9: if
<?php
//----------------------------------------------------------------------------------------------
// MODIF
//----------------------------------------------------------------------------------------------
?>
<?php if($a == 5) { ?>
<form id="form_modif" name="form_modif" method="post" action="<? echo $_SERVER['REQUEST_URI'] ?>" enctype="multipart/form-data">
<p> <?php echo CForm::get_hidden(55) ?> </p>
<p> <?php echo CForm::get_hidden($id, 'id') ?> </p>
<fieldset>
<legend>Formulaire de modification de menu </legend>
<p id="menu">
<label>Secteur</label>
<select name="idcat">
<?php echo CForm::get_option($idcat, 'secteur', 'id_sec', 'nom_sec') ?>
</select>
</p>
<p>
<label>Titre </label>
<input name="nom" type="text" value="<?php echo $nom ?>" />
<?php echo CHtml::get_msginfo($error_signe['nom'])?> </p>
<p>
<p class="go clear">
<label>Mot-clé</label>
<input type="text" name="txtcle" id="txtcle" class="text" />
<input type="button" name="bout" value="Go" onClick="test(document.forms.form_modif.txtcle.value,<? echo $id; ?>)">
</p>
<ul class="cleExemple" id="motcle">
<? $Zsql = "SELECT nom_motcle, id_motcle FROM motcle WHERE cat_motcle=".$id;
//print_r($Zsql);
示例10:
<div id="page"><!-- InstanceBeginEditable name="page" --><?php echo CHtml::get_toolbar(array('add'=>'0', 'cancel'=>'0')) ?><!-- InstanceEndEditable --></div>
<div id="over"><!-- InstanceBeginEditable name="over" --><?php echo CHtml::get_msginfo($msginfo) ?><!-- InstanceEndEditable --></div>
<div id="main"><!-- InstanceBeginEditable name="main" -->
<?php
//----------------------------------------------------------------------------------------------
// FILTRE
//----------------------------------------------------------------------------------------------
?>
<form id="form_filtre" name="form_filtre" method="get" action="moul_mail_valide.php">
<p> <?php echo CForm::get_hidden(6); ?> </p>
<p>
Fichiers
<select name="iMltListId" onchange="document.form_filtre.submit();" width="50px">
<option value="0">Toutes les listes</option>
<?php echo CForm::get_option($iMltListId, 'moul_listes', 'id', 'nom') ?>
</select>
</p>
</form>
<div class="ajaxZone">
<?php include 'moul_mail_valide_list_ajax.php'; ?>
</div>
<!-- InstanceEndEditable -->
</div>
</div>
<hr class="clearfloat" />
</div>
</div>
</body>
示例11:
<label>Menu </label>
<select name="idcat" onchange="update_select_art(document.forms['form_ajout'].elements['idcat'].options[document.forms['form_ajout'].elements['idcat'].selectedIndex].value, 'form_ajout');">
<option value="0">Choisir le menu</option>
<?php echo CForm::get_option($idcat, 'categorie', 'id', 'nom', CTableUser::is_admin($_SESSION['idmbr']) ? '1' : ' idreda = ' . $_SESSION['idmbr']); ?>
</select>
<?php echo CHtml::get_msginfo($error_signe['idcat'])?></p>
<p>
<label>Sous-menu </label>
<select name="idart" id="idart" onchange="update_page(document.forms['form_ajout'].elements['idart'].options[document.forms['form_ajout'].elements['idart'].selectedIndex].value, 'form_ajout');">
<?php echo CForm::get_option($idart, 'article', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND idcat = ' . $idcat : ' idreda = ' . $_SESSION['idmbr'] . ' AND idcat = ' . $idcat)); ?>
</select>
</p>
<p>
<label>Page </label>
<select name="idpage" id="idpage">
<?php echo CForm::get_option($idpage, 'page', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND idart = ' . $idart : ' idreda = ' . $_SESSION['idmbr'] . ' AND idart = ' . $idart)); ?>
</select>
<?php echo CHtml::get_msginfo($error_signe['page'])?></p>
<p>
<label>Date </label>
<input id="dateevent" name="dateevent" type="text" value="<?php echo $dateevent ?>" />
<?php echo $error_signe['dateevent']?>
</p>
</div>
<hr class="clearfloat" />
<!--<p>
<label>Texte défilant</label>
<input name="text" type="text" value="<?php echo $text?>" />
<?php echo CHtml::get_msginfo($error_signe['text'])?>
</p>
<p>
示例12: if
<?
//----------------------------------------------------------------------------------------------
// MODIF
//----------------------------------------------------------------------------------------------
?>
<? if($a == 5) { ?>
<form id="form_modif" name="form_modif" method="post" action="<? echo $_SERVER['REQUEST_URI'] ?>" enctype="multipart/form-data">
<p> <? echo CForm::get_hidden(55) ?> </p>
<p> <? echo CForm::get_hidden($id, 'id') ?> </p>
<fieldset>
<legend>Formulaire de modification </legend>
<p id="menu">
<label>Quartier</label>
<select name="id">
<? echo CForm::get_option($id, 'quartier', 'id_q', 'nom_q') ?>
</select>
</p>
<p>
<p class="go clear">
<label>CP</label>
<input type="text" name="txtcle" id="txtcle" class="text" />
<input type="button" name="bout" value="Go" onClick="test(document.forms.form_modif.txtcle.value,<? echo $id; ?>,5)">
</p>
<ul class="cleExemple" id="cp">
<?
// Récuperation donnée quartier
$Zsql = "SELECT nom_cp, id_cp FROM CpQuartier WHERE q_cp=".$id." ORDER BY id_cp";
$requetQ = CBdd::select($Zsql);
if ($requetQ){
$i = 0;
示例13: IN
<hr class="clearfloat"/>
<div class="floatleft">
<p>
<label>Nom</label>
<select onchange="this.form.submit();" name="filtre_nom_user" id="filtre_nom_user">
<option value="%%">Tout</option>
<?php echo CForm::get_option($filtre_nom_user, 'user', 'nom', 'nom', ' nom != "" AND email IN (SELECT expediteur FROM email WHERE expediteur != "postmaster@cyber-consult.ch")') ?>
</select>
</p>
</div>
<div class="floatleft">
<p>
<label>Prénom</label>
<select onchange="this.form.submit();" name="filtre_prenom_user" id="filtre_prenom_user">
<option value="%%">Tout</option>
<?php echo CForm::get_option($filtre_prenom_user, 'user', 'prenom', 'prenom', ' prenom != "" AND email IN (SELECT expediteur FROM email WHERE expediteur != "postmaster@cyber-consult.ch")') ?>
</select>
</p>
</div>
<div class="floatright">
<p>
<input type="submit" value="Actualiser"/>
</p>
</div>
</form>
<script type="text/javascript">
Calendar.setup({
inputField : "filtre_date_debut",
ifFormat : "%d-%m-%Y",
});
Calendar.setup({
示例14: if
<label>Site web</label>
<input name="web" type="text" value="<?=$web?>" />
</p>
</div>
<div class="floatleft margin-left">
<h2>Contact</h2>
<p>
<label>Etat contact</label>
<input type="radio" value="0" <?=CForm::get_checked($etat_contact, 0) ?> name="etat_contact"/>
Non contacté
<input type="radio" value="1" <?=CForm::get_checked($etat_contact, 1) ?> name="etat_contact"/>
Contacté</p>
<p>
<label>Opportunité</label>
<select id="idopportunite" name="idopportunite" <?php if ($etat_contact == 0) echo 'disabled="disabled"' ; ?>>
<?=utf8_encode(CForm::get_option($idopportunite, 'gr_opportunite', 'id', 'nom', ' etat = 1')) ?>
</select>
</p>
<p>
<label>Date contact</label>
<input name="date_contact" id="date_contact" type="text" value="<?=CDate::formate_date($date_contact) ?>" />
</p>
<div id="ajaxZone"></div>
<?php if ($etat_contact != 0): ?>
<script type="text/javascript">
$(function(){
$('#ajaxZone').load('hb_get_mail_content.php', {iOppId:$('#idopportunite').val(), iOppTypeId:1});
});
</script>
<?php endif; ?>
<h2>Rendez-vous</h2>
示例15: include_once
/*---------------------------------------------------------------------
IMPORTATIONS
----------------------------------------------------------------------*/
include_once("../inc/init.php");
/*---------------------------------------------------------------------
VARIABLES HTTP
----------------------------------------------------------------------*/
$idart = !empty($_GET['idart']) ? $_GET['idart'] : 0;
/*--------------------------------------------------------------------
TRAITEMENTS
----------------------------------------------------------------------*/
echo CForm::get_option($idart, 'page', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND text LIKE \'%<!--GALERIE-->%\' AND idart = ' . $idart : ' idreda = ' . $_SESSION['idmbr'] . ' AND text LIKE \'%<!--GALERIE-->%\' AND idart = ' . $idart));
?>
<?php
session_start();
/*---------------------------------------------------------------------
IMPORTATIONS
----------------------------------------------------------------------*/
include_once("../inc/init.php");
/*---------------------------------------------------------------------
VARIABLES HTTP
----------------------------------------------------------------------*/
$idart = !empty($_GET['idart']) ? $_GET['idart'] : 0;
/*--------------------------------------------------------------------
TRAITEMENTS
----------------------------------------------------------------------*/
echo CForm::get_option($idart, 'page', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND text LIKE \'%<!--GALERIE-->%\' AND idart = ' . $idart : ' idreda = ' . $_SESSION['idmbr'] . ' AND text LIKE \'%<!--GALERIE-->%\' AND idart = ' . $idart));
?>