<?php 
/********************************************************************************* 
 *  This file is part of Sentrifugo.
 *  Copyright (C) 2014 Sapplica
 *   
 *  Sentrifugo is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Sentrifugo is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Sentrifugo.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Sentrifugo Support <support@sentrifugo.com>
 ********************************************************************************/
?>
<div class="ml-alert-1-success" id='demo_success_msg' style="display: none;">
	<div class="style-1-icon success"></div>
</div>
            <form>
                <div class="total-form-controller">
                
                        <div class="new-form-ui clearb">
                             <label>Your current version is</label>
                             <div class="division"><div class="version-display"><?php echo CODEVERSION;?></div></div>
                        </div>
                        <?php 
                        $file = PARENTDOMAIN;
						$file_headers = @get_headers($file);
						if($file_headers[0] == 'HTTP/1.1 404 Not Found') {
						    $exists = false;
						}
						else {
						    $exists = true;
						}
								if($exists){
						?>
								<div id="currentversion"></div>
                        		
                        		<div class="new-form-ui clearb">
								 <label class="required">Select the version to upgrade </label>
									<div class="division">
									<select id="versionnumber" name="versionnumber" tabindex="-1">
									</select>							
									</div>	
								</div>
                                  
                                <div id ='successpan'></div>                                       												                                                      
		                        <div class="new-form-ui-submit">
                                <input name="Upgrade" type="button" value="Upgrade" id="Upgrade" onclick="upgradetotalsystem('<?php echo WEBSERVICEURL;?>','both','<?php echo CODEVERSION;?>')">
		                       		 <!--<button name="Upgrade" id="Upgrade" onclick="upgradetotalsystem('<?php //echo WEBSERVICEURL;?>','both','<?php //echo CODEVERSION;?>')" type="button">Upgrade</button>-->
                                  <button title="Go back" name="Cancel" id="Cancel" type="button" onclick="window.location = document.referrer;">Cancel</button>
		                        </div>
                    			<?php }else{?>
                    			<div class="new-form-ui clearb">
                              			Please connect to internet to upgrade application
                        		</div>
                    			<?php }?>
                </div>
            </form>




<script type="text/javascript">
$(document).ready(function(){
	getcurrentversion('<?php echo WEBSERVICEURL;?>','<?php echo CODEVERSION;?>');
});

</script>