<?php session_set_cookie_params(0);
if(!array_key_exists("sess",$_COOKIE))
{
  if(array_key_exists('PHPSESSID',$_COOKIE))
  {
    setcookie("sess",$_COOKIE['PHPSESSID'],time()+3600*24*7,"/");
  }
}
session_start();

$uid=0;
if(array_key_exists('uid',$_SESSION))
{
    setcookie("uid",$_SESSION['uid'],time()+3600*24*7,"/");
    $uid=(int)$_SESSION['uid'];
}

if (in_array($uid,[1,3]) && (array_key_exists('sid',$_SESSION)))
{
  setcookie("sid",$_SESSION['sid'],time()+3600*24*7,"/");
}

$startTime=(int)(microtime(true)*1000);
$timeArray=array();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html lang="en">
<?php

include("bcp/include/config.inc");
include("bcp/include/database.inc");
include("bcp/include/display.inc");
include("bcp/include/login.inc");
include("bcp/include/zepto.inc");
include("bcp/include/phplist.inc");
include("bcp/include/messages.inc");
include("bcp/include/mime.inc");
include("bcp/include/staffEdit.inc");
include("bcp/include/training.inc");
include("bcp/include/offer.inc");
include("bcp/include/paypal.inc");
include("bcp/include/stripe.inc");
require "vendor/autoload.php";
include("bcp/include/ipn.inc");
include("bcp/include/admin.inc");

if(object_key_exists('Operation',$_REQUEST))
  $Operation=$_REQUEST['Operation'];
else $Operation="Search";

$m=(new MongoDB\Client("mongodb://php:twpr2!dsG@biochannel-mongo"));
include("bcp/include/mongoTables.inc");

$url="https://db.biochannelpartners.com".$_SERVER['REQUEST_URI'];
$pageName="BioChannel Partners - BCP Partnering Portal";

$filter=["url"=>$url];


if(object_key_exists('Operation',$_REQUEST))
{
    $Operation=$_REQUEST['Operation'];
    if($Operation=="Search")
    {
        $start=0;
        if(object_key_exists('start',$_REQUEST))
        {
            if (is_numeric($_REQUEST['start']))
            {
                $start=(int)$_REQUEST['start'];
            }
    	}
        $pageName="BioChannel Partners - Search Results (".($start+1)." - ".($start+100).")";
    }
}

if($Operation=="subscribeToPremium") $pageName="Biochannel Partners - Subscribe to BCP Premium";

$seo=$tblSEO->findOne($filter);

if(("".gettype($seo)=="NULL") || (object_key_exists("updateTitle",$_REQUEST)))
{
    $tblSEO->replaceOne(["url"=>$url],["url"=>$url,"pageName"=>$pageName]);
}
else
{
    $pageName=$seo['pageName'];
}

$title=$pageName;
$pageAttributes=[];

if(object_key_exists('offerCode',$_REQUEST))
{
  $filter=["offerCode"=>$_REQUEST['offerCode']];
  $offer=$tblOffers->findOne($filter);
  if(gettype($offer)=="object")
  {
    $title=$offer['offerCode'];
    
    $pageAttributes['og:title']=$title;
    $pageAttributes['og:image']="https://db.biochannelpartners.com/images/offerImages/".$offer['offerImage'];
    $pageAttributes['og:description']=$offer['offerDescription'];
  }
}
elseif(object_key_exists('companyid',$_REQUEST))
{
  $companyName="Unknown";
  $companyid=$_REQUEST['companyid'];
  $companyRec=$tblCompanySnapshot->findOne(["companyid"=>(int)$companyid]);
  if(gettype($companyRec)!="NULL") $companyName=$companyRec['company']['Company'];
  if(gettype($companyRec)!="NULL") $pageAttributes=$companyRec['profilePage'];
  $title="View Profile: $companyName";
}

displayTemplateHead(".template/temphead.html",$title,$url,$pageAttributes);

?>
<link rel="stylesheet" href="/js/searchable/jquery.dropdown.css">
<script src="/js/searchable/jquery.dropdown.js"></script>
<script src="/js/biochannel.js?version=20240824"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/bio.ico" type="image/vnd.microsoft.icon" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/js/chosen.min.css">

<script
  type="text/javascript"
  src="https://code.jquery.com/jquery-3.5.1.min.js"
  integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
  crossorigin="anonymous"></script>

<script
  src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
  integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
  crossorigin="anonymous"></script>

<script src="/js/chosen.jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="/js/filter-multi-select/filter_multi_select.css">
<script src="/js/filter-multi-select/filter-multi-select-bundle.min.js" type="text/javascript"></script>

<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
<script src="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-select@3.18.3/dist/vue-select.min.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vue-select@3.18.3/dist/vue-select.css">
<link href='https://fonts.googleapis.com/css?family=Maven Pro|Sora' rel='stylesheet' type='text/css' />
<link rel="stylesheet"
      href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
      integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
      crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<link rel="stylesheet" href="/css/biochannel.css?ver=20260426m">

<!-- Required meta tags -->
<meta charset="utf-8">

<?php

$globalVariables=[];

if(object_key_exists('Operation',$_REQUEST))
  $Operation=$_REQUEST['Operation'];
else $Operation="Search";

$loginmsg=""; # Global Variable - Updated by getSessionInfo
$mysess=getSessionInfo();

$pageNames=array();

$pageNames['claim']='register-page';
$pageNames['claimProfile']='register-page';
$pageNames['register']='register-page';
$pageNames['resendValidationEmail']='verification-message';
$pageNames['resetPassword']='reset-password';
$pageNames['forgotPassword']='forgot-password';
$pageNames['PasswordReset']='password-reset';
$pageNames['My Profile']='connecting-you-to-your-company-profile';

if ((loggedIn()==0) and (!in_array($Operation,["Search"])))
{
  $email=""; if(object_key_exists('email',$_REQUEST)) $email=$_REQUEST['email'];

  if (strlen($email)==0) $pageNames['PasswordReset']='forgot-password';

  $pageName="login-page";

  if(object_key_exists($Operation,$pageNames)) $pageName=$pageNames[$Operation];

  if($Operation=="register")
  {
    $username=strtolower(getRequestVal('username'));
    $email=strtolower(getRequestVal("email"));
    $ck=lValidateRegistration($username,$email);
    if($ck=="OK") $pageName='verification-message';
  }
  if(in_array($Operation,["claim","claimProfile"]))
  {
    $username=strtolower(getRequestVal('username'));
    $email=strtolower(getRequestVal("email"));
    $ck=lValidateRegistration($username,$email);
    if($ck=="OK") $pageName='verification-message';
  }

  $thrivePage=get_wp_thrive_post($pageName);

  echo '<style type="text/css" class="tve_custom_style">';
  wp_thrive_css();
  echo '</style>';
}
else
{
  if($Operation=="My Profile")
  {
    $pageName='connecting-you-to-your-company-profile';
    $thrivePage=get_wp_thrive_post($pageName);
    echo '<style type="text/css" class="tve_custom_style">';
    wp_thrive_css();
    echo '</style>';
  }

  if($_SERVER['REQUEST_URI']=="/subscribeToPremium/")
  {
    $Operation="subscribeToPremium";
  }

  if($_SERVER['REQUEST_URI']=="/premiumMemberBenefits/")
  {
    $Operation="premiumMemberBenefits";
  }

  $pageNames['login']='dashboard';
  $pageNames['Company Profile']='company-profile';
  $pageNames['Company Snapshot']='company-profile';
  $pageNames['Dashboard']='dashboard';
  $pageNames['updateRegistration']="registration-details-updated";
  $pageNames['premiumMemberBenefits']="your-premium-member-benefits";

  if(object_key_exists($Operation,$pageNames))
  {
    $pageName=$pageNames[$Operation];
    $thrivePage=get_wp_thrive_post($pageName);
    echo '<style type="text/css" class="tve_custom_style">';
    wp_thrive_css();
    echo '</style>';
  }
  
  if($Operation=="subscribeToPremium")
  {
    $thrivePage=get_wp_thrive_post("partnering-portal-premium-membership");
    echo '<style type="text/css" class="tve_custom_style">';
    wp_thrive_css();
    echo '</style>';
  }
}

if($Operation=="UserManual")
{
  $userManualPage=getUserManualPage();

  echo '<style type="text/css" id="gm" class="tve_custom_style">';
  displayUserManualCSS();
  echo '</style>';
}
?>

<link href="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.snow.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.bubble.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.js"></script>

</head>

<?php
displayTemplateBody(".template/tempbody1.html");
?>
<nav class="navbar navbar-default navbar-expand-lg" style="background-color:#488a86;">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span> Menu
  </button>
  <div class="collapse navbar-collapse" id="navbarNav">
   <?php showMenu(); ?>
  </div>
  </nav>

  <div id="mycontent">

<?php

$done=0;

switch ($Operation)
{
  case "login":              if (loggedIn()==0) break;
  case "introduce":
  case "bookTraining":
  case "viewOffer":
  case "ShowScientificField":
  case "ShowScientificFields":
  case "resendValidationEmail": 
  case "Quick Search":
  case 'Search':             $done=1;
                             break;
}

if ((loggedIn()==0) && ($done==0))
{
  login_form($loginmsg);
}
else
{
  if ((loggedIn()==1) || (loggedInAs()==9999))
  {
    if(object_key_exists('myproxy',$mysess))
    {
      if($mysess['myproxy']!="!")
      {
        echo "<div class=\"noprint\" style=\"background:#FF0000; color: #FFFFFF; text-align: center; margin-bottom: 20px;\">".
             "Proxy Login as: ".$mysess['myproxy']['username']." (".$mysess['myproxy']['email'].")";
        if(isStaff()==1) echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=-\"><i class=\"fas fa-user-times\"></i> Clear Proxy</a>";
        if(isStaff()==1) echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=0\"><i class=\"fas fa-user\"></i> Nobody</a>";
        if(isStaff()==1) echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=20465\"><i class=\"fas fa-user\"></i> Datasets</a>";
        if(isStaff()==1) echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=20511\"><i class=\"fas fa-user\"></i> Premium</a>";
        if(isStaff()==1) echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=20512\"><i class=\"fas fa-user\"></i> Non-Premium</a>";
        if(isStaff()==1) echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=20733\"><i class=\"fas fa-user\"></i> Unlinked</a>";
        if(isStaff()==1) echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=9999\"><i class=\"fas fa-user\"></i> Not Logged In</a>";
        echo "</div>";
      }
    }
    elseif (isStaff()==1) 
    {
      echo "<div class=\"noprint\" style=\"background:#000088; color: #FFFFFF; text-align: center; margin-bottom: 20px;\">".
           "Proxy Login Off";
      echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=n\"><i class=\"fas fa-user-times\"></i> Hide Banner</a>";
      echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=0\"><i class=\"fas fa-user\"></i> Nobody</a>";
      echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=20465\"><i class=\"fas fa-user\"></i> Datasets</a>";
      echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=20511\"><i class=\"fas fa-user\"></i> Premium</a>";
      echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=20512\"><i class=\"fas fa-user\"></i> Non-Premium</a>";
      echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=20733\"><i class=\"fas fa-user\"></i> Unlinked</a>";
      echo " &nbsp; <a style=\"color:#FFFF88;\" href=\"?Operation=Proxy&proxy=9999\"><i class=\"fas fa-user\"></i> Not Logged In</a>";
      echo "</div>";
    }

    showNotifications();
  }

  if($Operation=="login")
  {
    if(strpos($_SERVER['REQUEST_URI'],"BookTraining")>0) $Operation="BookTraining";

    // If login was triggered by a protected page (e.g. docs.php), send the
    // user back there now that they are authenticated.
    // Only allow redirects to our own domain to prevent open-redirect attacks.
    if(object_key_exists('returnUrl',$_REQUEST))
    {
      $returnUrl=$_REQUEST['returnUrl'];
      $allowed=["db.biochannelpartners.com"];
      $host=parse_url($returnUrl,PHP_URL_HOST);
      if(in_array($host,$allowed))
      {
        echo "<p>Login successful. <a class=\"btn\" href=\"".htmlspecialchars($returnUrl)."\">Continue &rsaquo;</a></p>";
        return;
      }
    }
  }

  checkIpn();

  switch ($Operation)
  {
    case null:
    case "login":
    case "Dashboard":             if(object_key_exists("offerCode",$_REQUEST))
                                  {
                                      mongoViewOffer();
			          }
                                  else
                                  { 
                              	      dashboard();
                                  }
                                  break;

    case "premiumMemberBenefits": premiumMemberBenefits();
                                  break;

    case "My Profile":            mongoEditMyProfile();
                                  break;

    case "introduce":             sendMessageNotLoggedIn();
                                  break;

    case "moreInfo":
    case "contactMember":         moreInfo();
                                  break;
			       
    case "connectReminder":       mongoEditMyProfile();
                                  break;

    case "LinkedInPosts":         mongoAllLinkedInPosts();
                                  break;

    case "RegistrationAttempts":  registrationAttempts();
                                  break;

    case "ViewProfile":           projDisplaySingleProfile();
                                  break;

    case "ViewHistory":           mongoViewHistory();
                                  break;

    case "viewOutboxMessage":     viewOutboxMessage();
                                  break;

    case "messageReminders":      viewMessageReminders();
                                  break;

    case "releaseOutboxMessage":  releaseOutboxMessage();
                                  break;

    case "deleteOutboxMessage":   deleteOutboxMessage();
                                  break;

    case "viewOutboxReply":       viewOutboxReply();
                                  break;

    case "releaseOutboxReply":    releaseOutboxReply();
                                  break;

    case "deleteOutboxReply":     deleteOutboxReply();
                                  break;

    case "Actions":               listCompanyActions();
                                  break;

    case "stripeCustomer":        mongoStripeCustomer();
                                  break;

    case "viewOffer":             mongoViewOffer();
				  break;

    case "viewTrainingBookings":  viewTrainingBookings();
				  break;

    case "CreateUser":            mongoCreateUserPremium();
                                  break;
    
    case "BCPPremiumTrial":       mongoBCPPremiumTrial();
                                  break;

    case "databaseConfig":        dbConfig();
                                  break;

    case "findSimilar":           echo "<h3 class=\"title\">Find Similar Companies</h3>";
                                  $snapshot=$tblCompanySnapshot->findOne(["companyid"=>(int)$_REQUEST['companyid']]);
        
                                  if(gettype($snapshot)=="NULL")
                                  {
                                      echo "<p style=\"margin-bottom: 0px;\">Could not find company: ".$_REQUEST['companyid']."</p>";
                                  }
                                  else
                                  {
                                      echo "<p>".$snapshot['company']['Company']." is present in the following datasets:</p>";
                                      findSimilar($snapshot);
                                      echo "<p style=\"padding-top: 30px;\">Use the links above to view the dataset</p>";
                                  }
                                  break;

    case "offerConfig":           offerConfig();
                                  break;

    case "Proxy":                 proxyLogin();
                                  break;

    case "checkPremium":          mongoCheckPremium();
                                  break;

    case "linkingProblems":       linkingProblems();
                                  break;

    case "resetPassword":         echo "<p>You attempted to reset the password belonging to: <strong style=\"color:black\">".$_REQUEST['username']."</strong>";
                                  echo ". However you are currently logged in as: <strong style=\"color:black\">".$mysess['username']."</strong><p>";
                                  echo "<p>Click the button below if you want to logout and try again. Once you have logged out, you can press your back button.</p>";
                                  echo "<p><a class=\"btn\" href=\"index.php?Operation=Logout\">Logout</a></p>";
                                  break;

    case "gambicaCompanies":      
    case "hiddenCompanies":      
    case "premiumGambica":
    case "premiumNonGambica":
    case "premiumCompanies":      mongoPremiumCompanies();
                                  break;

    case "manageDatasets":        mongoManageDatasets();
                                  break;

    case "Search":                buildSearch();
                                  break;

    case "Quick Search":          buildSearch();
                                  break;

    case "Mongo":                 mongoDb();
                                  break;

    case "Phplist":               Phplist();
                                  break;

    case "viewWizzyActivity":     viewWizzyActivity();
				  break;

    case "resendValidationEmail": login_form("validate");
                                  break;

    case "subscribeToPremium":    mongoSubscribeToPremium();
                                  break;

    case "ViewCart":              viewCart();
                                  break;
  
    case "Checkout":              mongoCheckout();
                                  break;

    case "Company Snapshot":      mongoCompanySnapshot();
                                  break;

    case "Company Profile":       mongoCompanyProfile();
                                  break;

    case "Purchase Results":      purchaseResults();
                                  break;

    case "Explore":               mongoPurchasedSearch();
                                  break;

    case "Edit Page":             editPage($cxn,$mysess);
                                  break;

    case "Update Page":           updatePage($cxn,$mysess);
                                  break;

    case "addToCart":             mongoAddToCart();
                                  break;

    case "EditCart":              mongoEditCart();
                                  break;
 
    case "RemoveFromCart":        mongoRemoveFromCart();
                                  break;

    case "Mail":                  viewMails($mysess);
                                  break;

    case "Audit":
    case "Audit2":                mongoAudit2();
                                  break;

    case "Errors":                mongoErrors();
                                  break;

    case "wp":                    wp_thrive_post();
                                  break;

    case "Validate Users":        mongoValidateUsers();
                                  break;

    case "sendMessage":           mongoSendMessage();
                                  break;

    case "Messages":              mongoMessages();
                                  break;

    case "userManagement":        mongoUserManagement();
                                  break;

    case "PremiumLeads":          mongoPremiumLeads();
                                  break;

    case "viewRegistration":      
    case "CompaniesClaimed":      mongoCompaniesClaimed();
                                  break;

    case "ManageRocketChat":      mongoManageRocketChat();
                                  break;

    case "ManageTags":            manageCompanyTags();
                                  break;

    case "updateRegistration":    mongoUpdateRegistration();
                                  break;

    case "RequestInvoice":        mongoRequestInvoice();
                                  break;

    case "viewInvoice":           mongoViewInvoice();
                                  break;

    case "viewInvoices":          mongoViewInvoices();
                                  break;

    case 'buildInvoice':          mongoBuildInvoice();
                                  break;

    case 'editInvoice':           mongoEditInvoice();
                                  break;

    case "QuickSearch":
    case "Make Quick Search":     makeQuickSearch();
                                  break;

    case "premiumTrialAnalysis":  premiumTrialAnalysis();
                                  break;

    case "StaffPurchase":         mongoStaffPurchase();
                                  break;

    case "Staff Search":          staffSearch();
                                  break;

    case "ZeroPriceCheckout":     mongoZeroPriceCheckout();
                                  break;

    case "GreenSearch":           greenSavedSearch();
                                  break;

    case "Project":               mongoCompanyProjects();
                                  break;

    case "Project2":              mongoCompanyProjectsNew();
                                  break;

    case "Report":                mongoReportDetails();
                                  break;

    case "PaypalCheckout":        mongoPaypalCheckout();
                                  break;

    case "Payment Options":       mongoCaptureAddress();
                                  break;

    case "UserManual":            displayUserManual();
                                  break;

    case "Emails Sent":           mongoEmailsSent();
                                  break;

    case "logoImages":            profileLogoImages();
				  break;

    case "Notifications":         adminNotifications();
				  break;

    case "Emails Bounced":        showBouncedEmails();
                                  break;

    case "HippoEmailChecker":     hippoEmailChecker();
                                  break;

    case "generateLink":          mongoGenerateLink();
                                  break;

    case "emailLinks":            mongoEmailLinks();
                                  break;

    case "updateLogo":            mongoUpdateLogo();
                                  break;

    case "linkedInContacts":      mongoLinkedInContacts();
                                  break;

    case "paypalActivity":        paypalActivity();
                                  break;

    case 'statistics':            statistics();
                                  break;

    case "stripeActivity":        stripeActivity();
                                  break;

    case "stripeCompletePremium": stripeComplete();
                                  break;

    case "stripeComplete":        stripeComplete();
                                  break;

    case "stripeCancelled":       stripeCancelled();
				  break;

    case "stripeCancelledPremium": stripeCancelled();
				   break;

    case "TrainingCourseConfig":  trainingCourseConfig();
                                  break;

    case "ShowScientificFields":  if (object_key_exists("section",$_REQUEST))
                                  {
                                      showScientificFields($_REQUEST['section']);
                                  }
                                  else
                                  {
                                      showScientificFields();
                                  }
                                  break;

    case "ShowScientificField":   showScientificField($_REQUEST['section'],$_REQUEST['field']);
                                  break;

    case "BookTraining":
    case "bookTraining":          bookTraining($Operation);
                                  break;

    case "ViewEmailLink":         projViewEmailLink();
                                  break;

    case "websiteChecker":        websiteChecker();
                                  break;

    case "staffEdit":             staffEdit();
                                  break;

    case "createRichTextNote":    staffEditCreateRichTextNote();
                                  break;

    case "viewRichTextNote":      staffEditViewRichTextNote();
                                  break;

    case "editRichTextNote":      staffEditEditRichTextNote();
                                  break;

    case "restoreRichTextNote":   staffEditRestoreRichTextNote();
                                  break;

    case "addAttachment":         addAttachment();
                                  break;

    case "deleteAttachment":      deleteAttachment();
                                  break;

  }
}


?>

</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>

<script>

var config = {
  '.chosen-select'           : {},
  '.chosen-select-deselect'  : { allow_single_deselect: true },
  '.chosen-select-no-single' : { disable_search_threshold: 10 },
  '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
  '.chosen-select-rtl'       : { rtl: true },
  '.chosen-select-width'     : { width: '95%' }
}
for (var selector in config) {
  $(selector).chosen(config[selector]);
}
</script>

<div class="overlay-dark"></div>
<img class="img-overlay">
<script src="/js/image-popup.js" type="text/javascript"></script>
<?php

if($Operation=="staffEdit")
{
?>
<div id="scratchPad" style="text-align: center;position:fixed; bottom: 0; width: 100%; padding: 5px; z-index:99; height: 40px; background: #004422;\">
<script type="text/javascript">
  function toggleScratchpad()
	{
		divheight=$('#scratchPad').height();
		if(divheight<50)
		{
			$('#scratchPad').css("height","360px");
			$('#scratchPadBtn').html('<i class="fas fa-arrow-down"></i>');
		}
		else
		{
			$('#scratchPad').css("height","40px");
			$('#scratchPadBtn').html('<i class="fas fa-arrow-up"></i>');
		}
	}
</script>

<button id="scratchPadBtn" type="button" class="btn" onclick="toggleScratchpad()"> <i class="fas fa-arrow-up"></i></button>
<textarea style="margin-top: 10px; width: 100%; height: 300px;">
</textarea>
</div>
<?php
}
if($Operation=="staffEdit") staffEditReformat();
displayTemplateBody(".template/tempbody2.html");
performanceAudit(); 
?>

<!--1script src="/js/tinymce/tinymce.min.js"></script>
<1script>tinymce.init({ selector: "textarea.edit", height: 400, plugins: "code link lists help table wordcount", promotion: false, toolbar: "alignleft aligncenter alignright alignjustify alignnone | backcolor forecolor | bold underline italics strikethrough subscript superscript | copy cut paste pastetext removeformat | indent outdent hr | undo redo | link unlink | bullist numlist table wordcount help "});</script -->
</html>
