function prod_type($fatherid = 0, $selid = 0, $layer = 0, $type) { $str = ""; global $db; $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "crm_pord_type where father='{$fatherid}' ORDER BY id Asc"); if (count($query) > 0) { for ($i = 0; $i < $layer; $i++) { $str .= "├"; } while ($row = $db->fetch_array($query)) { $selstr = $row['id'] == $selid ? 'selected="selected"' : ''; $htmlstr = '<option value="' . $row['id'] . '" ' . $selstr . '>' . $str . $row['title'] . '</option>'; echo $htmlstr; prod_type($row['id'], $selid, $layer + 1, $type); } } return; }
?> </td> <td class="TableData" width="35%"><input name="title" type="text" class="BigInput" id="title" style="width: 300px;" maxlength="100" /> </td> </tr> <tr> <td nowrap class="TableContent">产品价格:</td> <td class="TableData"><input name="price" type="text" class="BigInput" id="price" size="40" style="width: 100px;" onKeyUp="value=value.replace(/[^0-9^.]/g,'');" />/元 非中文,如填写格式"2.68"</td> <td class="TableContent">产品分类:<?php get_helps(); ?> </td> <td class="TableData"><select class="SelectStyle" name="type"> <option value="" >请选择分类</option> <?php prod_type(0, 0, 0, 0); ?> </select> </td> </tr> </table> <?php //引入表单 form_add('产品信息', 'crm_product'); //引入编辑器 form_add_eweb('crm_product'); ?> </div> </form>
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="x-ua-compatible" content="ie=7" /> <link href="template/default/tree/images/admincp.css?SES" rel="stylesheet" type="text/css" /> </head> <body> <script src="template/default/tree/js/common.js?SES" type="text/javascript"></script> <script src="template/default/tree/js/admincp.js?SES" type="text/javascript"></script> <div id="append_parent"></div> <div class="container" id="cpcontainer"><div class="itemtitle"><h3>产品类别设置</h3></div> <table class="tb tb2 " id="tips"> <tr><th class="partition"><a href="javascript:;" onclick="show_all()">全部展开</a> | <a href="javascript:;" onclick="hide_all()">全部折叠</a> </th></tr></table> <script type="text/JavaScript"> var forumselect = '<?php echo prod_type(0, 0, 0, $type); ?> '; var rowtypedata = [ [[1, ''], [1,'', 'td25'], [5, '<div><input name="newname[]" value="顶级产品类别名称" style="width:160px;" size="30" type="text" class="txt" /><input type="hidden" name="newid[]" value="1" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)">删除</a></div>']], [[1, ''], [1,'', 'td25'], [5, '<div class="board"><input name="newname[]" style="width:160px;" value="产品类别名称" size="30" type="text" class="txt" /><input type="hidden" name="newids[]" value="2" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)">删除</a><select name="newinherited[]"><option value="">指定上级类别</option>' + forumselect + '</select></div>']], [[1, ''], [1,'', 'td25'], [5, '<div class="board"><input name="newname[]" style="width:160px;" value="产品类别名称" size="30" type="text" class="txt" /><input type="hidden" name="newids[]" value="2" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)">删除</a><select name="newinherited[]"><option value="">指定上级类别</option>' + forumselect + '</select></div>']], ]; </script> <form name="cpform" method="post" autocomplete="off" action="admin.php?ac=<?php echo $ac; ?> &fileurl=<?php echo $fileurl; ?> &do=class&type=<?php
?> " name="title" class="ui-input search-keyword" id="J-keyword"> </div> <label class="ui-form-label" for="keyword">产品价格:</label> <div id="J-keyword-type-select" class="ui-form-select-shell"> <input type="text" value="<?php echo urldecode($price); ?> " name="price" class="ui-input search-keyword" id="J-keyword"> </div> <label class="ui-form-label" for="keyword">产品分类:</label> <div id="J-keyword-type-select" class="ui-form-select-shell"> <select class="SelectStyle" style="height:25px;" name="type"> <option value="" >请选择分类</option> <?php echo prod_type(0, $type, 0, 0); ?> </select> </div> </div> <div class="ui-form-item fn-left" id="J-keyword-type-outer" style="width:100%;"> <?php $numsss = 0; foreach ($companylist as $row) { $numsss++; ?> <input type="hidden" name="kinputname[]" value="<?php echo $row["inputname"]; ?>
</td> </tr> <tr> <td nowrap class="TableContent">产品价格:</td> <td class="TableData"><input name="price" type="text" class="BigInput" id="price" size="40" style="width: 100px;" onKeyUp="value=value.replace(/[^0-9^.]/g,'');" value="<?php echo $view['price']; ?> " />/元 非中文,如填写格式"2.68"</td> <td class="TableContent">产品分类:<?php get_helps(); ?> </td> <td class="TableData"><select class="SelectStyle" name="type"> <option value="" >请选择分类</option> <?php prod_type(0, $view['type'], 0, 0); ?> </select> </td> </tr> </table> <?php //引入表单 form_edit('产品信息', 'crm_product', $view['id']); //引入编辑器 form_edit_eweb('crm_product', $view['id']); ?> </div> </form>