





<?php $__env->startSection('content'); ?>
<style>

.circle { 
   width: 140px;
   height: 140px;
   background: lightgray; 
   -moz-border-radius: 70px; 
   -webkit-border-radius: 70px; 
   border-radius: 70px;
}
</style>

<?php
    $visitor_name = '';
?>

<?php if(auth()->guard('publicuser')->check()): ?>
    <?php
        $visitor_name = auth('publicuser')->user()->name;
    ?>
<?php endif; ?>
<input type="hidden" id="loggedinUsername" value="<?php echo e($visitor_name); ?>">


            <!-- row -->
			<div class="container-fluid">
                
               

                <?php if(!session('centre')): ?>
                <div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="centreselection">
                    <div class="modal-dialog modal-lg modal-dialog-centered">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title">Choose a Centre</h5>
                                <button type="button" class="close" data-dismiss="modal"><span>&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                            	
                            	<div class="row">
			                    
			                       

			                            	<?php $__currentLoopData = $organisations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $org): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
			                            	
			                            	<div class="col" style="text-align: center; padding: 2px;">
			                            		<a href="#" onclick="setcentre(<?php echo e($org->id); ?>);">
				                            		<p>
				                                        <img class="mr-3 rounded" src="<?php echo e(asset('images/city.png')); ?>" width="40%">
				                                         <!--<i class="fa fa-university fa-3x mr-3 rounded" aria-hidden="true"></i>-->
				                                        <div> <strong><?php echo e($org->organisation_name); ?></strong> </div>
				                                        <div><?php echo e($org->city); ?></div>
				                                     </p>
			                                 	</a>
			                                        
			                                </div>
			                            	


			                                

			                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
			               		</div>

                            </div>
                           
                        </div>
                    </div>
                </div>
                <?php endif; ?>
                <div class="row">
                    <div class="col-xl-12">
                        <p class="mb-2">You have to create an account before availing the reservation facility. <a href="<?php echo url('/user/login'); ?>">Sign in/ Login</a></p>

                        <p class="mb-2">Kindly read the guidelines below before booking the tickets.</p>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xl-4">
						<div class="row" style="height: 100%;">
							
							<div class="col-lg-12">
								<div class="card">
									<div class="card-header border-0 pb-0">
										<h4 class="text-black">Book your tickets</h4>
									</div>
                                    <?php
                                      $todate = date("Y-m-d");
                                      $ticket_max_date = date("Y-m-d", strtotime("+".$ticket_booking_max_days."days"));
                                    ?>
									<div class="card-body pt-3">
										<div class="profile-blog">
											<form>
                                                            
                                                            <div class="form-group">
                                                                <label>Date of Visit</label>
                                                                <input name="date_of_visit" class="form-control" id="date_of_visit" type="date" value="<?php echo e(\Session::get('date_of_visit')); ?>" min="<?php echo e($todate); ?>" max="<?php echo e($ticket_max_date); ?>" >
                                                                <input type="hidden" name="ticket_max_date" id="ticket_max_date" value="<?php echo e($ticket_max_date); ?>">
                                                                <input type="hidden" name="todate" id="todate" value="<?php echo e($todate); ?>">
                                                            </div>

                                                            <div class="form-group">
                                                                <label>Name</label>
                                                                <input name="visitor_name" class="form-control" id="visitor_name" type="text" value="<?php echo e($visitor_name); ?>" maxlength="250" onkeypress="return isChar(event);" onchange="return nameCheck_char(this,'Name');">
                                                            </div>

                                                            <div class="form-group">
                                                                <label>Centre</label>
                                                                <select class="form-control" id="inputCentre" name="inputCentre">
                                                                        <option selected="">Choose...</option>
                                                                        <?php $__currentLoopData = $organisations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $org): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                        	<?php if($org->id==session('centre')): ?>
                                                                                <option value="<?php echo e($org->id); ?>" selected><?php echo e($org->remarks); ?>, <?php echo e($org->city); ?></option>
                                                                            <?php else: ?>
                                                                                <option value="<?php echo e($org->id); ?>"><?php echo e($org->remarks); ?>, <?php echo e($org->city); ?></option>
                                                                            <?php endif; ?>
                                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                        
                                                                    </select>
                                                            </div>

                                                           

                                                            <div class="mb-3 mb-0">
                                                                <label class="radio-inline me-3 radioBooking"><input type="radio" name="bookingType" id="normalRadio" value="normalBooking" checked> Normal</label>&nbsp;
                                                                <label class="radio-inline me-3 radioBooking"><input type="radio" name="bookingType" id="educationalRadio" value="groupBooking"> Educational Institution</label>
                                                                
                                                            </div>

                                                           
                                                            <div class="form-row">
                                                                <div class="form-group col-md-6" id="adultdiv">
                                                                    <label>Adults</label>
                                                                    <input type="number" class="form-control" name="adultCount" id="adultCount" value="<?php echo e(\Session::get('adultCount')); ?>" maxlength="3">
                                                                </div>
                                                                <div class="form-group col-md-6" id="childdiv">
                                                                    <label id="childlabel">Children</label>
                                                                    <input type="number" class="form-control" name="childCount" id="childCount" value="<?php echo e(\Session::get('childCount')); ?>" maxlength="3">
                                                                </div>
                                                                
                                                            </div>
                                                            
                                                            <button class="btn btn-primary" type="submit" id="bookBtn">Book Now</button>
                                                            <button class="btn btn-secondary" type="button">Clear</button>
                                                        </form>
										</div>
									</div>
								</div>
							</div>

							<!-- <div class="col-lg-12">							
								<div class="card">
									<div class="card-header border-0 pb-0">
										<h4 class="text-black">Availability</h4>
									</div>
									<div class="card-body pt-3">
										<div class="profile-news">
											<div class="media pt-3 pb-3">
												
												<div class="media-body" style="text-align:center;">
                                                    <p><input type="date" name="selectDate" id="selectDate" class="form-control">
                                                    <p><span style="text-align:center;"><img  src="<?php echo e(asset('images/planetaurium.png')); ?>" alt="image" class="mr-3 rounded" width="75"></span></p>

													<h5 class="m-b-5"><a href="<?php echo url('/post-details'); ?>" class="text-black">Planetaurium, Thiruvananthapuram</a></h5>
													<p class="mb-0"><h3>232</h3></p>
												</div>
											</div>
											
											
											
										</div>
									</div>
								</div>
                            </div> -->
                        </div>
                    </div>
                    <div class="col-xl-8">
                        <div class="card">
                            <div class="card-body">
                                <div class="profile-tab">
                                    <div class="custom-tab-1">
                                        <ul class="nav nav-tabs">
                                            <li class="nav-item"><a href="#my-posts" data-toggle="tab" class="nav-link active show">Kerala State Science & Technology Museum</a>
                                            </li>
                                            
                                           
                                        </ul>
                                        <div class="tab-content">
                                            <div id="my-posts" class="tab-pane fade active show">
                                                <div class="my-post-content pt-3">
                                                    <div class="post-input">
                                                        
                                                        <p class="mb-2">Kerala Science and Technology Museum ,Established in 1984, the Kerala State Science & Technology Museum, is an autonomous organisation, setup by the Government of Kerala, to serve as a dynamic medium of science communication for the public and for inculcating a sense of inquiry and scientific temperament in the minds of the young.</p>
                                                        <p> The main attraction of Kerala state Science and Technology Museum is the Priyadarsini Planetarium. The hybrid Planetarium with 240 seats is equipped with digital projection system and opto mechanical projection system. The planetarium is capable of projecting astronomical shows as well as educational fulldome shows. </p>
                                                        <p>Other major attractions in KSSTM are galleries on popular science, astronomy, space, electrical engineering, mathematics and robotics. The science park and children's play park help to learn scientific concepts through play.</p>
                                                        <p>The Science On Sphere facility is a unique educational tool at KSSTM for educating the visitors on Earth science. The adventurous 3D show is mostly suited to children.</p>
                                                        <p>During evening, there is musical water fountain and laser show to entertain the visitors. The astronomical observatory is available for public observation on all Thursdays and Fridays.</p>
                                                        <p>You are requested to go through the guidelines before availing online reservation.</p>

                                                    </div>
                                                    <div class="profile-uoloaded-post border-bottom-1 pb-5">
                                                        <img  src="<?php echo e(asset('images/ksstm_big.jpg')); ?>" alt="" class="img-fluid">
                                                        
                                                    </div>
                                                   
                                                    
                                                </div>
                                            </div>
                                            
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-xl-12">
                        <div class="card">
                            <div class="card-body">
                                <ul class="nav nav-tabs">
                                    <li class="nav-item"><a href="#" data-toggle="tab" class="nav-link active show">Terms and Conditions</a>
                                    </li>
                                    
                                   
                                </ul>
                                <p><h4><u>Guidelines to Visitors</u></h4></p>

                                <p class="mb-2">1. For reservation of tickets, the visitors shall register through the website www.ksstm.in using an active mobile number and/or email id and a password. 
                                </p>
                                <p class="mb-2">2.  The reservation slip showing reservation number will be send to the registered email id and/or the mobile number (as SMS) after completing the online payment. The registration slip will be also available at the customer login accounts in the website. 
                                </p>
                                <p class="mb-2">3.  Visitors are requested to collect actual tickets from the Kiosk installed at the centre, using the reservation number.
                                </p>
                                <p class="mb-2">4.  The visitors are requested to carry the registered mobile while visiting the campus as the OTP for issuing actual tickets at kiosks will be send to the registered mobile on the day of visit. <b>It is mandatory to carry the orginal id card of the visitor who has booked the ticket.</b>
                                </p>
                                <p class="mb-2">5.  Online ticket reservation facility is available for Science Galleries & Park, Planetarium show, 3D show, Science on Sphere show, and Musical Water Fountain show. 
                                </p>
                                <p class="mb-2">6.  There is no special reservation fee for online booking other than the actual ticket fare. But banking charges related to payment gateway shall be borne by the visitor.
                                </p>
                                <p class="mb-2">7.  Tickets are also available at KSSTM campus counter for all scheduled regular shows, subject to availability. 
                                </p>
                                <p class="mb-2">8.  For special shows (shows conducted based on demand), tickets are available only at campus ticket counter.
                                </p>
                                <p class="mb-2">9.  Online reservation is available till 3 hours before the scheduled show timing.
                                </p>
                                <p class="mb-2">10. All Mondays are holidays for the Museum.  
                                </p>
                                <p class="mb-2">11. Visitors are requested to refer show timings and tariff before booking. Show timings and date of reserved tickets are not alterable.
                                </p>
                                <p class="mb-2">12. <b>Visitors are requested to enter Museum campus at least 30 minutes before the commencement of the show.</b>
                                </p>
                                <p class="mb-2">13. No tickets are required for children less than 3 years.
                                </p>
                                <p class="mb-2">14. For children in the age group of  3-12, special discounted rates will be charged. 
                                </p>
                                <p class="mb-2">15. Persons above 12 years old will be considered as Adults and should take full tickets.
                                </p>
                                <p><h6><u>Cancellation Policy</u></h6></p>
                                <p class="mb-2">16. <b>Ticket refund is based on the Cancellation policy. 80% of actual fare will be refunded if online reservation is cancelled at least 2 days before date of visit; 50% refund till 1 day before the reserved date. No refund is applicable for cancellation afterwards. In case, due to any reasons, if KSSTM couldn’t conduct the show or open the facility, due to any unforeseen reasons, the full ticket amount will be refunded. </b>
                                </p>
                                <p class="mb-2">17. <b>For bulk booking from educational institutions, the group leader should carry the request containing the list of students in original letterhead from the institution and will be verified before issuing the actual tickets. The ticket will be considered invalid and no refund will be done if the group leader fails to produce the request. </b>
                                </p>
                                <p class="mb-2">18. All visitors are expected to follow the rules and procedures of KSSTM while visiting the campus. 
                                </p>
                                <p class="mb-2">19. Online transaction charges as applicable for the payment gateway will be extra as actual.
                                </p>
                                <p class="mb-2">20. Maximum number of visitors that can be booked in a ticket is limited to 65. If there are more than 65 people in the group booking, its is advised to book as multiple tickets.
                                </p>
                                <p class="mb-2">21. Any disputes regarding the online tickets will be settled at the discretion of the Director, KSSTM.
                                </p>
                            </div>
                        </div>
                    </div>

                    <div class="col-xl-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="post-input">
                                                        
                                    <!-- Footer Links -->
  <div class="container-fluid text-center text-md-left">

    <!-- Grid row -->
    <div class="row">

      <!-- Grid column -->
      <div class="col-md-6 mt-md-0 mt-3">

        <!-- Content -->
        <h5 class="text-uppercase">KERALA STATE SCIENCE AND TECHNOLOGY MUSEUM & PRIYADARSINI PLANETARIUM</h5>
        <p>
Vikasbhavan P.O,
Thiruvananthapuram - 33<br>

Ph : 2306024, 2306025, 2304286,
Fax : 0471-2304286<br>

Email : directorksstm@gmail.com<br>

Website : www.kstmuseum.com</p>

      </div>
      <!-- Grid column -->

      <hr class="clearfix w-100 d-md-none pb-3">

      <!-- Grid column -->
      <div class="col-md-3 mb-md-0 mb-3">

        <!-- Links -->
        <h5 class="text-uppercase">Other Links</h5>

        <ul class="list-unstyled">
          <li>
            <a href="licence">Terms and Conditions</a>
          </li>
          <li>
            <a href="disclaimer">Disclaimer</a>
          </li>
          <li>
            <a href="policy_cancel">Cancellation Policy</a>
          </li>
          <li>
            <a href="privacy_policy">Privacy Policy</a>
          </li>
          
        </ul>

      </div>
      <!-- Grid column -->

      <!-- Grid column -->
      <div class="col-md-3 mb-md-0 mb-3">

        <!-- Links -->
        <h5 class="text-uppercase">Links</h5>

        <ul class="list-unstyled">
          <li>
            <a href="about">About</a>
          </li>
          <li>
            <a href="rates">Rates</a>
          </li>
          <li>
            <a href="shows">Show Timings</a>
          </li>
          <li>
            <a href="contact">Contact</a>
          </li>
        </ul>

      </div>
      <!-- Grid column -->

    </div>
    <!-- Grid row -->

  </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


<script type="text/javascript">
    $(document).ready(function(){
        $("#centreselection").modal('show');
    });

function isChar(evt) 
{
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 47 && charCode < 58) 
    {
        return false;
    }
   
}
/////check given string suitable for names... accepts only a-z,A-Z,'///////////////////////////////////////////////
function nameCheck_char (field,fieldname) 
{  
    var inputString = field.value;
    // Same, but here we instead check for characters. NOT matching the pattern. Above we capture all legal chars, here we capture all illegal chars by adding a ^ inside the class,
    // And overwrite them with "".
    var newStr = inputString.match(/^([a-zA-Z ]){2,250}$/, "");
    // If the lengths aren't equal, something was removed. If something was removed, the string contained illegal chars. Returns true if no illegal chars, else false.
    if(newStr== null)
    {
        sweetAlert("Oops...", "Name field is not valid, please enter correct input for Name", "error");
        field.value = "";
        field.focus();
        return false;   
    }
}
function setcentre(org_id)
{
    var csrf = "<?php echo e(csrf_token()); ?>";
    $.ajax({
      type: "POST",
      url: "<?php echo e(url('user/setcentre')); ?>",
      dataType : 'json',
      data: {_token: csrf, centre: org_id},
      success: function( result ) {
        
         
        if(result.statusCode == 200){
                
            //alert("Centre set");
            $('#centreselection').modal('hide');

            $('#selectedCentre').val(org_id);

            $('#inputCentre').val(org_id);
        }
        else{
            sweetAlert("Oops...", "Something went wrong, Try again later !!", "error");
        }
        
      }
    });   
}

$(function(){
    var dtToday = new Date();
    
    var month = dtToday.getMonth() + 1;
    var day = dtToday.getDate();
    var year = dtToday.getFullYear();
    if(month < 10)
        month = '0' + month.toString();
    if(day < 10)
        day = '0' + day.toString();
    
    var maxDate = year + '-' + month + '-' + day;

    // or instead:
    // var maxDate = dtToday.toISOString().substr(0, 10);

    //alert(maxDate);
    $('#date_of_visit').attr('min', maxDate);
});

$(function(){

  $("#bookBtn").click(function(){

        //check if all values are enetered
        var date_of_visit = $("#date_of_visit").val();
        var visitor_name = $("#visitor_name").val();
        var inputCentre = $("#inputCentre").val();
        var adultCount = $("#adultCount").val();
        var childCount = $("#childCount").val();
        var bookingType = $('form input[type=radio]:checked').val();
        //alert(bookingType);

        var ticket_max_date = $("#ticket_max_date").val();
        var todate = $("#todate").val();
        if(date_of_visit>ticket_max_date)
        {
            sweetAlert("Oops...", "Please check date of visit", "error");
            return false;  
        }
        if(date_of_visit<todate)
        {
            sweetAlert("Oops...", "Please check date of visit", "error");
            return false;  
        }

        if(date_of_visit && visitor_name && inputCentre && (adultCount || childCount))
        {
           //save to session
           var csrf = "<?php echo e(csrf_token()); ?>";
            $.ajax({
              type: "POST",
              url: "<?php echo e(url('user/setinputs')); ?>",
              dataType : 'json',
              data: {_token: csrf, date_of_visit: date_of_visit, visitor_name: visitor_name, inputCentre: inputCentre, adultCount: adultCount, childCount: childCount, bookingType: bookingType},
              success: function( result ) {
                
                //console.log(result);
                //return;
                 
                if(result.statusCode == 200){
                        
                    //inputs set to session

                    var loggedin = $("#loggedinUsername").val();
                    if(loggedin)
                    {
                        //logged in user, redirect to facility booking page
                        let url = "<?php echo e(url('user/booktickets')); ?>";
                        document.location.href = url;
                    }
                    else
                    {
                         //sweetAlert("Oops...", "You must login to continue !!", "error");
                         alert("You must login to continue !!");
                         let url = "<?php echo e(url('user/login')); ?>";
                         document.location.href = url;
                         return false;
                    }

                }
                else{
                    sweetAlert("Oops...", "Something went wrong, Try again later !!", "error");
                    return false;
                }
                
              }
            });  
        }
        else
        {
            //alert(date_of_visit+".."+visitor_name+".."+inputCentre+".."+adultCount+".."+childCount);
            sweetAlert("Oops...", "All fields are not entered !!", "error");
            return false;
        }


        


        

        return false;

    });

   $("#educationalRadio").click(function(){
        sweetAlert("Educational Institution", "You must carry authorization letter from the institution at the time of visit. Otherwise ticket will be considered invalid!", "info");
        //$("#adultCount").val('');
        //$("#adultdiv").hide();
        //$("#childlabel").html('No: of Children including staffs')
   });
   $("#normalRadio").click(function(){
        
        
        //$("#adultdiv").show();
        //$("#childlabel").html('Children')
   });
});
</script>

<?php $__env->stopSection(); ?>			
<?php echo $__env->make('layout.public', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/ksstmprod/resources/views/tickets/index.blade.php ENDPATH**/ ?>