<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

$formname = 'Challan In';
$maindb = 'chalmain';
$trandb = 'chaltran';
$file = 'challan.php';

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);

$mht = 'height:20px;';

$admin = $_SESSION["admin_" . $dbname];
$vouchno = $_REQUEST["vouchno"];
$mainqry = mysqli_query($conn, "SELECT *, DATE_FORMAT(`vouchdt`, '%d-%m-%Y') AS vouchdt FROM `$maindb` WHERE vouchno='$vouchno'") or die(mysqli_error($conn));
$getmdata = mysqli_fetch_array($mainqry) or die(mysqli_error($conn));

$getparty = mysqli_query($conn, "SELECT accode,`name` FROM `accmast` WHERE accode =$getmdata[party]") or die(mysqli_error($conn));
$mparty = mysqli_fetch_array($getparty);
?>

<!DOCTYPE HTML>
<html lang="en-US">

    <head>
        <?php
        include("includes/files.php");
        ?>
    </head>

    <body id="main_container">
        <div class="row">
            <b style="font-size:18px;"><center>Repair Challan In</center></b>
        </div>
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <table class="table table-bordered">
                        <tr>
                            <td style="text-align: center;vertical-align: inherit;width:10%">
                                <img src="images/trdlogo3.png"/>
                            </td>
                            <td style="width:40%">
                                <table class="">
                                    <tr>
                                        <td><h5><b>MODERN HIRING SERVICE</b></h5></td>
                                    </tr>
                                    <tr>
                                        <td>Survey No. 14/1, 145/2, At Taloja Cement Road,</td>
                                    </tr>
                                    <tr>
                                    <tr>
                                        <td>Opp. Tata Motors, Near Damani Vill., Ustanae, </td>
                                    </tr>
                                    <tr>
                                    <tr>
                                        <td>Taluka Ambernath, Dsit. Thane. </td>
                                    </tr>
                                    <tr>
                                        <td><b>Mob.:</b> +91-9820220440 / 9821302996 </td>
                                    </tr>
                                    <tr>
                                    <tr>
                                        <td><b>Tel.:</b> +91-7506581753 / 7506581754 </td>
                                    </tr>
                                    <tr>
                                        <td><b>E-mail:</b> talojadepo@modernhiring.com, modern.hiring@yahoo.com</td>
                                    </tr>
                                    <tr>
                                        <td><b>Website:</b> www.modernhiring.com</td>
                                    </tr>
                                    
                                </table>
                                
                                <table>
                                    <tr>
                                        <td>
                                            <center><strong><b>DELIVERY CHALLAN</b></strong></center>
                                        </td>
                                    </tr>
                                    <TR>
                                       
                                        <td>
                                            <?php echo $getmdata["vouchno"];   ?>
                                        </td>
                                        
                                        
                                    </TR>
                                </table>
                            </td>
<!--                            <td style="padding: 0px;">
                                <table class="table table-bordered" style="margin-bottom: 0px;">
                                    <tr>
                                        <td style="width:30%">Party:</td>
                                        <td> <?php //echo $mparty["name"]   ?></td>
                                    </tr>                                    
                                </table>                                
                            </td>
                            <td style="padding: 0px;">
                                <table class="table table-bordered" style="margin-bottom: 0px;">
                                    <tr>
                                        <td>No. :</td>
                                        <td><?php //echo $getmdata["vouchno"]   ?></td>
                                    </tr>
                                    <tr>
                                        <td>Date :</td>
                                        <td><?php //echo $getmdata["vouchdt"]   ?></td>
                                    </tr>
                                </table>                                
                            </td>-->
                        </tr>
                        <tr>
                            <!--style="padding: 0px;"  style="margin-bottom: 0px;"-->
                            <td colspan="3">
                                <div class="table-responsive">
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <td style="width:25%;"><img src="images/dot.png"/>&nbsp;&nbsp;<strong style="font-size: 12px;">CUMMINS GENERATOR SETS</strong></td>
                                                <td style="width:25%;"><img src="images/dot.png"/>&nbsp;&nbsp;<strong style="font-size: 12px;">60-1500 KVA RANGE</strong></td>
                                                <td style="width:25%;"><img src="images/dot.png"/>&nbsp;&nbsp;<strong style="font-size: 12px;">50 HZ & 60 HZ</strong></td>
                                                <td style="width:25%;"><img src="images/dot.png"/>&nbsp;&nbsp;<strong style="font-size: 12px;">FUEL EFFICIENT GENSETS</strong></td>

                                            </tr>    
                                        </thead>
                                        <tbody>
                                        <td><img src="images/dot.png"/>&nbsp;&nbsp;<strong style="font-size: 12px;">SILENT SOUND PROOF GENSETS</strong></td>
                                        <td><img src="images/dot.png"/>&nbsp;&nbsp;<strong style="font-size: 12px;">D.G. SETS WITH PARALLEL OPERATIONS</strong></td>
                                        <td></td>
                                        <td></td>
                                        </tbody>
                                    </table>            
                                </div>                
                            </td>
                        </tr>
                        <tr>
                            <td><b>M/s</b> &nbsp;&nbsp;&nbsp;&nbsp;<?php echo $mparty["name"] ?></td>                
                            <td><b>RETURNABLER CHALLAN NO.</b>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $getmdata["vouchno"] ?></td>                
                        </tr>
                        <tr>
                        <tr>
                            <td><b>Address </b>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $getmdata["add1"] ?></td>
                            <td><b>Date :</b> &nbsp;&nbsp;&nbsp;&nbsp;<?php echo $getmdata["vouchdt"] ?></td>                
                        </tr>
                        <tr>
                        <tr>
                            <td><b></b>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $getmdata["add2"] ?></td>
                            <td><b>Your Order No.</b> &nbsp;&nbsp;&nbsp;&nbsp;<?php echo ""; ?></td>
                        </tr>
                        <tr>
                            <!--style="padding: 0px;"  style="margin-bottom: 0px;"-->
                            <td colspan="3">
                                <div class="table-responsive">
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <td style="width:5%;"><strong>Sr. No.</strong></td>
                                                <td style="width:80%;"><strong>Particulars</strong></td>
                                                <td style="width:15%;" class="text-right"><strong>Qty.</strong></td>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                            $ctr = 0;
                                            $gettranqry = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE vouchno='$vouchno' ORDER BY srno") or die(mysqli_error($conn));
                                            while ($row = mysqli_fetch_array($gettranqry)) {

                                                echo "<tr>";
                                                echo "<td style=$mht>";
                                                echo $row["srno"];
                                                echo "</td>";
                                                echo "<td style=$mht>";
                                                echo $row["particular"];
                                                echo "</td>";
                                                echo "<td class='text-right'>";
                                                echo $row["qty"];
                                                echo "</td>";
                                                echo "</tr>";
                                                $ctr++;
                                            }
                                            if ($ctr < 10) {
                                                $mctr = 10 - $ctr;
                                                for ($i = 1; $i <= $mctr; $i++) {
                                                    echo '<tr>';
                                                    echo "<td style=$mht></td>";
                                                    echo "<td style=$mht></td>";
                                                    echo "<td style=$mht></td>";
                                                    //echo "<td style=$mht></td>";
                                                }
                                                echo '</tr>';
                                                echo '<tr>';
                                                echo '<td>';
                                                echo '</td>';
                                                echo '<td>';
                                                echo '<b>Please Note:<br/>The above materials is our own property and is being send for <br/>"JOB WORK ONLY " & "IS NOT FOR SALE"</b>';
                                                echo '</td>';
                                                echo '<td>';
                                                echo '</td>';
                                                echo '</tr>';
                                            }
                                            ?>

                                            <tr>
                                                <td colspan="6">
                                                    <table>
                                                        <tr>
                                                            <td colspan="3">
                                                                <b>Remarks :</b><?php echo $getmdata["rem1"] . "<br/>"; ?>
                                                            </td>
                                                            <td style="width:115px;"></td>
                                                            <td style="width:150px;"><b>H.O. COPY</b></td>
                                                            <td style="width:175px;"></td>
                                                            <td valign="bottom" class="text-right">For <strong><b>MODERN HIRING SERVICES</b></strong></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <?php
                                                                echo $getmdata["rem2"];
                                                                ?>
                                                            </td>
                                                        </tr>
                                                        <td style="width:115px;"></td>
                                                        <td style="width:150px;"></td>

                                            </tr>
                                            <tr>
                                                <b>Receivers/Certifying Signature</b>
                                            </tr>
                                    </table>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                </td>
                </tr>
                </table>
            </div>
        </div>
    </div>

    <style>
        .height {
            min-height: 100px;
        }

        .icon {
            font-size: 45px;
            color: #5CB85C;
        }

        .iconbig {
            font-size: 70px;
            color: #5CB85C;
        }

        .table > tbody > tr > .emptyrow {
            border-top: none;
        }

        .table > thead > tr > .emptyrow {
            border-bottom: none;
        }

        .table > tbody > tr > .highrow {
            border-top: 2px solid;
        }
    </style>
    <?php
    include("includes/files_footer.php");
    ?>
    <script>
        $(function () {
            formGeneral();
        });
    </script>
</body>
</html>
