<?php

  //  include("../admin/GoTool/cat.inc");
  include("../cat.inc");
$connection = @mysqli_connect($host,$user,$password) or die(mysqli_error($connection));
$db = @mysqli_select_db($connection,$db_name) or die(mysqli_error($connection));

   $prog300="report/SaveDataGG.php";
  $prog301="report/getCSV.php";
    $prog302="report/export.php";
$logged=$_GET['log'];
                       $viewmail='';

  $type_face="Dashboard Portals";

 $Assessment1="Assessment";  //This is on the report side
  $Assessment2="Assessment";  //This is on the back end side to edit survey
//log=You are logged in as <span>admin</span>
//$logged = substr("abcdef", 0, -1);  // returns "abcde"
//$rest = substr("abcdef", 2, -1);  // returns "cde"
$sig="../../../../sig";
$logged1=substr($logged , 0,7);
$logged_test="You are";
if ($logged1==$logged_test){
$logged = substr($logged, 27, -7);  // returns "abcde"
}

// start the session


  $display_title="Dashboard Portals";
  $prog="dashboard_front/OpenStakeholdersManager.php";

$tok=$_GET['token'];
$bar=$_GET['ean'];
//$tok= session_id();
include("../cat.inc");


$price="Free";
$tab1="Event Details";
$tab2="Event Description";
$tab3="Register Here";


 if (isset($_POST['jedID2'])) {
	$jedID2=$_POST['jedID2'];
}

$Rtoday = date("Y-m-d h:i:s");
$Rtoday_calc=strtotime("$Rtoday");
    $display_back="<FORM><INPUT TYPE=\"BUTTON\" VALUE=\"Back\" ONCLICK=\"history.go(-1)\"></FORM><br/> ";


include("infolist.php");

 // $product_id=171;
  $path=89;                  //deletes from customer

   if ($jedID2==2000){

    $Znum=$_POST['Znum'];
     $bar22=$_POST['bar22'];
     $port_id=$_POST['portal'];
     $statusz=$_POST['status'];
$titlebaby=addslashes($_POST['titlebaby']);
$map_id=$_POST['mapid'];

  $sql2A =  "Update $table_name1005 SET  title='$titlebaby',status='$statusz', create_date='$Rtoday'  WHERE map_id = '$map_id'  ";
                    $result2A = @mysqli_query($connection,$sql2A) or die(mysqli_error($connection));
     $jedID2=2;
      $viewmail="<div class=\"success\">Title $map_id has been updated.</div>";
   }


      if ($jedID2==2005){

    $Znum=$_POST['groupy'];
   //  $bar22=$_POST['bar22'];
   $port_id=$_POST['portal'];
$titlebaby=addslashes($_POST['titlebaby']);
$map_id=$_POST['mapid'];

  $sql2A =  "Update $table_name1005 SET  information_id='$Znum', create_date='$Rtoday'  WHERE map_id = '$map_id'  ";
                    $result2A = @mysqli_query($connection,$sql2A) or die(mysqli_error($connection));
     $jedID2=2;
      $viewmail="<div class=\"success\">Information ID for $map_id has been updated.</div>";
   }


      if ($jedID2==2002){

    $Znum=$_POST['Znum'];
     $bar22=$_POST['bar22'];
     $port_id=$_POST['portal'];
$titlebaby=addslashes($_POST['titlebaby']);

     $sql12ad ="SELECT * FROM $table_name1005 WHERE survey_id = '$port_id' Order by surveyQ_id DESC limit 1";
         $result331d = @mysqli_query($connection,$sql12ad) or die(mysqli_error($connection));
                 while ($row1d = mysqli_fetch_array($result331d)) {
     $SQ=  $row1d['surveyQ_id'];
     $SQ=$SQ+1;
     $Sgroup=  $row1d['group_id'];

             }

   $sql286 = "INSERT INTO $table_name1005 (surveyQ_id,group_id, sub_id, survey_id, Z_num,surveyQ_idK, create_date, title, subtitle )
                                    VALUES('$SQ','$Sgroup','0','$port_id','-1', '$SQ', '$Rtoday', '$titlebaby', 'NONE')";
$result286 = @mysqli_query($connection,$sql286) or die(mysqli_error($connection));


  //$sql2A =  "Update $table_name1005 SET  title='$titlebaby', create_date='$Rtoday'  WHERE map_id = '$map_id'  ";
                 //   $result2A = @mysqli_query($connection,$sql2A) or die(mysqli_error($connection));
     $jedID2=2;
      $viewmail="<div class=\"success\">New Main Bar has been added.</div>";
   }





       if ($jedID2==20025){

    $Znum=-1;
     $bar22=1;
     $port_id=$_POST['portal'];
      $Sgroup=$_POST['groupy'];
$titlebaby=addslashes($_POST['titlebaby']);


   $sql286 = "INSERT INTO $table_name1005 (surveyQ_id,group_id, sub_id, survey_id, Z_num,surveyQ_idK, create_date, title, subtitle ) VALUES
                                            ('$bar22','$Sgroup','0','$port_id','-1', '$bar22', '$Rtoday', '$titlebaby', 'NONE')";
$result286 = @mysqli_query($connection,$sql286) or die(mysqli_error($connection));


//  $sql2A =  "Update $table_name1005 SET  title='$titlebaby', create_date='$Rtoday'  WHERE map_id = '$map_id'  ";
       //             $result2A = @mysqli_query($connection,$sql2A) or die(mysqli_error($connection));
     $jedID2=2;
      $viewmail="<div class=\"success\">New Main Bar has been added.</div>";
   }



      if ($jedID2==2003){

    $Znum=$_POST['Znum'];
     $bar22=$_POST['bar22'];
     $port_id=$_POST['portal'];
$titlebaby=addslashes($_POST['titlebaby']);

     $sql12ad ="SELECT * FROM $table_name1005 WHERE survey_id = '$port_id' AND surveyQ_id='$bar22'  Order by Z_num DESC limit 1";
         $result331d = @mysqli_query($connection,$sql12ad) or die(mysqli_error($connection));
                 while ($row1d = mysqli_fetch_array($result331d)) {
     $SQZ=  $row1d['Z_num'];
     if ($SQZ==-1){
      $SQZ=1;
     }else{
       $SQZ=$Znum;
     $SQZ=$SQZ+1;
     }

     $Sgroup=  $row1d['group_id'];

             }

   $sql286 = "INSERT INTO $table_name1005 (surveyQ_id,group_id, sub_id, survey_id, Z_num,surveyQ_idK, create_date, title, subtitle ) VALUES('$bar22','$Sgroup','1','$port_id','$SQZ', '$SQZ', '$Rtoday', '$titlebaby', 'NONE')";
$result286 = @mysqli_query($connection,$sql286) or die(mysqli_error($connection));


//  $sql2A =  "Update $table_name1005 SET  title='$titlebaby', create_date='$Rtoday'  WHERE map_id = '$map_id'  ";
     //               $result2A = @mysqli_query($connection,$sql2A) or die(mysqli_error($connection));
     $jedID2=2;
      $viewmail="<div class=\"success\">New Sub Bar has been add.</div>";
   }


    if ($jedID2==2001){
      include('ZcheckedCheck_update.php');
    $Znum=$_POST['Znum'];
     $bar22=$_POST['bar22'];
     $port_id=$_POST['portal'];
$titlebaby=addslashes($_POST['titlebaby']);
$map_id=$_POST['mapid'];

$sql2A =  "Update $table_name1005 SET title='$titlebaby9', buy='$buy', app='$app', pay='$pay', Intprint='$Intprint', road='$road', check1='$check1', path='$path', upp='$upp', assess='$assess', zDisc='$zDisc', zKolbe='$zKolbe', zStrength='$zStrength', zSpiritTake='$zSpiritTake', zSpirit='$zSpirit', zLife='$zLife', zLifeTime='$zLifeTime', zPersonal='$zPersonal', Report='$Report', Enroll='$Enroll', SignMem='$SignMem', Doctor='$Doctor', Memcard='$Memcard', Patient='$Patient', AgentMat='$AgentMat', EnrollMat='$EnrollMat', AgentList='$AgentList', AgentForm='$AgentForm', zDoctor='$zDoctor', title3='$title3', title37='$title37', title4='$title4', MemCardTitle='$MemCardTitle',zPersonalT='$zPersonalT2', status='$status', MemRecord='$MemRecord', groupy='$groupy',van36='$RegEvents2' WHERE map_id = '$map_id'  ";
                 $result2A = @mysqli_query($connection,$sql2A) or die(mysqli_error($connection));
     $jedID2=2;
      $viewmail="<div class=\"success\">Title $map_id has been updated.</div>";
   }


  if ($jedID2==436){
      $map_id=$_POST['pnum'];

     $sql33a800 ="Delete FROM $table_name36 WHERE customer_id='$map_id'";
  $result33a800 = @mysqli_query($connection,$sql33a800) or die(mysqli_error($connection));

  $viewmail="<div class=\"success\">Record $map_id has been deleted.</div>";
    $bob2=2;
  $jedID2=$bob2;

  }



    if ($jedID2==536){
      $cust_id2=$_POST['pnum'];
      $newagent_id=$_POST['newagent'];

$sql2 = "UPDATE $table_name36 SET  salesrep_id='$newagent_id' WHERE customer_id= '$cust_id2' ";
$result2 = @mysqli_query($connection,$sql2) or die(mysqli_error($connection));

  $viewmail="<div class=\"success\">Record Assignment has been updated.</div>";
    $bob2=2;
  $jedID2=$bob2;

  }

 $sq112ab="SELECT * FROM $table_name362  ORDER BY name";
  $result112ab = @mysqli_query($connection,$sq112ab) or die(mysqli_error($connection));
while ($row112ab = mysqli_fetch_array($result112ab)) {
 $leader_id1=  $row112ab['customer_group_id'];
 $first_id=  $row112ab['name'];
 $first_id=stripslashes($first_id);
  $first_id=htmlspecialchars_decode($first_id);
  $first_id=mb_convert_encoding($first_id,  "HTML-ENTITIES");


// $last_id=  $row112ab['lastname'];
 $nameP[$leader_id1]="$first_id";

  $display_listCGP .=  "<option value=$leader_id1> $nameP[$leader_id1]</option>";
 }
      $Zt10=100;
      $Zt1=1;

   for ($x2=$Zt1; $x2<=$Zt10; $x2++) {


$bobporta="Not Assigned";
 $sql12drr ="SELECT * FROM $table_name1005 WHERE survey_id = '$x2'";
          $result331drr = @mysqli_query($connection,$sql12drr) or die(mysqli_error($connection));
  while ($row1drr = mysqli_fetch_array($result331drr)) {
     $group_id2=  $row1drr['group_id'];
     $bobporta=$nameP[$group_id2];
	}

  $display_listPortal .=  "<option value=$x2> Portal $x2 -$bobporta</option>";

   }




         if( $jedID2==0){

//$run="$loc2/createaccount/OpenEvent.php?path=$path&product_id=$product_id";

        $i=$i+1;

  $display_block66 ="



   <FORM  name=\"formcheck55\"  METHOD=\"POST\"   ACTION=\"$loc2/admin/GoTool/$prog?token=$tok&log=$logged\">

   Select  $type_face:
    <select name=\"group_id\">
       $display_listPortal
    </select>
                     <input type=\"hidden\" name=\"bb\" value=\"1\"  />
                 <input type=\"hidden\" name=\"gbad\" value=\"1\"  />

                 <input type=\"hidden\" name=\"yummap\" value=\"100\" size=\"40\" />
               <input type=\"hidden\" name=\"gbadMod\" value=\"\"  />
                <input type=\"hidden\" name=\"jedID2\" value=\"2\"  />

<input type=\"submit\" value=\"Select  $type_face\" name=\"B3\">
              </form>";







    $display_block= "Below lists all  $type_face Created in GoTool: <hr><hr><br/><br/>
         $display_block66

    ";

     }





         if( $jedID2==2){

  if (isset($_POST['mail1'])) {
	$mail1=$_POST['mail1'];
}
                      //group_id is portal

  if (isset($_POST['group_id'])) {
	$group_id=$_POST['group_id'];
}

if ($mail1>0){

if (isset($_POST['group_id'])) {
	$event_id=$_POST['group_id'];
}
  //include("OpenEventManager_mail.php");
}



 if (isset($_POST['group_id'])) {
	$port_id=$_POST['group_id'];
}

if (isset($_POST['portal'])) {
	$port_id=$_POST['portal'];
}
//echo "port $port_id <br>";

 $sql12d ="SELECT * FROM $table_name1005 WHERE survey_id = '$port_id'";
          $result331d = @mysqli_query($connection,$sql12d) or die(mysqli_error($connection));
  $num331z0 = mysqli_num_rows($result331d);

        if ($num331z0<1){
       $display_block="No records found.";

         $boom .="<tr>
<td><font color=\"811616\">New Bucket</font></td>
<td colspan=\"3\" width=\"150\">

 <FORM  name=\"formcheck55B\"  METHOD=\"POST\"   ACTION=\"$loc2/admin/GoTool/$prog?token=$tok&log=$logged\">
                <input type=\"hidden\" name=\"Znum\" value=\"$Z_num\" />
                <input type=\"hidden\" name=\"bar22\" value=\"$suveyQ_id[$map_id]\" />
                <input type=\"hidden\" name=\"portal\" value=\"$port_id\" />
<input type=\"hidden\" name=\"group_id\" value=\"$port_id\" />
                <input type=\"hidden\" name=\"mapid\" value=\"$map_id\" />
               <input type=\"text\" name=\"titlebaby\" value=\"New Bucket\"  />
                 Group <select name=\"groupy\">
<option value=\"0\"> NONE</option>
       $display_listCGP
    </select>
                <input type=\"hidden\" name=\"jedID2\" value=\"20025\" />

      Add: <input name=\"button name\" type=\"image\" src=\"GoTool/image/add.png\" />
</form>


</td>


</tr>";

$display_block .="$viewmail
<table class=\"list\">$boom</table>
 ";


        }else{
         $display_block="$num331z0 records found.";
       $sql12ad ="SELECT * FROM $table_name1005 WHERE survey_id = '$port_id' AND sub_id='0' AND Z_num <'0' Order by surveyQ_idK, surveyQ_id";
         $result331d = @mysqli_query($connection,$sql12ad) or die(mysqli_error($connection));

                 while ($row1d = mysqli_fetch_array($result331d)) {
     $map_id=  $row1d['map_id'];
     $title[$map_id]= stripslashes( $row1d['title']);
     $group_id[$map_id]=  $row1d['group_id'];
      $sub_id[$map_id]=  $row1d['group_id'];
       $suveyD_id[$map_id]=  $row1d['survey_id'];
       $suveyQ_id[$map_id]=  $row1d['surveyQ_id'];
        $suveyQ_id2=  $row1d['surveyQ_id'];
                 $Z_num4=$row1d['Z_num'];
   $Ztitle1[$Z_num4]="$title[$map_id]";

  $cd_1[28]='';
        $status[$map_id]=$row1d['status'];

   if ($status[$map_id]>0){
$cd_1[28]="checked";
}


     $boom .="<tr>
<td><font color=\"811616\">$suveyD_id[$map_id] - $suveyQ_id[$map_id] -$Z_num4</font></td>
<td colspan=\"3\">
    <FORM  name=\"formcheck55\"  METHOD=\"POST\"   ACTION=\"$loc2/admin/GoTool/$prog?token=$tok&log=$logged\">
                <input type=\"hidden\" name=\"Znum\" value=\"$Z_num4\" />
                <input type=\"hidden\" name=\"bar22\" value=\"$suveyQ_id[$map_id]\" />
                <input type=\"hidden\" name=\"portal\" value=\"$suveyD_id[$map_id]\" />
                <input type=\"hidden\" name=\"mapid\" value=\"$map_id\" />

                <input type=\"hidden\" name=\"jedID2\" value=\"2000\" />
<input type=\"text\" name=\"titlebaby\" value=\"$title[$map_id]\"  />    Status: <input type=\"checkbox\" name=\"status\"  $cd_1[28]  value=\"1\">
      Update: <input name=\"button name\" type=\"image\" src=\"GoTool/image/add.png\" />
</form>
</td>

</tr>";
          // $stringT[$map_id] - $display_block29[$map_id]   $info[$map_id]
 // $section4 .= "<h3 class=\"collapsible\" id=\"section1\">$title[$map_id]<span></span></h3>
//<div class=\"container\">
//    <div class=\"content\">



         $sql12ad1 ="SELECT * FROM $table_name1005 WHERE survey_id = '$port_id' AND sub_id='1' AND surveyQ_id='$suveyQ_id[$map_id]' AND Z_num >'-1' AND title !='NONE' Order by surveyQ_idK, surveyQ_id";

///echo "$sql12ad1<br/>";
         $result331d1 = @mysqli_query($connection,$sql12ad1) or die(mysqli_error($connection));
         while ($row1dz = mysqli_fetch_array($result331d1)) {
                $map_id1=  $row1dz['map_id'];
                 $title[$map_id1]=  $row1dz['title'];
$title9[$map_id1]=  $row1dz['title'];
               //   $suveyQ_id[$map_id1]=  $row1dz['surveyQ_id'];
                    $subtitle[$map_id1]=  $row1dz['subtitle'];
            $buy[$map_id1]=  $row1dz['buy'];
            $Z_num=  $row1dz['Z_num'];
            $Z_num2[$map_id1]=  $row1dz['Z_num'];
           $create_date[$map_id1]=$row1dz['create_date'];
$Ascore[$map_id1]=$row1dz['Ascore'];
$pat_id[$map_id1]=$row1dz['pat_id'];
$app[$map_id1]=$row1dz['app'];
$pay[$map_id1]=$row1dz['pay'];
//echo "Hi $pay[$map_id1]-$map_id1<br/>";
$Intprint[$map_id1]=$row1dz['Intprint'];
$road[$map_id1]=$row1dz['road'];
$check1[$map_id1]=$row1dz['check1'];
$path1[$map_id1]=$row1dz['path'];
$upp[$map_id1]=$row1dz['upp'];
$assess[$map_id1]=$row1dz['assess'];
$zDisc[$map_id1]=$row1dz['zDisc'];
$zKolbe[$map_id1]=$row1dz['zKolbe'];
$zStrength[$map_id1]=$row1dz['zStrength'];
$zSpiritTake[$map_id1]=$row1dz['zSpiritTake'];
$zSpirit[$map_id1]=$row1dz['zSpirit'];
$zLife[$map_id1]=$row1dz['zLife'];
$zLifeTime[$map_id1]=$row1dz['zLifeTime'];
$zPersonal[$map_id1]=$row1dz['zPersonal'];
//$zPersonalT2=$row1dz['zPersonalT'];
$Report[$map_id1]=$row1dz['Report'];
$Enroll[$map_id1]=$row1dz['Enroll'];
$SignMem[$map_id1]=$row1dz['SignMem'];
$Doctor[$map_id1]=$row1dz['Doctor'];
$Memcard[$map_id1]=$row1dz['Memcard'];
$Patient[$map_id1]=$row1dz['Patient'];
$AgentMat[$map_id1]=$row1dz['AgentMat'];
$EnrollMat[$map_id1]=$row1dz['EnrollMat'];
$AgentList[$map_id1]=$row1dz['AgentList'];
$AgentForm[$map_id1]=$row1dz['AgentForm'];
$zDoctor[$map_id1]=$row1dz['zDoctor'];
//$title3[$map_id1]=$row1dz['title3'];
//$title37[$map_id1]=$row1dz['title37'];
//$title4[$map_id1]=$row1dz['title4'];
//$MemCardTitle[$map_id1]=$row1dz['MemCardTitle'];
$status[$map_id1]=$row1dz['status'];
$MemRecord[$map_id1]=$row1dz['MemRecord'];
$groupy[$map_id1]=$row1dz['groupy'];
$RegEvents[$map_id1]=$row1dz['van36'];

include('ZcheckedCheck.php');
include('ZChecksforback.php');

  $Ztitle1[$Z_num]="$title[$map_id1]";


          $infoZ[$Z_num]= $row1dz['information_id'];

          $info[$map_id1]=  $row1dz['information_id'];

          If ($info[$map_id1]>0){

  $sql33 ="SELECT * FROM $table_name92 where information_id='$info[$map_id1]' ";
     $result331 = @mysqli_query($connection,$sql33) or die(mysqli_error($connection));
    while ($row11d = mysqli_fetch_array($result331)) {

         $desc31=  $row11d['description'];
         $title31=  $row11d['title'];
                     $display_block9=stripslashes($desc31);
              // $display_block9=htmlspecialchars_decode($display_block9);
            $display_block29[$map_id1]=  html_entity_decode($display_block9, ENT_QUOTES, 'UTF-8');

 // $display_block19[$x2]=      htmlentities( $display_block9, ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8" );


 $find[] = '“'; // left side double smart quote
$find[] = '‘'; // left side single smart quote
$find[] = '’'; // right side single smart quote
$find[] = '…'; // elipsis
$find[] = '—'; // em dash
$find[] = '–'; // en dash
$find[] = '��'; // right side double smart quote                       // ’
$replace[] = '"';
$replace[] = "'";
$replace[] = "'";
$replace[] = "...";
$replace[] = "-";
$replace[] = "-";
  $replace[] = '"';
$display_block29[$map_id1]= str_replace($find, $replace, $display_block29[$map_id1]);
$infozz[$Z_num]= $display_block29[$map_id1];










$string2=strip_tags($display_block29[$map_id1]);

if (  strlen($string2) > 13)  {
$string2=substr($string2,0,80);
        }
 //  ? .'...' : $string;
 $stringT[$map_id1]=$string2;
           }

          }



       $boom .="<tr>
<td><font color=\"811616\">$suveyD_id[$map_id] - $suveyQ_id[$map_id]-$map_id1-$Z_num</font></td>
<td width=\"150\">
      <h3 class=\"collapsible\" id=\"section15$map_id1\"><font color=\"921319\">$title[$map_id1]</font><span></span></h3>
<div class=\"container\">
    <div class=\"content\">
 <FORM  name=\"formcheck55A\"  METHOD=\"POST\"   ACTION=\"$loc2/admin/GoTool/$prog?token=$tok&log=$logged\">
                <input type=\"hidden\" name=\"Znum\" value=\"$Z_num\" />
                <input type=\"hidden\" name=\"bar22\" value=\"$suveyQ_id[$map_id]\" />
                <input type=\"hidden\" name=\"portal\" value=\"$suveyD_id[$map_id]\" />

                <input type=\"hidden\" name=\"mapid\" value=\"$map_id1\" />
               <input type=\"text\" name=\"titlebaby9\" value=\"$title9[$map_id1]\" width=\"200\" />
                $checklist22
                <input type=\"hidden\" name=\"jedID2\" value=\"2001\" />

      Update: <input name=\"button name\" type=\"image\" src=\"GoTool/image/add.png\" />
</form>
          </div>
</div>

</td>

<td><a target=\"blank\" href=\"$loc2/admin/index.php?route=catalog/information/update&token=$tok&log=$logged&information_id=$info[$map_id1]\">$info[$map_id1]</a></td>
<td>
       <FORM  name=\"formcheck55\"  METHOD=\"POST\"   ACTION=\"$loc2/admin/GoTool/$prog?token=$tok&log=$logged\">
       <select name=\"groupy\">
<option selected value=\"$info[$map_id1]\">$stringT[$map_id1] </option>
        $display_listINFO
    </select>
    <input type=\"hidden\" name=\"portal\" value=\"$suveyD_id[$map_id]\" />
                <input type=\"hidden\" name=\"mapid\" value=\"$map_id1\" />
                <input type=\"hidden\" name=\"jedID2\" value=\"2005\" />
      Update: <input name=\"button name\" type=\"image\" src=\"GoTool/image/add.png\" />
</form>
 <h3 class=\"collapsible\" id=\"section15$map_id1\"><font color=\"921319\">$stringT[$map_id1]</font><span></span></h3>
<div class=\"container\">
    <div class=\"content\">
- $display_block29[$map_id1]</div></div> </td>
</tr>";


        }

  $boom .="<tr>
<td>New Sub Bucket<font color=\"811616\"></font></td>
<td width=\"150\">

 <FORM  name=\"formcheck55B\"  METHOD=\"POST\"   ACTION=\"$loc2/admin/GoTool/$prog?token=$tok&log=$logged\">
                <input type=\"hidden\" name=\"Znum\" value=\"$Z_num\" />
                <input type=\"hidden\" name=\"bar22\" value=\"$suveyQ_id[$map_id]\" />
                <input type=\"hidden\" name=\"portal\" value=\"$suveyD_id[$map_id]\" />
                <input type=\"hidden\" name=\"mapid\" value=\"$map_id1\" />
               <input type=\"text\" name=\"titlebaby\" value=\"New Sub Bucket\"  />

                <input type=\"hidden\" name=\"jedID2\" value=\"2003\" />

  <font color=\"811616\">    Update:</font> <input name=\"button name\" type=\"image\" src=\"GoTool/image/add.png\" />
</form>
 <FORM  name=\"formcheck344\" target=\"blank\"  METHOD=\"POST\" ACTION=\"$loc2/createaccount2/switching3sub.php?token=$tok&log=$logged\">
                Need to Change SubBucket Order:
                 <input type=\"hidden\" name=\"lookD\" value=\"$suveyD_id[$map_id]\"  />
                 <input type=\"hidden\" name=\"bar22\" value=\"$suveyQ_id[$map_id]\" />
                 <input type=\"hidden\" name=\"survey_id\" value=\"$suveyD_id[$map_id]\"  />
                <input type=\"hidden\" name=\"jedID2\" value=\"800\"  />
                <i>Access Change Module.<i>
			   <input name=\"button name\" type=\"image\" src=\"GoTool/image/add.png\" /></form>


</td>

<td>Add</td>
<td>  </td>
</tr>";


   //

         }


   $boom .="<tr>
<td><font color=\"811616\">New Bucket</font></td>
<td colspan=\"3\" width=\"150\">

 <FORM  name=\"formcheck55B\"  METHOD=\"POST\"   ACTION=\"$loc2/admin/GoTool/$prog?token=$tok&log=$logged\">
                <input type=\"hidden\" name=\"Znum\" value=\"$Z_num\" />
                <input type=\"hidden\" name=\"bar22\" value=\"$suveyQ_id[$map_id]\" />
                <input type=\"hidden\" name=\"portal\" value=\"$port_id\" />
                <input type=\"hidden\" name=\"mapid\" value=\"$map_id\" />
               <input type=\"text\" name=\"titlebaby\" value=\"New Bucket\"  />

                <input type=\"hidden\" name=\"jedID2\" value=\"2002\" />

      Add: <input name=\"button name\" type=\"image\" src=\"GoTool/image/add.png\" />
</form>
<div class=success2> Change Bucket Order</div>
  <FORM  name=\"formcheck344\" target=\"blank\"  METHOD=\"POST\" ACTION=\"$loc2/createaccount2/switching3.php?token=$tok&log=$logged\">
                Need to Change Bucket Order:
                 <input type=\"hidden\" name=\"lookD\" value=\"$suveyD_id[$map_id]\"  />
                 <input type=\"hidden\" name=\"survey_id\" value=\"$suveyD_id[$map_id]\"  />
                <input type=\"hidden\" name=\"jedID2\" value=\"800\"  />
                <i>Access Change Module.<i>
			   <input name=\"button name\" type=\"image\" src=\"GoTool/image/add.png\" /></form>


</td>


</tr>";


 include('sectionZ4a.php');



$display_block ="$viewmail
<table class=\"list\">$boom</table>
 $section4 ";


 }

  }   //end jed=2






      if( $jedID2==1){

    $product_id=$_GET['product_id'];

  $r1=rand(0,10);
  $r2=rand(0,10);

 $sql12d ="SELECT * FROM $table_name900 WHERE product_id = '$product_id'";
          $result331d = @mysqli_query($connection,$sql12d) or die(mysqli_error($connection));
         while ($row1d = mysqli_fetch_array($result331d)) {
$title=  $row1d['class_name'];
$title=stripslashes($title);
        $title=htmlspecialchars_decode($title);
                                $title=mb_convert_encoding($title,  "HTML-ENTITIES");
$model=  $row1d['model'];
$seats=  $row1d['seats'];

$run="$loc/createaccount/OpenEvent.php?path=$path&product_id=$product_id";

$event_id=  $row1d['event_id'];

$filled=  $row1d['filled'];

 $sql12dg ="SELECT * FROM $table_name900D WHERE product_id = '$product_id'";
          $result331dg = @mysqli_query($connection,$sql12dg) or die(mysqli_error($connection));
          $num331a = mysqli_num_rows( $result331dg);


$filled=$seats-$filled-$num331a;
$description=  $row1d['description'];

$description=stripslashes($description);
        $description=htmlspecialchars_decode($description);
                                $description=mb_convert_encoding($description,  "HTML-ENTITIES");

$class_days=  $row1d['class_days'];
$dateEvent2=  $row1d['date_time'];

//class_days = '" . $this->db->escape(serialize($data['class_days'])) . "',
//class_length = '" . $this->db->escape($data['class_length']) . "',
//date_time = '" . (int)strtotime($data['class_date'] . ' ' . $data['class_time']) . "'


$dateEvent= gmdate('n/d/Y', $dateEvent2);
$cost=  $row1d['cost'];
$date_end =  $row1d['date_end'];  //  strtotime(
$timeEvent= gmdate('g:i:s A', $dateEvent2);
$dayEvent= gmdate('l', $dateEvent2);
//$dateEvent2= gmdate('m/d/Y h:i:s A', $date_end);
$telephone=  $row1d['telephone'];
$location=  $row1d['location'];
$length=  $row1d['class_length'];

$timeEventEnd=strtotime("$timeEvent + $length");

$refundable=  $row1d['refundable'];
if ($refundable==0){
$refundable ="No";
}else{
 $refundable="Yes";
}

if ($cost==0){
$cost ="Free";
}


//$title="CAPACITY Conference Ministry Service (Volunteer) Information Sessions";


$product_code=$model;


$display_block ="


  <h1>$title</h1>
  <div class=\"product-info\">
        <div class=\"right\">
            <div class=\"price\">Price:                $cost                <br />  </div>

  </div>
        <i>Click Tabs to Review Event</i>  <br/><br/>
  <div id=\"tabs\" class=\"htabs\"> <a href=\"#tab-event\">$tab3</a>
  <a href=\"#tab-description\">$tab2</a>
            <a href=\"#tab-review\">$tab1</a>
  </div>
    <!--Tab 1-->
<div id=\"tab-event\" class=\"tab-content\">
       <h2 id=\"review-title\">$tab3</h2>
       <form action=\"$run\" method=\"post\" enctype=\"multipart/form-data\" id=\"form\">
          <fieldset>
            <input type=\"hidden\" name=\"jedID2\" value=\"2\"  />
                <input type=\"hidden\" name=\"mdate\" value=\"$dateEvent\"  />
                    <input type=\"hidden\" name=\"mtime\" value=\"$timeEvent\"  />
                        <input type=\"hidden\" name=\"location\" value=\"$location\"  />
                          <input type=\"hidden\" name=\"title\" value=\"$title\"  />
                            <input type=\"hidden\" name=\"prod\" value=\"$product_id\"  />
                              <input type=\"hidden\" name=\"event\" value=\"$event_id\"  />
     <table><tr><td> First:</td><td> <input type=\"text\" name=\"firstname\" value=\"First Name&hellip;\"  size=\"60\" onfocus=\"this.value=(this.value=='First Name&hellip;')? '' : this.value ;\" />  </td></tr>
     <tr><td> Last:</td><td>  <input type=\"text\" name=\"lastname\" value=\"Last Name&hellip;\" size=\"60\"  onfocus=\"this.value=(this.value=='Last Name&hellip;')? '' : this.value ;\" />   </td></tr>
     <tr><td> Email:</td><td> <input type=\"text\" name=\"email\" value=\"Email Address&hellip;\" size=\"60\"  onfocus=\"this.value=(this.value=='Email Address&hellip;')? '' : this.value ;\" />  </td></tr>
     <tr><td> Phone:</td><td> <input type=\"text\" name=\"phone\" value=\"Phone Number&hellip;\" size=\"60\"  onfocus=\"this.value=(this.value=='Phone&hellip;')? '' : this.value ;\" />     </td></tr>
     <tr><td> Zip:</td><td> <input type=\"text\" name=\"zip\" value=\"Zip Code&hellip;\" size=\"60\"  onfocus=\"this.value=(this.value=='Zip Code&hellip;')? '' : this.value ;\" />   </td></tr>
       </table>  <br/>  Best time to Contact You:<select size=\"1\" name=\"Time\">
	<option value=\"Morning\">Morning</option>
	<option value=\"Evening\">Evening</option>
	<option value=\"Weekend\">Weekend</option>
	</select>     <br/>  <br/>

    <input type=\"hidden\" name=\"r1\" value=\"$r1\"  />
    <input type=\"hidden\" name=\"r2\" value=\"$r2\"  />
      Prove you are not spam: $r1 + $r2 =  <input type=\"text\" name=\"math\" value=\"Answer&hellip;\" size=\"5\" onfocus=\"this.value=(this.value=='Answer&hellip;')? '' : this.value ;\" />
      <br/>
            <button class=\"fsSubmitButtonsmall\" type=\"input\"> Register </button>

      </fieldset>
      </form>
					</div>

  <div id=\"tab-description\" class=\"tab-content\"><p>
	$description</p>
</div>
<div id=\"tab-review\" class=\"tab-content\">


    				<table class=\"form\">
							<tr>
								<td>Event Name: </td>
								<td>$title</td>
							</tr>
							     <tr>
									<td>Telephone: </td>
									<td>$telephone</td>
								</tr>
														<tr>
								<td>Event Date: </td>
								<td>$dateEvent</td>
							</tr>
							<tr>
								<td>Event Time: </td>
								<td>$timeEvent</td>
							</tr>
							<tr>
								<td>Event Days: </td>
								<td> $dayEvent <br />
																	</td>
							</tr>
							<tr>
								<td>Event Length: </td>
								<td>$length</td>
							</tr>
							<tr>
								<td>Location: </td>
								<td>$location</td>
							</tr>
							<tr>
								<td>Seats: </td>
								<td>$seats</td>
							</tr>
							<tr>
								<td>Seats Available: </td>
								<td>$filled</td>
							</tr>
							<tr>
								<td>Refundable: </td>
								<td>$refundable</td>
							</tr>
						</table>


    <div class=\"buttons\">

    </div>
  </div>


";
       }    }









?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
<title>GoTool's Open Event Manager<?PHP echo "$tok"; ?> jedID2=<?PHP echo "$jedID2"; ?>gbad=<?PHP echo "$gbad"; ?> sbad=<?PHP echo "$sbad"; ?> survey_id=<?PHP echo "$survey_idR"; ?></title>
<base href="<?PHP echo "$loc24"; ?>" />
<STYLE type="text/css">
   H1.myclass {border-width: 1; border: solid; text-align: center}

 </STYLE>

<link rel="stylesheet" type="text/css" href="view/stylesheet/stylesheet.css" />

<script type="text/javascript" src="view/javascript/jquery/jquery-1.7.1.min.js"></script>
				<script type="text/javascript" src="view/javascript/tablePagination.min.js"></script>
<script type="text/javascript" src="view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="view/javascript/jquery/ui/external/jquery.bgiframe-2.1.2.js"></script>
<script type="text/javascript" src="view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="view/javascript/jquery/excelexport.js"></script>

<script type="text/javascript" src="view/javascript/jquery/superfish/js/superfish.js"></script>

<script type="text/javascript"><!--
function updatesum() {
document.form.sum.value = (document.form.sum1.value -0) + (document.form.sum2.value -0) + (document.form.sum3.value -0) + (document.form.sum4.value -0); }
//--></script>









<?PHP echo "$special_code"; ?>



<script type="text/javascript" src="view/javascript/sortable.js"></script>
<script type="text/javascript" src="GoTool//mover/toggleDiv.js"></script>
<script type="text/javascript" src="GoTool/mover/table.js"></script>
<script type="text/javascript" src="GoTool/mover/table2CSV.js"></script>
<script type="text/javascript" src="view/javascript/jquery.collapsible.min.js"></script>
<link rel="stylesheet" type="text/css" href="view/stylesheet/collap.css" />

<link rel="stylesheet" type="text/css" href="GoTool/mover/table.css" media="all">

<script type="text/javascript">
function getCSVData(){
 var csv_value=$('#ReportTable').table2CSV({delivery:'value'});
 $("#csv_text").val(csv_value);
}
</script>




  <script type="text/javascript">
//-----------------------------------------
// Confirm Actions (delete, uninstall)
//-----------------------------------------
$(document).ready(function(){
    // Confirm Delete
    $('#form').submit(function(){
        if ($(this).attr('action').indexOf('delete',1) != -1) {
            if (!confirm ('<?php echo $text_confirm; ?>')) {
                return false;
            }
        }
    });


//collapsible management
        $('.collapsible').collapsible({
            defaultOpen: 'section1,section2,section3,section4'
        });



//toggle

   $('#clickme').click(function() {
          $('#me').animate({
               height: 'toggle'
               }, 2000
          );
     });






    // Confirm Uninstall
    $('a').click(function(){
        if ($(this).attr('href') != null && $(this).attr('href').indexOf('uninstall',1) != -1) {
            if (!confirm ('<?php echo $text_confirm; ?>')) {
                return false;
            }
        }
    });
});
</script>

<script type="text/javascript">
function toggleDiv(divId) {
   $("#"+divId).toggle();
}

function toggleAndChangeText() {
     $('#divToToggle').toggle();
     if ($('#divToToggle').css('display') == 'none') {
          $('#aTag').html('<img border=0 src="GoTool/image/add.png">');
     }
     else {
          $('#aTag').html('<img border=0 src="GoTool/image/minus.png">');
     }
}


//});

</script>

<SCRIPT LANGUAGE="JavaScript" SRC="GoTool/risk/AnimatedFader.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">

//Script submitted to and featured on
//http://www.dynamicdrive.com

/*
 * FadingText(divName, numSteps, BGColor)
 * divName : Must match the DIV names defined at the end of the BODY)
 * numSteps: The number of steps in the fading transition
 * BGColor : The background colour of the DIV or document.
 */
	FadingText('fade1', 10,"FFFFFF");

/*** The "Frame Interval" Smaller = faster ***/
	FadeInterval=30;

</SCRIPT>




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

	//select all the a tag with name equal to modal
	$('a[name=modal]').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();

		//Get the A tag
		var id = $(this).attr('href');

		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();

		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});

		//transition effect
		$('#mask').fadeIn(1000);
		$('#mask').fadeTo("slow",0.8);

		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();

		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);

		//transition effect
		$(id).fadeIn(2000);

	});

	//if close button is clicked
	$('.window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();

		$('#mask').hide();
		$('.window').hide();
	});

	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});


	$(window).resize(function () {

 		var box = $('#boxes .window');

        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();

        //Set height and width to mask to fill up the whole screen
        $('#mask').css({'width':maskWidth,'height':maskHeight});

        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        //Set the popup window to center
        box.css('top',  winH/2 - box.height()/2);
        box.css('left', winW/2 - box.width()/2);

	});

});

</script>

<script type="text/javascript" src="GoTool/risk/jquery.min.js"></script>
<script src="GoTool/risk/formwizard2.js" type="text/javascript">

/***********************************************         1.4.2 version of jQuery above
* jQuery Form to Form Wizard-
* This notice MUST stay intact for legal use
*
***********************************************/

</script>

<script type="text/javascript">

var myform=new formtowizard({
	formid: 'feedbackform',
	persistsection: true,
	revealfx: ['slide', 500]
})

var myform2=new formtowizard({
	formid: 'feedbackform2',
	persistsection: true,
	revealfx: ['fade', 1000],
	validate: ['order_username', 'order_sex', 'order_addr1', 'order_shippingmethod', 'order_feedback']
})


var myform3=new formtowizard({
 formid: 'staff_feedbackform',
 validate: ['staff_username', 'staff_sex', 'staff_addr1'],
 revealfx: ['slide', 500] //<--no comma after last setting
})


</script>






<style>




#mask {
  position:absolute;
  left:0;
  top:0;
  z-index:9000;
  background-color:#000;
  display:none;
}

#boxes .window {
  position:fixed;
  left:0;
  top:0;
  width:440px;
  height:400px;
  display:none;
  z-index:9999;
  padding:20px;
}

#boxes #dialog {
  width:375px;
  height:403px;
  padding:10px;
  background-color:#ffffff;
}

#boxes #dialog1 {
  width:375px;
  height:403px;
}

#dialog1 .d-header {
  background:url(GoTool/risk/images/login-header2.png) no-repeat 0 0 transparent;
  width:375px;
  height:200px;
}

#dialog1 .d-header1 {
  background:url(GoTool/risk/images/login-middle.png) repeat 0 0 transparent;
  width:375px;

}

#dialog1 .d-header input {
  position:relative;
  top:60px;
  left:100px;
  border:3px solid #cccccc;
  height:22px;
  width:200px;
  font-size:15px;
  padding:5px;
  margin-top:4px;
}

#dialog1 .d-blank {
  float:left;
  background:url(GoTool/risk/images/login-blank.png) no-repeat 0 0 transparent;
  width:267px;
  height:53px;
}

#dialog1 .d-login {
  float:left;
  width:108px;
  height:400px;
}

#boxes #dialog2 {
  background:url(GoTool/risk/images/notice.png) repeat 0 0 transparent;
  width:326px;
  height:400px;
  padding:50px 0 20px 25px;
}


#boxes #dialog3 {
  background:url(GoTool/risk/images/notice.png) repeat 0 0 transparent;
  width:326px;
  height:400px;
  padding:50px 0 20px 25px;
}

#boxes #dialog4 {
  background:url(GoTool/risk/images/notice.png) repeat 0 0 transparent;
  width:326px;
  height:400px;
  padding:50px 0 20px 25px;
}

#boxes #dialog5 {
  background:url(GoTool/risk/images/notice.png) repeat 0 0 transparent;
  width:326px;
  height:400px;
  padding:50px 0 20px 25px;
}

#boxes #dialog6 {
  background:url(GoTool/risk/images/notice.png) repeat 0 0 transparent;
  width:326px;
  height:400px;
  padding:50px 0 20px 25px;
}

fieldset.sectionwrap{ /*fieldset that wraps around each form "page" */
border-width:0;
margin-top: 0;
	margin-bottom: 0;

padding:2px;
}

legend{ /*title shown at top of each form page */
font:bold 16px Arial;
color: darkred;
}

div.stepsguide{ /*div that contains all the "steps" text located at top of form */
width: 320px; /*width of "steps" container*/
overflow:hidden;
margin-bottom:15px;
cursor:pointer;
}

div.stepsguide .step{ /*div that wraps around each "steps" text */
width:290px; /*width of each "steps" text*/
font: bold 18px Arial;
float:left;
}

div.stepsguide .disabledstep{ /*div that wraps around each "steps" text */
color:#C4C4C4;
}

div.stepsguide .step .smalltext{ /*small footer text inside "steps" text */
font-size: 10px;
font-weight: normal;
}

div.formpaginate{ /* CSS for pagination DIV container */
width: 300px;
overflow:hidden;
font-weight:bold;
text-align:center;
margin-top:1em;
}

div.formpaginate .prev, div.formpaginate .next{ /*CSS for "prev" and "next" SPAN elements within paginate container */
border-radius:5px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
padding:2px 5px;
background:darkred;
color:white;
cursor:hand;
cursor:pointer;
}


#feedbackform2 legend{ /*title shown at top of each form page */
color: navy;
}

#feedbackform2 div.field{
margin-bottom:7px;
}


#feedbackform2 div.formpaginate .prev, #feedbackform2 div.formpaginate .next{
background:navy;
}


</style>





</head>
<body>

<div id="content">
  <div class="breadcrumb">
        <a href="http://<?PHP echo "$loc"; ?>/<?PHP echo "$dir"; ?>/admin/index.php?route=common/home&amp;token=<?PHP echo "$tok"; ?>">Home</a>
        ::<a href="GoTool/<?PHP echo "$prog"; ?>?token=<?PHP echo $tok; ?>&log=<?PHP echo $logged; ?>"><?PHP echo $display_title; ?></a>

      </div>
          <?PHP echo "$mess"; ?>    <?PHP echo "$warn"; ?>   <?PHP echo "$display_back"; ?>
 <div class="box">
    <div class="heading">
      <h1><img src="view/image/report.png" alt="" /> <?PHP echo "$display_title"; ?> </h1>
    </div>
    <div class="content">



      <?PHP echo "$display_block"; ?>





      <div class="pagination"></div>
    </div>
  </div>
<!-- </div>  -->


</div>
 <?PHP echo "$string"; ?>
  <?PHP echo "$display_blockFF"; ?>

    <div style="font-size:10px;color:#ccc"></div>

<div id="boxes">

<div id="dialog" class="window">
Note Window |
<FORM METHOD=POST
   ACTION="consult.php?token=$tok&log=$logged"
   onSubmit="popupform(this, 'join')">
Name: <INPUT NAME="realname"><BR>
Email: <INPUT NAME="email"><BR>
Value: <INPUT NAME="val2"><BR>
<INPUT TYPE=SUBMIT VALUE="show me">
</FORM>
<a href="#"class="close"/>Close it</a>
</div>

<!-- Start of Login Dialog -->
<div id="dialog1" class="window">
  <div class="d-header">
  <input type="button" value="Close it" class="close"/>
    <input type="text" value="username" onclick="this.value=''"/><br/>
  </div>
  <div class="d-header1">
    <input type="text" value="username" onclick="this.value=''"/><br/>
    <input type="password" value="Password" onclick="this.value=''"/>
  </div>
  <div class="d-blank"></div>
  <div class="d-login"><input type="image" alt="Login" title="Login" src="images/login-button.png"/></div>
</div>
<!-- End of Login Dialog -->



<!-- Start of Sticky Note -->
<div id="dialog2" class="window">
<?PHP echo "$bottomNote"; ?>
<input type="button" value="Close it" class="close"/>
</div>
<!-- End of Sticky Note -->

<!-- Start of Sticky Note -->
<div id="dialog3" class="window">
<?PHP echo "$bottomReport"; ?>
<input type="button" value="Close it" class="close"/>
</div>
<!-- End of Sticky Note -->

<!-- Start of Sticky Note -->
<div id="dialog4" class="window">
<?PHP echo "$bottomDelete"; ?>
<input type="button" value="Close it" class="close"/>
</div>
<!-- End of Sticky Note -->

<!-- Start of Sticky Note -->
<div id="dialog5" class="window">
<?PHP echo "$bottomCriteria"; ?>
<input type="button" value="Close it" class="close"/>
</div>
<!-- End of Sticky Note -->

<!-- Start of Sticky Note -->
<div id="dialog6" class="window">
<?PHP echo "$bottomDate"; ?>
<input type="button" value="Close it" class="close"/>
</div>
<!-- End of Sticky Note -->

<!-- Mask to cover the whole screen -->
  <div id="mask"></div>
</div>

 </body></html>
