超出允许值时打开单独的窗口

时间:2014-08-02 10:11:39

标签: php

当我尝试执行上述任务时出现语法错误。怎么了?任何指导? 这个想法是在这种情况下,当列数超过9时,由于空间限制,将显示一个按钮,通过单击按钮,单独的窗口将显示更多详细信息。这里的separte窗口不是问题。请在这里看到:

  <?php 
            $actionCount = count($this->actionpoints);
            $maxCols = 9;
            $actualCols = ($actionCount > $maxCols) ? $maxCols + 1 : $actionCount;

            if($this->permission_number<=9 && $this>view_permission['action_points'] ){
            $actualCols = ($actionCount > $maxCols) ? $maxCols + 1 : $actionCount;
            }else {$('#button').show();
              <input type="submit" value="show details"></input>;
            }             
            //followed by more codings...
   ?>

语法错误从else行开始。提前告诉你的建议!

2 个答案:

答案 0 :(得分:0)

应该是:

}else {
?>
  <input type="submit" value="show details" onclick="widow.open('new_url')"></input>;
<?php
}  

答案 1 :(得分:0)

认为正确的代码将是

<?php 
        $actionCount = count($this->actionpoints);
        $maxCols = 9;
        $actualCols = ($actionCount > $maxCols) ? $maxCols + 1 : $actionCount;

        if($this->permission_number<=9 && $this->view_permission['action_points'] ){
        $actualCols = ($actionCount > $maxCols) ? $maxCols + 1 : $actionCount;
        }else { ?>
        <script>    
            $('#button').show();
        </script>   
          <input type="submit" value="show details"></input>;
        <?php }             
        //followed by more codings...
?>