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


PHP get_table_field函数代码示例

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


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

示例1: get_table_field

                                    echo $field["name"];
                                    ?>
">
                            <input type="hidden" name="<?php 
                                    echo $field["name"];
                                    ?>
" value="<?php 
                                    echo $data[$field['name']];
                                    ?>
"/>
                            <div class="upload-img-box">
                              <?php 
                                    if (isset($data[$field['name']])) {
                                        ?>
<div class="upload-pre-file"><span class="upload_icon_all"></span><?php 
                                        echo get_table_field($data[$field['name']], 'id', 'name', 'File');
                                        ?>
</div><?php 
                                    }
                                    ?>
                            </div>
                          </div>
                          <script type="text/javascript">
								//上传图片
							    /* 初始化上传插件 */
								$("#upload_file_<?php 
                                    echo $field["name"];
                                    ?>
").uploadify({
							        "height"          : 30,
							        "swf"             : "/weiphp2.0/Public/static/uploadify/uploadify.swf",
开发者ID:skylei,项目名称:sae_weiphp,代码行数:31,代码来源:451320da6214bf4f21b1f0216eaaa110.php

示例2: display


//.........这里部分代码省略.........
             //value是图片路径
             $sc_src = $value;
             $html = "<div class='popup-gallery'><a title=\"查看大图\" href=\"{$sc_src}\"><img src=\"{$sc_src}\"/ style=\"border-radius:100%;\"></a></div>";
         }
         return $html;
     });
     //doaction转换为html
     $this->convertKey('doaction', 'html', function ($value, $key, $item) {
         $actions = $key['opt']['actions'];
         $result = array();
         foreach ($actions as $action) {
             $getUrl = $action['get_url'];
             $linkText = $action['text'];
             $url = $getUrl($item);
             if (isset($action['opt'])) {
                 $content = array();
                 foreach ($action['opt'] as $key => $value) {
                     $value = htmlspecialchars($value);
                     $content[] = "{$key}=\"{$value}\"";
                 }
                 $content = implode(' ', $content);
                 if (isset($action['opt']['data-role']) && $action['opt']['data-role'] == "modal_popup") {
                     //模态弹窗
                     $result[] = "<a href=\" javascrapt:void(0);\" modal-url=\"{$url}\" " . $content . ">{$linkText}</a>";
                 } else {
                     $result[] = "<a href=\"{$url}\" " . $content . ">{$linkText}</a>";
                 }
             } else {
                 $result[] = "<a href=\"{$url}\">{$linkText}</a>";
             }
         }
         return implode(' ', $result);
     });
     //Join转换为html
     $this->convertKey('Join', 'html', function ($value, $key) {
         if ($value != 0) {
             $val = get_table_field($value, $key['opt']['mate'], $key['opt']['return'], $key['opt']['model']);
             if (!$key['opt']['url']) {
                 return $val;
             } else {
                 $urld = U($key['opt']['url'], array($key['opt']['return'] => $value));
                 return "<a href=\"{$urld}\">{$val}</a>";
             }
         } else {
             return '-';
         }
     });
     //status转换为html
     $setStatusUrl = $this->_setStatusUrl;
     $that =& $this;
     $this->convertKey('status', 'html', function ($value, $key, $item) use($setStatusUrl, $that) {
         //如果没有设置修改状态的URL,则直接返回文字
         $map = $key['opt'];
         $text = $map[$value];
         if (!$setStatusUrl) {
             return $text;
         }
         //返回带链接的文字
         $switchStatus = $value == 1 ? 0 : 1;
         $url = $that->addUrlParam($setStatusUrl, array('status' => $switchStatus, 'ids' => $item['id']));
         return "<a href=\"{$url}\" class=\"ajax-get\">{$text}</a>";
     });
     //如果html为空
     $this->convertKey('html', 'html', function ($value) {
         if ($value === '') {
             return '<span style="color:#bbb;">(空)</span>';
         }
         return $value;
     });
     //编译buttonList中的属性
     foreach ($this->_buttonList as &$button) {
         $button['tag'] = isset($button['attr']['href']) ? 'a' : 'button';
         $this->addDefaultCssClass($button);
         $button['attr'] = $this->compileHtmlAttr($button['attr']);
     }
     //生成翻页HTML代码
     C('VAR_PAGE', 'page');
     $pager = new \Think\Page($this->_pagination['totalCount'], $this->_pagination['listRows'], $_REQUEST);
     $pager->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
     $paginationHtml = $pager->show();
     //显示页面
     $this->assign('title', $this->_title);
     $this->assign('suggest', $this->_suggest);
     $this->assign('keyList', $this->_keyList);
     $this->assign('buttonList', $this->_buttonList);
     $this->assign('pagination', $paginationHtml);
     $this->assign('list', $this->_data);
     /*加入搜索 陈一枭*/
     $this->assign('searches', $this->_search);
     $this->assign('searchPostUrl', $this->_searchPostUrl);
     /*加入筛选select 郑钟良*/
     $this->assign('selects', $this->_select);
     $this->assign('selectPostUrl', $this->_selectPostUrl);
     //如果是选择返回数据的列表页就调用admin_solist模板文件,否则编译原有模板
     if ($solist) {
         parent::display('admin_solist');
     } else {
         parent::display('admin_list');
     }
 }
开发者ID:tmac1997,项目名称:DormitoryWebsite,代码行数:101,代码来源:AdminListBuilder.class.php

示例3: get_table_field

                    ?>
">
                                <input type="hidden" name="config[<?php 
                    echo $o_key;
                    ?>
]" value="<?php 
                    echo $form['value'];
                    ?>
"/>
                                <div class="upload-img-box">
                                  <?php 
                    if (isset($form["value"])) {
                        ?>
<div class="upload-pre-file"><span class="upload_icon_all"></span>
                                    <?php 
                        echo get_table_field($form['value'], 'id', 'name', 'File');
                        ?>
</div><?php 
                    }
                    ?>
                                </div>
                             
                          </div>
                          <script type="text/javascript">
								//上传图片
							    /* 初始化上传插件 */
								$("#upload_file_<?php 
                    echo $o_key;
                    ?>
").uploadify({
							        "height"          : 30,
开发者ID:KurtX,项目名称:weiphp3beta,代码行数:31,代码来源:cc8882575a2473af8ca684b4904c7d8e.php

示例4: search

 public function search($keyword)
 {
     if (!$keyword) {
         $this->error('输入要查询的内容');
     }
     $model_id = get_table_field('product', 'name', 'id', 'model');
     $map['model_id'] = $model_id;
     $map['title'] = array('like', '%' . $keyword . '%');
     $rs = D('Document')->where($map)->select();
     // 过滤非本站内容
     $cate_ids_array = $this->cate_ids['array'];
     foreach ($rs as $k => $v) {
         $category = $v['category_id'];
         if (!in_array($category, $cate_ids_array)) {
             unset($rs[$k]);
         }
     }
     // 搜索结果页SEO信息
     $seo = array('title' => $keyword . ' -- 搜索结果', 'keywords' => $keyword, 'description' => $keyword);
     S('SEO_ARTICLE', $seo);
     $this->assign('rs', $rs);
     $this->assign('keyword', $keyword);
     $this->display();
 }
开发者ID:slpi1,项目名称:onethink_multi_site,代码行数:24,代码来源:ArticleController.class.php

示例5: get_warnings

function get_warnings($symb, $pf_exch, $pf_working_date, $volume)
{
    // do a bunch of checks and return warning strings
    $warnings = '';
    // check that the volume and the moving average match
    $ma_10_diff = get_table_field('moving_averages', 'ma_10_diff', $symb, $pf_working_date, $pf_exch);
    if ($volume > 0 and $ma_10_diff < 0) {
        $warnings .= '<font color="red">Going long on a falling MA</font><br>';
    } elseif ($volume < 0 and $ma_10_diff > 0) {
        $warnings .= '<font color="red">Going short on a rising MA</font><br>';
    }
    return $warnings;
}
开发者ID:kombat003,项目名称:trader-dss,代码行数:13,代码来源:trader-functions.php


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