
<div class="m-subheader " style="padding-top:0px; padding-bottom: 20px">
	<div class="d-flex align-items-center">
		<div class="mr-auto">
			<h3 class="m-subheader__title m-subheader__title--separator">
				System Setting
			</h3>
			<ul class="m-subheader__breadcrumbs m-nav m-nav--inline">
				<li class="m-nav__item m-nav__item--home">
					<a href="#" class="m-nav__link m-nav__link--icon">
						<i class="m-nav__link-icon flaticon-line-graph"></i>
					</a>
				</li>
				<li class="m-nav__separator">
					-
				</li>
				<li class="m-nav__item">
					<a href="" class="m-nav__link">
						<span class="m-nav__link-text">
							Dashboard
						</span>
					</a>
	 	 		</li>
				<li class="m-nav__separator">
					-
				</li>
				<li class="m-nav__item">
						<span class="m-nav__link-text">
							Admin
						</span>
				</li>
				<li class="m-nav__separator">
					-
				</li>
				<li class="m-nav__item">
						<span class="m-nav__link-text">
							System Setting
						</span>
				</li>
			</ul>
		</div>
	</div>
</div>
<div class="m-portlet m-portlet--tabs" id="formSettingView">
	<div class="m-portlet__head">
		<div class="m-portlet__head-tools">
			<ul class="nav nav-tabs m-tabs m-tabs-line   m-tabs-line--left m-tabs-line--primary" role="tablist">
				<!-- <li class="nav-item m-tabs__item" style="display:none;">
					<a class="nav-link m-tabs__link " data-toggle="tab" href="#m_builder_pagecompany-general" role="tab">
						General
					</a>
				</li>
				<li class="nav-item m-tabs__item" style="display:none;">
					<a class="nav-link m-tabs__link " data-toggle="tab" href="#m_builder_pagesetting-addr" role="tab">
						Contact
					</a>
				</li> -->
				<li class="nav-item m-tabs__item">
					<a class="nav-link m-tabs__link active" data-toggle="tab" href="#m_builder_pagesetting-logo" role="tab">
						Logo
					</a>
				</li>
				<!-- <li class="nav-item m-tabs__item" style="display:none;">
					<a class="nav-link m-tabs__link " data-toggle="tab" href="#m_builder_pagesetting-email" role="tab">
						Email
					</a>
				</li> -->
				<li class="nav-item m-tabs__item">
					<a class="nav-link m-tabs__link " data-toggle="tab" href="#m_builder_pagesetting-other" role="tab">
						Other
					</a>
				</li>
			</ul>
			
		</div>
	</div>
	<!--begin::Form-->
	<form class="m-form m-form--fit m-form--label-align-right " enctype="multipart/form-data" id="my-great-dropzone">
		<div class="m-portlet__body">
			<div class="tab-content">
				 <!-- <div class="tab-pane " id="m_builder_pagecompany-general" role="tabpanel"  style="height:300px;">
				 	<div class="form-group m-form__group row">
				 		<label class="col-md-1 col-lg-1 col-xl-1 col-form-label">Organization Name:</label>
						<div class="col-lg-3">
							<input type="text" class="form-control m-input m-input" id="txtSettingName1" value="<?php echo $this->getName1() ;?>" placeholder="Enter Your Organization Name" >
						</div>
						<label class="col-md-1 col-lg-1 col-xl-1 col-form-label">Organization Code:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingCode" placeholder="Enter Your Organization Code" value="<?php echo $this->getCode() ;?>" type="Name">
						</div>
				 		<label class="col-md-1 col-lg-1 col-xl-1 col-form-label">Ref No :</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingRefNo" placeholder="Enter Your Ref No" value="<?php echo $this->getRefNo() ;?>" type="Ref">
						</div>
				 	</div>
				</div>
				 <div id="m_builder_pagesetting-addr" class="tab-pane" role="tabpanel" style="height:300px;">
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Address 1:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingAddr1" placeholder="Enter Address" value="<?php echo $this->getAddr1() ;?>" type="text">
						</div>
						<label class="col-lg-1 col-form-label">Address 2:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingAddr2" placeholder="Enter Address" value="<?php echo $this->getAddr2() ;?>" type="text">
						</div>
						<label class="col-lg-1 col-form-label">Address 3:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingAddr3" placeholder="Enter Address" value="<?php echo $this->getAddr3() ;?>" type="Ref No">
						</div>
					</div>	  
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Address 4:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingAddr4" placeholder="Enter Address" value="<?php echo $this->getAddr4() ;?>" type="text">
						</div>
						<label class="col-lg-1 col-form-label">Address 5:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingAddr5" placeholder="Enter Address" value="<?php echo $this->getAddr5() ;?>" type="text">
						</div>
						<label class="col-lg-1 col-form-label">Tel No:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingTelNo" placeholder="Enter Tel No" value="<?php echo $this->getTelNo() ;?>" type="text">
						</div>
					</div>	  
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Fax No:</label>
							<div class="col-lg-3">
								<input class="form-control m-input" id="txtSettingFaxNo" placeholder="Enter Fax No" value="<?php echo $this->getFaxNo() ; ?>" type="text">
							</div>
					</div>	  
	            </div> -->

	            <div id="m_builder_pagesetting-logo" class="tab-pane active" role="tabpanel" style="height:300px;">
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Logo File:</label>
							<div class="col-lg-3">
								<div class="custom-file">
								  	<input class="custom-file-input" id="fileLogo" type="file" name="fileLogo">
								  	<label class="custom-file-label" for="fileLogo" id="fileLogoLabel" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"></label>
								</div> 
								
							
								
							
							</div>
					</div>
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Image:</label>
						<div class="col-lg-3">
							<div style="margin-top:5px">
								<img id="imgLogo" width="200px" height="100px" border="1" src="<?php echo Util::getLogo($_SESSION[SE_ORGID]) ; ?>"/>
							</div>
							<span class="m-form__help">
								Size : 200(w) x 100(h). Format : png,jpg,jpeg
							</span>
						</div>
						<div class="col-lg-3">
							<button type="button" id="btnSettingUpload" class="btn btn-outline-accent m-btn m-btn--custom m-btn--icon m-btn--outline-2x m-btn--pill m-btn--air">
								<span>
									<i class="fa flaticon-add"></i>
									<span>Upload</span>
								</span>
							</button>
							<button type="button" id="btnSettingRemove" class="btn btn-outline-danger m-btn m-btn--custom m-btn--icon m-btn--outline-2x m-btn--pill m-btn--air">
								<span>
									<i class="fa flaticon-delete"></i>
									<span>Remove</span>
								</span>
							</button>
						</div>	
					</div>	 
					<div id="setting_upload" style="margin-top:10px;display:none;">
						<div><span id="setting_upload_mesg">Uploading file .....</span></div>
						<div style="margin-top:10px"><img src="image/uploading.gif"></div>
					</div>   
	            </div>

	            <!-- <div id="m_builder_pagesetting-email" class="tab-pane" role="tabpanel" style="height:300px;">
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Mail Server:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingMailserver" type="text" value="<?php echo $this->getEmailServer() ;?>" >
						</div>
						<label class="col-lg-1 col-form-label">Port:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingMailPort" type="text" value="<?php echo $this->getEmailPort() ;?>">
						</div>
					</div>	  
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Username:</label>
						<div class="col-lg-3">
							<input class="form-control m-input" id="txtSettingMailUser" value="<?php echo $this->getEmailUser() ;?>">
						</div>
						<label class="col-lg-1 col-form-label">Password:</label>
						<div class="col-lg-3">
							<input type="password" class="form-control m-input" id="txtSettingMailPwd" value="<?php echo $this->getEmailPwd() ;?>" >
						</div>	      
					</div>
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label"></label>
						<div class="col-lg-3">
							<label class="m-checkbox m-checkbox--state-success" style="font-size:15px;" >
								<input id="chkSettingMailResend" type="checkbox" <?php echo $this->getEmaiResend(); ?> > 
								Allow Claimant Re-Send Email 
								<span></span>
							</label></br>
							<label class="m-checkbox m-checkbox--state-success" style="font-size:15px;" >
								<input id="chkSettingMailEnableAuthentication"  type="checkbox" <?php echo $this->getEnableAuthentication() ;?>/> Enable Authentication
								<span></span>
							</label></br>
							<label class="m-checkbox m-checkbox--state-success" style="font-size:15px;" >
								<input type="checkbox" id="chkSettingMailSSL" <?php echo $this->getEmailSSL() ;?>/> Use SSL
								<span></span>
							</label>
						</div>
						<label class="col-lg-1 col-form-label"> </label>
						<div class="col-lg-3">
							<button type="button" id="btnSettingTestEmailModal" class="btn btn-outline-info m-btn m-btn--icon" value="Test">
								<span>
									<i class="fa fa-envelope-open"></i>
									<span>Test Email</span>
								</span>
							</button>
						</div>
					</div>
	            </div> -->
	            <div id="m_builder_pagesetting-other" class="tab-pane" role="tabpanel" style="height:300px;">
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Upload Size Limit:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingOtherUploadSizeLimit" value="<?php echo $this->getUploadSizeLimit() ;?>" >
						</div>
						<div style="padding-top:8px;">
							<span style="font-size:15px;">KB</span>
						</div>
						<!--<label class="col-lg-1 col-form-label">Base Currency:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingOtherBaseCurrency" value="<?php //echo $this->getBaseCurrency() ;?>">
						</div>
						<label class="col-lg-1 col-form-label">Emp. Code to Export:</label>
						<div class="col-lg-2">
							<select class="form-control m-input m-input" id="txtSettingOtherEmpCode">
								<?php //echo $this->getEmpCodeToExportSelection() ; ?></select>
						</div>-->
					</div>	  
					<!--<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Show Limit Type</label>
						<div class="col-lg-2">
							<select class="form-control m-input m-input" id="cobExpenseClaimType" >
								<?php //echo $this->getLimitTypeOption() ; ?></select>
						</div>
						<label class="col-lg-1 col-form-label">Show expenses from last:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingClaimDayLast" value="<?php //echo $this->getBaseCurrency() ;?>">
						</div>
					</div> -->
					<!-- <span class="m-form__help">Size : 200(w) x 100(h). Format : png,jpg,jpeg</span>
					<div class="col-lg-3">
						<button type="button" id="btnSettingUpload" class="btn btn-outline-accent m-btn m-btn--custom m-btn--icon m-btn--outline-2x m-btn--pill m-btn--air">
							<span>
								<i class="fa flaticon-add"></i>
								<span>Upload</span>
							</span>
						</button>
						<button type="button" id="btnSettingRemove" class="btn btn-outline-danger m-btn m-btn--custom m-btn--icon m-btn--outline-2x m-btn--pill m-btn--air">
						<span>
							<i class="fa flaticon-delete"></i>
							<span>Remove</span>
						</span>
					</div> -->	
					<!-- <div id="setting_upload" style="margin-top:10px;display:none;">
						<div><span id="setting_upload_mesg">Uploading file .....</span></div>
						<div style="margin-top:10px"><img src="image/uploading.gif"></div>
					</div>    -->
	            <!-- </div> -->

	            <!-- <div id="m_builder_pagesetting-email" class="tab-pane" role="tabpanel" style="height:300px;">
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Mail Server:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingMailserver" type="text" value="<?php echo $this->getEmailServer() ;?>" >
						</div>
						<label class="col-lg-1 col-form-label">Port:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingMailPort" type="text" value="<?php echo $this->getEmailPort() ;?>">
						</div>
						<label class="col-lg-1 col-form-label">Username:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingMailUser" value="<?php echo $this->getEmailUser() ;?>">
						</div>
						<label class="col-lg-1 col-form-label">Password:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingMailPwd" value="<?php echo $this->getEmailPwd() ;?>" >
						</div>	      
					</div>
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label"> </label>
						<div class="col-lg-7">
							<label class="m-checkbox" style="margin-right: 20px;">
								<input id="chkSettingMailResend" type="checkbox" <?php echo $this->getEmaiResend(); ?> > 
								Allow Claimant Re-Send Email 
								<span></span>
							</label>
							<label class="m-checkbox" style="margin-right: 20px;">
								<input id="chkSettingMailEnableAuthentication"  type="checkbox" <?php echo $this->getEnableAuthentication() ;?>/> Enable Authentication
								<span></span>
							</label>
							<label class="m-checkbox">
								<input type="checkbox" id="chkSettingMailSSL" <?php echo $this->getEmailSSL() ;?>/> Use SSL
								<span></span>
							</label>
						</div>
					</div>
	            </div>

	            <div id="m_builder_pagesetting-other" class="tab-pane" role="tabpanel" style="height:300px;">
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Upload Size Limit:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingOtherUploadSizeLimit" value="<?php echo $this->getUploadSizeLimit() ;?>" >
						</div>
						<label class="col-lg-1 col-form-label">Base Currency:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingOtherBaseCurrency" value="<?php echo $this->getBaseCurrency() ;?>">
						</div>
						<label class="col-lg-1 col-form-label">Emp. Code to Export:</label>
						<div class="col-lg-2">
							<select class="form-control m-input m-input" id="txtSettingOtherEmpCode">
								<?php echo $this->getEmpCodeToExportSelection() ; ?></select>
						</div>
					</div>	  
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label">Show Limit Type</label>
						<div class="col-lg-2">
							<select class="form-control m-input m-input" id="cobExpenseClaimType" >
								<?php echo $this->getLimitTypeOption() ; ?></select>
						</div>
						<label class="col-lg-1 col-form-label">Show Expenses From Last:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingClaimDayLast" value="<?php echo $this->getBaseCurrency() ;?>">
						</div>
						<label class="col-lg-1 col-form-label">Max Password Age:</label>
						<div class="col-lg-2">
							<input class="form-control m-input" id="txtSettingMaxPasswordAge" value="<?php echo $this->getMaxPasswordAge() ;?>">
						</div>
					</div>
					<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label"></label>
						<div class="col-lg-3">
							<label style="font-size:15px;" class="m-checkbox m-checkbox--state-success">
								Allow deletion of master item even it's used in other tables
								<input id="chkSettingOtherAllowDeleteMaster" type="checkbox" <?php echo $this->getAllowDeleteMaster() ;?>> 
								<span></span>
							</label>
						</div>
						<div class="col-lg-2">
							<label style="font-size:15px;" class="m-checkbox m-checkbox--state-success">
								Use payment reference
								<input id="chkSettingClaimUsePaymentReference" type="checkbox" <?php echo $this->getClaimUsePaymentReference() ;?>  > 
								<span></span>
							</label>
						</div>
						<div class="col-lg-2">
							<label style="font-size:15px;" class="m-checkbox m-checkbox--state-success">
								Use Tax Calculation
								<input id="chkSettingClaimUseTaxCalculation" type="checkbox" <?php echo $this->getTaxCalculation() ; Log::write($this->getTaxCalculation());?> > 
								<span></span>
							</label>
						</div>
	            	</div>
	            	<div class="form-group m-form__group row">
						<label class="col-lg-1 col-form-label"></label>
						<div class="col-lg-3">
							<label style="font-size:15px;" class="m-checkbox m-checkbox--state-success">
								Allow Future Date For Receipt Date
								<input id="chkSettingClaimAllowFutureDate" type="checkbox" <?php echo $this->getFutureDate() ;?> > 
								<span></span>
							</label>
						</div>
						<div class="col-lg-3">
							<label style="font-size:15px;" class="m-checkbox m-checkbox--state-success">
								Grey Tax Field
								<input id="chkSettingClaimUseTaxGrey" type="checkbox" <?php echo $this->getTaxGrey() ;?> > 
								<span></span>
							</label>
						</div>
	            	</div>
				</div> -->
			</div>
		<div class="m-portlet__foot">
			<div class="row align-items-left">
				<div class="col-lg-12 m--align-right">
					<button type="button" id="btnSettingUpdate" class="btn btn-outline-success m-btn m-btn--icon" value="Update">
						<span>
							<i class="fa flaticon-edit"></i>
							<span>Update</span>
						</span>
					</button>
				</div>
			</div>
		</div>
		</form>
</div>

<div id="emailTestingSetting" class="modal fade" style="overflow: auto;overflow-y: scroll;">
    <div class="modal-dialog" >
        <div class="modal-content" style="width: 700px">
            <div class="modal-header" id="emailTestingSettingHeader" style="background-color:#31B0D5">
			
				<h4 class="modal-title" id="emailTestingSettingTitle" >Test Email Setting</h4>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">
						&times;
					</span>
				</button>
            </div>
            <div class="modal-body">
                <div id="emailTestingSettingContent">
						<input type="text" class="form-control" placeholder="Put your email here....." id="emailTestingDestination">
                </div>
            </div>
            <div class="modal-footer" style="padding:5px">
            	<div id="emailTestingSettingButton">	
					<div class="row align-items-left">
						
						<div class="col-lg-12 m--align-right">
								<button type="button" data-dismiss="modal" class="btn btn-outline-danger m-btn m-btn--icon" value="Update">
									<span>
									<i class="fa flaticon-reply"></i>
										<span>Cancel</span>
									</span>
								</button>
								<button type="button" id="btnSettingTestEmail" class="btn btn-outline-success m-btn m-btn--icon" value="Update">
									<span>
										<i class="fa fa-envelope"></i>
										<span>Send</span>
									</span>
								</button>
						</div>
					</div>
                </div>
            </div>
        </div>
    </div>
</div>


<script>
$('#fileLogo').change(function() {
	var file_name = $('#fileLogo').val();
	$('#fileLogoLabel').text(file_name.split('\\')[2]);
  });

</script>
<script type="text/javascript">
var setting_url = "<?php echo Util::convertLink("Setting") ; ?>" ;
var empCodeToExportValue = "<?php echo $this->getEmpCodeToExportSelected(); ?>" ;
var selectedtype = "<?php echo $this->getLimitTypeData(); ?>"

<?php include (PATH_CODE . "js/admin/setting.js") ; ?>
</script>
