jbox弹框交互

html代码:

<div class="right">
        <div class="table-operate ue-clear">
            <a href="javascript:CallJbox('<?php echo "/company/companycertdetailinfo/create/" . (isset($keyId) ? $keyId : ""); ?>','添加企业资质资格',800,300)"
               class="add">添加</a>
        </div>
    </div>
    <div class="table-box">
        <table>
            <thead>
            <tr>
                <th class="name">资质资格类型</th>
                <th class="name">证书编号</th>
                <th class="name">资质资格等级</th>
                <th class="operate">操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if (isset($certdetails)):foreach ($certdetails as $person): ?>
                <tr>
                    <td class="name"><?php echo isset($person["certtypename"]) ? $person["certtypename"] : ""; ?></td>
                    <td class="name"><?php echo isset($person["certid"]) ? $person["certid"] : ""; ?></td>
                    <td class="name"><?php echo isset($person["titlelevelname"]) ? $person["titlelevelname"] : ""; ?></td>
                    <td class="operate"><a
                            href="javascript:CallJbox('<?php echo "/" . $url_module . "/companycertdetailinfo/edit/" . $person["id"]; ?>','企业资质资格详细信息',800,300)">编辑</a>
                        <a href="javascript:deletedata('<?php echo "/" . $url_module . "/companycertdetailinfo/delete/" . $person["id"]; ?>')">删除</a>
                    </td>
                </tr>
            <?php endforeach;endif; ?>
            </tbody>
        </table>
    </div>
    <div class="title">
        <h2>企业资质证书信息</h2>
    </div>
    <div class="right">
        <div class="table-operate ue-clear">
            <a href="javascript:CallJbox('<?php echo "/company/companycertinfo/create/" . (isset($keyId) ? $keyId : ""); ?>','添加企业资质证书',800,300)"
               class="add">添加</a>
        </div>
    </div>

js代码

//弹窗显示界面
function CallJbox(url, title, width, height) {
    $.jBox("iframe:" + url, {
        title: title,
        width: width,
        height: height,
        iframeScrolling: 'no',
        buttons: {}
    });
}

function deletedata(url) {
    if (confirm("确认是否删除?")) {
        $.ajax({
            type: "Post",
            url: url,
            data: {},
            success: function (res) {
                var r = $.parseJSON(res);
                if (r.ret == 0) {
                    alert("删除成功!");
                    window.location.reload();
                } else {
                    alert(r.msg);
                }
            }
        });
    }
}

php代码

//get companycertinfos
            $sql = "select cci.id,dat.qualificationtype as typename,cci.certid,cci.techman
                    from companycertinfos cci
                    left join dictaptitudekinds dat on (dat.code=cci.certtypenum)
                    where cci.companyid=" . $keyid;
            $query = $this->mydb->find($sql);
            $data["certinfos"] = $query["obj"];

           

posted on 2015-07-10 16:39  勤奋者努力着  阅读(99)  评论(0编辑  收藏  举报

导航