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


PHP odd_even函数代码示例

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


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

示例1: usort

usort($elts, "elt_cmp");
$score_limit = $elts[0]->score - 1;
$similar_tids = array();
$n = count($elts);
$rownum = 0;
$rows = "";
for ($i = 0; $i < $n; $i++) {
    $elt = $elts[$i];
    if ($elt->score < $score_limit) {
        break;
    }
    if ($elt->tid != $arg_tid) {
        $similar_tids[] = $elt->tid;
    }
    $rownum++;
    $o = odd_even($rownum);
    $rows .= "<tr {$o}>";
    $rows .= sprintf("<td>%s</td>", h($elt->posted));
    $t = sprintf("trans.php?tid=%d", $elt->tid);
    $rows .= sprintf("<td>%s</td>\n", mklink($elt->name2, $t));
    $t = sprintf("trans.php?tid=%d", $elt->tid);
    $rows .= sprintf("<td>%s</td>\n", mklink($elt->name, $t));
    $text = sprintf("%.2f", $elt->amount);
    $rows .= sprintf("<td class='num'>%s</td>\n", mklink($text, $t));
    $tag_name = @$tag_id_to_name[$elt->tag_id];
    $t = sprintf("tag.php?tag_id=%d", $elt->tag_id);
    $rows .= sprintf("<td>%s</td>", mklink($tag_name, $t));
    $rows .= "</tr>\n";
}
$body .= "<h2>Similar transactions</h2>\n";
if (count($splits) == 1 && count($similar_tids) > 0) {
开发者ID:pacew,项目名称:accts,代码行数:31,代码来源:trans.php

示例2: __

?>
</th>
      <th class="modify" width=50><?php 
echo __('Action');
?>
</th>
    </tr>
  </thead>
  <tbody>

<?php 
while ($offer = $offers->fetchObject()) {
    ?>

    <tr style="height:35px;" class="<?php 
    echo odd_even();
    ?>
">
      <td align=left>
      	<a href="<?php 
    echo get_url('offer/view/' . $offer->id);
    ?>
">
      		<?php 
    echo $offer->title;
    ?>

      	</a>
      </td>
      <td>
      	<input type=hidden name="offer_id[]" value="<?php 
开发者ID:sindotnet,项目名称:hotelyan,代码行数:31,代码来源:index.php

示例3: foreach

">
                        <tbody>
                            <?php 
$i = 0;
?>
                            <?php 
if (isset($key_headers)) {
    ?>
                                <?php 
    foreach ($key_headers as $key => $val) {
        ?>
                                    <tr id="<?php 
        __e($key);
        ?>
" class="<?php 
        odd_even(++$i);
        ?>
">
                                        <th><?php 
        __e($val);
        ?>
</th>
                                        <td class="center" id="<?php 
        __e($object . '-' . $i . '-' . $key);
        ?>
"><?php 
        __ed($key, $object_data);
        ?>
</td>
                                    </tr>
                                <?php 
开发者ID:redox007,项目名称:SI_Framework,代码行数:31,代码来源:register-template.php

示例4: foreach

 <img src="<?php 
echo PLUGINS_URI;
?>
dashboard/img/sort.png" /></th>
            </tr>
        </thead>
        <tbody>
            <?php 
$entrynum = 0;
?>
            <?php 
foreach ($log_entries as $entry) {
    ?>
 
                <tr class="<?php 
    print odd_even();
    ?>
">
                    <td class="hidden"><?php 
    echo $entrynum;
    ?>
</td>
                    <td class="priority"><img src="<?php 
    echo PLUGINS_URI;
    ?>
dashboard/img/<?php 
    print $entry->priority('string');
    ?>
.png" title="<?php 
    print $entry->priority('string');
    ?>
开发者ID:blr21560,项目名称:dashboard,代码行数:31,代码来源:index.php

示例5: odd_even

<?php

function odd_even($param)
{
    $count = count($param);
    $sum = 0;
    for ($i = 0; $i < $count; $i++) {
        $sum += $param[$i];
    }
    if ($sum % 2 === 0) {
        echo "Even";
    } else {
        echo "ODD";
    }
}
//function arr_gen($el){
//	for ($j=0; $j < $el ; $j++) {
//		$arr[$j] =rand(1,20);
//	}
//	return $arr;
//		var_dump($arr)
//}
$arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
odd_even($arr);
开发者ID:s4ylerr,项目名称:test2,代码行数:24,代码来源:task02.php

示例6: even_odd

function even_odd()
{
    return odd_even();
}
开发者ID:chaobj001,项目名称:tt,代码行数:4,代码来源:Framework.php

示例7: __

  <thead>
    <tr>
      <th class="name"><a href="<?php echo $baseURL;?>&order=name"><?php echo __('Name'); ?></a></th>
      <th class="id"><a href="<?php echo $baseURL;?>&order=id"><?php echo __('ID');?></a></th>
      <th class="dcount"><a href="<?php echo $baseURL;?>&order=downloads"><?php echo __('Downloads'); ?></a></th>
      <th class="created"><a href="<?php echo $baseURL;?>&order=created"><?php echo __('Created'); ?></a></th>
      <th class="expires"><a href="<?php echo $baseURL;?>&order=expires"><?php echo __('Expires'); ?></a></th>
      <th class="action" style="width:56px;"><?php echo __('Action');?></th>
    </tr>
  </thead>
  <tbody>
<?php
foreach ($downloads as $download) {
	$name = htmlspecialchars($download->name);
?>
	<tr class="<?php echo odd_even(); ?>">
		<td><a href="<?php echo get_url('plugin/downloads/edit/'.$download->id); ?>"><?php echo $name;?></a></td>
		<td><code><?php echo $download->id;?></code></td>
		<td><code><?php echo $download->downloads; ?></code></td>
		<td><code><?php echo date('m/d/Y',strtotime($download->created)); ?></code></td>
		<td><code><?php echo !empty($download->expires) ? date('m/d/Y',strtotime($download->expires)) : 'never'; ?></code></td>
		<td>
			<?php echo "<a href=\"/download-file/{$download->id}/{$download->filename}\" target=\"_blank\" title=\"{$download->filename}\"><img src=\"".PLUGINS_URI."/downloads/images/icon-open.png\" alt=\"view icon\" title=\"View\"></a>"; ?>
			<a class="edit-link" name="<?php echo $name;?>" href="<?php echo get_url('plugin/downloads/edit/'.$download->id); ?>"><img src="<?php echo PLUGINS_URI;?>/downloads/images/icon-edit.png" alt="edit icon" title="Edit <?php echo $name;?>" /></a>
			<a class="delete-link" name="<?php echo $name;?>" href="<?php echo get_url('plugin/downloads/delete/'.$download->id); ?>"><img src="<?php echo PLUGINS_URI;?>/downloads/images/icon-trash.png" alt="delete file icon" title="Delete <?php echo $name;?>" /></a>
		</td>
	</tr>
<?php
}
?>
</tbody>
开发者ID:realslacker,项目名称:Downloads-Plugin,代码行数:31,代码来源:index.php

示例8: foreach

      <th class="name"><?=__('Name'); ?></th>
      <th class="dimensions"><?=__('Dimensions'); ?></th>
      <th class="dcount"><?=__('Displays'); ?></th>
      <th class="dcount"><?=__('Clicks'); ?></th>
      <th class="ctr"><?=__('CTR');?></th>
      <th class="created"><?=__('Created'); ?></th>
      <th class="expires"><?=__('Expires'); ?></th>
      <th class="action" style="width:50px;"><?=__('Action');?></th>
    </tr>
  </thead>
  <tbody>
<?php
foreach ($banners as $banner):
	$name = htmlspecialchars($banner->name);
?>
	<tr class="<?=odd_even(); ?>">
		<td><a href="<?=get_url('plugin/banner/banner_edit/'.$banner->id); ?>"><?=$banner->name; ?></a></td>
		<td><code><?="{$banner->width}x{$banner->height}"; ?></code></td>
		<td><code><?=$banner->dcount; ?></code></td>
		<td><code><?=$banner->ccount; ?></code></td>
		<td><code><?=round(($banner->ccount/$banner->dcount)*100,1);?>%</code></td>
		<td><code><?=$banner->created; ?></code></td>
		<td><code><?=$banner->expires; ?></code></td>
		<td>
			<a class="edit-link" name="<?=$name;?>" href="<?=get_url('plugin/banner/banner_edit/'.$banner->id); ?>"><img src="/wolf/admin/images/icon-rename.gif" alt="edit icon" title="Edit Banner"></a>
			<a class="delete-link" name="<?=$name;?>" href="<?=get_url('plugin/banner/banner_delete/'.$banner->id); ?>"><img src="/wolf/admin/images/icon-remove.gif" alt="delete file icon" title="Delete Banner"></a>
		</td>
	</tr>
<?php endforeach; ?>
</tbody>
</table>
开发者ID:realslacker,项目名称:Banner-Plugin,代码行数:31,代码来源:index.php

示例9: foreach

?>
                </tr>
            </thead>   
            <tbody>
                <?php 
if (isset($list) && !empty($list)) {
    ?>
                    <?php 
    foreach ($list as $k => $list_item) {
        $id = isset($list_item['id']) ? $list_item['id'] : $k;
        ?>
                        <tr id="<?php 
        __e("list-{$object}-{$id}");
        ?>
" class="<?php 
        odd_even($k + 1);
        ?>
 ">
                            <?php 
        foreach ($list_headers as $key => $val) {
            ?>
                                <td class="center" id="<?php 
            __e($object . '-' . $id . '-' . $key);
            ?>
"><?php 
            __ed($key, $list_item);
            ?>
</td>
                            <?php 
        }
        ?>
开发者ID:redox007,项目名称:SI_Framework,代码行数:31,代码来源:list-template.php

示例10: dashboard_events_widget_render

function dashboard_events_widget_render()
{
    global $dashboardEvents;
    if (get_request_method() == "POST") {
        if (isset($_POST["dashboard_events"]) && $_POST["dashboard_events"] == "clear_all") {
            $dashboardEvents->clear();
            redirect(get_url("plugin/dashboard/"));
            die;
        }
    }
    $log_entries = Record::findAllFrom("DashboardLogEntry", "created_on=created_on ORDER BY created_on DESC");
    $path = WOLF_PATH_WIDGETS . "events/";
    ?>
			<form method="post" action="">
				<table class="dashboardTable" cellpadding="0" cellspacing="0" border="0">
					<thead>
						<tr>
							<th colspan="2"></th>
							<th><?php 
    echo __("Event");
    ?>
</th>
							<th class="moment"><?php 
    echo __("Time");
    ?>
 <img src="<?php 
    echo $path;
    ?>
img/sort.png" /></th>
						</tr>
					</thead>
					
					<tbody>
						<?php 
    $entrynum = 0;
    foreach ($log_entries as $entry) {
        ?>
									<tr class="<?php 
        echo odd_even();
        ?>
">
										<td class="hidden"><?php 
        echo $entrynum;
        ?>
</td>
										<td class="priority">
											<img src="<?php 
        echo $path;
        ?>
img/<?php 
        echo $entry->priority("string");
        ?>
.png" title="<?php 
        echo $entry->priority("string");
        ?>
" />
										</td>
										<td class="dashboardMessage"><?php 
        echo $entry->message;
        ?>
</td>
										<td class="date">
											<a title="<?php 
        echo $entry->created_on;
        ?>
"><?php 
        echo DateDifference::getString(new DateTime($entry->created_on));
        ?>
</a>
										</td>
									</tr>
								<?php 
        $entrynum++;
    }
    ?>
          
					</tbody>
				</table>

				<p class="buttons">
					<input type="hidden" name="dashboard_events" value="clear_all" />
					<input type="submit" name="dashboard_action" value="<?php 
    echo __("Clear all");
    ?>
" class="button" />
				</p>
			</form>
		<?php 
}
开发者ID:pawedWolf,项目名称:wolfcms-dashboard,代码行数:89,代码来源:index.php

示例11: odd_even

<?php

/**
 * The template part for displaying results in search pages.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package brosco
 */
?>
<div class="<?php 
odd_even();
?>
">
<div class="container">
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
	<?php 
if (has_post_thumbnail()) {
    ?>
   <a href="<?php 
    the_permalink();
    ?>
" title="<?php 
    the_title_attribute();
    ?>
开发者ID:rymaga,项目名称:manpaper,代码行数:31,代码来源:content-search.php


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