<?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="frmStackholders" id="frmStackholders">
  <input type="hidden" name="action" value="updateS4">
  <input type="hidden" name="shid" value="<?php echo isset($_GET['sid'])?$_GET['sid']:'';?>">
  
    <div class="modal-header">
      <a href='#' onclick='parent.$.colorbox.close(); return false;'><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span> </button></a>
      <h4 class="modal-title" id="myModalLabel">Update Stakeholder</h4>
    </div>
    <div class="modal-body">
      <div role="tabpanel">
        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
          <li class="active"><a data-toggle="tab" href="#TabGeneral"><span class="adminpro-icon adminpro-analytics tab-custon-ic"></span>General Info</a></li>
          <li><a data-toggle="tab" href="#TabImportance"><span class="adminpro-icon adminpro-analytics-arrow tab-custon-ic"></span>Importance</a></li>
          <li><a data-toggle="tab" href="#TabConcerns"><span class="adminpro-icon adminpro-analytics-bridge tab-custon-ic"></span>Concerns</a> </li>
          <li><a data-toggle="tab" href="#TabInteraction"><span class="adminpro-icon adminpro-analytics-bridge tab-custon-ic"></span>Interaction</a> </li>
          <li><a data-toggle="tab" href="#TabOrientation"><span class="adminpro-icon adminpro-analytics-bridge tab-custon-ic"></span>Orientation</a> </li>
          <li><a data-toggle="tab" href="#TabStrategy"><span class="adminpro-icon adminpro-analytics-bridge tab-custon-ic"></span>Strategy</a> </li>
          <li><a data-toggle="tab" href="#TabUpdates"><span class="adminpro-icon adminpro-analytics-bridge tab-custon-ic"></span>Updates</a> </li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
          <!--<div role="tabpanel" class="tab-pane active" id="uploadTab">upload Tab</div>
                                    <div role="tabpanel" class="tab-pane" id="browseTab">browseTab</div>-->
          <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">Name of Stakeholder <span style="color: #FF0000;">*</span></label>
                        </div>
                        <div class="col-lg-9">
                          <input type="text" class="form-control" name="name" id="sh_name" value="<?php echo isset($shInfo['name'])?$shInfo['name']:'';?>" required/>
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Abbreviation <span style="color: #FF0000;">*</span></label>
                        </div>
                        <div class="col-lg-9">
                          <input type="text" class="form-control" name="abbreviation" id="sh_abbreviation" value="<?php echo isset($shInfo['abbreviation'])?$shInfo['abbreviation']:'';?>" required/>
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Logo </label>
                        </div>
                        <div class="col-lg-9">
                          <input type="file" name="sh_logo" id="sh_logo" value=""/>
                          <input type="hidden" name="old_sh_logo" value="<?php echo isset($shInfo['sh_logo'])?$shInfo['sh_logo']:'';?>">
                          <img src="uploads/stake-holders/<?php echo isset($shInfo['sh_logo'])?$shInfo['sh_logo']:'';?>" width="50" height="50"> </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Areas of Operations </label>
                        </div>
                        <div class="col-lg-9">
                          <input type="text" class="form-control" name="areas_of_operations" id="sh_areas_of_operations" value="<?php echo isset($shInfo['areas_of_operations'])?$shInfo['areas_of_operations']:'';?>" />
                        </div>
                      </div>
                    </div>
                    <!--<div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">PWD Oriented</label>
                        </div>
                        <div class="col-lg-9">
                          <input type="checkbox" class="" name="pwd_oriented" id="sh_pwd_oriented" value="Y" <?php //if(isset($shInfo['pwd_oriented']) && $shInfo['pwd_oriented']=='Y'){?>checked<?php //}?> />
                        </div>
                      </div>
                    </div>-->
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Address </label>
                        </div>
                        <div class="col-lg-9">
                          <input type="text" class="form-control" name="address" id="sh_address" value="<?php echo isset($shInfo['address'])?$shInfo['address']:'';?>" />
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Focal Person </label>
                        </div>
                        <div class="col-lg-9">
                          <input type="text" class="form-control" name="focal_person" id="sh_focal_person" value="<?php echo isset($shInfo['focal_person'])?$shInfo['focal_person']:'';?>" />
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Contact# </label>
                        </div>
                        <div class="col-lg-9">
                          <input type="text" class="form-control" name="tel_no" id="sh_tel_no" value="<?php echo isset($shInfo['tel_no'])?$shInfo['tel_no']:'';?>" />
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">E-mail </label>
                        </div>
                        <div class="col-lg-9">
                          <input type="text" class="form-control" name="email" id="sh_email" value="<?php echo isset($shInfo['email'])?$shInfo['email']:'';?>" />
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Website </label>
                        </div>
                        <div class="col-lg-9">
                          <input type="text" class="form-control" name="website_url" id="website_url" value="<?php echo isset($shInfo['website_url'])?$shInfo['website_url']:'';?>" placeholder="http://www.url.com" />
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Select Category <span style="color: #FF0000;">*</span></label>
                        </div>
                        <div class="col-lg-6">
                          <div class="form-select-list">
                            <select class="form-control custom-select-value" name="category_id" id="sh_category_id" required>
                              <option value="">Select Category</option>
                              <?php 
                                                        $selQry_listings = "SELECT * FROM ".TBL_CATEGORIES." ORDER BY category_title";
                                                        $listingsInfo =  $con->getMultiRow($selQry_listings, __FILE__,__LINE__);
                                                        $totListings = count($listingsInfo);	
                                                            for($t=0;$t<$totListings;$t++)
                                                            {
                                                        ?>
                              <option value="<?php echo $listingsInfo[$t]['category_id'];?>" <?php if ( isset($shInfo['category_id']) && $shInfo['category_id']==$listingsInfo[$t]['category_id']){?> selected<?php }?>><?php echo $listingsInfo[$t]['category_title'];?></option>
                              <?php }?>
                            </select>
                          </div>
                        </div>
                        <div class="col-lg-3">
                          <!--<span class="input-group-btn">
                                                    <button type="button" class="btn btn-success" data-toggle="modal" data-target="#catModal"> <i class="fa fa-plus"></i> </button>
                                                    </span>-->
                        </div>
                      </div>
                    </div>
                    <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="description" id="description_sh" rows="10" cols="40"><?php echo isset($shInfo['description'])?$shInfo['description']:'';?></textarea>
                          <!--<script>CKEDITOR.replace( 'description_sh' );</script>-->
                        </div>
                      </div>
                    </div>
                    
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">High Priority</label>
                        </div>
                        <div class="col-lg-9">
                          <input type="checkbox" class="" name="is_high_priority" id="is_high_priority" value="1" <?php if(isset($shInfo['is_high_priority']) && $shInfo['is_high_priority']=='1'){?>checked<?php }?> />
                        </div>
                      </div>
                    </div>
                    
                    <div class="form-group-inner">
                      <div class="row">
                        <div class="col-lg-3">
                          <label class="login2 pull-right pull-right-pro">Departments & Files <span style="color: #FF0000;">*</span></label>
                        </div>
                        <div class="col-lg-9">
                          <div id="treeview_container" class="hummingbird-treeview well h-scroll-large">
                            <ul id="treeview" class="hummingbird-base">
                              <?php 
								  //--------------- Category Info ----------
								  $srno = 0;
								  								  
								  if($_SESSION['userGroupID']==1 or $_SESSION['userGroupID']==2){								  
								    $selQry_depts = "SELECT * FROM ".TBL_DEPARTMENTS." ORDER BY name";
								  }else{
								      $selQry_depts = "SELECT * FROM ".TBL_DEPARTMENTS." where status='1' and id IN(".$userDeptAccess.") ORDER BY name";
								  }
								  $deptsInfo =  $con->getMultiRow($selQry_depts, __FILE__,__LINE__);
								  $totDeptsListings = count($deptsInfo);
									if($totDeptsListings>0)
									{
										for($dept=0;$dept<$totDeptsListings;$dept++)
										{
											$srno++;
											$deptChecked = '';
											$deptDisplay = 'none';
								  			//----------------------------------------
											$selQry_file_dept = "SELECT dept_id FROM ".TBL_STAKEHOLDERS_DEPTS_FILES." WHERE stakerholder_id = '".$_GET['sid']."' AND dept_id='".$deptsInfo[$dept]['id']."' AND is_dept_checked='1' ";
											$fileDeptInfo =  $con->getSingleRow($selQry_file_dept, __FILE__,__LINE__);
											if(!empty($fileDeptInfo['dept_id']))
											{
												$deptChecked = 'checked';
												$deptDisplay = 'block';
											}
											//----------------------------------------
											$selQry_files = "SELECT * FROM ".TBL_FILES." WHERE department_id='".$deptsInfo[$dept]['id']."' ORDER BY name";
										    $filesInfo =  $con->getMultiRow($selQry_files, __FILE__,__LINE__);
										    $totDeptsListings = count($filesInfo);
											
											if($totDeptsListings>0)
											{
												for($df=0;$df<$totDeptsListings;$df++)
												{
													//----------------------------------------
													$selQry_DeptFile = "SELECT file_id FROM ".TBL_STAKEHOLDERS_DEPTS_FILES." WHERE stakerholder_id = '".$_GET['sid']."' AND file_id='".$filesInfo[$df]['id']."'";
													$DeptFileInfo =  $con->getSingleRow($selQry_DeptFile, __FILE__,__LINE__);
													if(!empty($DeptFileInfo['file_id']))
													{
														$deptDisplay = 'block';
													}
												}	
											}	
											//----------------------------------------
								?>
                                <li><i class="fa fa-plus"></i>
                                <label>
                                <input name="depts[]" id="node-<?php echo $deptsInfo[$dept]['id'];?>" value="<?php echo $deptsInfo[$dept]['id'];?>" data-id="custom-<?php echo $deptsInfo[$dept]['id'];?>" type="checkbox" <?php echo $deptChecked;?>>
                                <?php echo $deptsInfo[$dept]['name'];?></label>
                                <ul style="margin-left:10px; display:<?php echo $deptDisplay;?>">
                                  <?php 
								  //--------------- Category Info ----------
								    $srno = 0;
									if($totDeptsListings>0)
									{
										for($file=0;$file<$totDeptsListings;$file++)
										{
											$srno++;
											$fileChcked = '';
											//----------------------------------------
											$selQry_dept_file = "SELECT file_id FROM ".TBL_STAKEHOLDERS_DEPTS_FILES." WHERE stakerholder_id = '".$_GET['sid']."' AND file_id='".$filesInfo[$file]['id']."'";
											$deptFileInfo =  $con->getSingleRow($selQry_dept_file, __FILE__,__LINE__);
											if(!empty($deptFileInfo['file_id']))
											{
												$fileChcked = 'checked';
											}
											//----------------------------------------
								  ?>
                                  <li>
                                    <i class="fa fa-minus"></i>
                                    <label>
                                    <input name="files[]" id="node-<?php echo $filesInfo[$file]['id'];?>" value="<?php echo $filesInfo[$file]['id'];?>" data-id="custom-0" type="checkbox" <?php echo $fileChcked;?>>
                                    <?php echo $filesInfo[$file]['name'];?></label>                                    
                                  </li>
                                  <?php }
								  }?>
                                </ul>
                              </li>
                              <?php }
							  }?>

                            </ul>
                          </div>
                        </div>
                      </div>
                    </div>
                    
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div id="TabImportance" class="tab-pane 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-4">
                          <label class="login2 pull-right pull-right-pro">What is important for Stakeholder ?</label>
                        </div>
                        <div class="col-lg-8">
                          <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-4">
                          <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-8">
                          <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-4">
                          <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-8">
                          <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>
                </div>
              </div>
            </div>
          </div>
          <div id="TabConcerns" class="tab-pane 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-4">
                          <label class="login2 pull-right pull-right-pro">Key Issues/Concerns of stakeholder</label>
                        </div>
                        <div class="col-lg-8">
                          <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 id="TabInteraction" class="tab-pane 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-4">
                          <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-8">
                          <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>
                </div>
              </div>
            </div>
          </div>
          <div id="TabStrategy" class="tab-pane 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="sparkline8-hd">
                      <div class="main-sparkline8-hd">
                        <h1><?php echo !empty($orgsInfo['name'])?$orgsInfo['name']:'';?> strategy, Responsibilities, execution, milestones achieved</h1>
                      </div>
                    </div>
                    <div class="row" style="margin-top:20px;">
                      <div class="col-lg-12">
                        <div class="basic-login-inner inline-basic-form">
                          <div class="form-group-inner">
                            <div class="row">
                              <div class="col-lg-3">
                                <input type="text" class="form-control basic-ele-mg-b-10" placeholder="Enter Strategy" />
                              </div>
                              <div class="col-lg-3">
                                <input type="text" class="form-control basic-ele-mg-b-10" placeholder="Enter Responsibility" />
                              </div>
                              <div class="col-lg-3">
                                <input type="text" class="form-control basic-ele-mg-b-10" placeholder="Enter Key milestones" />
                              </div>
                              <div class="col-lg-2">
                                <input type="file" class="basic-ele-mg-b-10" placeholder="Upload document" />
                              </div>
                              <div class="col-lg-1">
                                <div class="login-btn-inner">
                                  <div class="row">
                                    <div class="col-lg-4"> &nbsp;
                                      <button class="btn btn-sm btn-primary login-submit-cs" type="button">Add</button>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner" style="margin-top:30px;">
                      <div class="row">
                        <div class="col-lg-12">
                          <div class="static-table-list">
                            <table class="table" border="1">
                              <thead>
                                <tr>
                                  <th>#</th>
                                  <th>Strategy</th>
                                  <th>Responsibility</th>
                                  <th>Key milestones</th>
                                  <th>Related Documents</th>
                                </tr>
                              </thead>
                              <tbody>
                                <tr>
                                  <td></td>
                                  <td></td>
                                  <td></td>
                                  <td></td>
                                  <td></td>
                                </tr>
                              </tbody>
                            </table>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div id="TabOrientation" class="tab-pane 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-12">
                          <div class="static-table-list">
                            <table class="table" border="1">
                              <thead>
                                <tr>
                                  <th colspan="3" style="text-align:center;">Pre-Defined Orientation</th>
                                </tr>
                                <tr>
                                  <th width="33%">Title</th>
                                  <th width="33%">Def.</th>
                                  <th width="33%">Ranking</th>
                                </tr>
                              </thead>
                              <tbody>
                                <tr>
                                  <td>SH interest</td>
                                  <td><div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="Low" name="orientation_sh_interest" id="orientation_sh_interest_low" <?php if ( isset($shInfo['orientation_sh_interest']) && $shInfo['orientation_sh_interest']=='Low'){?>checked <?php }?> >
                                          <i></i> Low </label>
                                        </div>
                                      </div>
                                    </div>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="Medium" name="orientation_sh_interest" id="orientation_sh_interest_medium" <?php if ( isset($shInfo['orientation_sh_interest']) && $shInfo['orientation_sh_interest']=='Medium'){?>checked <?php }?>>
                                          <i></i> Medium </label>
                                        </div>
                                      </div>
                                    </div>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="High" name="orientation_sh_interest" id="orientation_sh_interest_high" <?php if ( isset($shInfo['orientation_sh_interest']) && $shInfo['orientation_sh_interest']=='High'){?>checked <?php }?>>
                                          <i></i> High </label>
                                        </div>
                                      </div>
                                    </div></td>
                                  <td><div class="row">
                                      <div class="col-lg-6">
                                        <div class="touchspin-inner">
                                          <input class="touchspin1" type="text" value="<?php echo isset($shInfo['orientation_sh_interest_ranking'])?$shInfo['orientation_sh_interest_ranking']:'';?>" placeholder="1-10" maxlength="10" name="orientation_sh_interest_ranking" id="orientation_sh_interest_ranking">
                                          Range(1-10) </div>
                                      </div>
                                    </div></td>
                                </tr>
                                <tr>
                                  <td>SH Influence</td>
                                  <td><div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="10" name="orientation_sh_influence" id="orientation_sh_influence_low" <?php if ( isset($shInfo['orientation_sh_influence']) && $shInfo['orientation_sh_influence']=='10'){?>checked <?php }?>>
                                          <i></i> Low </label>
                                        </div>
                                      </div>
                                    </div>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="16" name="orientation_sh_influence" id="orientation_sh_influence_medium" <?php if ( isset($shInfo['orientation_sh_influence']) && $shInfo['orientation_sh_influence']=='16'){?>checked <?php }?>>
                                          <i></i> Medium </label>
                                        </div>
                                      </div>
                                    </div>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="20" name="orientation_sh_influence" id="orientation_sh_influence_high" <?php if ( isset($shInfo['orientation_sh_influence']) && $shInfo['orientation_sh_influence']=='20'){?>checked <?php }?>>
                                          <i></i> High </label>
                                        </div>
                                      </div>
                                    </div></td>
                                  <td></td>
                                </tr>
                                <tr>
                                  <td>Initial Orientation</td>
                                  <td>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="green" name="sh_initial_orientation" id="sh_initial_orientation_low" <?php if ( isset($shInfo['sh_initial_orientation']) && $shInfo['sh_initial_orientation']=='green'){?>checked <?php }?>>
                                          <i></i> <span style="color:#00FF00">Supportive</span> </label>
                                        </div>
                                      </div>
                                    </div>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="red" name="sh_initial_orientation" id="sh_initial_orientation_medium" <?php if ( isset($shInfo['sh_initial_orientation']) && $shInfo['sh_initial_orientation']=='red'){?>checked <?php }?>>
                                          <i></i> <span style="color: #FF0000">Resistant</span> </label>
                                        </div>
                                      </div>
                                    </div>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="orange" name="sh_initial_orientation" id="sh_initial_orientation_high" <?php if ( isset($shInfo['sh_initial_orientation']) && $shInfo['sh_initial_orientation']=='orange'){?>checked <?php }?>>
                                          <i></i> <span style="color: #FF9900;">Neutral</span> </label>
                                        </div>
                                      </div>
                                    </div>
                                  </td>
                                  <td></td>
                                </tr>
                                <tr>
                                  <td>Current Orientation</td>
                                  <td><div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="green" name="sh_current_orientation" id="sh_current_orientation_low" <?php if ( isset($shInfo['sh_current_orientation']) && $shInfo['sh_current_orientation']=='green'){?>checked <?php }?>>
                                          <i></i> <span style="color:#00FF00">Supportive</span> </label>
                                        </div>
                                      </div>
                                    </div>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="red" name="sh_current_orientation" id="sh_current_orientation_medium" <?php if ( isset($shInfo['sh_current_orientation']) && $shInfo['sh_current_orientation']=='red'){?>checked <?php }?>>
                                          <i></i> <span style="color: #FF0000">Resistant</span> </label>
                                        </div>
                                      </div>
                                    </div>
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="orange" name="sh_current_orientation" id="sh_current_orientation_high" <?php if ( isset($shInfo['sh_current_orientation']) && $shInfo['sh_current_orientation']=='orange'){?>checked <?php }?>>
                                          <i></i> <span style="color: #FF9900;">Neutral</span> </label>
                                        </div>
                                      </div>
                                    </div></td>
                                  <td></td>
                                </tr>
                                <tr>
                                  <td>Desired Orientation</td>
                                  <td><div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="green" name="sh_desired_orientation" id="sh_desired_orientation_low" <?php if ( isset($shInfo['sh_desired_orientation']) && $shInfo['sh_desired_orientation']=='green'){?>checked <?php }?>>
                                          <i></i> <span style="color:#00FF00">Supportive</span> </label>
                                        </div>
                                      </div>
                                    </div>                                    
                                    <div class="row">
                                      <div class="col-lg-12">
                                        <div class="i-checks pull-left">
                                          <label>
                                          <input type="radio" value="orange" name="sh_desired_orientation" id="sh_desired_orientation_high" <?php if ( isset($shInfo['sh_desired_orientation']) && $shInfo['sh_desired_orientation']=='orange'){?>checked <?php }?>>
                                          <i></i> <span style="color: #FF9900;">Neutral</span> </label>
                                        </div>
                                      </div>
                                    </div></td>
                                  <td></td>
                                </tr>
                              </tbody>
                            </table>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="form-group-inner">
                      <div class="login-btn-inner">
                        <div class="row">
                          <div class="col-lg-3"></div>
                          <div class="col-lg-9">
                            <div class="login-horizental cancel-wp pull-right">
                              <!--<button class="btn btn-white" type="submit">Cancel</button>-->
                              <!--<button class="btn btn-sm btn-primary login-submit-cs" type="button" onClick="shActions('frmStackholders');">Save & Finish</button>-->
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div id="TabUpdates" class="tab-pane 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="sparkline8-hd">
                      <div class="main-sparkline8-hd">
                        <h1>Stakeholder Updates Log</h1>
                      </div>
                    </div>
                    <div class="form-group-inner" style="margin-top:30px;">
                      <div class="row">
                        <div class="col-lg-12">
                          <div class="static-table-list">
                            <table class="table" border="1">
                              <thead>
                                <tr>
                                  <th>#</th>
                                  <th>Update</th>
                                  <th>Timestamp</th>
                                </tr>
                              </thead>
                              <tbody>
                                <?php 
								$counter_rankupd = 0;
								$selQuery_rank_upd = "SELECT * FROM  ".TBL_RANKING_HISTORY." WHERE sh_id='".$_GET['sid']."';";
								$rankupdInfo = $con->getMultiRow($selQuery_rank_upd);
								$tot_mappingsInfo = count($rankupdInfo);
								if($tot_mappingsInfo > 0){
									 for($ru=0;$ru<$tot_mappingsInfo;$ru++)
									 {
									 	$counter_rankupd++;
								?>
                                    <tr>
                                      <td><?php echo $counter_rankupd;?>.</td>
                                      <td><?php echo isset($rankupdInfo[$ru]['update_detail'])?$rankupdInfo[$ru]['update_detail']:'';?></td>
                                      <td><?php echo isset($rankupdInfo[$ru]['modified'])?date("d-m-Y",strtotime($rankupdInfo[$ru]['modified'])):'';?></td>
                                    </tr>
                                <?php }
								}?>
                              </tbody>
                            </table>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="modal-footer">
      <a href='#' onclick='parent.$.colorbox.close(); return false;'><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></a>
      <!--<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('frmStackholders');">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>
<!-- meanmenu JS
		============================================ -->
<script src="js/jquery.meanmenu.js"></script>
<!-- mCustomScrollbar JS
		============================================ -->
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<!-- sticky JS
		============================================ -->
<script src="js/jquery.sticky.js"></script>
<!-- scrollUp JS
		============================================ -->
<script src="js/jquery.scrollUp.min.js"></script>
<!-- Tree Viewer JS
		============================================ -->
<script src="js/tree-line/jstree.min.js"></script>
<script src="js/tree-line/jstree.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>

<!-- Tree View
		============================================ -->
<!--<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>-->
<script src="scripts/treeview/hummingbird-treeview.js"></script>
<script>
	$("#treeview").hummingbird();
</script>

<script>
$(document).ready(function(e){
	$('form input').on('keypress', function(e) {
    	return e.which !== 13;
	});
	
	$("#frmStackholders").on('submit', function(e){
	
	e.preventDefault();
	
	var shdata = new FormData(this);
	
	var sh_name = $("#sh_name").val();
	var sh_abbreviation = $("#sh_abbreviation").val();
	var sh_areas_of_operations = $("#sh_areas_of_operations").val();
	var sh_address = $("#sh_address").val();
	var sh_focal_person = $("#sh_focal_person").val();
	var sh_tel_no = $("#sh_tel_no").val();
	var sh_email = $("#sh_email").val();
	var sh_category_id = $("#sh_category_id").val();
	
	if(sh_name=='' || sh_abbreviation=='' || sh_category_id=='')
	{		
		Lobibox.notify('error', {                    
			title: 'Error',					
			position: 'top right',//top left,top right,bottom left,bottom right,
			msg: 'Please, enter all mandatory fields in General Info Tab'
		});
	}
	else
	{
    	$.ajax({		
		type: 'POST',
        url: 'stackholdersActions.php',
		processData: false,
		contentType: false,
        data: shdata,
		cache: false,
		dataType: 'JSON',
        success:function(response){
			
            if(response[0].message == 'ok'){
				
				$(':input').not(':button, :submit, :reset, :hidden, :checkbox, :radio').val('');
    			$(':checkbox, :radio').prop('checked', false);
				$('#frmStackholders').trigger("reset");
				
				//getCategoriesList();
				
				$('#myModal').modal('hide');
				
				Lobibox.notify('success', {
                    title: 'Success',
                    msg: 'Stakeholder updated successfully.'
                });
				
				window.location.href = 'sh-map.php';
				
            }else{
                //alert('Some problem occurred, please try again.');
				Lobibox.notify('error', {
                    title: 'Error',
                    msg: 'Some problem occurred, please try again.'
                });
            }
        },
		error:function(html)
		{			
			Lobibox.notify('error', {
                    title: 'Error',
                    msg: 'Some problem occurred, Please try again.'
                });
        }
    });
	}
	});
	
});
</script>

</body>
</html>
