<?php include("includes/head.php");?>
<?php 
//$_GET['sid'] = '2';
if(isset($_GET['sid']) && $_GET['sid']!='')
{
	$query_shInfo = "SELECT * FROM ".TBL_STAKEHOLDERS." WHERE id = '$_GET[sid]'";
	$shInfo = $con->getSingleRow($query_shInfo);
}
?>
<body>
<form name="frmStockholders" id="frmStockholders">
  <input type="hidden" name="action" value="updateSHSummaries">
  <input type="hidden" name="shid" value="<?php echo isset($_GET['sid'])?$_GET['sid']:'';?>">
  <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 Summaries</h4>
  </div>
  <div class="modal-body">
    <div role="tabpanel">
      <!-- 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="form-group-inner">
                  <div class="row">
                    <div class="col-lg-5">
                      <label class="login2 pull-right pull-right-pro">Summary of <?php echo !empty($orgsInfo['name'])?$orgsInfo['name']:'';?> interaction with stakeholder</label>
                    </div>
                    <div class="col-lg-7">
                      <textarea name="sh_summary_interaction" id="sh_summary_interaction" rows="10" cols="40"><?php echo isset($shInfo['sh_summary_interaction'])?$shInfo['sh_summary_interaction']:'';?></textarea>
                      <!--<script>CKEDITOR.replace( 'sh_summary_interaction' );</script>-->
                    </div>
                  </div>
                </div>
                <div class="form-group-inner">
                  <div class="row">
                    <div class="col-lg-5">
                      <label class="login2 pull-right pull-right-pro">What is important for Stakeholder ?</label>
                    </div>
                    <div class="col-lg-7">
                      <input type="text" class="form-control" name="important_for_sh" id="important_for_sh" value="<?php echo isset($shInfo['important_for_sh'])?$shInfo['important_for_sh']:'';?>" />
                    </div>
                  </div>
                </div>
                <div class="form-group-inner">
                  <div class="row">
                    <div class="col-lg-5">
                      <label class="login2 pull-right pull-right-pro">How could SH contribute to <?php echo !empty($orgsInfo['name'])?$orgsInfo['name']:'';?></label>
                    </div>
                    <div class="col-lg-7">
                      <input type="text" class="form-control"  name="sh_contribute" id="sh_contribute" value="<?php echo isset($shInfo['sh_contribute'])?$shInfo['sh_contribute']:'';?>"/>
                    </div>
                  </div>
                </div>
                <div class="form-group-inner">
                  <div class="row">
                    <div class="col-lg-5">
                      <label class="login2 pull-right pull-right-pro">How could the stakeholder block <?php echo !empty($orgsInfo['name'])?$orgsInfo['name']:'';?>?</label>
                    </div>
                    <div class="col-lg-7">
                      <input type="text" class="form-control" name="sh_block" id="sh_block" value="<?php echo isset($shInfo['sh_block'])?$shInfo['sh_block']:'';?>" />
                    </div>
                  </div>
                </div>
                <div class="form-group-inner">
                  <div class="row">
                    <div class="col-lg-5">
                      <label class="login2 pull-right pull-right-pro">Key Issues/Concerns of stakeholder</label>
                    </div>
                    <div class="col-lg-7">
                      <textarea name="sh_issues_concerns" id="sh_issues_concerns" rows="10" cols="40"><?php echo isset($shInfo['sh_issues_concerns'])?$shInfo['sh_issues_concerns']:'';?></textarea>
                      <!--<script>CKEDITOR.replace( 'sh_issues_concerns' );</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');
				
				$('#sh_summary_interaction').html(response[0].sh_summary_interaction);
				$('#important_for_sh').html(response[0].important_for_sh);
				$('#sh_contribute').html(response[0].sh_contribute);
				$('#sh_block').html(response[0].sh_block);
				$('#sh_issues_concerns').html(response[0].sh_issues_concerns);
				
				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>
