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

$maindb = "feedback";
//$trandb = "saletran";
$formname = "Feedback Register";
$file = "feedback.php";

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

if (isset($_POST["view"])) {
    $vouchno = $_POST[vouchno];
    $name = $_POST[name];
    $mobile = $_POST[mobile];
    $comments = $_POST[comments];
    $address = $_POST[address];
    $date = $_POST[date];
    $destination = $_POST[destination];


    $vouchcond = "";
    $namecond = "";
    $mobilecond = "";
//    browse($gtype);
    if (!empty($vouchno)) {
        $vouchcond = " AND a.vouchno='$vouchno' ";
    }

    if (!empty($name)) {
        $namecond = " AND b.name='$name' ";
    }

    if (!empty($mobile)) {
        $mobilecond = " AND b.mobile='$mobile' ";
    }


    if (empty($_POST["vouchno"])) {
        browse("From Book No Cannot Be Empty");
        header("refresh:1; feedback.php");
    }
//if (empty($_POST["todt"])) {
//browse("To Date Cannot Be Empty");
//header("refresh:1; feedback.php");
//}
//$mfrmdate = trim($_POST["frmdt"]);
//$mtodate = trim($_POST["todt"]);
// print "SELECT * FROM `$maindb` WHERE `vouchno`!='' $partyname $broker $transpor $item $godown $mtype";
//$getpmain = mysqli_query($conn,"SELECT *,DATE_FORMAT(`vouchdt`, '%d-%m-%Y') as mydt,DATE_FORMAT(`deptdate`, '%d-%m-%Y') as deptdate
//                         FROM $maindb where `vouchdt` >= '$mfrmdate' AND `vouchdt` <= '$mtodate'
//                         $staffcond $mtypecond order by vouchno")or die(mysqli_error($conn));
    $getfeed = mysqli_query($conn,"SELECT a.*, b.name, b.mobile FROM $maindb a , `confmain` b where a.vouchno = b.vouchno $vouchcond $namecond $mobilecond")or die(mysqli_error($conn));
    $get = mysqli_fetch_array($getfeed);

    $gethotel = mysqli_query($conn,"Select * from confmain where `vouchno`='$get[vouchno]'") or die(mysqli_error($conn));
    $mhotel = mysqli_fetch_array($gethotel);


    $comments = $get[comments];
    $mhot1 = $mhotel[destcity1];
    $mhot2 = $mhotel[destcity2];
    $mhot3 = $mhotel[destcity3];
    $mhot4 = $mhotel[destcity4];
    $mhot5 = $mhotel[destcity5];

    include("includes/linkshead.php");
    ?>
    <!--<script src="MyScript/challan.js" type="text/javascript"></script>-->
    <link rel="stylesheet" type="text/css" href="MyStyle/feedback.css">
    </head>
    <body>
        <!--    <div id="preloader" class="col-lg-12 text-center">
                <h3 class="text-center">Loading</h3>
                <div id="status">&nbsp;</div>
            </div>-->
        <form action='' method='POST' src="images/feedback2.jpg">
            <!--<div style="position:relative; top:0px; left:0px; width:100px; height:100px; opacity:0.3;"><img src="images/logo.jpg" alt=" " /></div>-->



            <!-- Default box -->
            <div class="row" >
                <div class="col-lg-7">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><?php Echo $formname; ?></h3>
                            <div class="actions pull-right">
                                <i class="fa fa-chevron-down"></i>

                            </div>
                        </div>
                        <div class="panel-body" >
                            <!--                            <div class="form-group">
                                                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                                <label class="label-control marg" style=""></label>
                                                            </div>
                                                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                                                <label class="label-control marg" style="">Not Good</label>
                                                            </div>
                                                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                                                <label class="label-control marg" style="">Satisfactory</label>
                                                            </div>
                                                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                                                <label class="label-control marg" style="">Good</label>
                                                            </div>
                                                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                                                <label class="label-control marg" style="">Excellent</label>
                                                            </div>
                                                            
                                                        </div>-->
                            <div class="form-group">
                                <ul>
                                    <li style="display:inline; margin-right:50px; font-weight:bold"></li> 
                                    <li style="display:inline; margin-right:72px; font-weight:bold"></li> 
                                    <li style="display:inline; margin-right:5px; font-weight:bold;color:#FF0000;">Not Good</li> 
                                    <li style="display:inline; margin-right:12px; font-weight:bold;color:#FFA500;">Satisfactory</li> 
                                    <li style="display:inline; margin-right:23px; font-weight:bold;color:#64ccfc;">Good</li> 
                                    <li style="display:inline; margin-right:5px; font-weight:bold;color:#008000;">Excellent</li> 
                                </ul>  
                            </div>
                            <div class="form-group">
                                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                    <label class="label-control marg" style="">Over All Trip</label>
                                </div>
                                <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                    <input type="radio" name="trip" value="1" <?php
                                    if ($get['trip'] == '1') {
                                        echo 'checked';
                                    }
                                    ?>  title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                    <input type="radio" name="trip" value="2" <?php
                                    if ($get['trip'] == '2') {
                                        echo 'checked';
                                    }
                                    ?>  title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    <input type="radio" name="trip" value="3" <?php
                                           if ($get['trip'] == '3') {
                                               echo 'checked';
                                           }
                                           ?>  title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    <input type="radio" name="trip" value="4" <?php
                                           if ($get['trip'] == '4') {
                                               echo 'checked';
                                           }
                                           ?>  title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                </div>
                            </div>
                                    <?php if ($mhot1 != '') {
                                        ?>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Service in <?= $mhot1 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="service1" value="1" <?php
                                               if ($get['service1'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?>  title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="service1" value="2" <?php
                                               if ($get['service1'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?> title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service1" value="3" <?php
                                               if ($get['service1'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?>  title="Good"style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service1" value="4" <?php
                                               if ($get['service1'] == '4') {
                                                   echo 'checked';
                                               }
                                               ?> title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Hotel in <?= $mhot1 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="hotel1" value="1" <?php
                                               if ($get['hotel1'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?>  title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="hotel1" value="2" <?php
                                               if ($get['hotel1'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?> title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel1" value="3" <?php
                                               if ($get['hotel1'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?>  title="Good"style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel1" value="4" <?php
                                if ($get['hotel1'] == '4') {
                                    echo 'checked';
                                }
                                ?> title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>
        <?php
    }
    if ($mhot2 != '') {
        ?>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Service in <?= $mhot2 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="service2" value="1" <?php
                                               if ($get['service2'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?> title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="service2" value="2" <?php
                                               if ($get['service2'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?> title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service2" value="3" <?php
                                               if ($get['service2'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?> title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service2" value="4" <?php
                                               if ($get['service2'] == '4') {
                                                   echo 'checked';
                                               }
                                               ?> title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Hotel in <?= $mhot2 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="hotel2" value="1" <?php
                                               if ($get['hotel2'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?> title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="hotel2" value="2" <?php
                                               if ($get['hotel2'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?> title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel2" value="3" <?php
                                               if ($get['hotel2'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?> title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel2" value="4" <?php
                                if ($get['hotel2'] == '4') {
                                    echo 'checked';
                                }
                                ?> title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>

        <?php
    }
    if ($mhot3 != '') {
        ?>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Service in <?= $mhot3 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="service3" value="1" <?php
                                               if ($get['service3'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?> title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="service3" value="2" <?php
                                               if ($get['service3'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?> title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service3" value="3" <?php
                                               if ($get['service3'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?> title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service3" value="4" <?php
                                               if ($get['service3'] == '4') {
                                                   echo 'checked';
                                               }
                                               ?> title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Hotel in <?= $mhot3 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="hotel3" value="1" <?php
                                               if ($get['hotel3'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?> title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="hotel3" value="2" <?php
                                               if ($get['hotel3'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?> title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel3" value="3" <?php
                                               if ($get['hotel3'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?> title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel3" value="4" <?php
                                if ($get['hotel3'] == '4') {
                                    echo 'checked';
                                }
                                ?> title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>

        <?php
    }
    if ($mhot4 != '') {
        ?>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Service in <?= $mhot4 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="service4" value="1" <?php
                                               if ($get['service4'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?>title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="service4" value="2" <?php
                                               if ($get['service4'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?>title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service4" value="3" <?php
                                               if ($get['service4'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?>title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service4" value="4" <?php
                                               if ($get['service4'] == '4') {
                                                   echo 'checked';
                                               }
                                               ?>title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Hotel in <?= $mhot4 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="hotel4" value="1" <?php
                                               if ($get['hotel4'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?>title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="hotel4" value="2" <?php
                                               if ($get['hotel4'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?>title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel4" value="3" <?php
                                               if ($get['hotel4'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?>title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel4" value="4" <?php
                                if ($get['hotel4'] == '4') {
                                    echo 'checked';
                                }
                                ?>title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>

        <?php
    }
    if ($mhot5 != '') {
        ?>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Service in <?= $mhot5 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="service5" value="1" <?php
                                               if ($get['service5'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?>title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="service5" value="2" <?php
                                               if ($get['service5'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?>title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service5" value="3" <?php
                                               if ($get['service5'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?>title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="service5" value="4" <?php
                                               if ($get['service5'] == '4') {
                                                   echo 'checked';
                                               }
                                               ?>title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg" style="">Hotel in <?= $mhot5 ?></label>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                        <input type="radio" name="hotel5" value="1" <?php
                                               if ($get['hotel5'] == '1') {
                                                   echo 'checked';
                                               }
                                               ?>title="Not Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;">
                                        <input type="radio" name="hotel5" value="2" <?php
                                               if ($get['hotel5'] == '2') {
                                                   echo 'checked';
                                               }
                                               ?>title="Satisfactory" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel5" value="3" <?php
                                               if ($get['hotel5'] == '3') {
                                                   echo 'checked';
                                               }
                                               ?>title="Good" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                        <input type="radio" name="hotel5" value="4" <?php
                                               if ($get['hotel5'] == '4') {
                                                   echo 'checked';
                                               }
                                               ?>title="Excellent" style="height:35px; width:20px; vertical-align: middle; margin-right:56px;"> 
                                    </div>
                                </div>

    <?php } ?>
        <!--                            <table>
        <tr><td>   
                <div class="form-group" style="float:left; clear: left;">
                <div class="form-group">
                    <div class="col-lg-12 col-md-3 col-sm-3 col-xs-3 ">
                        <div class="col-lg-6 col-md-8 col-sm-8 col-xs-8 pad">
                            <label class="label-control marg">Travel next</label>
                        </div>
                        <div class="col-lg-6 col-md-4 col-sm-4 col-xs-4">
                            <input type="date" class="form-control"  name="date" value="<?php Echo ($addflag != 1) ? $get["date"] : date("d-m-Y"); ?>" style="width:136px; margin-left: -39px;">
                        </div>
                    </div>
                </div></td></tr>
        </table>-->
        <!--                            <table>
        <tr><td>
                <div class="form-group">
                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 ">
                        <label class="label-control marg">Destination</label>
                    </div>
                    <div class="col-lg-3 col-md-8 col-sm-8 col-xs-8 pad">
                        <input type="text" class="form-control" name="destination" value="<?php Echo ($addflag != 1) ? $get["destination"] : ""; ?>"  style="width:250px;">
                    </div>
                </div></td></tr>
        </table>-->
                            <div class="form-group">
                                <div class="col-lg-10 col-md-3 col-sm-3 col-xs-3 ">
                                    <strong>Would you like to receive updates about our special offer<input type="checkbox" name="" style="zoom:2; " <?php
                                    if ($get['offers'] == '1') {
                                        echo 'checked';
                                    }
                                    ?>></strong>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-10 col-md-3 col-sm-3 col-xs-3 ">
                                    <br>
                                    <!--<b>Other Comments:</b><textarea rows="4" cols="50" name="comments" value="<?php // Echo ($addflag != 1) ? $get["comments"] : "";                    ?>"></textarea>-->
                                    <b>Other Comments:</b><textarea rows="4" cols="50" name="comments" value=""><?php echo $get["comments"] ?></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-12 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                    <div class="col-lg-6 col-md-8 col-sm-8 col-xs-8 pad">
                                        <label class="label-control marg  pull-left"  >When do you Planning to travel next</label>
                                    </div>
                                    <div class="col-lg-6 col-md-8 col-sm-8 col-xs-8 pad" >
                                        <select name="gtype" class="form-control pull-left" style="height:33px;width:145px; margin-left:-85px;">
                                            <option value="0"<?php
                                    if ($get[travel] == '0') {
                                        echo "selected : 'selected'";
                                    }
                                    ?>>3 Month</option>
                                            <option value="1"<?php
                                    if ($get[travel] == '1') {
                                        echo "selected : 'selected'";
                                    }
                                    ?>>6 Month</option>
                                            <option value="2"<?php
                                    if ($get[travel] == '2') {
                                        echo "selected : 'selected'";
                                    }
                                    ?>>Next year</option>
                                            <option value="3"<?php
                                    if ($get[travel] == '3') {
                                        echo "selected : 'selected'";
                                    }
                                    ?>>2 year</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-10 col-md-3 col-sm-3 col-xs-3 ">
                                    <br>
                                    <b>Residental Address:</b><textarea rows="4" cols="50" name="address" value="<?php Echo ($addflag != 1) ? $get["comments"] : ""; ?>"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--                        <div class="panel-footer">
    <?php // include("includes/buttons.php");              ?>
                                                </div>-->
                    </div>
                </div>
            </div>
        </form>

    <?php include("includes/linksfoot.php"); ?>
    </body>
    </html>
    <?php
}
?>
