<?php
	/*
	Hezecom Email Solution
	Author: Hezecom Technologies (http://hezecom.com) info@hezecom.net
	COPYRIGHT 2014 ALL RIGHTS RESERVED
	
	You must have purchased a valid license from CodeCanyon.com in order to have 
	access this file.

	You may only use this file according to the respective licensing terms 
	you agreed to when purchasing this item.
	*/
	session_start();
	include('config/config.php');
	include('language/eng.php');
	include('libraries/functions.php');
	include_once('libraries/class_dbcon.php');
	include_once('libraries/upload_class.php');	
	include("libraries/xmlapi.php");
    include('libraries/class_cpanel.php');
	$new = new MyCpanel();
	$db=DB::getInstance();
	$dbc=new dboptions();
	$dbc->logged_in_protect();
	$row=UserProfile($_SESSION['mail_username']);
	include('libraries/url_writer.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo H_TITLE;?></title>
<link rel="stylesheet" type="text/css" href="<?php echo H_THEME;?>/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<?php echo H_THEME;?>/css/font-awesome.min.css">
<link href="<?php echo H_THEME;?>/css/style.css" rel="stylesheet">
<script src="<?php echo H_THEME;?>/js/modernizr.custom.js"></script>
</head>
<body>
  	<div class="navbar navbar-fixed-top header">
 	<div class="col-md-12">
        <div class="navbar-header">
          
          <a href="#" class="navbar-brand"><?php echo H_TITLE;?></a>
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse1">
         <span class="fa fa-bars"></span>
          </button>
      
        </div>
        <div class="collapse navbar-collapse" id="navbar-collapse1">
         
          <ul class="nav navbar-nav navbar-right">
             <li><a href="#"><?php echo LANG_HI;?> <?php echo $row->cfname;?></a></li>
            
 <li><a href="<?php echo $mail;?>"><span class="fa fa-envelope-o" style="color:#F30;"></span> <?php echo LANG_MAIL;?></a></li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="fa fa-user" style="color:#F30;"></span> <?php echo LANG_ACCOUNT;?><b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<div class="navbar-content">
        <div class="row">
       <div class="col-md-5">
       <?php if(is_file(UPLOAD_FOLDER.$row->user_image)){?><a href="#" ><img src="<?php echo UPLOAD_FOLDER.$row->user_image;?>" class="img-responsive"/></a><?php }else{?>
        <span class="fa fa-user" style="color:#CCC; font-size:100px;"></span>
       <?php }?>
       
     
    <p class="text-center small"><a href="<?php echo $update_url;?>"><?php echo LANG_CHANGE_PICTURE;?></a></p>
  </div>
<div class="col-md-7">
<span><?php echo $row->cfname.' '.$row->clname;?></span>
<p class="text-muted small"><?php echo $row->cusername;?></p>
<div class="divider">
</div>
<a href="<?php echo $main;?>" class="btn btn-primary btn-sm active"><?php echo LANG_VIEW_PROFILE;?></a>
</div>
</div>
</div>
<div class="navbar-footer">
<div class="navbar-footer-content">
<div class="row">
<div class="col-md-6">
<a href="<?php echo $cp_url;?>" class="btn btn-default btn-sm"><?php echo LANG_CHANGE_PASSWORD;?></a>
</div>
<div class="col-md-6">
<a href="<?php echo $logout;?>" class="btn btn-default btn-sm pull-right"><?php echo LANG_SIGN_OUT;?></a>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
           </ul>
        </div>	
     </div>	
</div>

<!--main-->
<div class="container" id="main">
   <div class="row">
 <div class="col-md-3 col-sm-6">
 <?php if(is_file(UPLOAD_FOLDER.$row->user_image)){?><a href="#" ><img src="<?php echo UPLOAD_FOLDER.$row->user_image;?>" class="img-responsive"/></a><?php }else{?>
        <span class="fa fa-user" style="color:#CCC; font-size:200px; text-align:center"></span>
       <?php }?><br>
<a href="<?php echo $update_url;?>" class="btn btn-primary btn-sm "><?php echo LANG_UPDATE;?></a>
<a href="<?php echo $cp_url;?>" class="btn btn-primary btn-sm"><?php echo LANG_CHANGE_PASSWORD;?></a><br><br>
</div>
            
<div class="col-md-8 col-sm-6">
<?php if(get('action')=='update'){?>
 <div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading"><h3 class="panel-title"><strong><?php echo LANG_UPDATE;?></strong></h3></div>
  <div class="panel-body">
 <div id="output"></div>
<form  action="libraries/update_profile.php" id="msgSend" method="post" role="form" enctype="multipart/form-data">
<input type="hidden" name="uid" value="<?php echo $row->uid;?>">
	<div class="form-group">
    <label class="control-label" for="cfname"><?php echo LANG_FIRST_NAME;?></label>
	<input id="cfname" name="cfname" type="text" maxlength="50"  value="<?php echo $row->cfname;?>" class="form-control styler" />
	</div>

	<div class="form-group">
    <label class="control-label" for="clname"><?php echo LANG_LAST_NAME;?></label>
	<input id="clname" name="clname" type="text" maxlength="50"  value="<?php echo $row->clname;?>" class="form-control styler" />
	</div>

	<div class="form-group">
    <label class="control-label" for="cbirthday"><?php echo LANG_BITHDAY;?> <small><em>dd/mm/yyyy</em></small></label>
	<input id="cbirthday" name="cbirthday" type="text" maxlength="30"  value="<?php echo $row->cbirthday;?>" class="form-control styler datepicker" />
	</div>

	<div class="form-group">
    <label class="control-label" for="cgender"><?php echo LANG_GENDER;?></label>
     <select name="cgender" id="cgender" class="form-control styler choz">
	<option value="<?php echo $row->cgender;?>"><?php echo $row->cgender;?></option>
    <option value="Male">Male</option>
    <option value="Female">Female</option>
    </select>
	</div>

	
	<div class="form-group">
    <label class="control-label" for="cphone"><?php echo LANG_PHONE;?></label>
	<input id="cphone" name="cphone" type="text" maxlength="50"  value="<?php echo $row->cphone;?>" class="form-control styler" />
	</div>

	<div class="form-group">
    <label class="control-label" for="cemail"><?php echo LANG_ALTERNATE_EMAIL;?></label>
	<input id="cemail" name="cemail" type="text" maxlength="50"  value="<?php echo $row->cemail;?>" class="form-control styler" />
	</div>

	<div class="form-group">
    <label class="control-label" for="clocation"><?php echo LANG_LOCATION;?></label>
     <select name="clocation" id="clocation" class="form-control styler choz">
	<option value="<?php echo $row->clocation;?>"><?php echo $row->clocation;?></option>
    <?php include('libraries/views/countries.html');?>
    </select>
	</div>

	<div class="form-group">
    <label class="control-label" for="user_image"><?php echo LANG_CHANGE_PICTURE;?></label>
	<input id="user_image" name="user_image"type="file" class="styler"/><br>
	</div>

<div class="form-group">
<button class="btn btn-primary btn-lg " name="button" type="submit" id="msgButton"><?php echo LANG_UPDATE;?></button>
<a href="main.php" class="btn btn-default btn-lg "><?php echo LANG_CANCEL;?></a>
 </div>
</form>
</div>
</div>
</div>
<?php }elseif(get('action')=='updatepwd'){?>

 <div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading"><h3 class="panel-title"><strong><?php echo LANG_CHANGE_PASSWORD;?></strong></h3></div>
  <div class="panel-body">
 <div id="output"></div>
<form action="libraries/change_pwdprocess.php" id="msgSend" method="post" role="form">
<input type="hidden" name="myemail" value="<?php echo $row->cusername;?>" >

<div class="form-group">
<input type="password" class="form-control input-lg"  name="oldpwd" placeholder="<?php echo LANG_OLD_PASSWORD;?>" required>
</div>

<div class="form-group">
<input type="password" class="form-control input-lg"  name="newpwd" placeholder="<?php echo LANG_NEW_PASSWORD;?>" maxlength="50" required>
</div>
<div class="form-group">
<input type="password" class="form-control input-lg"  name="newpwd2" placeholder="<?php echo LANG_CONFIRM_NEW_PASSWORD;?>" maxlength="50" required>
</div>

<div class="form-group">
<button class="btn btn-primary btn-lg " name="button" type="submit" id="msgButton"><?php echo LANG_CHANGE_PASSWORD;?></button>
<a href="main.php" class="btn btn-default btn-lg "><?php echo LANG_CANCEL;?></a>
 </div>
</form>
</div>
</div>
</div>

<?php }else{?>

<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading"><h3 class="panel-title"><strong><?php echo LANG_PROFILE;?></strong></h3></div>
	<table class="table table-striped table-bordered" data-page-size="200">
	 <tbody>
	<tr>
	<th><?php echo LANG_FIRST_NAME;?></th><td><?php echo $row->cfname;?></td>
	</tr>
    	  	
	<tr>
	<th><?php echo LANG_LAST_NAME;?></th><td><?php echo $row->clname;?></td>
	</tr>
		
	<tr>
	<th><?php echo LANG_USER_EMAIL;?></th><td><?php echo $row->cusername;?></td>
	</tr>
		

	<tr>
	<th><?php echo LANG_BITHDAY;?></th><td><?php echo $row->cbirthday;?></td>
	</tr>
		
	<tr>
	<th><?php echo LANG_GENDER;?> </th><td><?php echo $row->cgender;?></td>
	</tr>
		
	<tr>
	<th><?php echo LANG_PHONE;?></th><td colspan="2"><?php echo $row->cphone;?></td>
	</tr>
		
	<tr>
	<th><?php echo LANG_ALTERNATE_EMAIL;?></th><td colspan="2"><?php echo $row->cemail;?></td>
	</tr>
		
	<tr>
	<th><?php echo LANG_LOCATION;?></th><td colspan="2"><?php echo $row->clocation;?></td>
	</tr>
	
	</tbody>
	</table>
	</div>
    <?php }?>
</div>
   		
	  </div>
  </div>
</div>

<script src='<?php echo H_THEME;?>/js/jquery.js'></script>
<script src="<?php echo H_THEME;?>/js/bootstrap.min.js"></script>
<script src="<?php echo H_THEME;?>/js/jquery.form.js"></script>
<script src="<?php echo H_THEME;?>/js/hezecom.custom.js"></script>
<script type='text/javascript'>
        $(document).ready(function() {
        
            /* toggle layout */
$('#btnToggle').click(function(){
	if ($(this).hasClass('on')) {
    	$('#main .col-md-6').addClass('col-md-4').removeClass('col-md-6');
    	$(this).removeClass('on');
    }
  	else {
    	$('#main .col-md-4').addClass('col-md-6').removeClass('col-md-4');
      	$(this).addClass('on');
  	}
});
        
        });
		</script>
  </body>
  </html>
