<?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>
 ********************************************************************************/
?>

<?php
$form = $this->form;
$login_role = $this->login_role;
$baseUrl = $this->serverUrl().$this->baseUrl();
?>

<div id="error_message" style="display:none;"></div>
<div class="profile-tabs">
    <div class="profile-tabs-left">
        <ul>
                <li><a href="<?php echo BASE_URL; ?>dashboard/viewprofile"><div class="profile-icon view-profile"></div><p>View Profile</p></a></li>
                <li><a href="<?php echo BASE_URL; ?>viewsettings/1"><div class="profile-icon view-settings"></div><p>Settings</p></a></li>
                <li class="now"><div class="profile-icon view-password-hover"></div><p>Change Password</p><div class="absolute-div"></div></li>
                <?php 
                if($login_role == SUPERADMINROLE)
                {
                ?>
                <li><a href="<?php echo BASE_URL; ?>dashboard/emailsettings"><div class="profile-icon view-emailsettings"></div><p>Mail Settings</p></a></li>
                <?php 
                }
                ?>
        </ul>  
    </div>


    <div class="profile-tabs-right-password">
        <div class="profile-tabs-right-inside">
		<?php sapp_Global::generateClientValidations($form);?>
            <form name="<?php echo $form->getName(); ?>" id="<?php echo $form->getId(); ?>" action="javascript: void(0)" method="<?php echo $form->getMethod(); ?>"  oncopy="return false">

                <div class="total-form-controller">
                <?php echo $form->id;?>
                        <div class="new-form-ui clearb">
                             <label class="required">Current Password <img class="tooltip" title="Enter current password" src="<?php echo MEDIA_PATH;?>images/help.png"></label>
                             <div class="division"><?php echo $form->password;?></div>
                        </div>
                        
                        <div class="new-form-ui clearb">
						<?php if($this->passwordid == 1){?>
                             <label class="required">New Password <img class="tooltip" title="Enter alphanumeric characters" src="<?php echo MEDIA_PATH;?>images/help.png"></label>
						<?php }else if($this->passwordid == 2){?>
						     <label class="required">New Password <img class="tooltip" title="Enter alphanumeric and special characters" src="<?php echo MEDIA_PATH;?>images/help.png"></label>  
                        <?php }else if($this->passwordid == 3){?>
						     <label class="required">New Password <img class="tooltip" title="Enter only numbers" src="<?php echo MEDIA_PATH;?>images/help.png"></label>
                        <?php }else{?>
						     <label class="required">New Password <img class="tooltip" title="Enter numbers and special characters" src="<?php echo MEDIA_PATH;?>images/help.png"></label>
                        <?php }?> 						
                             <div class="division"><?php echo $form->newpassword;?></div>
                        </div>
						
						
                        <div class="new-form-ui clearb">
                        <?php if($this->passwordid == 1){?>
                             <label class="required">Confirm Password <img class="tooltip" title="Enter alphanumeric characters" src="<?php echo MEDIA_PATH;?>images/help.png"></label>
						<?php }else if($this->passwordid == 2){?>
						     <label class="required">Confirm Password <img class="tooltip" title="Enter alphanumeric and special characters" src="<?php echo MEDIA_PATH;?>images/help.png"></label>  
                        <?php }else if($this->passwordid == 3){?>
						     <label class="required">Confirm Password <img class="tooltip" title="Enter only numbers" src="<?php echo MEDIA_PATH;?>images/help.png"></label>
                        <?php }else{?>
						     <label class="required">Confirm Password <img class="tooltip" title="Enter numbers and special characters" src="<?php echo MEDIA_PATH;?>images/help.png"></label>
                        <?php }?>
                             <div class="division"><?php echo $form->passwordagain;?></div>
                        </div>
                              
                        <div class="new-form-ui-submit"><?php echo $form->submit;?>
                                 <button name="Cancel" id="Cancel" onClick="window.location = document.referrer;" type="button">Cancel</button>
						</div>
                </div>
            </form>
        </div>
    </div>
</div>


<script type="text/javascript">
$(document).ready(function(){	
	var total_width = $('.profile-tabs').width();
	var profile_tabs_right_password_width = total_width-2;	
	$('.profile-tabs-left').css("width", "150");
	$('.profile-tabs-right-password').css("width", (profile_tabs_right_password_width-155));
	
	function checkWidth() {
        var total_width = $('.profile-tabs').width();
		var profile_tabs_right_password_width = total_width-2;		
		$('.profile-tabs-left').css("width", "150");
		$('.profile-tabs-right-password').css("width", (profile_tabs_right_password_width-155));        
    }
	
	$(window).resize(function() {
		checkWidth();
	});
		$('#password,#newpassword,#passwordagain').keydown(function(e) {

		 if (e.keyCode == 32) {
              return false;
			}
		});
});

</script>