{#include file="sys/admin_header.htm"#}
<script src="{#$QISHI.site_dir#}data/cache_classify.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="js/tc.all.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
	$('input[id=lefile]').change(function() {
	   $('#uploadListVal').val($(this).val());
	});
	showmenulayer("#district_cn","#menu2","#district","#sdistrict",QS_city);
	showmenu("#email_cn","#menu3","#email");
	showmenu("#mobile_cn","#menu4","#mobile");
	//设置性别中文字段
	$("input[name='sex']").click(function(){$("#sex_cn").val($(this).attr("title"))	});
	// 语言要求
	selectYourLanguage("#language_box","#language", "#language_cn");
	function selectYourLanguage(showID, language, language_cn) {
		var language_val = $(language).val();
		if(language_val) {
			var language_array = language_val.split(","),
				che_array = $(showID + " :checkbox");
			$.each(che_array, function() {
				var liobj = $(this), che_data = liobj.val();
				for (var i = 0; i < language_array.length; i++) {
					if(che_data == language_array[i]) {
						liobj.attr('checked', !0);
					}
				};
			});
		}
		$(showID + " :checkbox").click(function() {
			var che_id = new Array();
			var che_cn = new Array();
			$(showID + " :checkbox[checked]").each(function(index,el) {
				che_id[index] = $(this).val();
				che_cn[index] = $(this).attr("title");
			})
			$(language).val(che_id.join(","));
			$(language_cn).val(che_cn.join(","));
		})
	}
	// 所属行业填充数据
  trade_filldata("#trad_list", QS_trade, "#determine", "#deselect", "#aui_outer", "#trade_result_show", "#trade", "#trade_cn");
  // 所属行业弹出框
  $("#trade_result_show").click(function() {
    popWin("aui_outer");
  });
  /*所属行业选择弹出层填充数据*/
  function trade_filldata(fillID, data_resources, determinebtn, deselectbtn, showID, resultshowID, resultID, resultCN) {
    var tradhtm = '';
    var sourse_length = parseInt(data_resources.length);
    var rows = 0;
    var subscriptnum = 0;
    if((sourse_length%3) == 0) {
      rows = sourse_length / 3;
    } else {
      rows = (sourse_length / 3) + 1;
    }
    for (var i = 0; i < rows; i++) {
      tradhtm += '<tr>';
      for (var j = 0; j < 3; j++) {
        if (data_resources[subscriptnum]) {
          var trad_array = data_resources[subscriptnum].split(",");
          tradhtm += '<td><label><input type="checkbox" data="'+trad_array[0]+','+trad_array[1]+'" name="item-list" class="input-checkbox">'+trad_array[1]+'</label></td>';
          subscriptnum ++;
        };
      };
      tradhtm += '</tr>';
    };
    $(fillID).html(tradhtm);
    // 恢复选中
    if ($(resultID).val().length > 0) {
      var idarray = $(resultID).val().split(",");
      $.each(idarray, function(index, val) {
        $(fillID+" :checkbox").unbind().each(function() {
          var boxdata_array = $(this).attr("data").split(",");
          if(val == boxdata_array[0]) {
            $(this).attr('checked',true);
          }
        });
      });
      copy_selected();
      isexceed($(fillID+" :checkbox[checked]").length);
    };
    // 单选
    $(fillID+" label :checkbox").unbind().on("click",function(event) {
      if ($(this).find(":checkbox").attr('checked')) {
        $(this).find(":checkbox").attr('checked',false);
        isexceed($(fillID+" :checkbox[checked]").length);
      } else {
        $(this).find(":checkbox").attr('checked',true);
        isexceed($(fillID+" :checkbox[checked]").length);
      }
    });
    /*判断选中的数量是否超出最大限制*/
    function isexceed(num) {
      if(num >= 1) {
        $(fillID+" :checkbox").each(function(index, el) {
          if (!$(this).attr('checked')) {
            $(this).attr('disabled',"disabled");
          }
        });
      } else {
        $(fillID+" :checkbox").each(function(index, el) {
          $(this).attr('disabled',false);
        });
      }
    }
    // 确定
    $(determinebtn).unbind().click(function() {
      copy_selected();
      close_dialog();
      searchHistory();
    });
    // 取消
    $(deselectbtn).unbind().click(function() {
      close_dialog();
    });
    // 弹出框关闭
    function close_dialog() {
      $("#maskLayer").remove();
      $(showID).hide();
    }
    // 复制选中 赋值
    function copy_selected() {
      var selectedhtm = "";
      var selectedid_array = new Array();
      var selectedcn_array = new Array();
      $(fillID+" :checkbox[checked]").unbind().each(function(index) {
        var data_array = $(this).attr("data").split(",");
        selectedhtm += '<span data-id="'+data_array[0]+'">'+data_array[1]+'<a class="close" style="top: 2px;"></a></span>';
        selectedid_array[index]=data_array[0];
        selectedcn_array[index]=data_array[1];
      });
      $(resultshowID + " .items").html(selectedhtm);
      var spanwidth = 0, itemswidth = $(resultshowID).width()-28, widtharray = new Array();
      if($(resultshowID + " .items span")) {
        $(resultshowID + " .items span").each(function(index) {
          spanwidth = spanwidth + $(this).outerWidth(true);
          widtharray[index] = $(this).outerWidth(true);
        })
      }
      var difwidth=spanwidth-itemswidth;
      if (widtharray.length == 2) {
        if(widtharray[0] + widtharray[1] > itemswidth) {
          setHeightCss(40);
        } else {
          setHeightCss(20);
        }
      } else if (widtharray.length == 3) {
        if(widtharray[0] + widtharray[1] + widtharray[2] > itemswidth) {
          if(widtharray[0] + widtharray[1] > itemswidth) {
            if(widtharray[1] + widtharray[2] > itemswidth) {
              setHeightCss(60);
            } else {
              setHeightCss(40);
            }
          } else {
            setHeightCss(40);
          }
        }
      } else {
        setHeightCss(20);
      }
      function setHeightCss (val) {
        $(resultshowID).css("height",val+"px");
        $(resultshowID + " .items").css("height",val+"px");
        $(resultshowID + " em").css("height",val+10+"px");
      }
      $(resultshowID + " span").unbind().click(function() {
        var dtid = $(this).attr("data-id");
        $(fillID+" :checkbox[checked]").unbind().each(function() {
          var dt_array = $(this).attr("data").split(",");
          if(dtid == dt_array[0]) {
            $(this).attr('checked',false);
          }
        });
        isexceed($(fillID+" :checkbox[checked]").length);
        copy_selected();
      });
      $(resultshowID).val(selectedcn_array.join(","));
      $(resultID).val(selectedid_array.join(","));
      $(resultCN).val(selectedcn_array.join(","));
    }
  }
});
</script>
<div class="admin_main_nr_dbox">
<div class="pagetit">
	<div class="ptit"> {#$pageheader#}</div>
  <div class="clear"></div>
</div>
<div class="toptit">修改list- <span style="color:#0066CC">{#$list.title#}</span> </div>
<form id="Form1" name="Form1" method="post" action="?act=editlist_save" enctype="multipart/form-data">
{#$inputtoken#}
  <table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF"  >
<tr>
          <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">所属会员：</td>
          <td bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">
{#$list.belong#}
		 </td>
      </tr>
		<tr>
          <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">
          	{#if $list.utype=='1'#}
          	所属企业：
          	{#else#}
          	所属猎头：
          	{#/if#}
          </td>
          <td bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed" class="link_lan">
            <a href="{#$list.belong_url#}" target="_blank">{#$list.belong_name#}</a>
			 </td>
        </tr>
		<tr>
          <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">上传时间：</td>
          <td bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed" class="link_lan">
          {#$list.addtime|date_format:"%Y-%m-%d"#}
			 </td>
        </tr>
		 <tr>
          <td width="110" height="30" align="right" bgcolor="#FFFFFF"  style=" border-bottom:1px #CCCCCC dashed">
          	<span style="color:#FF3300; font-weight:bold">*</span> list名称：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed"><input name="title" type="text" class="input_text_200" id="title" value="{#$list.title#}" maxlength="50" />
           </td>
        </tr>
        <tr>
    <td height="30" align="right"  style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold;">*</span>所属行业：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
      <div>
        <input type="text" id="trade_result_show" value="{#$list.trade_cn|default:"请选择所属行业"#} " readonly="readonly" name="trade_cn" id="trade_cn" class="input_text_200 input_text_selsect"/>
        <input name="trade" id="trade" type="hidden" value="{#$list.trade#}" />
        <input name="trade_cn" id="trade_cn" type="hidden" value="{#$list.trade_cn#}" />
      </div>
	 </td>
  </tr>
		<tr>
          <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span> 审核状态：</td>
          <td bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">
		   <label><input name="audit"  type="radio" value="1" {#if $list.audit eq "1"#}checked="checked"{#/if#} />审核通过</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		    <label><input name="audit"  type="radio" value="2" {#if $list.audit eq "2"#}checked="checked"{#/if#} />审核中</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		 
		   <label><input name="audit"  type="radio" value="3" {#if $list.audit eq "3"#}checked="checked"{#/if#} />审核未通过</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		 </td>
        </tr>
         <tr>
    <td height="30" align="right" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>手机：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
  <div>
    <input type="text" value="{#$list.mobile_cn|default:"请选择"#}"  readonly="readonly" name="mobile_cn" id="mobile_cn" class="input_text_200 input_text_selsect"/>
    <input name="mobile" id="mobile" type="hidden" value="{#$list.mobile#}" />
    <div id="menu4" class="menu">
      <ul>
      <li id="1" title="全部有">全部有</li>
      <li id="2" title="多数有">多数有</li>
      <li id="3" title="少数有">少数有</li>
      <li id="4" title="全部无">全部无</li>
      </ul>
    </div>
      </div>
   </td>
  </tr>
  <tr>
    <td height="30" align="right" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span>邮箱：</td>
    <td  style=" border-bottom:1px #CCCCCC dashed">
  <div>
    <input type="text" value="{#$list.email_cn|default:"请选择"#}"  readonly="readonly" name="email_cn" id="email_cn" class="input_text_200 input_text_selsect"/>
    <input name="email" id="email" type="hidden" value="{#$list.email#}" />
    <div id="menu3" class="menu">
      <ul>
      <li id="1" title="全部有">全部有</li>
      <li id="2" title="多数有">多数有</li>
      <li id="3" title="少数有">少数有</li>
      <li id="4" title="全部无">全部无</li>
      </ul>
    </div>
      </div>
   </td>
  </tr>
         <tr>
          <td width="110" height="30" align="right" bgcolor="#FFFFFF"  style=" border-bottom:1px #CCCCCC dashed">
          	<span style="color:#FF3300; font-weight:bold">*</span> 年份：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed"><input name="list_time" type="text" class="input_text_200" id="list_time" value="{#$list.list_time|date_format:"%Y"#}" maxlength="50" />
           </td>
        </tr>
        <tr>
          <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold;">*</span>下载次数：</td>
          <td bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">
	{#$list.down#}次 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="?act=check_detail&id={#$list.id#}">查看明细</a>
	</td>
        </tr>
         <tr>
          <td width="110" height="30" align="right" bgcolor="#FFFFFF"  style=" border-bottom:1px #CCCCCC dashed">
          	<span style="color:#FF3300; font-weight:bold">*</span> 价格：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed"><input name="price" type="text" class="input_text_200" id="price" value="{#$list.price#}" maxlength="50" />
           </td>
        </tr>
        <tr>
          <td width="110" height="30" align="right" bgcolor="#FFFFFF"  style=" border-bottom:1px #CCCCCC dashed">
          	 当前文件：</td>
          <td  style=" border-bottom:1px #CCCCCC dashed">
          	<input width="200" value="{#$list.file#}" name="" id="uploadListVal" datatype="*" sucmsg="&nbsp;" nullmsg="" errormsg="">
          	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          	<a href="{#$QISHI.site_domain#}{#$QISHI.site_dir#}data/list/{#$list.file#}">下载</a>
          	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          	<input type="button" value="修改"  onclick="$('input[id=lefile]').click();" />    
          	<input type="file" name="file" id="lefile" style="display:none;" />    
           </td>
        </tr>
        <tr>
          <td align="right" valign="top" bgcolor="#FFFFFF" >
		  <span style="color:#FF3300; font-weight:bold">*</span> 描述：</td>
          <td bgcolor="#FFFFFF"  >
		  <textarea name="contents" class="company_mb_textarea" id="contents" style="width:580px; height:180px;" >{#$list.contents#}</textarea>
            <br />
            
		</td>
        </tr>
		</table>
		<div class="toptit">联系方式</div>
		  <table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF"  >
		<tr>
          <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span> 联 系 人：</td>
          <td bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">{#$list.contact#}</td>
        </tr>
		<tr>
          <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span> 联系电话：</td>
          <td bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">{#$list.contact_mobile#}</td>
        </tr>
		<tr>
          <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed"><span style="color:#FF3300; font-weight:bold">*</span> 联系邮箱：</td>
          <td bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed"><label>
         {#$list.contact_email#}
          </label></td>
        </tr>
		<tr>
            <td height="30" align="right" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed">&nbsp;</td>
            <td height="120" bgcolor="#FFFFFF" style=" border-bottom:1px #CCCCCC dashed"><span style="font-size:14px;">
              <input type="hidden" name="id"  value="{#$list.id#}" />
			  <input type="hidden" name="url"  value="{#$url#}" />
              <input name="submit3" type="submit" class="admin_submit"    value="保存修改"/> 
              <input name="submit22" type="button" class="admin_submit"    value="返 回" onclick="window.location.href='{#$url#}'"/>
            </span></td>
          </tr>
  </table>
  </form>
</div>
<!-- 所属行业弹出框 -->
<div class="aui_outer" style="display:none;" id="aui_outer">
  <table class="aui_border">
    <tbody>
      <tr><td class="aui_nw"></td><td class="aui_n"></td><td class="aui_ne"></td></tr>
      <tr>
        <td class="aui_w"></td>
        <td class="aui_c">
          <div class="aui_inner">
            <table class="aui_dialog">
              <tbody>
                <tr><td class="aui_header" colspan="2"><div class="aui_titleBar"><div class="aui_title" style="cursor: move;">选择所属行业</div><a href="javascript:;" class="aui_close">×</a></div></td></tr>
                <tr>
                  <td class="aui_main" style="width: auto; height: auto; visibility: visible;">
                    <div class="aui_content" style="padding: 20px 25px;">
                      <div class="items jquery-localdata">
                        <p class="tips">最多可以选择 1 项</p>
                        <div style="height:410px" class="item-table">
                          <table style="width:700px;" class="options-table">
                            <tbody class="item-list"><tr class=""><td><table><tbody id="trad_list">
                              <!-- 列表内容 -->
                            </tbody></table></td></tr>
                            </tbody>
                          </table>
                        </div>
                      </div>
                    </div>
                  </td>
                </tr>
                <tr><td class="aui_footer" colspan="2"><div class="aui_buttons" style=""><button class="aui-btn aui-btn-primary" id="determine" type="button">确定</button><button class="aui-btn aui-btn-light" id="deselect" type="button">取消</button></div></td></tr>
              </tbody>
            </table>
          </div>
        </td>
        <td class="aui_e"></td>
      </tr>
      <tr><td class="aui_sw"></td><td class="aui_s"></td><td class="aui_se" style="cursor: se-resize;"></td></tr>
    </tbody>
  </table>
</div>
<!-- 所属行业弹出框 End-->
{#include file="sys/admin_footer.htm"#}
</body>
</html>