<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>书目详情</title>
<style>
    * {
        margin:0; padding:0; list-style:none;
        font-family:'华文楷体';
    }
    #out {
        margin: 0 auto;
        width: 1125px;
        height: 2001px;
    }
    #top {
        width: 466px;
        height: 578px;
        padding: 108px 330px 120px 330px;
        background: #f2f2f2;
    }
    #body { }
    #body .title{
        width: 952px;
        margin: 0 auto;
        height: 61px;
        line-height: 61px;
        font-size: 61px;
        color: #484848;
        padding-top: 71px;
    }
    #body .about {
        position: relative;
    }
    #body .about .author {
        width: 952px;
        margin: 0 auto;
        height: 49px;
        line-height: 49px;
        font-size: 49px;
        color: #484848;
        padding-top: 77px;
    }
    #body .about .public {
        width: 952px;
        margin: 0 auto;
        height: 51px;
        line-height: 51px;
        font-size: 51px;
        color: #484848;
        padding-top: 41px;
    }
    #body .about span {
        position: absolute;
        top:110px;
        right:72px;
        color: #c7c7cc;
        font-size: xx-large;
        font-weight: bolder;
    }
    #body img {
        display: block;
        padding-top:110px;
        width: 466px;
        height: 89px;
        margin: 0 auto;
    }
    #body .detail {
        width: 952px;
        margin: 0 auto;
        line-height: 70px;
        font-size: 70px;
        color: #000000;
        padding-top: 22px;
        padding-bottom: 82px;
        -ms-word-break: keep-all;
        word-break: break-all;
    }    #over {
        height:146px;
        background:#f2f2f2;
        margin:0 auto;
        padding-top:20px;
        text-align:center;
        font-size:49px;
        line-height:146px;
        color: #cccccc;
    }
    #foot {
        height:145px;
        background: #2578b5;
        padding-top:84px;
        text-align:center;
        font-size:56px;
        line-height:145px;
        color: #fcfcfc;
    }
    #foot a{
        text-decoration: none;
    }
    #book_img{
        margin-left: 150px;
    }
</style>
</head><body>
<div id='out'>
<div id="top">
<?php   
   
      require 'curl.class.php';
      $url="http://202.117.71.151:8080/opac/".$_GET['result'];//得到的是用户点击的书名链接
      $result=new getdetailinfo();
      $arr=$result->book_detail($url);//正则匹配出书的具体信息如出版社等等
      $info=explode("/", $arr[0][1]);
      $info[1]=str_replace("<", "",$info[1]);
      $a=$info[0];//得到书名
      $a=trim($a);
      $str = html_entity_decode($a);//原网页书名文字是ASCII,进行转码
      $url_book_img="http://www.douban.com/search?q=".$str;//得到的书名去豆瓣查询得到书的封面图片
      $book_img=new getimgsrc();
      $url_book=$book_img->book_img_src($url_book_img);//得到图片的绝对地址
      $fileName = "./image/".uniqid("my_") . ".jpg";//设置图片路径
      $img=new getnewimg();
      $c =$img->bookimg($url_book, $fileName);//通过地址抓取图片内容
      $file_name=basename($fileName);
      $path='./image/'.$file_name;//此处获取图片的路径
      ?>
      
     <img src=<?php echo $path;//在本地服务器上正常显示图片,在真正的服务器上文件以文本方式输出乱码?> height="70%" width="60%" id="book_img" />;
        
    </div>
    <div id="body">
    <?php
   
    for ($i=0; $i < 3; $i++){
     for ($j=0; $j < count($arr[$i]); $j++){
     echo "<div class=\"about\">";
     echo "<h3 class=\"author\">".$arr[$i][$j]."</h3>";
     echo "</div>";
     }
    }//输出书本的详尽信息,比如出版社等等·
    ?>
        
        
    </div>
    <div id="over">————完毕————</div>
    <?php echo "<div id=\"foot\"><h3><a href=\"listprogress.php?url={$url}&book_name={$info[0]}&author={$info[1]}\">立即借阅</a></h3></div>";?>

</div>
</body>
</html>