<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2010 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts VistaCart                     |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
// +----------------------------------------------------------------------+
?>
<?php echo $javascript->link('jquery.js'); ?>
<script language="javascript" type="text/javascript">
function chk(){
	
	var i=0;
	var fcs_fld=new Array();
	var errorstr = '';
	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
	
		
		if ($.trim($('#cpword').val()) == '') { errorstr += "- Please Enter Current Password.\n"; fcs_fld[i]='cpword'; i++; }
		if ($.trim($('#npword').val()) == '') { errorstr += "- Please Enter New Password.\n";fcs_fld[i]='npword'; i++;}
		if ($.trim($('#npword').val())!='') 
				{
				 if ($.trim($('#npword').val()).length < 6) { errorstr += "- Password should contain atleast 6 characters.\n";   fcs_fld[i]='npword'; i++;}
				}	
		if($.trim($('#npword').val()) != '') {
		if ($.trim($('#rpword').val()) == '') { errorstr += "- Please Confirm Password.\n";fcs_fld[i]='rpword'; i++;}
		}
		if($.trim($('#rpword').val()) != '') {
		if ($.trim($('#npword').val()) != $.trim($('#rpword').val())) { errorstr += "- Password Mismatch.\n"; fcs_fld[i]='rpword'; i++;}
		}
	
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		$('#'+fcs_fld[0]+'').val('');$('#'+fcs_fld[0]+'').focus();
		return false;
	}
	else
	{
		return true;
	}
} 
</script>
            <div align="center" class="subheading">
              <div align="left">Password</div>
            </div>
            <br />
			<?php if($session->check('Message.flash')) { ?><div id="okbox"><font color="#446423"><?php $session->flash(); ?></font></div><?php } ?>
            <div align="left" id="item_details_admin">
              <!--items display area start -->
              <div align="center" id="items_display_area_admin">
                <div align="left" class="inner_content_area_admin">
                <form name="pword" action="" method="post">
                  <div id="admin_heading">Change Password</div>
                  <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Current Password <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                      
                        <span class="toplinks">
                       
                        <input type="password" name="cpword" class="box2_admin" size="27"  id="cpword"/>
                        </span>
                     
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  
            
                 
				      <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">New Password <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                        <input type="password" name="npword" class="box2_admin" size="27"  id="npword"/>
                        </span>
                     
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
				  
				  
				  
				       <div id="grid_admin">
                    <div align="left" id="inner_leftcontent">
                      <p class="maintext_inner">Re enter New Password <span class="required_field">*</span></p>
                    </div>
                    <div align="right" id="inner_rightcontent">
                     
                        <span class="toplinks">
                       <input type="password" name="rpword" class="box2_admin" size="27"  id="rpword"/>
						
						
                        </span>
                    
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
				 
       
  
                  
                  
                  
                
				  
				            <div id="admin_bottom">
									<div align="left" id="inner_leftcontent">
						  			
									</div>
							
									<div align="right" id="inner_rightcontent">
                    
                        <span class="toplinks">
						<input type="submit" class="buttn_admin" value="Update" onClick="return chk();">
						<input type="button" class="buttn_admin" value="Cancel" onClick="javascript:history.go(-1);">
                        
</span>
                    
                    </div>
							
							
							
							</div>
                </div>
             </form>
              </div>
              <div align="left" class="float_clear1"></div>
            </div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>