001: <?php
002:
003: $html = '
004: <style type="text/css">
005: table{
006: font-size:11px; border-collapse:collapse; margin:auto; width:100%; position:relative;
007: }
008:
009: #all{
010: margin:auto;
011: width:100%;
012: color: #000000;
013: font: 11px "Lucida Grande",Geneva,Arial,Verdana,Helvetica,sans-serif;
014: }
015:
016: .clearfix {
017: display: block;
018: height:20px;
019: }
020: .percent50 td{
021: width:50%;
022: }
023: #all h2{
024: color: #000000;
025: float: right;
026: font-size: 16px;
027: margin: 0 0 10px;
028: }
029: #all h3{
030: font-size: 13px;
031: padding: 0 0 10px;
032: }
033: }
034: .date{
035: color: #000000;
036: font: 11px "Lucida Grande",Geneva,Arial,Verdana,Helvetica,sans-serif;
037: }
038: .details{
039: clear: right;
040: float: right;
041: }
042: .from,.to{
043: font-weight: bold;
044: margin-bottom: 10px;
045: }
046: .addresses {
047: margin-top: 50px;
048: }
049: .lines{
050: border-collapse: collapse;
051: border-spacing: 0;
052: width: 100%;
053: }
054: .item-kind first{
055: }
056: .lines thead th{
057: border-bottom: 1px solid #000000;
058: color: #686868;
059: font-weight: normal;
060: padding: 5px 10px;
061: text-align: left;
062: vertical-align: bottom;
063: white-space: nowrap;
064: }
065: .lines tbody td {
066: border-bottom: 1px solid #CCCCCC;
067: padding: 8px 10px;
068: vertical-align: top;
069: }
070: .lines first{
071: color:#FFF;
072: }
073: </style>
074: </head>
075: <body>
076: <div id="all">
077: <table>
078: <tr class="percent50">
079: <td><img src="images/logo_.png" alt="logo" /></td>
080: <td>
081: <h2>Devis N� 4</h2>
082: <div class="date details">Date : 17-05-2011</div>
083: </td>
084: </tr>
085: <tr class="clearfix"><td></td></tr>
086: <tr class="percent50 addresses">
087: <td><div class="to">Emmeteur : </div><div>212 communication</div><div> B12 Gu�liz , Marrakech .</div></td>
088: <td><div class="from">Adress� � : </div><div>ELQANDILI Yassine</div> 21 QU EL IKHLASS ESSAOUIRA</td>
089: </tr>
090: <tr class="clearfix"><td></td></tr>
091: <tr class="clearfix"><td></td></tr>
092: <tr><td><h3 class="left">Dails du devis </h3></td></tr>
093: <tr class="clearfix"><td></td></tr>
094: </table>
095: <table class="lines">
096: <thead>
097: <tr>
098: <th class="item-kind first"></th>
099: <th class="item-description">Description</th>
100: <th class="item-qty">Qte</th>
101: <th class="item-tax">TVA</th>
102: <th class="item-price">Prix Unit. HT</th>
103: <th class="item-total last">Total HT</th>
104: </tr>
105: </thead>
106: <tbody>
107: <tr>
108: <td class="item-kind first"></td>
109: <td class="item-description">Logo</td>
110: <td class="item-qty">1</td>
111: <td class="item-tax">0</td>
112: <td class="item-price">100.00</td>
113: <td class="item-total last">100.00</td>
114: </tr>
115: <tr>
116: <td class="item-kind first"></td>
117: <td class="item-description">Banni�re</td>
118: <td class="item-qty">1</td>
119: <td class="item-tax">0</td>
120: <td class="item-price">100.00</td>
121: <td class="item-total last">100.00</td>
122: </tr>
123: <tr>
124: <td class="item-kind first"></td>
125: <td class="item-description">Logo</td>
126: <td class="item-qty">1</td>
127: <td class="item-tax">0</td>
128: <td class="item-price">100.00</td>
129: <td class="item-total last">100.00</td>
130: </tr>
131: <tr>
132: <td class="item-kind first"></td>
133: <td class="item-description">Logo</td>
134: <td class="item-qty">1</td>
135: <td class="item-tax">0</td>
136: <td class="item-price">100.00</td>
137: <td class="item-total last">100.00</td>
138: </tr>
139: </tbody>
140: </table>
141: </div>';
142: echo $html;
143: require_once('/html2pdf/html2pdf.class.php');
144: $html2pdf = new HTML2PDF('P','A4','fr', false, 'ISO-8859-15', array(20, 20, 20, 20));
145: $html2pdf->WriteHTML($html);
146: ob_end_clean();
147: $html2pdf->Output('aaas.pdf');
148: ?>