<?php include("includes/head.php");?>
<?php 
//$_GET['sid'] = '2';
if(isset($_GET['uid']) && $_GET['uid']!='')
{
	$query_shInfo = "SELECT * FROM ".TBL_RANKING_HISTORY." WHERE id = '$_GET[uid]'";
	$shInfo = $con->getSingleRow($query_shInfo);
}
?>
<body>
<form name="frmStockholders" id="frmStockholders">
  <input type="hidden" name="action" value="updateSHupdate">
  <input type="hidden" name="shid" value="<?php echo isset($_GET['sid'])?$_GET['sid']:'';?>">
  <input type="hidden" name="uid" value="<?php echo isset($_GET['uid'])?$_GET['uid']:'';?>">
  
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-label="Close" onClick="$.colorbox.close();"><span aria-hidden="true">&times;</span> </button>
      <h4 class="modal-title" id="myModalLabel">Update Stakeholder Logs</h4>
    </div>
    <div class="modal-body">
      <div role="tabpanel">
        <!-- Nav tabs -->
        
        <!-- Tab panes -->
        <div class="tab-content">            
          <div id="TabGeneral" class="tab-pane in active custon-tab-style1">
            <div class="basic-login-form-ad">
              <div class="row" style="margin-top:30px;">
                <div class="col-lg-12">
                  <div class="all-form-element-inner">                    
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Introduction</label>
                        </div>
                        <div class="col-lg-9">
                          <textarea name="update_detail" id="update_detail" rows="10" cols="60"><?php echo isset($shInfo['update_detail'])?$shInfo['update_detail']:'';?></textarea>
                          <!--<script>CKEDITOR.replace( 'description_sh' );</script>-->
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          
        </div>
      </div>
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal" onClick="$.colorbox.close();">Close</button>
      <!--<button type="button" class="btn btn-primary save">Save changes</button>-->
      <!--<button class="btn btn-sm btn-primary login-submit-cs" type="button" onClick="shActions('frmStockholders');">Update & Finish</button>-->
      <button data-loading-text="Saving..." type="submit" class="btn btn-success"> <i class="fa fa-floppy-o"></i> Save </button>
    </div>
</form>
<!-- jquery
		============================================ -->
<!--<script src="js/vendor/jquery-1.11.3.min.js"></script>-->
<!-- bootstrap JS
		============================================ -->
<script src="js/bootstrap.min.js"></script>
<!-- summernote JS
		============================================ -->
<script src="js/summernote.min.js"></script>
<script src="js/summernote-active.js"></script>
<!-- notification JS
		============================================ -->
<script src="js/Lobibox.js"></script>
<script src="js/notification-active.js"></script>
<!-- main JS
		============================================ -->
<script src="js/main.js"></script>

<script>
$(document).ready(function(e){

	$("#frmStockholders").on('submit', function(e){
	
	e.preventDefault();
	
	var shdata = new FormData(this);
	
	$.ajax({		
		type: 'POST',
        url: 'sh-update-config.php',
		processData: false,
		contentType: false,
        data: shdata,
		cache: false,
		dataType: 'JSON',
        success:function(response){
			
            if(response[0].message == 'ok'){
								
				$('#myModal').modal('hide');
				
				$('#update_<?php echo isset($_GET['sid'])?$_GET['sid']:'';?>_<?php echo isset($_GET['uid'])?$_GET['uid']:'';?>').html(response[0].Uupdate);
				$('#update_timestamp_<?php echo isset($_GET['sid'])?$_GET['sid']:'';?>_<?php echo isset($_GET['uid'])?$_GET['uid']:'';?>').html(response[0].Utimestamp);
				
				Lobibox.notify('success', {
                    title: 'Success',
                    msg: 'Info updated successfully.'
                });
				
            }else{
                //alert('Some problem occurred, please try again.');
				$('#myModal').modal('hide');
				
				Lobibox.notify('error', {
                    title: 'Error',
                    msg: 'Some problem occurred, please try again.'
                });
            }
        },
		error:function(html)
		{			
			$('#myModal').modal('hide');
			
			Lobibox.notify('error', {
                    title: 'Error',
                    msg: 'Some problem occurred, Please try again.'
                });
        }
    });
	
	
	});
	
});
</script>

</body>
</html>
