0

Hy i have a problem with printing, im trying to print only the part of invoice but i cant handle it, ive tryied css to hide the others div but still not success, show a blank page after..this is my code thank you...

<?php include('config.php'); error_reporting(0); ?>
<!DOCTYPE html>
<html lang="en">
<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="shortcut icon" href="images/favicon.png" type="image/png">

  <link href="css/style.default.css" rel="stylesheet">
  <link href="css/jquery.datatables.css" rel="stylesheet">
  <link href="print.css" rel="stylesheet">

  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="js/html5shiv.js"></script>
  <script src="js/respond.min.js"></script>
  <![endif]-->

</head>

<body>

<!-- Preloader -->
<div id="preloader">
    <div id="status"><i class="fa fa-spinner fa-spin"></i></div>
</div>

<section>

  <div class="leftpanel">

    <div class="logopanel">

    </div><!-- logopanel -->

    <div class="leftpanelinner">    

        <!-- This is only visible to small devices -->


      <h5 class="sidebartitle">Menu</h5>
      <ul class="nav nav-pills nav-stacked nav-bracket">
        <li class="active"><a href="index.php"><i class="fa fa-home"></i> <span>Home</span></a></li>
        <li><a href="search.php"><i class="fa fa-suitcase"></i> <span>Saldi movimenti</span></a></li>
        <li class="nav-parent"><a href=""><i class="fa fa-edit"></i> <span>Anagrafiche</span></a>
          <ul class="children">
            <li><a href="add_new.php"><i class="fa fa-caret-right"></i>Inserisci nuova anagrafica</a></li>
            <li><a href="del.php"><i class="fa fa-caret-right"></i>Elimina anagrafica</a></li>
            <li><a href="show_all.php"><i class="fa fa-caret-right"></i>Mostra tutte le anagrafiche</a></li>
            <li><a href="show_all.php"><span class="pull-right badge badge-danger">nuovo</span><i class="fa fa-caret-right"></i>Inserisci dati transportatore </a></li>
          </ul>
        </li>
        <li class="nav-parent"><a href=""><i class="fa fa-file-text"></i> <span>Movimenti</span></a>
          <ul class="children">
            <li><a href="add_newm.php"><i class="fa fa-caret-right"></i>Aggiungi movimento</a></li>
            <li><a href="show_all2.php"><i class="fa fa-caret-right"></i>Mostra tutti i movimenti</a></li>
          </ul>
        </li>
        <li><a href="assc.php"><i class="fa fa-file-text"></i><span>Assistenza clienti</span></a></li>
      </ul>

      <div class="infosummary">
        <h5 class="sidebartitle">Informazioni</h5>    
        <ul>
            <li>
                <div class="datainfo">
                    <span class="text-muted">Total movimenti</span>
                    <?php
$result = mysql_query("SELECT id FROM articles", $con);
$num_rows = mysql_num_rows($result);

echo "<h4>$num_rows</h4>";

?>


        </div>
                <div id="sidebar-chart" class="chart"></div>   
            </li>
             <li>
                <div class="datainfo">
                    <span class="text-muted">Total anagrafiche</span>
                                        <?php
$result = mysql_query("SELECT * FROM category", $con);
$num_rows = mysql_num_rows($result);

echo "<h4>$num_rows</h4>";

?>

                </div>
                <div id="sidebar-chart5" class="chart"></div>   
            </li>
            <li>
                <div class="datainfo">
                    <span class="text-muted">Totale di tutti gli carichi</span>
                   <?php

$result = mysql_query("SELECT id,SUM(CarrelliCC+Carrelli+Ripiani+DoppieProlunghe+Prolunghe+Carl) as total   FROM articles");  
$row= mysql_fetch_assoc($result);

echo "<h4>" . $row['total'] . "</h4>";

?>
                </div>
                <div id="sidebar-chart2" class="chart"></div>   
            </li>
            <li>
                <div class="datainfo">
                    <span class="text-muted">Totale di tutti gli scarichi</span>
                     <?php

$result = mysql_query("SELECT id,SUM(CarrelliCC2+Carrelli2+Ripiani2+Prolunghe2+DoppieProlunghe2+Carl2) as total2   FROM articles");  
$row= mysql_fetch_assoc($result);

echo "<h4>" . $row['total2'] . "</h4>";

?>
                </div>
                <div id="sidebar-chart3" class="chart"></div>   
            </li>


        </ul>
      </div><!-- infosummary -->

    </div><!-- leftpanelinner -->
  </div><!-- leftpanel -->

  <div class="mainpanel">

    <div class="headerbar">

      <a class="menutoggle"><i class="fa fa-bars"></i></a>



      <div class="header-right">

      </div><!-- header-right -->

    </div><!-- headerbar -->

    <div class="pageheader">
      <h2><i class="fa fa-home"></i>Stampa</h2>
      <div class="breadcrumb-wrapper">
        <span class="label">Sei qui:</span>
        <ol class="breadcrumb">
          <li><a href="invoice.php">Stampa</a></li>
        </ol>
      </div>
    </div>

    <div class="contentpanel">
   <div class='panel panel-default'>
        <div class='panel-body'>
            <div class='row'>
                <div class='col-sm-6'>


                    <img src='images/bonini.jpg' class='img-responsive mb10' alt='' height='80' width='80'/>
                    <address>
                        <strong>Bonini Paolo/Bonini Roberto</strong><br>
                        Via Litoranea lkm 14<br>
                        04016 Sabaudia (Lt)<br>
                    </address>

                </div><!-- col-sm-6 -->
          <?php if(isset($_GET['id'])){$id=$_GET['id'];
 $qry=mysql_query("SELECT * FROM articles WHERE id='$id'", $con);
 if(!$qry){die("Query Failed: ". mysql_error());
 }
 while($row=mysql_fetch_array($qry)){ 



   echo "      <div class='col-sm-6 text-right'>
               <p>    <small>In data odierna sono stati effetuati i seguenti movimenti di materiale con la ditta:</small></p>
                <p> <strong>".$row['category']."</strong></p>
                    <address>
                        <p> Documento:<strong> Movimento</strong></p>
                         <p> Numero:<strong> ".$row['id']."</strong></p>
                      <p>  Data:<strong> ".$row['date']."</strong></p>
                    </address>



                </div>
            </div><!-- row -->

            <div class='table-responsive'>
            <table class='table table-invoice'>
            <thead>
              <tr>
                <th>/</th>
                <th>Caricati</th>
                <th>Scaricati</th>
                <th>Differenza</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>
                    <div class='text-primary'><strong>Carrelli con piastra luc.ROSSO</strong></div>
                </td>
                <td>".$row['Carl']."</td>
                <td>".$row['carl2']."</td>
                <td>".$row['q6']."</td>
              </tr>
              <tr>
                <td>
                    <div class='text-primary'><strong>Carrelli con piastra luc.NERO</strong></div>
                </td>
                <td>".$row['CarrelliCC']."</td>
                <td>".$row['CarrelliCC2']."</td>
                <td>".$row['q1']."</td>
              </tr>
              <tr>
                <td>
                    <div class='text-primary'><strong>Carelli - senza piastra</strong></div>
                </td>
                <td>".$row['Carrelli']."</td>
                <td>".$row['Carrelli2']."</td>
                <td>".$row['q2']."</td>
              </tr>
              <tr>
                <td>
                    <div class='text-primary'><strong>Ripiani</strong></div>
                </td>
                <td>".$row['Ripiani']."</td>
                <td>".$row['Ripiani2']."</td>
                <td>".$row['q3']."</td>
              </tr>
               <tr>
                <td>
                    <div class='text-primary'><strong>Prolunghe</strong></div>
                </td>
                <td>".$row['Prolunghe']."</td>
                <td>".$row['Prolunghe2']."</td>
                <td>".$row['q4']."</td>
              </tr>
               <tr>
                <td>
                    <div class='text-primary'><strong>Doppie Prolunghe</strong></div>
                </td>
                <td>".$row['DoppieProlunghe']."</td>
                <td>".$row['DoppieProlunghe2']."</td>
                <td>".$row['q5']."</td>
              </tr>
               <tr>
                <td>
                    <div class='text-primary'><strong>Note:</strong></div>
                </td>
                <td>".$row['note']."</td>";
          } } 
 ?>  
              </tr>
            </tbody>
          </table>
          </div><!-- table-responsive -->

            <table class='table table-total'>
                <tbody>
                    <tr>
                        <td><strong>Firma :</strong></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>

            <div class='text-right btn-invoice'>
                <button class='btn btn-white' onclick=window.print();><i class='fa fa-print mr5'></i>Stampa</button>
            </div>

            <div class='mb40'></div>

            <div class='well'>
                Attenzione: nel caso di mancata restituzione dei materiali sara emessa fattura tenendo conto dei correnti prezzi di vendita e noleggio
            </div>


        </div><!-- panel-body -->
      </div><!-- panel --> 

    </div><!-- contentpanel -->

  </div><!-- mainpanel -->

</section>


<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery-migrate-1.2.1.min.js"></script>
<script src="js/jquery-ui-1.10.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/modernizr.min.js"></script>
<script src="js/jquery.sparkline.min.js"></script>
<script src="js/toggles.min.js"></script>
<script src="js/retina.min.js"></script>
<script src="js/jquery.cookies.js"></script>

<script src="js/flot/flot.min.js"></script>
<script src="js/flot/flot.resize.min.js"></script>
<script src="js/morris.min.js"></script>
<script src="js/raphael-2.1.0.min.js"></script>

<script src="js/jquery.datatables.min.js"></script>
<script src="js/chosen.jquery.min.js"></script>

<script src="js/custom.js"></script>
<script src="js/dashboard.js"></script>

</body>
</html>
2
Contributors
1
Reply
17
Views
3 Years
Discussion Span
Last Post by cereal
0

Hi, show an html output of the page, not the PHP source, and the contents of print.css. By the way this:

<link href="print.css" rel="stylesheet">

Should be referenced as print:

<link href="print.css" rel="stylesheet" media="print" />

Unless you're using @media print inside the style.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.