首页 > php框架

jqGrid 导出excel表格代码(php+jqgrid实例)

jqgrid 导出excel表格代码(php教程+jqgrid实例)
require_once ../../../tabs.php;
?>

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html>
  <head>
    <title>jqgrid php demo</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css教程" media="screen" href="../../../themes/redmond/jquery-ui-1.7.1.custom.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="../../../themes/ui.jqgrid.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="../../../themes/ui.multiselect.css" />
    <style type="text">
        html, body {
        margin: 0;            /* remove body margin/padding */
        padding: 0;
        overflow: hidden;    /* remove scroll bars on browser window */
        font-size: 75%;
        }
    </style>
    <script src="../../../网页特效/jquery.网页特效" type="text/网页特效"></script>
    <script src="../../../js/i18n/grid.locale-en.js" type="text/网页特效"></script>
    <script type="text/javascript">
    $.jgrid.no_legacy_api = true;
    $.jgrid.usejson = true;
    </script>
    <script src="../../../js/jquery.jqgrid.min.js" type="text/javascript"></script>
    <script src="../../../js/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
  </head>
  <body>
      <div>
          <?php include ("http://pic1.phprm.com/2013/09/05/grid.jpg");?>
      </div>
      <br/>
      <?php tabs(array("grid.php"));?>
   </body>
</html>

阅读全文

php 静态文件生成类

php教程 静态文件生成类
defined(php教程ox) or die(header("http/1.1 403 not forbidden"));           
          
class include_createstatic            
{           
               
    private $htmlpath = ;           
    private $path = ;           
    public $monthpath = ;           
    private $listpath = ;           
    private $content = ;           
    private $filename = ;           
    private $extname = .html;           
               
    public function createhtml($type,$desname,$content)           
    {           
        $this->htmlpath = getappinf(htmlpath);           
        if (!file_exists($this->htmlpath))           
        {           
            @mkdir($this->htmlpath);           
        }           
        $this->path = $this->htmlpath.$this->monthpath./;           
        if (!file_exists($this->path))           
        {           
            @mkdir($this->path);           
        }           
        $this->listpath = $this->htmlpath.list/;           
        if (!file_exists($this->listpath))           
        {           
            @mkdir($this->listpath);           
        }           
        switch ($type)           
        {           
            case index:           
                $this->filename = $desname;           
                break;           
            case list:           
                $this->filename = $this->listpath.$desname;           
                break;           
            case view:           
                $this->filename = $this->path.$desname;           
                break;           
        }           
        $this->filename .= $this->extname;           
        $this->content = $content;           
    }           
               
    public function write()           
    {           
        $fp=php教程($this->filename,wb);           
        if (!is_writable($this->filename))           
        {           
            return false;           
        }           
        if (!fwrite($fp,$this->content))           
        {           
            return false;           
        }           
        fclose($fp);           
        return $this->filename;           
    }           
}      

阅读全文

php自动采集内容中带有图片地址的远程图片保存到本地

php自动采集内容中带有图片地址的远程图片保存到本地

function my_file_get_contents($url, $timeout=30) {
 if ( function_exists(curl_init) ) 
 {
  $ch = curl_init();
  curl_setopt ($ch, curlopt_url, $url);
  curl_setopt ($ch, curlopt_returntransfer, 1);
  curl_setopt ($ch, curlopt_connecttimeout, $timeout);
  $file_contents = curl_exec($ch);
  curl_close($ch);
 }
 else if ( ini_get(allow_url_fopen/ target=_blank >fopen) == 1 || strtolower(ini_get(allow_url_fopen)) == on )   
 {
  $file_contents = @file_get_contents($url);
 }
 else
 {
  $file_contents = ;
 }
 return $file_contents;
}

阅读全文

php防dedecms附件式文件在线管理系统(1/6)

php教程防dedecms附件式文件在线管理系统
  使用方法:
     1。先在根目录建立uploadfile目录
     2。“值”与“图”:这是用于将此图片传到父窗口的。值,传的是文件名,可用于input;图,传的是图片,用于编辑器。在使用此功能时,先将“值”前面的文本框填写父窗口的ID值。我在用层弹出本程序时可正常赋值。
     3。可多个文件上传,如果目标目录有相同的文件,则重命名为“文件名(n).jpg",和FCKeditor一样的命名方式
  测试环境:apache2.2.14 + PHP5.3 + windowswww.php100.com
*/

阅读全文

php 生成word文档并下载代码

php教程 生成word文档并下载代码
include("include/conn_php教程.php");
  $id=$_GET["id"];
  $sql="select * from  down where id=$id ";
  $result=mysql_query($sql);  
  $row=mysql_fetch_row($result);
  $file2=$row["upload"];
 
function downFile($sFilePath)
{
   if(file_exists($sFilePath)){
       $aFilePath=explode("/",str_replace("php教程);
       $sFileName=$aFilePath[count($aFilePath)-1];
       $nFileSize=filesize ($sFilePath);
       header ("Content-Disposition: attachment; filename=" .basename($sFileName) );
       header ("Content-Length: " . $nFileSize);
       header ("Content-type: application/octet-stream");
       mb_convert_encoding(readfile($sFilePath),"utf-8","GB2312");
   }
   else
   {
       echo("文件不存在!");
   }
}

阅读全文