<?php
$ROWS_PER_PAGE = 14;
$RS_NAME = "";
$ROOM_LEAP_TIME = "12:00:00";

require_once("lib/dbconn.php");
require_once("lib/form.php");
require_once("lib/functions.php");


$PID = "home";
$SC = $_SERVER["SCRIPT_NAME"];
@session_start();

include 'lib/function_query.php';

?>

<html>
    <head >
        <title>HMS - Saranghe Living</title>
        <LINK rel="icon" href="images/aa.png" type="image/png">
  		<LINK rel="shortcut icon" href="images/aa.png" type="image/png">
        
        <SCRIPT type="text/javascript" language="JavaScript" src="js/jquery.js"></SCRIPT>
        <script type='text/javascript' language="JavaScript" src='js/jquery.ajaxQueue.js'></script>
        <script type='text/javascript' language="JavaScript" src='js/jquery.bgiframe.min.js'></script>
        <script type='text/javascript' language="JavaScript" src='js/jquery.ui.datepicker.js'></script>
        <script type='text/javascript' language="JavaScript" src='js/jquery.autocomplete.js'></script>
        <script type='text/javascript' language="JavaScript" src='js/thickbox-compressed.js'></script>
        <script type='text/javascript' language="JavaScript" src='js/localdata.js'></script>
        <script type='text/javascript' language="JavaScript" src='js/jquery.ui.core.js'></script>
        <SCRIPT type='text/javascript' language="JavaScript" src='js/floatingtable.js'></SCRIPT>
        <SCRIPT type='text/javascript' language="JavaScript" src='js/jquery-1.8.2.js'></SCRIPT>
        <SCRIPT type='text/javascript' language="JavaScript" src='js/jquery-ui.js'></SCRIPT>
        <SCRIPT type='text/javascript' language="JavaScript" src='js/jquery.table.addrow.js'></SCRIPT>
        <SCRIPT type='text/javascript' language="JavaScript" src='js/jquery-ui-sliderAccess.js'></SCRIPT>
        
        <link rel="stylesheet" type="text/css" href="css/jquery.gritter.css" />
        <link rel="stylesheet" type="text/css" href="css/template.css" />
        <LINK rel="stylesheet" type="text/css" href="css/tabbar.css">
        <link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery-ui2.css" />
        <link rel="stylesheet" type="text/css" href="css/semantic.css">
        <LINK rel="stylesheet" type="text/css" href="css/default.css">
        <script> 
            function daysInMonth(month, year) {
			    return new Date(year, month, 0).getDate();

			}
			
            $(function() {
                $( ".tanggal" ).datepicker({
                    dateFormat:'yy-mm-dd',
                    changeMonth :true,
                    changeYear :true
                });
                
                $( ".bln_thn" ).datepicker({
                	
                    dateFormat:'yy-mm',
                    changeMonth :true,
                    changeYear :true,
                    showButtonPanel: true,
                    
                    onClose: function(dateText, inst) { 
			            var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
			            var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
			            
			            $(this).datepicker('setDate', new Date(year, month, 1));
			            
			            
			            var nm_id = $(".bln_thn").val();
					    var thn = nm_id[0];
					    var bln = nm_id[1];
					    var jml_hr = daysInMonth(bln, thn);
					    $(".jml_hr").val(jml_hr);
			        }
                });
                
                $( ".tgl1" ).datepicker({
			      changeMonth: true,
			      dateFormat:'yy-mm-dd',
			      numberOfMonths: 3,
			      onClose: function( selectedDate ) {
			        $( ".tgl2" ).datepicker( "option", "minDate", selectedDate );
			      }
			    });
			    $( ".tgl2" ).datepicker({
			      defaultDate: "+1d",
			      changeMonth: true,
			      dateFormat:'yy-mm-dd',
			      numberOfMonths: 3,
			      onClose: function( selectedDate ) {
			        $( ".tgl1" ).datepicker( "option", "maxDate", selectedDate );
			      }

                  
			    });
			    
			    
			    //$('.wkt1').timepicker({ 'timeFormat': 'H:i:s' });
				
				//$('.wkt2').timepicker({ 'timeFormat': 'H:i:s' });
				
				/*var startDateTextBox  = $('.wkt1');
				var endDateTextBox = $('.wkt2');

				$.timepicker.datetimeRange(
					startDateTextBox,
					endDateTextBox,
					{
						minInterval: (1000*60*60), // 1hr
						dateFormat: 'yy-mm-dd', 
						timeFormat: 'HH:mm',
						start: {}, // start picker options
						end: {} // end picker options					
					}
				);*/
                
            });
            
            $().ready(function() {
                function log(event, data, formatted) {
                    $("<li>").html( !data ? "No match!" : "Selected: " + formatted).appendTo("#result");
                }
                function formatItem(row) {
                    return row[0] + " (<strong>id: " + row[1] + "</strong>)";
                }
                function formatResult(row) {
                    return row[0].replace(/(<.+?>)/gi, '');
                }                
                $("#clear").click(function() {
                    $(":input").unautocomplete();
                });
            });

            
        </script>

    </head>

    <body class="BODY">
         <?php
          
					
				
         ?>
         <table width="100%" border="0" cellspacing="0" cellpadding="0" >
             <tr valign="top">
                 <td  valign="absmiddle" >  
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="right" >
                        <tr valign="middle" >
                            <td rowspan="2" height="64" align="left" background="images/top.gif"><img src="images/aa.png" width = "80" align="left" hspace="15" />
                                <font color=black>
                               

                                <div class="TITLE_SIM" >Saranghe Living</div>
                                 <div class="TITLE_SIM" >"A Little Korea in Every Corner"</div>
                                <div class="TITLE_SIM"><?php echo $kota = getFromTable("select kota from tbl_pnpm"); ?></div>
                            <td  height="64" align="left" background="images/top.gif">

                            </td>
                        </tr>
                    </table>

                </td>
             </tr>
             <!--MENU-->
             
             <tr>
                 <td>
                     <?php include('includes/menu.php');?>
                 </td>
             </tr>
             
             <tr>
                 <td>
                     <?php
                     if (empty($_SESSION[uid])) {
                     	echo "<script language='JavaScript'>document.location='index.php'</script>";
                     } else {
					 	if (file_exists("includes/" . $_GET["p"] . ".php")) {                                                  
	                        include("includes/" . $_GET["p"] . ".php");
	                        echo "<br>";
	                        include("includes/footer.php");
	                        exit;
	                    } else {
	                        echo "File tidak tersedia!";
	                        include("includes/footer.php");
	                    }
					 }	
                     
                     ?>
                 </td>
             </tr>
         </table>
	<?php  ?>
    </body>

</html>
