poscms dr_field_options_id函数的使用

{template "header.html", "/"}
    <script type="text/javascript" src="{HOME_THEME_PATH}js/lyz.calendar.min.js"></script>
    <link href="{HOME_THEME_PATH}css/lyz.calendar.css" rel="stylesheet">
    <link href="{HOME_THEME_PATH}css/hpxq.css" rel="stylesheet">
    <link rel="stylesheet" href="{HOME_THEME_PATH}css/jedate.css" />
    <link rel="stylesheet" href="{THEME_PATH}js/ui-dialog.css">
 <script type="text/javascript"t src="{THEME_PATH}js/dialog-plus.js"></script>
 <script type="text/javascript" src="{THEME_PATH}js/jquery.artDialog.js?skin=default"></script>
 <script type="text/javascript" src="{THEME_PATH}js/validate.js"></script>
 <script type="text/javascript" src="{THEME_PATH}js/admin.js"></script>
 <script type="text/javascript" src="{THEME_PATH}js/dayrui.js"></script>
 
 <script type="text/javascript" src="{HOME_THEME_PATH}js/layer.js"></script>
 <script src="{HOME_THEME_PATH}js/jquery.jedate.min.js" type="text/javascript" charset="utf-8"></script>
 <!--<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">-->
 <!--<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>-->
 <!--<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>-->
 
 <script type="text/javascript" charset="utf-8">
     {if !$member}
     window.location.href="/?s=member&c=login";
     {/if}
 </script>
{template "nav.html", "/"}
    </div>
    <div class="neirong">
        <div class="main1">
            <div class="left">
                <div class="title">
                    货盘详情
                </div>
                <table>
                    {php $from=explode("-",$havenf);}
                    {php $to=explode("-",$havent);}
                    {php $user=dr_member_info($uid);}
                    {if $member.uid==$uid}
                        {php $true=1;}
                    {else}
                        {list action=table table=1_transorder panid=$id uid=$member.uid}
                        {if $t}{php $true=1;}{/if}
                        {/list}
                    {/if}
                    <tr>
                        <th class="th1"><p>货主</p></th><th class="th2">{if $true}{$contact}{else}{mb_substr($contact,0,1)}**{/if}</th>
                        <th class="th1"><p>手机号码</p></th><th class="th2">{php $sphone = substr($phone,0,3).'****'.substr($phone,7);}
                        {$true?$phone:$sphone}
                        </th>
                        
                        <th class="th1"><p>用户信誉</p></th><th class="th2">良好</th>
                    </tr>
                    
                    <tr><th class="th1"><p>货物名称</p></th><th class="th2">{$title}</th><th class="th1"><p>货物类型</p></th><th class="th2">{$goodstype}</th><th class="th1"><p>货物重量</p></th><th class="th2">{$cyl}吨</th></tr>
                    
                    
                    <tr><th class="th1"><p>发货港</p></th>
                    <th class="th2">{php $havenf = explode('-', $havenf);}{$havenf[0]}-{$havenf[1]}<br>{$havenf[2]}-{$havenf[3]}</th>
                    <th class="th1"><p>卸货港</p></th>
                    <th class="th2">{php $havent = explode('-', $havent);}{$havent[0]}-{$havent[1]}<br>{$havent[2]}-{$havent[3]}</th>
                    
                    <th class="th1"><p>出价</p></th>
                    
                    <th class="th2">{$expectprice}</th>
                    <tr>
                        <th class="th1"><p>装载日期</p></th>
                        <th class="th2">{php echo explode(" ",$starttime)[0];}</th>
                        <th class="th1"><p>截至日期</p></th>
                        <th class="th2">{php echo explode(" ",$you)[0];}</th>
                        <th class="th1"><p></p></th>
                        <th class="th2"></th>
                    </tr>
                    <tr><th class="th1 te"><p>备注</p></th><th colspan="5" class="th2">{$description}</th></tr>
                </table>
                <div class="fankui">
                    <span>如果发现以上信息不实,请立即向我们反馈。</span>
                    <a href="javascript:feedback();">我要反馈</a>
                </div>
                
                <script type="text/javascript" charset="utf-8">
                    function feedback(){
                        {if !$member}
                            dr_tips('<font color=red>请先登录!</font>', 3);
                            return;
                        {/if}
                        window.location.href="/index.php?c=form_feedback&type=goods&user={$contact}";
                    }
                </script>
                {if $member['identity']=="shipmaster" && !$true}
                <div class="title" >
                    我要接单
                </div>
                <form  method="post" id="order">
                    <input type="hidden" name="data[panid]" id="" value="{$id}" />
                    <input type="hidden" name="data[type]" id="" value="goods" />
                    <input type="hidden" name="data[publishuid]" id="" value="{$uid}" />
                    <div class="lianxi">
                        <span>*</span><span>联系人:</span><input name="data[contact]" type="text" required="required" value="{$member.username}">
                    </div>
                    <div class="phone">
                        <span>*</span><span>联系电话:</span><input name="data[phone]" type="text" value="{$member[phone]}" required="required">
                    </div>
                    <div class="yuncheng">
                        <span class="xing">*</span><span>实际承运量:</span><div class="kuang"><input id="load" onchange="compute()" name="data[trueload]" type="text" value="" required="required"><span style="color: #666666">吨</span></div>
                    </div>
                    <div class="baojia">
                        <span class="xing"></span><span>报价:</span><div class="kuang"><input onchange="compute()" id="price" name="data[price]" type="text" value="" required="required"><span style="color: #666666">元/吨</span></div>
                    </div>
                    <div class="zongjia">
                        <span>总价(RMB):</span><span><input id="total" style="height:36px;border:1px solid #dcdcdc;border-radius:5px;padding-left:10px;width:150px;" type="text" name="data[orderprice]"  value="0" readonly="readonly" /></span>
                    </div>
                    <div class="beizhu">
                        <span>备注:</span><div class="kuang"><textarea name="data[description]" required="required">联系我时,请说明是重运满舱看到的信息。</textarea></div>
                    </div>
                    <div class="fankui jiedan">
                        <span>接单后显示货主联系电话!</span>
                        <a href="javascript:takeorder();" >立即接单</a>
                    </div>
                </form>
                {else if $member['identity']=="goodsowner"}
                <div class="alert alert-warning" role="alert">您不是船主,不能接单</div>
                {/if}
            </div>
            
            <!--下单弹出用户信息-->
            <!--<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">-->
            <!-- 开始演示模态框-->
            <!--</button>-->
             <!--模态框(Modal) -->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="abs">
             <div class="modal-dialog">
              <div class="modal-content">
               <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" 
                  aria-hidden="true">×
                </button>
                <h4 class="modal-title" id="myModalLabel">
                 恭喜您,下单成功!
                </h4>
               </div>
               <div class="modal-body">
                   货主姓名:{$contact}</br>
                联系方式:{$phone}</br>
                要谨记哦~
               </div>
               <div class="modal-footer">
                <button type="button" class="btn btn-default" 
                  data-dismiss="modal">关闭
                </button>
                <!--<button type="button" class="btn btn-primary">-->
                <!-- 提交更改-->
                <!--</button>-->
               </div>
              </div>
             </div>
            </div>
            
            <div class="right">
                <div class="sousuo">
                    <div class="top">
                        <span>货盘搜索</span><img src="{HOME_THEME_PATH}images/web/hplb-09.png">
                    </div>
                    <div class="bottom">
                        <form>
                            <div class="fenlei"><span>货物类型:</span>
                            <select id="goodstype">
                             {php $field = dr_field_options_id(790);} 
                            
                              {loop $field $name $value}
                                 <option value="{$name}">{$value}</option>
                                 {/loop}
                            
                            </select>
                            </div>
                            <div class="chengyun">
                                <span>承&nbsp;&nbsp;运&nbsp;&nbsp;量&nbsp;:</span>
                                <div class="dun"><input class="cylf" type="text"><span style="color:grey">吨</span></div>
                                <span>至</span>
                                <div class="dun"><input class="cylt" type="text"><span style="color: grey">吨</span></div>
                            </div>
                            <div class="gangkou gangkou1">
                                <span>发&nbsp;&nbsp;货&nbsp;&nbsp;港:</span><input class="from" type="text">
                            </div>
                            <div class="gangkou">
                                <span>卸&nbsp;&nbsp;货&nbsp;&nbsp;港:</span><input class="to" type="text">
                            </div>
                            <div class="date">
                                <span>装载日期:</span><div style="margin-left:21px" class="dun"><input type="text" id="txtBeginDate"></div>
                                <span>至</span><div style="margin-left:5px"  class="dun"><input type="text" id="txtEndDate"></div>
                            </div>
                            <div class="hw_name">
                                <a class="chaxun" href="javascript:search();">查询</a>
                            </div>
                        </form>
                        <script type="text/javascript" charset="utf-8">
                        function search(){
                            var goodstype = $("#goodstype").val();
                            var cylf = $(".cylf").val()?$(".cylf").val():0;
                            var cylt = $(".cylt").val()?$(".cylt").val():9999999999;
                            var from = $(".from").val()?$(".from").val():"";
                            var to = $(".to").val()?$(".to").val():"";
                            var starttimef = $("#txtBeginDate").val()?parseInt(new Date($("#txtBeginDate").val()).getTime())/1000:0;
                            var starttimet = $("#txtEndDate").val()?parseInt(new Date($("#txtEndDate").val()).getTime())/1000:9999999999;
                            window.location.href = "/index.php?s=goodsplate&c=category&id=2"+"&goodstype="+goodstype+"&cylf="+cylf+"&cylt="+cylt+"&from="+from+"&to="+to+"&starttimef="+starttimef+"&starttimet="+starttimet;
                        };
                        </script>
                    </div>
                </div>
                <div class="fabu">
                    <div class="top">
                        <span>最新发布货盘</span><a href="/index.php?s=goodsplate&c=category&id=2">查看所有></a>
                    </div>
                    <div class="bottom">
                        <ul>
                            {list action=module module=goodsplate order=inputtime cache=0 num=13}
                            <li>
                                {php $from=explode("-",$t.havenf);}
                                {php $to=explode("-",$t.havent)}
                                <a href="{$t.url}">
                                    <span><img src="{HOME_THEME_PATH}images/web/cp-1.png" class="qi"></span><span style="width: 110px; display: inline-block;">{$from[1]}-{$from[3]}</span>
                                    <img src="{HOME_THEME_PATH}images/web/cp-2.png" class="zhong"></span><span style="width:110px; display: inline-block">{$to[1]}-{$to[3]}</span>
                                    <span class="riqi">{$t.inputtime}</span>
                                 </a>
                            </li>
                            {/list}
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
<script>
    $(function () {
        $("#txtBeginDate1").calendar({
            controlId: "divDate",                                 // 弹出的日期控件ID,默认: $(this).attr("id") + "Calendar"
            speed: 200,                                           // 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如:1000),默认:200
            complement: true,                                     // 是否显示日期或年空白处的前后月的补充,默认:true
            readonly: true,                                       // 目标对象是否设为只读,默认:true
            //upperLimit: new Date(),                               // 日期上限,默认:NaN(不限制)
            lowerLimit: new Date("2011/01/01"),                   // 日期下限,默认:NaN(不限制)
            callback: function () {                               // 点击选择日期后的回调函数
                //alert("您选择的日期是:" + $("#txtBeginDate").val());
            }
        });
        $("#txtEndDate1").calendar();
    });
    $.fn.serializeCheck = function() {  
                            var obj = {error:0,msg:""};
                            var a = this.serializeArray();
                            for (var i=0;i<a.length;i++){
                                if(a[i].value==""){
                                    obj.error = 0;
                                    obj.msg = "参数【"+a[i].name+"】缺失!";
                                    break;
                                }
                            }
                            obj.data = this.serialize();
                            return obj;
                        };
    function takeorder(){
        {if !$member}
            dr_tips('<font color=red>请先登录!</font>', 3);
            return;
        {/if}
        var res = $('#order').serializeCheck();
        if(res.error){
            dr_tips('<font color=red>请将表单填写完整!</font>', 3);
            return;
        }
        console.log(res);
        var data = $('#order').serialize();
        $.ajax({
   url:"/index.php?c=api&m=goodsorder",
   data:data,
   type:"post",
   dataType:"json",
   success:function(data){
       if(data.code){
           dr_tips('请输入正确的数字!');
       }else{
           //show();
           dr_tips('<font color=green>下单成功!</font>', 3);
           setTimeout(function() {window.location.reload(true);}, 1000);
       }
   },
   error:function(){
   }
  })
    };
    function compute(){
        var load = $("#load").val()?parseFloat($("#load").val()):0;
        var price = $("#price").val()?parseFloat($("#price").val()):0;
        var tatal=load*price;
        $("#total").val(tatal);
        // dr_tips('请输入正确的数字!');
    };
    function show(){ 
      layer.open({
        type: 2,
        title: '欢迎页',
        maxmin: true,
        area: ['800px', '500px'],
        content: 'http://layer.layui.com/test/welcome.html',
        end: function(){
          layer.tips('Hi', '#about', {tips: 1})
        }
      });
    };
</script>
<script>
    $(".hk").css("left",150)
         var hk
    $(".dhx").mouseenter(function(){
      hk = $(this).index();
      $(".hk").stop().animate({left:hk*150},300);
    }).mouseleave(function(){
      $(".hk").stop().animate({left:150},300);
    })
    </script>
     <script type="text/javascript">
         $("#txtBeginDate").jeDate({
             isinitVal: false,
             initAddVal: [1, "DD"],
             //festival: true,
             //ishmsVal: false,]
             isTime: true, //isClear:false,
             format: "YYYY-MM-DD",
             minDate: '2016-06-16 23:59:59'
         })
          $("#txtEndDate").jeDate({
             isinitVal: false,
             initAddVal: [1, "DD"],
             //festival: true,
             //ishmsVal: false,]
             isTime: true, //isClear:false,
             format: "YYYY-MM-DD",
             minDate: '2016-06-16 23:59:59'
         })
         
      </script>
{template "footer.html", "/"}
有帮助(- 没帮助(-