⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vote.lbi

📁 非常漂亮的 ecshop 模板 希望大家能够喜欢。
💻 LBI
字号:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- {if $vote} -->
{insert_scripts files='transport.js'}
<div id="ECS_VOTE">
  <div class="module_j globalModule">
  <table cellspacing="0px" cellpadding="0px" width="100%" class="modhead_j">
  <tr>
	<td class="mhl_j" valign="top"></td>
	<td class="mhc_j" valign="top"><div class="inmhc_j"><h6 class="h6_j">站内调查</h6></div></td>
    <td class="mhr_j" valign="top"></td>
  </tr>
</table>
<table cellspacing="0px" cellpadding="0px" width="100%" class="modbody_j">
  <tr>
	<td class="mbl_j" valign="top"></td>
	<td class="mbc_j" valign="top">
	  <div class="inmbc_j"><form name="ECS_VOTEFORM" method="post" action="javascript:submit_vote()">
        <table border="0">
          <!-- {foreach from=$vote item=title} -->
          <tr>
            <th>{$title.vote_name}</th>
          </tr>
          <tr>
            <td class="textDesc">({$lang.vote_times}:{$title.vote_count})</td>
          </tr>
          <!-- {/foreach} -->
          <tr>
            <!-- {foreach from=$vote item=title} -->
            <td class="optionList">
              <!-- {foreach key=key from=$title.options item=item} -->
              <!-- {if $title.can_multi eq 0} -->
              <input type="checkbox" name="option_id" value="{$item.option_id}" id="option_{$key}" /> <label for="option_{$key}">{$item.option_name}</label> <span class="textDesc">({$item.percent}%)</span><br />
              <!-- {else} -->
              <input type="radio" name="option_id" value="{$item.option_id}" id="option_{$key}" /> <label for="option_{$key}">{$item.option_name}</label> <span class="textDesc">({$item.percent}%)</span><br />
              <!-- {/if} -->
              <!-- {/foreach} -->
              <input type="hidden" name="type" value="{$title.can_multi}" />
            </td>
            <!-- {/foreach} -->
          </tr>
          <tr>
            <td class="btnList">
              <input type="hidden" name="id" value="{$vote_id}" />
              <input type="image" name="submit" src="../images/btn_submit.gif" />
              <input type="image" src="../images/btn_reset.gif" onclick="ECS_VOTEFORM.reset();" />
            </td>
          </tr>
        </table>
    </form></div>
	</td>
	<td class="mbr_j" valign="top"></td>
  </tr>
</table>
<table cellspacing="0px" cellpadding="0px" width="100%" class="modfoot_j">
  <tr>
	<td class="mfl_j" valign="top"></td>
	<td class="mfc_j" valign="top"></td>
	<td class="mfr_j" valign="top"></td>
  </tr>
</table></div>
</div>
<script type="text/javascript">
//<![CDATA[
{literal}
/**
 * 处理用户的投票
 */
function submit_vote()
{
  var frm     = document.forms['ECS_VOTEFORM'];
  var type    = frm.elements['type'].value;
  var vote_id = frm.elements['id'].value;
  var option_id = 0;

  if (frm.elements['option_id'].checked)
  {
    option_id = frm.elements['option_id'].value;
  }
  else
  {
    for (i=0; i<frm.elements['option_id'].length; i++ )
    {
      if (frm.elements['option_id'][i].checked)
      {
        option_id = (type == 0) ? option_id + "," + frm.elements['option_id'][i].value : frm.elements['option_id'][i].value;
      }
    }
  }

  if (option_id == 0)
  {
    return;
  }
  else
  {
    Ajax.call('vote.php', 'vote=' + vote_id + '&options=' + option_id + "&type=" + type, voteResponse, 'POST', 'JSON');
  }
}

/**
 * 处理投票的反馈信息
 */
function voteResponse(result)
{
  if (result.message.length > 0)
  {
    alert(result.message);
  }
  if (result.error == 0)
  {
    var layer = document.getElementById('ECS_VOTE');

    if (layer)
    {
      layer.innerHTML = result.content;
    }
  }
}
{/literal}
//]]>
</script>
<!-- {/if} -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -