<?php
	$boom2='';
	$topcat22='';
	$Dfirstname=  '';
	$Dlastname=  '';
	$badboy9110='';
	
//	$port_idz=$row1daa1G1['zPersonalT'];
//$showchart=$row1daa1G1['zDoctor'];
$badboy9111=$port_idz;
$badboy91111="?token=$tok";
$badboy9111="$loc2/power/pdf3/documents/printPartApp.php?";
$badboy9111="$loc2/admin/GoTool/stakeholdercredits/credits.php?";

$Boo2=0;
	$TXBoo=0;
$TXXBoo=0;
	$BamBoo=0;
	$showchart2=$row1daa1G1['zDoctor'];
	
	$text_account34=  '';
	$Ctext_account34=0;
	
	$jedID2U=3;
	
	$Mgrade2[0]='';
	$Mgrade2[1]='';
	$Mgrade2=explode(",", $Mgrade);
			$Mgrade3=count($Mgrade2);
//echo "<Br>Hi $grade $Mgrade3";
	
	if($Mgrade3<2){
	$Mgrade2[1]='';
	
	}
	
	if($Mgrade3<1){
	$Mgrade2[0]='';
		$Mgrade2[1]='';
	}
	
	if (isset($_POST['Boo2'])) {
  	$Boo2=$_POST['Boo2'];
}
	
	if (isset($_POST['text_account34'])) {
	  	$text_account34=$_POST['text_account34'];
	}
	
	if (isset($_POST['Ctext_account34'])) {
	  	$Ctext_account34=$_POST['Ctext_account34'];
	}
	
	if($Ctext_account34==$showchart){
	
	if($text_account34 >0){
		

	include('viewcohartups.php');	
		$topcat22=$display_blockRA92;
		
		if ($Boo2!=$grade) {		
		$topcat22='';
		}
		
		if ($Boo2==$grade) {		
		$bvo=1;
		}
		
	}
	
	}
	
	

	  /// $sql33a800 ="SELECT * FROM $table_name36 WHERE salesrep_id='$text_account3' AND status='1' ORDER BY lastname ";
	    $sql33a800 ="SELECT * FROM $table_name36 WHERE  status='1' ORDER BY lastname ";
	
	
if ($Mgrade3>1){

	 $sql33a800 ="SELECT * FROM $table_name36 WHERE customer_group_id ='$Mgrade2[0]' OR customer_group_id= '$Mgrade2[1]' AND status='1' ORDER BY lastname ";

	}else{
	
		$sql33a800 ="SELECT * FROM $table_name36 WHERE customer_group_id ='$Mgrade2[0]'  AND status='1' ORDER BY lastname ";

	}	
	   
	   
	   
	             $result33a800 = @mysql_query($sql33a800,$connection) or die(mysql_error());

$num3334bT29z = mysql_num_rows($result33a800);

if ($num3334bT29z>0){
$boom2 .= "<tr><td colspan=\"5\"> <p align=\"center\">Assigned to this Group: $num3334bT29z </p> </td></tr>";
}

if ($num3334bT29z<1){
$boom2 .= "<tr><td colspan=\"5\">None Assigned</td></tr>";
}



	   while ($row112a800 = mysql_fetch_array($result33a800)) {
	  $Rep[1]=  $row112a800['customer_id'];
	  $Rep[2]=  $row112a800['firstname'];
	  $Rep[3]=  $row112a800['lastname'];
	  $Rep[4]=  $row112a800['telephone'];
	 // $Rep[5]=  $row112a800['van5'];
	 // $Rep[6]=  $row112a800['van6'];
	  //  $sign_date=  $row112a800['sign_date'];
	     $signD=  $row112a800['date_added'];
	   $signD=date("m/d/Y", strtotime("$signD"));
	//      $mapD=  $row112a800['map_id'];

$btilepic='';
if ($tilepic==1){

$btilepic="<FORM  name=\"formcheck\" target=\"_blank\" METHOD=\"POST\" ACTION=\"$badboy9111&log=$Rep[1]&token=$tok&log=$logged\">
		                <input type=\"hidden\" name=\"text_account34\" value=\"$Rep[1]\"  />
		 <input type=\"hidden\" name=\"showchart\" value=\"$showchart\"  />
		 <input type=\"hidden\" name=\"Boo2\" value=\"$grade\"  />
		  <input type=\"hidden\" name=\"upload\" value=\"$Pgrade\"  />
		  <input type=\"hidden\" name=\"Bamboo\" value=\"$showchart\"  />
		  <input type=\"hidden\" name=\"Ctext_account34\" value=\"$showchart\"  />
		   <input type=\"hidden\" name=\"TXBoo\" value=\"$x2\"  />
	<input type=\"hidden\" name=\"TXXBoo\" value=\"$x22\"  />
		                <button class=\"fsSubmitButtonsmall\" type=\"input\">$tile2</button>
		         </form>";
}

$btilepic='';

	 $boom2 .= "
	 <tr>
	<td>$Rep[1]</td>
	<td>$Rep[2]</td>
	<td>$Rep[3]</td>
	<td>$Rep[4] </td>
	<td><FORM  name=\"formcheck\" target=\"_blank\" METHOD=\"POST\" ACTION=\"$badboy9111&log=$Rep[1]&token=$tok&log=$logged\">
	                <input type=\"hidden\" name=\"text_account34\" value=\"$Rep[1]\"  />
	                 <input type=\"hidden\" name=\"Ctext_account34\" value=\"$showchart\"  />
	                 <input type=\"hidden\" name=\"Boo2\" value=\"$grade\"  />
	                 
	    <input type=\"hidden\" name=\"last\" value=\"$Rep[3]\" >
	 <input type=\"hidden\" name=\"createD\" value=\" $signD\" >
	<input type=\"hidden\" name=\"stringSS\" value=\"$port_idz\" >             
	    <input type=\"hidden\" name=\"MIT\" value=\"$grade\">
 <input type=\"hidden\" name=\"dir_id\" value=\"$GgradeSum\">
 <input type=\"hidden\" name=\"admin_id\" value=\"$hi2\">
 <input type=\"hidden\" name=\"Bamboo\" value=\"$showchart\"  />
  <input type=\"hidden\" name=\"TXBoo\" value=\"$x2\"  />
	<input type=\"hidden\" name=\"TXXBoo\" value=\"$x22\"  />
 		  <input type=\"hidden\" name=\"upload\" value=\"$Pgrade\"  />
  <input type=\"hidden\" name=\"product\" value=\"$Tgrade\">
	 <input type=\"hidden\" name=\"first\" value=\"$Rep[2]\" >             
	                 
	                 
	                 
	                <button class=\"fsSubmitButtonsmall\" type=\"input\">$tile1</button>
	         </form>
	
	$btilepic
		         
		         </td>


	</tr>
	 ";



	  }


  ///new while

	$topcat22.= "

	<table class=\"sortable\" id=\"RE\"> <thead> <tr>
	<td class=\"filterable\">ID #</td>
	<td class=\"filterable\">First Name</td>
	<td class=\"filterable\">Last Name</td>
	<td class=\"filterable\">Phone #</td>
	<td class=\"filterable\">Action</td>


	</tr></thead><tbody>
	<tr class=\"filter\">
	<td align=\"left\"><input type=\"text\" name=\"filter_req\" value=\"\" size=\"6\" onkeyup=\"Table.filter(this,this)\"/></td>
	<td align=\"left\"><input type=\"text\" name=\"filter_req0\" value=\"\" size=\"6\" onkeyup=\"Table.filter(this,this)\"/></td>
	<td align=\"left\"><input type=\"text\" name=\"filter_req1\" value=\"\" size=\"10\" onkeyup=\"Table.filter(this,this)\"/></td>
	<td align=\"left\"><input type=\"text\" name=\"filter_req2\" value=\"\" size=\"10\" onkeyup=\"Table.filter(this,this)\"/></td>
	<td align=\"left\"><input type=\"text\" name=\"filter_comment\" value=\"\" size=\"10\" onkeyup=\"Table.filter(this,this)\"/></td>



	</tr>$boom2</tbody></table>";

?>