<?php session_start(); ?> <!-- session start -->
<?php include("../include/config.php"); ?> <!-- database connection -->
<?php include("../include/connect_url.php"); ?> <!-- connection url/link folder -->
<?php include("../include/date_time.php"); ?> <!-- date & time format -->
<?php include("../database/account.php"); ?> <!-- query database account -->
<?php include("../include/lang.php"); ?> <!-- language -->
<?php include("../include/session_login.php"); ?> <!-- session login -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title><?php include("../template/title.php"); ?></title>

<link rel="shortcut icon" href="<?php echo $connect_url_data; ?>/favicon.ico" />

<link href="<?php echo $connect_url_data; ?>/css/styles.css" rel="stylesheet" type="text/css" />
<!--[if IE]> <link href="<?php echo $connect_url_data; ?>/css/ie.css" rel="stylesheet" type="text/css"> <![endif]-->
<link rel="stylesheet" href="<?php echo $connect_url_data; ?>/font/font-awesome-4.3.0/css/font-awesome.min.css">

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/download/jquery183.js"></script> 
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/download/jquery192.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/charts/excanvas.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/charts/jquery.flot.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/charts/jquery.flot.orderBars.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/charts/jquery.flot.pie.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/charts/jquery.flot.resize.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/charts/jquery.sparkline.min.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/tables/jquery.sortable.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/tables/jquery.resizable.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.autosize.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.uniform.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.inputlimiter.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.maskedinput.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.autotab.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.select2.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.dualListBox.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.cleditor.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.ibutton.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.validationEngine-en.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.validationEngine.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/globalize/globalize.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/globalize/globalize.culture.de-DE.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/globalize/globalize.culture.ja-JP.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/uploader/plupload.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/uploader/plupload.html4.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/uploader/plupload.html5.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/uploader/jquery.plupload.queue.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/wizards/jquery.form.wizard.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/wizards/jquery.validate.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/wizards/jquery.form.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.collapsible.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.breadcrumbs.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.tipsy.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.progress.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.colorpicker.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.jgrowl.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.fancybox.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.fileTree.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.sourcerer.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/others/jquery.fullcalendar.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/others/jquery.elfinder.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/forms/jquery.mousewheel.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.easytabs.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/files/bootstrap.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/files/functions.js"></script>

</head>

<body>

<!-- header-->
<?php include("../template/header.php"); ?>

<!-- sidebar-->
<?php include("../template/sidebar.php"); ?>
   
<!-- Content begins -->
<div id="content">
    
    <!-- Breadcrumbs line -->
    <div class="breadLine">
        <div class="bc">
            <ul id="breadcrumbs" class="breadcrumbs">
                     <li><a href="<?php echo $connect_url_data; ?>/dashboard"><?php echo $lang['Dashboard']; ?></a></li>
                <li class="current"><a href="#"><?php echo $lang['Localisation']; ?></a></li>
            </ul>
        </div>
        
<!-- breaklink -->
<?php include("../menu/breadlink.php"); ?>
	
    </div>
    
    <!-- Main content -->
    <div class="wrapper">

<?php

if($_POST)
{

//timezone 
$timezone = $_POST['timezone'];

//country
$country = $_POST['country'];

//language
$language = $_POST['language'];

//currency
$currency = $_POST['currency'];

//number format
$number_format = $_POST['number_format'];

//account
$sql = "UPDATE tbl_account SET  timezone_id='$timezone', country_id='$country', language_id='$language', currency_id='$currency', number_format_id='$number_format' WHERE  id ='$db_account_id '";
$result = mysql_query($sql) or die("Error: Failed to Update!");

die ("<script> alert('Saved.');
window.location.href='$connect_url_data/localisation';
</script> ");
}
?>

<form name="form" id="form" action="<?php echo $connect_url_data; ?>/localisation" class="main" method="POST"  enctype="multipart/form-data">
            <fieldset>
                <div class="widget fluid">
                    <div class="whead"><h6><span class="fa fa-file" style="margin-top:-2px;"></span>&nbsp; <?php echo $lang['Localisation']; ?></h6></div>
               
		      
		      <div class="formRow">
                            <div class="grid2"><label><?php echo $lang['Timezone']; ?>:</label></div>
                            <div class="grid10">
                               <?php
				$query_timezone1=mysql_query("SELECT * FROM tbl_timezone WHERE id!='$db_timezone_id' ORDER BY timezone ASC");
				$option_timezone1="";
				while($row=mysql_fetch_array($query_timezone1)) {
				$option_timezone1 .= "<option value='$row[id]'";
				$option_timezone1 .= ">". $row['code1'] ." ". $row['timezone'] ."</option>";  }
				?>    
				<select name="timezone" id="timezone"  data-placeholder="Choose" class="select" tabindex="2" style="width:100%;">
                                <?php if($db_timezone_id!=0){echo "<option value='$db_timezone_id'>$db_timezone_code1 $db_timezone_timezone</option>"; }else{echo"<option value=''></option> ";}?>
				<?php echo $option_timezone1; ?>
				</select>
                            </div>             
                    </div>
		      
		      <div class="formRow">
                            <div class="grid2"><label><?php echo $lang['Country']; ?>:</label></div>
                            <div class="grid10">
                               <?php
				$query_country1=mysql_query("SELECT * FROM tbl_country WHERE id!='$db_country_id' ORDER BY country ASC");
				$option_country1="";
				while($row=mysql_fetch_array($query_country1)) {
				$option_country1 .= "<option value='$row[id]'";
				$option_country1 .= ">". $row['code1'] ." ". $row['country'] ."</option>";  }
				?>    
				<select name="country" id="country"  data-placeholder="Choose" class="select" tabindex="2" style="width:100%;">
                                <?php if($db_country_id!=0){echo "<option value='$db_country_id'>$db_country_code1 $db_country_country</option>"; }else{echo"<option value=''></option> ";}?>
				<?php echo $option_country1; ?>
				</select>
                            </div>             
                    </div>
		      
		    <div class="formRow">
                            <div class="grid2"><label><?php echo $lang['Language']; ?>:</label></div>
                            <div class="grid10">
                               <?php
				$query_language1=mysql_query("SELECT * FROM tbl_language WHERE id!='$db_language_id' ORDER BY language ASC");
				$option_language1="";
				while($row=mysql_fetch_array($query_language1)) {
				$option_language1 .= "<option value='$row[id]'";
				$option_language1 .= ">". $row['code1'] ." ". $row['language'] ."</option>";  }
				?>    
				<select name="language" id="language"  data-placeholder="Choose" class="select" tabindex="2" style="width:100%;">
                                <?php if($db_language_id!=0){echo "<option value='$db_language_id'>$db_language_code1 $db_language_language</option>"; }else{echo"<option value=''></option> ";}?>
				<?php echo $option_language1; ?>
				</select>
                            </div>             
                    </div>
		      
		    <div class="formRow">
                            <div class="grid2"><label><?php echo $lang['Currency']; ?>:</label></div>
                            <div class="grid10">
                               <?php
				$query_currency1=mysql_query("SELECT * FROM tbl_currency WHERE id!='$db_currency_id' ORDER BY currency ASC");
				$option_currency1="";
				while($row=mysql_fetch_array($query_currency1)) {
				$option_currency1 .= "<option value='$row[id]'";
				$option_currency1 .= ">". $row['code1'] ." ". $row['currency'] ."</option>";  }
				?>    
				<select name="currency" id="currency"  data-placeholder="Choose" class="select" tabindex="2" style="width:100%;">
                                <?php if($db_currency_id!=0){echo "<option value='$db_currency_id'>$db_currency_code1 $db_currency_currency</option>"; }else{echo"<option value=''></option> ";}?>
				<?php echo $option_currency1; ?>
				</select>
                            </div>             
                    </div>
		    
		     <div class="formRow">
                            <div class="grid2"><label><?php echo $lang['Number Format']; ?>:</label></div>
                            <div class="grid10">
                               <?php
				$query_number_format1=mysql_query("SELECT * FROM tbl_number_format WHERE id!='$db_number_format_id' ORDER BY number_format ASC");
				$option_number_format1="";
				while($row=mysql_fetch_array($query_number_format1)) {
				$option_number_format1 .= "<option value='$row[id]'";
				$option_number_format1 .= ">". $row['number_format'] ."</option>";  }
				?>    
				<select name="number_format" id="number_format"  data-placeholder="Choose" class="select" tabindex="2" style="width:100%;">
                                <?php if($db_number_format_id!=0){echo "<option value='$db_number_format_id'>$db_number_format_code1 $db_number_format_number_format</option>"; }else{echo"<option value=''></option> ";}?>
				<?php echo $option_number_format1; ?>
				</select>
                            </div>             
                    </div>
		    
		
		   
		    <div class="formRow">
                    <div class="grid2"><br /></div>
                    <div class="grid10">
			<a href="#" class="buttonM bBlue" onclick="document.getElementById('form').submit();"><span class="fa fa-save"></span><span><?php echo $lang['Save']; ?></span></a>
		        <a href="#" class="buttonM bBlue" onclick="window.location.href='<?php echo $connect_url_data; ?>/dashboard'"><span class="fa fa-times-circle"></span><span><?php echo $lang['Cancel']; ?></span></a>
		    </div>
		    
		    </div>
                  
                </div>
            </fieldset>

	    
	    
        </div>
	
    </div>
    <!-- Main content ends -->
    
</div>
<!-- Content ends -->  
             
</body>
</html>
