<?php require_once('../auth/auth.php');require_once('../auth/acid_balance.php');require_once('../auth/function.php');?>
<?php 
   $g_acid  = isset($_GET['g_acid'])?$_GET['g_acid']:0;
   $tid = $_GET['tid'];
   echo $invoice = $_GET['invoice'];
$inacc= mysqli_query($conn,"SELECT 
  co_name,owner_name,co_phone,co_email,co_address,co_logo,t.tid,t.dr_acid,t.cr_acid,t.invoice,t.date,t.amount,t.details,t.ttype,a.acid,a.ac_name,a.ac_number,em_acname
  FROM transaction t LEFT JOIN company c ON(t.coid=c.coid)
  LEFT JOIN accounts a ON(a.acid=t.dr_acid)
  LEFT JOIN user u ON(u.uid=t.userid)
  LEFT JOIN em_employee e ON(e.em_id=u.us_em_id)
  WHERE t.coid='$coid' AND t.tid ='$tid' LIMIT 1") or die(mysqli_error($conn));
$inac= mysqli_fetch_assoc($inacc);

$co_name        = $inac['co_name'];
$owner_name     = $inac['owner_name'];
$co_address     = $inac['co_address'];
$co_phone       = $inac['co_phone'];
$co_email       = $inac['co_email'];
$co_logo        = $inac['co_logo'];

$tid            = $inac['tid'];
$invoice        = $inac['invoice'];
$date           = $inac['date'];
$amount         = $inac['amount'];
$details        = $inac['details'];
$ttype          = $inac['ttype'];
$dr_acid        = $inac['dr_acid'];
$cr_acid        = $inac['cr_acid'];


$acid           = $inac['acid'];
$ac_name        = $inac['ac_name'];
$ac_number      = $inac['ac_number'];


$em_acname      = $inac['em_acname'];
?>
<?php require_once('../auth/auth.php');require_once('../auth/acid_balance.php');require_once('../auth/function.php');?>
<?php 
echo $invoice=$_GET['invoice'];
?> 
<script language="javascript">
function PrintMeY(DivID) {
var disp_setting="toolbar=yes,location=no,";
disp_setting+="directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";
   var content_vlue = document.getElementById(DivID).innerHTML;
   var docprint=window.open("","",disp_setting);
   docprint.document.open();
   docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"');
   docprint.document.write('"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
   docprint.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">');
   docprint.document.write('<head><title>Print</title>');
   docprint.document.write('<style type="text/css">body{ margin:0px;');
   docprint.document.write('font-family:SolaimanLipi, Arial,verdana;color:#000;');
   docprint.document.write('font-family:SolaimanLipi, Arial, Geneva, sans-serif; font-size:10px;width: 288px;}');
   docprint.document.write('a{color:#000;text-decoration:none;} </style>');
   docprint.document.write('</head><body onLoad="self.print()">');
   docprint.document.write(content_vlue);
   docprint.document.write('</body></html>');
   docprint.document.close();
   docprint.focus();
}
</script>

 
        <section >

        <div class="col-sm-4"></div>
        <div class="col-lg-4">
          <div class="card card-printable style-default-light">
            <div class="card-head">
             
              <center style="margin-top: 3px;">

              <script type="text/javascript">
                           $(document).ready(function() {
                                $('.aciddvb').click(function(){
                                var pid = $(this).attr("aciddvb");
                                    $('#img-load').show();
                                    $.post('../ac_add_view/profile_view.php?acid='+ pid,function(pid){
                                    $('#vouinvview').html(pid);
                                    
                                    $('#img-load').hide();
                                    });   
                                });
                         });
              </script>
               <a href="#"  onclick="PrintMeY('divid')"><i class="md md-print"></i></a>
              <a href="#" class="paddvb" paddvb="<?php echo $invoice; ?>"><i class="md md-arrow-back"></i></a>
               <a href="#" style="margin-top:4px;"  class="padprint"  padprint="<?php echo $invoice; ?>"><i class="fa fa-file-text"></i></a>

              </center>


              <div class="tools" style="margin-top: -17px;">
                
                     <a class="btn btn-floating-action close" href="#" style="width: 25px; height: 25px;" data-dismiss="modal" aria-hidden="true"><i class="md md-close" style="margin-top: -11px;"></i></a>
              
              </div>
            </div><!--end .card-head -->



<section class="content">
  <div class="row">
    <div class="col-md-12">
      <div class="card card-primary card-outline direct-chat direct-chat-primary shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
        <div class="card-header" style="padding: 3px 8px;">
          <h3 class="card-title">Purchase Invoice </h3>
          <div class="card-tools">
            <span id="sdf"></span>
            <!--<button type="button" onclick="pdfMe('#m_receipt');" class="btn btn-tool" title="Download Pdf"><i class="fas fa-download"></i></button>-->
            <!--<button type="button" class="btn btn-tool" onclick="printMe('#m_receipt',{'top':'7%','left':'37%'})" title="Print Now"><i class="fas fa-print"></i></button>-->
            
                           <a href="#"  onclick="PrintMeY('divid')"><i class="fa fa-print"></i>print</a>

            <button type="button" class="btn btn-tool" data-card-widget="remove" data-dismiss="modal">
              <i class="fas fa-times"></i>
            </button>
          </div>
        </div>   

        <div class="card-body p-1" id="divid" style="overflow:hidden;position: relative;">





<div class="col-lg-12">
                <div style="float: left; width: 100%;margin-top: -5px;text-align: center;">
                  <address style="margin-bottom: 0px;font-size: 11px;margin-top: 5px;">
                    <strong style="font-size: 18px;font-weight: bold"><?php echo 'Al Modina Auto'; ?></strong><hr style="margin: 0px 0px;border: 0.5px solid #066265;">
                    <?php echo '4 no Stimar Gat Band Road Barisal'; ?>
                     <?php echo '01712308833 '; ?> # <?php echo 'manikbsl786@gmail.com'; ?>
                  </address>
                  <hr style="margin: 0px 0px;border: 0.5px solid #066265;">
                </div><!--end .col -->
                <div style="float: left; width: 100%;">
                  <div style="padding: 0px;min-height: 20px;min-height: 20px; margin-bottom: 2px;border: 1px solid #e3e3e3;border-radius: 2px;">
                   
                      <div class="clearfix">
                      <div class="pull-center"> <strong> <center><b style="font-size: 19px;">Sales Invoice</b></center> </strong></div>
                    </div>
           
                  </div>
                </div><!--end .col -->
             
            
              <!-- END INVOICE DESCRIPTION -->

                

                  <div class="col-sm-12" style="float: left; width: 100%">
                   <hr style="margin-top: 0px; margin-bottom: 2px;    border: 0.5px solid #066265;">

                  </div>


                <div class="col-xs-12" style="float: left; width: 100%">
                  <div  style="padding: 5px; font-size: 8px;">
                    <div  >
                      <div  style="float: left; width: 100%;font-size: 11px"> VOUCHER NO : <?php echo $invoice ?></div> 
                      <div  style="float: left; width: 100%;font-size: 12px"> DATE TIME  : <?php echo $datetime;?> </div>
                    </div>
           
                  </div>
                  
                </div><!--end .col -->
                

                  <div class="col-sm-12" style="float: left; width: 100%">
                   <hr style="margin-top: 0px; margin-bottom: 2px;    border: 0.5px solid #066265;">

                  </div>


              <!-- BEGIN INVOICE DESCRIPTION -->

                <div class="col-xs-12" style="float: left; width: 100%;font-size: 12px;">
                  <address style="font-size: 12px;margin-bottom: 0px; margin-top: 1px;line-height: 20px;border-bottom: 1.3px dotted;">
                    Name : <?php echo 'md jamal hossain'; ?>
                  </address>
                </div><!--end .col -->

                <div class="col-xs-4" style="float: left; width: 100%;font-size: 12px;">
                  <address style="font-size: 12px;margin-bottom: 0px; margin-top: 1px;line-height: 20px;border-bottom: 1.3px dotted;">
                   Mobile: <?php echo '01712308833 '; ?>
                  </address>
                </div><!--end .col -->
                <div class="col-xs-4" style="float: left; width: 100%;font-size: 12px;">
                  <address style="font-size: 12px;margin-bottom: 0px; margin-top: 1px;line-height: 20px;border-bottom: 1.3px dotted;">
                   Address : <?php echo '4 no Stimar Gat Band Road Barisal'; ?>
                  </address>
                </div><!--end .col -->







                <div class="col-xs-12" style="float: left; width: 100%">

<br/>
              <table cellpadding="0"  cellspacing="0"  class=" t-table" style="font-size: 10px; width: 100%; margin-bottom: 3px;margin-top: -10px;">
                <tr>
                    <th style="font-size: 12px;text-align:center;background-color: black;color:white;width: 8%">S/L</th>
                        <th style="font-size: 12px;text-align:left;background-color: black;color:white">Discription</th>
                        <th style="font-size: 12px;text-align:center;background-color: black;color:white;width: 5%">QTY</th>
                        <th style="font-size: 12px;text-align:center;background-color: black;color:white;width: 15%">Price</th>
                        <th style="font-size: 12px;text-align:center;background-color: black;color:white;width: 15%">Total</th>
                       
                  </tr>
              </thead>

              <tbody>

               

                <tr class="delete_op<?php echo 1;?>" > 
                <td style="font-size: 12px;text-align: center;width: 5%;border-left: 0.1px solid black;padding: 0px 3px;overflow-x: hidden;overflow-y: hidden;white-space: nowrap;" ><?php echo 1;?></td>
                 <td style="font-size: 12px;text-align:left;padding: 4px;border-left: 0.1px solid black; padding: 0px 3px;">
                  <?php echo'HUNK/XTM150CC';   ?>
                   
                 </td>

              <td style="font-size: 12px;text-align:center;padding: 4px;border-left: 0.1px solid black; padding: 0px 3px;"> <?php echo 15;?> </td>

              <td style="font-size: 12px;text-align:right;padding: 4px;border-left: 0.1px solid black; padding: 0px 3px;"> 
                <?php echo 1000;?> </td>


                <td style="font-size: 10px;text-align:right;width: 13%;border-left: 0.1px solid black; padding: 0px 3px;border-right: 0.1px solid black;">   <?php echo 15000;?></td>

              

                </tr>

    
                 
                 
                 <tr>

                <td colspan="2" style="font-size: 12px;text-align:right;border-left: 0.1px solid black;border-bottom: 0.1px solid black;border-top: 0.1px solid black; padding: 0px 3px;"> Total = </td>

                <td style="font-size: 12px;text-align:center;border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;border-top: 0.1px solid black;">
                    <?php echo 15; ?>
                  
                </td>
        
                <td style="font-size: 12px;text-align:right;border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;border-top: 0.1px solid black;"> Service
                </td>

                <td style="font-size: 12px;text-align:right; border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;border-right: 0.1px solid black;border-top: 0.1px solid black;">
                 <b style="font-size: 13; "> <?php echo 15000;?>
                  </b> 
                </td>

               
            </tr>


           
                     
                     <tr>
                        <td colspan="4" style="font-size: 12px;text-align: right;border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;">Discount</td>
                        <td  style="text-align: right;border-left: 0.1px solid black;border-right: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;"><?php echo 500;?>
                        </td>


           
                      </tr>



                      <tr>
           
                        <td colspan="4" style="font-size: 13px;text-align: right;border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;" >Grand Total</td>
                        <td  style="text-align: right;border-left: 0.1px solid black;border-right: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;"><b><?php echo 14500;?>
                    </b>    </td>
                      </tr>

     






                      <tr>
                        <td colspan="4" style="font-size: 12px;text-align: right;border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;">Payment</td>
                        <td style="text-align: right;border-left: 0.1px solid black;border-right: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;">
<?php echo 10000;?>

                        
                        </td>
                      </tr>

                      <tr>
                        <td colspan="4" style="font-size: 12px;text-align: right;border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;">Invoice Due</td>
                        <td style="text-align: right;border-left: 0.1px solid black;border-right: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;"><?php  echo 4000; ?>
                        </td>
                      </tr>



  


                      <tr>
                        <td colspan="4" style="font-size: 12px;text-align: right;border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;">Previous</td>
                        <td style="text-align: right;border-left: 0.1px solid black;border-right: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;"> 100
          

                        </td>
                      </tr>


                      <tr>
                        <td colspan="4" style="font-size: 12px;text-align: right;border-left: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;">Current Due</td>
                        <td style="text-align: right;border-left: 0.1px solid black;border-right: 0.1px solid black;border-bottom: 0.1px solid black; padding: 0px 3px;"> 4100
           


                        </td>
                      </tr>
              </tbody>
              </table>
            </div>







                <div class="col-xs-12" style="font-size: 10px;float: left; width: 100%">
                  <address style="font-size: 10px;margin-bottom: 0px; margin-top: 11px;margin-left:15px; line-height: 20px;border-bottom: 1.3px dotted;text-transform: uppercase;">
                 In Word : TTHREE HUNDRED AND FIFTY BDT ONLY









                  </address>
                </div><!--end .col -->

















                <div class="col-xs-12" id="footer" style="float: left; width: 100%">

                <hr style="margin: 0px 0px;border: 0.5px solid #007bff;">


                  <address style="margin-bottom: 0px; margin-top: 5px;line-height: 12px;">
                  

                    <table style="width: 100%;">
                        <tr>
                            <td class="hidden-border" style="font-size: 10px; width: 50%;text-align: center">
                               Buyer s signature
                            </td>

      
                            <td class="hidden-border" style="font-size: 10px; width: 50%; text-align: center">
                              Seller s signature
                            </td>
                        </tr>
                    </table>
             <br>


          <div class="col-sm-12" style="width: 100%;background: ;color: ;">
          <ssssss style= "font-size: 8px"> <center>&nbsp;Powered by: WellDiv # Web: www.welldiv.com </center> </ssssss>
          </div>

                  


                  </address>
                </div>


</div>
</div>
</div>
</div>
</div>
</section>


<style type="text/css">
@font-face { 
    font-family: SolaimanLipi; 
    src: local('SolaimanLipi'),
         url('../../fonts/solaimanlipi.woff') format('woff'),
         url('../../fonts/solaimanlipi.woff2') format('woff2');
    }


@page { margin: 0 }
body { margin: 0 }
.sheet {
  margin: 0;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  page-break-after: always;
  font-size: 10px;
}

/** Paper sizes **/
body.A3               .sheet { width: 299mm; height: 419mm }
body.A3.landscape     .sheet { width: 420mm; height: 296mm }
body.A4               .sheet { width: 210mm; height: 296mm }
body.A4.landscape     .sheet { width: 297mm; height: 209mm }
body.A5               .sheet { width: 148mm; height: 209mm }
body.A5.landscape     .sheet { width: 210mm; height: 147mm }
body.letter           .sheet { width: 216mm; height: 279mm }
body.letter.landscape .sheet { width: 280mm; height: 215mm }
body.legal            .sheet { width: 216mm; height: 356mm }
body.legal.landscape  .sheet { width: 357mm; height: 215mm }

/** Padding area **/
.sheet.padding-10mm { padding: 10mm }
.sheet.padding-15mm { padding: 15mm }
.sheet.padding-20mm { padding: 20mm }
.sheet.padding-25mm { padding: 25mm }

/** For screen preview **/
@media screen {
  body { background: #e0e0e0 }
  .sheet {
    background: white;
    box-shadow: 0 .5mm 2mm rgba(0,0,0,.3);
    margin: 5mm auto;
  }
}

/** Fix for Chrome issue #273306 **/
@media print {
           body.A3.landscape { width: 420mm }
  body.A3, body.A4.landscape { width: 297mm }
  body.A4, body.A5.landscape { width: 210mm }
  body.A5                    { width: 148mm }
  body.letter, body.legal    { width: 216mm }
  body.letter.landscape      { width: 280mm }
  body.legal.landscape       { width: 357mm }
}

</style>
</div>
 </div>
 </div>
          </div>
        </div>


<div class="col-sm-4"></div>





  </section>

