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


PHP listData函数代码示例

本文整理汇总了PHP中listData函数的典型用法代码示例。如果您正苦于以下问题:PHP listData函数的具体用法?PHP listData怎么用?PHP listData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: show

 public function show()
 {
     $data['user_id'] = $this->tank_auth->get_user_id();
     $this->load->model('empleado_model');
     $this->load->helper('dropdown');
     $username = $this->tank_auth->get_username();
     $data['nombre_de_usuario'] = $this->empleado_model->getName($username);
     $data['panelheading'] = "Captura de incidencias";
     if ($this->uri->segment(3) != '' && $this->uri->segment(4) != '') {
         $id = $this->uri->segment(3);
         $qna = $this->uri->segment(4);
         $this->load->model('qna_model');
         $data['qna'] = $this->qna_model->get($qna);
         if ($data['qna']->activa) {
             $data['index'] = "capturar/show";
         } else {
             redirect('captura/index');
         }
     } else {
         $id = $this->uri->segment(3);
         $data['index'] = "capturar";
     }
     $data['empleado'] = $this->captura_model->get_empleado_join($id);
     $this->load->helper('dropdown');
     $data['options'] = listData('incidencias', 'id', 'incidencia_cod', 'inc_descripcion', 'ASC', ' - ');
     $data['periodos'] = listData2('periodos', 'id', 'period', 'year', 'activo');
     $data['capturas'] = $this->captura_model->get_incidencias($id, $qna);
     $this->load->view('layouts/index', $data);
 }
开发者ID:rikardote,项目名称:rechum,代码行数:29,代码来源:Captura.php

示例2: index

 public function index()
 {
     $data['dropdownItems'] = listData('posts', 'id', 'title');
     // using custom helper method listData
     $data['posts'] = $this->post_model->getPosts();
     // call Post model method getPosts()
     $this->load->view('index', $data);
     // load the view file , pass $data array to view file
     $this->load->view('footer');
 }
开发者ID:ucantseeme,项目名称:p2,代码行数:10,代码来源:Welcome.php

示例3: foreach

</thead>

<?php 
if (isset($_POST['acctype'])) {
    $code1 = $code2 = '';
    foreach ($rights1 as $key => $ri) {
        $code1 .= isset($_POST['ri1' . $key]) ? 1 : 0;
    }
    foreach ($rights2 as $key => $ri) {
        $code2 .= isset($_POST['ri2' . $key]) ? 1 : 0;
    }
    updateFieldWhere('acctypes', 'rights1', $code1, "acctype = " . $_POST['acctype']);
    updateFieldWhere('acctypes', 'rights2', $code2, "acctype = " . $_POST['acctype']);
    redirect();
}
foreach (listData('acctypes', '1') as $data) {
    echo '<tr>';
    echo '<td>' . $data['name'] . '</td>';
    $ristr = $data['rights1'];
    echo '<td><form action="" method="POST">';
    echo '<input type="hidden" name="acctype" value="' . $data['acctype'] . '" />';
    echo 'Vartotojų lentelėje<br>';
    $ristr = $data['rights1'];
    foreach ($rights1 as $key => $ri) {
        echo '<span class="label"><input style="width: auto;" ' . ($ristr[$key] == 1 ? 'checked="checked"' : '') . ' type="checkbox" name="ri1' . $key . '" />' . $ri . '</span>&nbsp;&nbsp;';
    }
    echo '<br>';
    echo 'Poreikių lentelėje<br>';
    $ristr = $data['rights2'];
    foreach ($rights2 as $key => $ri) {
        echo '<span class="label"><input style="width: auto;" ' . ($ristr[$key] == 1 ? 'checked="checked"' : '') . ' type="checkbox" name="ri2' . $key . '" />' . $ri . '</span>&nbsp;&nbsp;';
开发者ID:vsi-geros-valios-projektai,项目名称:admin.pagalbadaiktais.lt,代码行数:31,代码来源:fields.php

示例4: getUseCaseItem

    case "select":
        echo "<p class='debug'>UseCaseID: {$UseCaseID} :: ID: {$id}</p>";
        if ($UseCaseID != "") {
            getUseCaseItem($UseCaseID, $userID);
        } else {
            if ($id != "") {
                getUseCaseItem($id, $userID);
            }
        }
        break;
    case "edit":
        updateUseCaseItem($UseCaseID, $UseCaseTitle, $UseCaseDescription, $PrimaryActor, $AlternateActors, $PreRequisits, $PostConditions, $MainPathSteps, $AlternatePathSteps, $SuccessCriteria, $PotentialFailures, $FrequencyOfUse, $OwnerUserID, $PriorityID, $CaseStatusID);
        listData($listQuery, $userID);
        break;
    case "":
        listData($listQuery, $userID);
        break;
}
function filterDropDown($fields)
{
    dropdownFields($fields, "Filter By", "filterBy", $filterBy);
}
function orderDropDown($fields)
{
    dropdownFields($fields, "Order By", "orderBy", $orderBy);
}
function listData($listQuery, $userID)
{
    listUseCase($userID);
    echo "<br /><br /><a href='useCases.php?u={$userID}&action=new'>Add UseCase Item</a>";
}
开发者ID:katiesenger,项目名称:DSHome,代码行数:31,代码来源:useCases.php

示例5: listData

<div class="page"><div class="page-con">

<?php 
echo '<h2>Suteikta parama</h2>';
echo '<ul class="poreikiailist smallersq">';
$data0 = listData(false, false, false, "SELECT * FROM needs LEFT JOIN cats ON needs.need_cat = cats.cat_id WHERE need_full_user = " . CUSER . " AND need_type = 2 AND needs.deleted = 0");
foreach ($data0 as $pdata) {
    echo '<li>';
    echo '<a href="/poreikiai/id/' . $pdata['need_id'] . '">';
    echo '<div class="icon" style="background-image: url(/img/c' . $pdata['cat_id'] . '.png);"></div>';
    echo '<div class="name">' . $pdata['need_name'] . '</div>';
    echo '<div class="city">' . $citiesList[$pdata['user_city']] . '</div>';
    echo '</a>';
    echo '</li>';
}
echo '</ul>';
if (count($data0) == 0) {
    echo 'Sąrašas tuščias';
}
?>

</div><div class="page-sid">

<div class="sid-back">
<h2>Keisti slaptažodį</h2>
<!-- edit form for user's password / this form uses the HTML5 attribute "required" -->
<form method="post" action="" name="user_edit_form_password">
	<label for="user_password_old"><?php 
echo $phplogin_lang['Old password'];
?>
<span class="reqfield">*</span></label><input id="user_password_old" type="password" name="user_password_old" autocomplete="off" required />
开发者ID:vsi-geros-valios-projektai,项目名称:pagalbadaiktais.lt,代码行数:31,代码来源:edit.php

示例6: inputsList

 /**
  * Renders an input list.
  * @param boolean $checkbox flag that indicates if the list is a checkbox-list.
  * @param CModel $model the data model
  * @param string $attribute the attribute
  * @param array $data value-label pairs used to generate the input list.
  * @param array $htmlOptions additional HTML options.
  * @return string the generated input list.
  * @since 0.9.5
  */
 protected function inputsList($checkbox, $model, $attribute, $data, $htmlOptions = array())
 {
     CHtml::resolveNameID($model, $attribute, $htmlOptions);
     $select = CHtml::resolveValue($model, $attribute);
     if ($model->hasErrors($attribute)) {
         if (isset($htmlOptions['class'])) {
             $htmlOptions['class'] .= ' ' . CHtml::$errorCss;
         } else {
             $htmlOptions['class'] = CHtml::$errorCss;
         }
     }
     $name = $htmlOptions['name'];
     unset($htmlOptions['name']);
     if (array_key_exists('uncheckValue', $htmlOptions)) {
         $uncheck = $htmlOptions['uncheckValue'];
         unset($htmlOptions['uncheckValue']);
     } else {
         $uncheck = '';
     }
     $hiddenOptions = isset($htmlOptions['id']) ? array('id' => CHtml::ID_PREFIX . $htmlOptions['id']) : array('id' => false);
     $hidden = $uncheck !== null ? CHtml::hiddenField($name, $uncheck, $hiddenOptions) : '';
     if (isset($htmlOptions['template'])) {
         $template = $htmlOptions['template'];
     } else {
         $template = '<label class="{labelCssClass}">{input}{label}</label>';
     }
     unset($htmlOptions['template'], $htmlOptions['separator'], $htmlOptions['hint']);
     if ($checkbox && substr($name, -2) !== '[]') {
         $name .= '[]';
     }
     unset($htmlOptions['checkAll'], $htmlOptions['checkAllLast']);
     $labelOptions = isset($htmlOptions['labelOptions']) ? $htmlOptions['labelOptions'] : array();
     unset($htmlOptions['labelOptions']);
     $items = array();
     $baseID = CHtml::getIdByName($name);
     $id = 0;
     $method = $checkbox ? 'checkBox' : 'radioButton';
     $labelCssClass = $checkbox ? 'checkbox' : 'radio';
     if (isset($htmlOptions['inline'])) {
         $labelCssClass .= ' inline';
         unset($htmlOptions['inline']);
     }
     foreach ($data as $value => $label) {
         $checked = !is_array($select) && !strcmp($value, $select) || is_array($select) && !empty($select) && !is_object($select[0]) && in_array($value, $select) || is_array($select) && !empty($select) && is_object($select[0]) && in_array($value, array_keys(CHtml . listData($select)));
         $htmlOptions['value'] = $value;
         $htmlOptions['id'] = $baseID . '_' . $id++;
         $option = CHtml::$method($name, $checked, $htmlOptions);
         $label = CHtml::label($label, $htmlOptions['id'], $labelOptions);
         $items[] = strtr($template, array('{labelCssClass}' => $labelCssClass, '{input}' => $option, '{label}' => $label));
     }
     return $hidden . implode('', $items);
 }
开发者ID:nkdsoft,项目名称:YiiBooster,代码行数:62,代码来源:TbActiveForm.php

示例7: UNION

         break;
     case 7:
         $q = 'SELECT user_email FROM users WHERE user_acctype = 0 AND user_active = 1';
         break;
     case 8:
         $q = 'SELECT user_email FROM needy WHERE deleted = 0';
         break;
     case 9:
         $q = '(SELECT user_email FROM needs WHERE need_type = 1 AND need_full = 1 AND user_subscribed = 1) UNION (SELECT users.user_email AS user_email FROM needs LEFT JOIN users ON needs.need_full_user = users.user_id WHERE need_type = 1 AND users.user_subscribed = 1 AND users.user_active = 1)';
         break;
     case 10:
         $q = '(SELECT user_email FROM needs WHERE need_type = 2 AND need_full = 1 AND user_subscribed = 1) UNION (SELECT users.user_email AS user_email FROM needs LEFT JOIN users ON needs.need_full_user = users.user_id WHERE need_type = 2 AND users.user_subscribed = 1 AND users.user_active = 1)';
         break;
 }
 $recips = array();
 foreach (listData(false, false, false, $q) as $rec) {
     if ($rec['user_email'] != '') {
         $recips[] = $rec['user_email'];
     }
 }
 $amount = count($recips);
 //$recips = implode(', ', $recips);
 $sendByOne = false;
 $report = array('success' => array(), 'fail' => array());
 if ($sendByOne) {
     if ($amount > 0) {
         foreach ($recips as $receip) {
             $successfullySent = myMail($receip, $_POST['subject'], $_POST['message'], $_POST['from']);
             if ($successfullySent) {
                 $report['success'][$receip] = $receip;
             } else {
开发者ID:vsi-geros-valios-projektai,项目名称:admin.pagalbadaiktais.lt,代码行数:31,代码来源:laiskai.php

示例8: search

 public function search()
 {
     $data['user_id'] = $this->tank_auth->get_user_id();
     $this->load->model('empleado_model');
     $username = $this->tank_auth->get_username();
     $data['nombre_de_usuario'] = $this->empleado_model->getName($username);
     $data['is_admin'] = $this->tank_auth->is_admin();
     $data['panelheading'] = "Empleados";
     $centros = explode(",", $this->tank_auth->get_user_centros());
     $data['empleado'] = $this->empleado_model->get_search($centros);
     if (empty($data['empleado'])) {
         $data['noencontrado'] = " <strong>Atencion!</strong><br>Empleado no encontrado o no pertenece a su adscripcion<br>Informacion en Recursos Humanos";
         $data['empleado'] = NULL;
     }
     $data['options'] = listData('adscripciones', 'id', 'adscripcion', 'descripcion');
     $data['index'] = "empleados/index";
     $this->load->view('layouts/index', $data);
 }
开发者ID:rikardote,项目名称:rechum,代码行数:18,代码来源:--Empleados.php

示例9: isset

}
?>
</select>
<input class="search" type="text" name="s" value="<?php 
echo isset($_GET['s']) ? $_GET['s'] : '';
?>
" />
<input type="submit" value="Rodyti" />
</form>

<ul class="poreikiailist">
<?php 
$where = "SELECT need_id, need_name, cat_name, cat_id, user_city, need_regdate, a.deleted AS deleted FROM (SELECT need_id, need_name, cat_name, cat_id, need_type, need_needy, need_regdate, needs.deleted AS deleted FROM needs INNER JOIN cats ON needs.need_cat = cats.cat_id WHERE needs.need_type = {$fbsite} AND needs.need_full=0 AND needs.need_expires > NOW() AND needs.deleted = 0 {$filterCat}) a INNER JOIN needy ON a.need_needy = needy.user_id WHERE a.need_type = {$fbsite} {$filterCity} {$filterStok} {$srch} ORDER BY need_id DESC";
$c = 0;
if (pageNum() != 0) {
    foreach (listData(false, false, pageNum(), $where, 15) as $pdata) {
        echo '<li>';
        echo '<a href="/poreikiai/id/' . $pdata['need_id'] . '">';
        echo '<div class="icon" style="background-image: url(/img/c' . $pdata['cat_id'] . '.png);"></div>';
        echo '<div class="name">' . $pdata['need_name'] . '</div>';
        echo '<div class="city">' . $citiesList[$pdata['user_city']] . '</div>';
        echo '</a>';
        echo '</li>';
        $c++;
    }
}
if ($c == 0) {
    err('Nerastas nė vienas poreikis');
}
?>
</ul>
开发者ID:vsi-geros-valios-projektai,项目名称:pagalbadarbais.lt,代码行数:31,代码来源:home.php

示例10: foreach

foreach ($data0 as $pdata) {
    echo '<li>';
    echo '<a href="/poreikiai/id/' . $pdata['need_id'] . '">';
    echo '<div class="icon" style="background-image: url(/img/c' . $pdata['cat_id'] . '.png);"></div>';
    echo '<div class="name">' . $pdata['need_name'] . '</div>';
    echo '<div class="city">' . $citiesList[$pdata['user_city']] . '</div>';
    echo '</a>';
    echo '</li>';
}
echo '</ul>';
if (count($data0) == 0) {
    echo 'Sąrašas tuščias';
}
echo '<h2>Gauta pagalba</h2>';
echo '<ul class="poreikiailist smallersq">';
$data1 = listData(false, false, false, "SELECT * FROM needs LEFT JOIN cats ON needs.need_cat = cats.cat_id WHERE need_needy = {$id} AND need_type = {$site} AND needs.deleted = 0 AND need_full = 1");
foreach ($data1 as $pdata) {
    echo '<li>';
    echo '<a href="/poreikiai/id/' . $pdata['need_id'] . '">';
    echo '<div class="icon" style="background-image: url(/img/c' . $pdata['cat_id'] . '.png);"></div>';
    echo '<div class="name">' . $pdata['need_name'] . '</div>';
    echo '<div class="city">' . $citiesList[$pdata['user_city']] . '</div>';
    echo '</a>';
    echo '</li>';
}
echo '</ul>';
if (count($data1) == 0) {
    echo 'Sąrašas tuščias';
}
echo '</div><div class="page-sid"><div class="sid-back">';
echo '<h2>Pagalbos gavėjo kuratorius</h2><p>Norėdami padėti pagalbos gavėjui kreipkitės į šį kuratorių:</p>';
开发者ID:vsi-geros-valios-projektai,项目名称:pagalbadarbais.lt,代码行数:31,代码来源:stokojantysis.php

示例11: isset

<?php

$page_id = isset($_GET['blogid']) ? $_GET['blogid'] : false;
$page_site = 1;
if ($page_id) {
    $pagerow = getRow('pages', "page_id = {$page_id} AND (page_site = {$page_site} OR page_site = 2) AND deleted = 0 AND page_published < NOW()");
    if (!$pagerow) {
        err('Naujiena neegzistuoja');
        return;
    }
} else {
    $where = "SELECT * FROM pages WHERE page_type = 1 AND (page_site = {$page_site} OR page_site = 2) AND deleted = 0 AND page_published < NOW() ORDER BY page_published DESC";
    echo '<ul>';
    foreach (listData(false, false, pageNum(), $where) as $key => $data) {
        echo '<li><a href="/naujienos/' . $data['page_id'] . '">' . $data['page_name'] . '</a></li>';
    }
    echo '</ul>';
    pagination2(countData(false, false, $where), 10, 'naujienos/psl');
    return;
}
if ($pagerow) {
    echo '<h2>' . $pagerow['page_name'] . '</h2>';
    echo $pagerow['page_content'];
}
开发者ID:vsi-geros-valios-projektai,项目名称:pagalbadaiktais.lt,代码行数:24,代码来源:naujienos.php

示例12: filterDropDown

                    echo "<p class='debug'>{$field} updated from {$oldValue} to {$newValue}</p>";
                }
            }
        }
        break;
}
$fields = "InventoryDescription, InventoryTypeID,\tPurchasePrice,\tPurchaseLocation,\tInventoryLocationID,\tInventoryOwnerID, Picture1Location, Picture2Location,\tDateSold, InventoryConditionID, UPC, CustomID";
function filterDropDown()
{
    dropdownFields($fields, "Filter By", "filterBy", $filterBy);
}
function orderDropDown()
{
    dropdownFields($fields, "Order By", "orderBy", $orderBy);
}
listData($listQuery);
function listData($listQuery)
{
    if (!($result = mysql_query($listQuery))) {
        echo "<p class='error'>Could not find inventory listing " . mysql_error() . "</p>";
    } else {
        echo "<h2>Inventory</h2>";
        orderDropDown();
        filterDropDown();
        $data = mysql_query($listQuery, $database);
        echo "<form><table class='displayData'>";
        // printing table rows
        echo "<tr><th>&nbsp;</th><th>ID</th>";
        foreach ($fields as $field) {
            echo "<th>{$field}</th>";
        }
开发者ID:katiesenger,项目名称:DSHome,代码行数:31,代码来源:inventory.php

示例13: array

}
$stokojantys = array();
$ops = listData('needy', "deleted = 0 {$parent} ORDER BY user_lname");
foreach ($ops as $op) {
    $stokojantys[$op[0]] = $op['user_lname'] . ' ' . $op['user_fname'] . ' ' . $op['user_orgname'];
}
$options['fields']['need_needy'] = array('Stokojantis', 'inputtype' => 'drop', 'drops' => $stokojantys, 'required' => true);
$kats = array();
$ops = listData('cats', 'cat_type = ' . $need_cat_type . ' AND deleted = 0 AND cat_level = 0');
foreach ($ops as $op) {
    $kats[$op[0]] = $op['cat_name'];
}
$options['fields']['need_cat'] = array('Kategorija', 'inputtype' => 'drop', 'drops' => $kats, 'required' => true);
if ($usermeta['need_type'] == 2) {
    $subkats = array();
    $ops = listData('cats', 'cat_type = ' . $need_cat_type . ' AND deleted = 0 AND cat_level = 1 AND cat_parent = ' . $usermeta['need_subcat']);
    foreach ($ops as $op) {
        $subkats[$op[0]] = $op['cat_name'];
    }
    $options['fields']['need_subcat'] = array('Subkategorija', 'inputtype' => 'drop', 'drops' => $subkats, 'required' => true);
}
$options['fields']['need_name'] = array('Pavadinimas', 'required' => true);
$options['fields']['need_desc'] = array('Aprašymas', 'inputtype' => 'textarea', 'required' => true);
$options['fields']['need_expires'] = array('Galiojimo laikas', 'required' => true);
updateUsermeta($options, $us, 'needs', 'need_id');
echo '<br><hr><br>';
$options = array();
$options['fields']['need_full'] = array('Poreikis patenkintas', 'inputtype' => 'drop', 'drops' => array('Ne', 'Taip'));
updateUsermeta($options, $us, 'needs', 'need_id');
if ($usermeta['need_full'] == 1) {
    echo '<br><hr><br>';
开发者ID:vsi-geros-valios-projektai,项目名称:admin.pagalbadaiktais.lt,代码行数:31,代码来源:editthing.php

示例14: getCatChildren

function getCatChildren($parent)
{
    $children = array();
    $ops = listData('cats', 'deleted = 0 AND cat_level = 1 AND cat_parent = ' . $parent);
    foreach ($ops as $op) {
        $children[$op[0]] = $op['cat_name'];
    }
    return $children;
}
开发者ID:vsi-geros-valios-projektai,项目名称:admin.pagalbadaiktais.lt,代码行数:9,代码来源:functions.php

示例15: listData

					        	<select class="form-control" name="pro_cat">
					        	<option>Select category</option>
					        	';
    listData(category, cat_name, cat_id);
    echo '
								</select>
					      	</div>
					    </div>

					    <div class="form-group">
					      	<label class="control-label col-sm-2">Brand:</label>
					      	<div class="col-sm-8">
					        	<select class="form-control" name="pro_brand" required>
					        	<option>Select brand</option>
					        	';
    listData(brands, brand_name, brand_id);
    echo '
								</select>
					      	</div>
					    </div>

					    <div class="form-group">
						        <label class="control-label col-sm-2">Price (with tax):</label>
						        <div class="col-sm-8">
						            <input type="number" class="form-control" min="0" step="1" name="pro_price" required>
						        </div>
				    	</div>

					    <div class="form-group">
					    	<label class="control-label col-sm-2">Picture:</label>
					      	<div class="col-sm-8">
开发者ID:Toesmash,项目名称:git-techpoint,代码行数:31,代码来源:add.php


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