Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/tabs/a.php
<?php
/*  This File is the main popup content
	It is called with if file exists.
	
	C. Carl Peterson 2005
	C. Port Networks LLC. 2005
	
	Released under the GPL
*/
echo '<table cellpadding="8" cellspacing="8"><tr><td>';
echo "<table style=\"text-align: left; width: 500px; height: 300px;\" border=\"1\" >";

echo('<tr bgcolor="#666699"> ');
echo('<td class="gpcellm" colspan="2"  bgcolor="#D7E5F2" ><b>User information</td></tr>');
echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Name </td> <td style=\"width: 100px;\"> $pullUser</td></tr>");
echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Type </td> <td style=\"width: 100px;\"> $Type</td></tr>");
echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Location </td> <td style=\"width: 100px;\"> $Location</td></tr>");
echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Creator</td> <td style=\"width: 100px;\"> $creator</td></tr>");
$plan=get_plan_name($idBp);
if ($debug) print " ADATE ".$adate." EDATE ".$edate." RADP ".$radiusprofile;
if ($plan!='')
	echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Billing Plan </td> <td style=\"width: 100px;\"> $plan</td></tr>");
if ($edate=='')
	echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Activate Date </td> <td style=\"width: 100px;\">". date_from_attribute($adate,$dateFormat) ."</td></tr>");
else
	echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Activate Date </td> <td style=\"width: 100px;\">". $edate."</td></tr>");

echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Creation Date </td> <td style=\"width: 100px;\"> $cdate</td></tr>");
echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Radius profile </td> <td style=\"width: 100px;\">".get_radiusprofile_name($radiusprofile)."</td></tr>");
if ($edate!='')
if (date_compare(date($dateFormat),$edate)>0) {
echo '<tr><td class="gpcell" style=\"width: 60px;\">Expiration Date</td> <td style=\"width: 100px;\">'.$edate.'<br><small style=" font-family: Courier New,Courier,monospace; color: rgb(255,0, 0);">(Be careful this account is expired)</small>';
}
else
   echo("<tr><td class=\"gpcell\" style=\"width: 60px;\">Expiration Date</td> <td style=\"width: 140px;\">$edate");
if (isset($_POST['basetime'])) $def_basetime=$_POST['basetime'];
else $def_basetime='Week';
if (isset($_POST['typegr'])) $def_typegr=$_POST['typegr'];
else $def_typegr='Time';
if (isset($_POST['plot_type'])) $def_plot_type=$_POST['plot_type'];
else $def_plot_type='lines';
echo("</td></tr>");
echo('</td>');
echo('</tr>');
echo('</table></td><td><table border="1"><tr>');
echo('<td colspan="3" rowspan="1" style=\"text-align: center;\">');
echo '<img src="../statistiques/GenerateStat.php?plot_type='.$def_plot_type.'&&typegr='.$def_typegr.'&&basetime='.$def_basetime.'&&puser='.$pullUser.'" alt="User statistiques">';
//echo '../statistiques/GenerateStat.php?plot_type='.$def_plot_type.'&&typegr='.$def_typegr.'&&basetime='.$def_basetime.'&&puser='.$pullUser;
//echo ("<input type=\"button\" class=\"smallButton\" name=\"UserSelected\" value=\"$acct_login\" onClick=\"window.open('../statistiques/GenerateStat.php?plot_type=$def_plot_type&&typegr=$def_typegr&&basetime=$def_basetime&&puser=$pullUser','User informations','width=800','height=600','status=yes','resizable=yes','menubar=yes','scrollbars=yes');\" >");
echo ('</td></tr><tr>');
printf("<form action=\"sexyTabs.php\" method=\"post\">");
echo('<input type="hidden" name="pullUser"  value="'.$pullUser.'">');
echo('<input type="hidden" name="tab"  value="a">');
echo('<td class="gpcell"> Based on : ');
echo ('<select id="typegr" name="typegr" onChange=\'this.form.submit()\'>');
echo ("<option value=\"Time\">Time</option>");
echo ("<option value=\"Octet\">Octet</option>");
echo '</select>';
echo('</td>');
echo('<td class="gpcell" >By :&nbsp         ');
echo ('<select id="basetime"  name="basetime" onChange=\'this.form.submit()\'>');
echo ("<option value=\"Hours\">Hours</option>");
echo ("<option value=\"Week\">Week</option>");
echo ("<option value=\"Months\">Months</option>");
echo ("<option value=\"Year\">Year</option>");
echo ("<option value=\"Years\">Years</option>");
echo '</select>';
echo('</td>');	
echo('<td class="gpcell"> Plot : ');
echo ('<select name="plot_type" id="plot_type" onChange=\'this.form.submit()\' >');
echo ("<option value=\"bars\">Bars</option>");
echo ("<option value=\"lines\">Lines</option>");
echo ("<option value=\"linepoint\">Lines point</option>");
echo ("<option value=\"area\">Area</option>");
echo ("<option value=\"points\">Points</option>");
echo ("<option value=\"pie\">Pie</option>");
echo ("<option value=\"thinbarline\">Thinbarline</option>");
echo ("<option value=\"squared\">Squared</option>");
echo ("<option value=\"stackedbars\">Stacked bars</option>");
echo '</select></td>';
echo ('</tr></table></td></tr></table></form>');


print "<script Language=\"JavaScript\">
document.getElementById('plot_type').value='$def_plot_type';
document.getElementById('basetime').value='$def_basetime';
document.getElementById('typegr').value='$def_typegr';
</script>";
echo("<form action=\"sexyTabs.php\" method=\"post\">");
echo "<table style=\"text-align: left; height: 58px; width: 736px; margin-left: 10px;\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\">
   <tbody>
     <tr>
    <td class=\"gpcell\" style=\"width: 140px;\">Password</td>
   <td colspan=\"2\" style=\"width: 309px;\"><input
   name=\"pm\" value=\"$password\"></td>
   </tr>";
if ($Type=="Hourly" or $Type=="Subscription Time") 
{
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 140px;\">Max session time</td>
       <td colspan=\"2\" style=\"width: 309px;\">";
	if ($defaultTimeCount == 'Minutes') $Max=$Max/(60);
	if ($defaultTimeCount == 'Hours') $Max=$Max/(3600);
	if ($defaultTimeCount == 'Months') $Max=$Max/(31*24*3600);
	if ($defaultTimeCount == 'Days') $Max=$Max/(24*3600);
	if ($defaultTimeCount == 'Years') $Max=$Max/(365*24*3600);

	echo ("<table><tr><td><input type=text id='valuesub' size=10 class=text name=\"maxas\" value=\"$Max\"></td><td>");
	echo '<select name="TimeCount">';

		$tabv=split(";",$timeCount);
	   for ($i=0;$i<sizeof($tabv);$i++) {
	       if ($defaultTimeCount == $tabv[$i])
		echo ("<option selected=\"selected\" value=\"".$tabv[$i]."\">".$tabv[$i]);
	      else
		echo ("<option value=\"".$tabv[$i]."\">".$tabv[$i]);
	      echo ("</option>'");
	    }
	    echo '</select> 
			</td>';
			
	    echo '</tr></table>';
     echo "</td></tr>";
  if ($typeBp=="") $typeBp="Time"; 
}
else if ($Type=="Octets" or $Type=="Subscription Octets")
{
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Max Download Mega octets : </td>
	<td colspan=\"2\" style=\"width: 309px;\">";
	
	if ($defaultOctetCount == 'Mo') $Max=$Max/(1000*1000);
	if ($defaultOctetCount == 'Go') $Max=$Max/(1000*1000*1000);
	if ($defaultOctetCount == 'To') $Max=$Max/(1000*1000*1000*1000);

	echo ("<table><tr><td><input type=text id='valuesub' size=10 class=text name=\"maxas\" value=\"$Max\"></td><td>");
	echo '<select name="TimeCount">';

		$tabv=split(";",$octetCount);
	   for ($i=0;$i<sizeof($tabv);$i++) {
	       if ($defaultOctetCount == $tabv[$i])
		echo ("<option selected=\"selected\" value=\"".$tabv[$i]."\">".$tabv[$i]);
	      else
		echo ("<option value=\"".$tabv[$i]."\">".$tabv[$i]);
	      echo ("</option>'");
	    }
	    echo '</select> 
			</td>';
			
	    echo '</tr></table>';
     echo "</tr>";

  if ($typeBp=="") $typeBp="Octets"; 
 
}
else if ($Type=="Subscription Mac")
{
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Mac address : </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 name=\"maxas\" value=\"$Max\"></td>
     </tr>";

  if ($typeBp=="") $typeBp="Mac"; 
} 
else if ($Type=="Subscription Expiration" or $Type="Expiration")
{
	
  echo "
	  <tr>
	  <td class=\"gpcell\" style=\"width: 140px;\">Expiration Date : </td>";
  echo "<td colspan=\"2\" style=\"width: 309px;\"><input type=\"text\" name=\"maxas\" id=\"f_date_b\" value='$Max'/><button type=\"reset\" id=\"f_trigger_b\">...</button>";
  echo '<script type="text/javascript">
	  Calendar.setup({
		  inputField     :    "f_date_b",      // id of the input field
			  ifFormat       :    "'.cdateformat_calendar($dateFormat).'",       // format of the input field
			  showsTime      :    true,            // will display a time selector
			  button         :    "f_trigger_b",   // trigger for the calendar (button ID)
			  singleClick    :    true,           // double-click mode
			  step           :    1                // show all years in drop-down boxes (instead of every other year as default)
});
</script>';

			
echo 	('</tr>');


if ($typeBp=="")   $typeBp="Expiration";
}

$search = "SELECT Id,NameBp,TimeBp FROM BillingPlan where TypeBp='".$typeBp."' AND LocationID='".$locID."'";
$result = $oreon->database->database->query($search) or die("Query database error !");

echo('<tr>'),
  ('<td class="gpcell" style="text-align: left">'),
  ('Billing  Plan  :'),
  ('</td>'),
  ('<td style="text-align: left">'),
  ('<select name="BillingPlan">');
   echo("<option value=\"-1\">None</option>");


while( $row = $oreon->database->database->fetch_array($result)) {
 
   if ($idBp!=$row['Id'])   
    echo("<option value=\"".$row['Id']."\">".$row['NameBp']."</option>");
   else
    echo("<option selected=\"selected\" value=\"".$row['Id']."\">".$row['NameBp']."</option>");
   
}		
echo('</select></td></tr>');

$search = "SELECT GroupName FROM usergroup where UserName='".$pullUser."'";
$result3=$oreon->database->database->query($search);
$row = $oreon->database->database->fetch_array($result3); 
$gp_name_def=$row['GroupName'];


$search = "SELECT gp_name FROM group_template where location_id='".$locID."' GROUP BY gp_name";
$result2=$oreon->database->database->query($search);
echo('<tr>'),
  ('<td class="gpcell" style="text-align: left">'),
  ('Group :'),
  ('</td>'),
  ('<td  style="text-align: left">'),
  ('<select name="GroupName">');

  echo("<option value=''></option>");
while( $row = $oreon->database->database->fetch_array($result2)) {
 
   if ($gp_name_def!=$row['gp_name'])   
    echo("<option value=\"".$row['gp_name']."\">".$row['gp_name']."</option>");
   else
    echo("<option selected=\"selected\" value=\"".$row['gp_name']."\">".$row['gp_name']."</option>");
   
}		
echo('</select></td></tr>');
if ($Type!="Subscription Expiration" and $Type!="Expiration" ) {
echo "
  <tr>
	  <td class=\"gpcell\" style=\"width: 140px;\">Expiration date</td>";
  echo "<td colspan=\"2\" style=\"width: 309px;\"><input type=\"text\" name=\"edate\" id=\"f_edate_b\" value='$edate'/><button type=\"reset\" id=\"f_tredate_b\">...</button>";
  echo '<script type="text/javascript">
	  Calendar.setup({
		  inputField     :    "f_edate_b",      // id of the input field
			  ifFormat       :    "'.cdateformat_calendar($dateFormat).'",       // format of the input field
			  showsTime      :    true,            // will display a time selector
			  button         :    "f_tredate_b",   // trigger for the calendar (button ID)
			  singleClick    :    true,           // double-click mode
			  step           :    1                // show all years in drop-down boxes (instead of every other year as default)
});
</script>';

			
echo 	('</tr></table>');
echo "<table style=\"text-align: left; height: 58px; width: 736px; margin-left: 10px;\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\">
    <tr><td><table><tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">First name : </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"firstname\" value=\"$firstname\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Last name : </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"lastname\" value=\"$lastname\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Customer id : </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"cid\" value=\"$cid\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Department: </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"department\" value=\"$department\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Country: </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"country\" value=\"$country\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Address: </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"address\" value=\"$address\"></td>
     </tr>";
    echo "</table></td><td><table>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">City: </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"city\" value=\"$city\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Zip code: </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"zipcode\" value=\"$zipcode\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Mail : </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"mail\" value=\"$mail\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Home phone : </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"homephone\" value=\"$homephone\"></td>
     </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Work phone : </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"workphone\" value=\"$workphone\"></td>
	 </tr>";
  echo "
    <tr>	
        <td class=\"gpcell\" style=\"width: 240px;\">Mobile phone : </td>
       <td colspan=\"2\" style=\"width: 309px;\"><input
	 type=\"text\" name=\"mobile\" value=\"$mobile\"></td>
     </tr>";
echo '</table></td></tr></table>';

echo "<table style=\"text-align: left; margin-left: 10px;\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\">
        <td class=\"gpcell\" style=\"width: 50px;\">Note : </td>
       
	<td colspan=\"2\">
	<TEXTAREA NAME=\"note\" ROWS=\"10\" COLS=\"120\">$note
	</TEXTAREA>
	</td>
       </tr>";
}
echo "
</table>
<br>";
echo "<table style=\"text-align: left; width: 500px; height: 31px;\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\">";
echo ('<tr>');
echo ('<td  colspan=2  align="center">');
echo('<input type="hidden" name="buttonID"  value="modify_user">');
echo('<input type="hidden" name="pullUser"  value="'.$pullUser.'">');
echo ("<input type=\"submit\" name=\"submit\" class=\"button\" value=\"Modify User \">");
echo ('</td>');
echo ('</form>');
printf("<form action=\"sexyTabs.php?usr=$pullUser\" method=\"post\" onsubmit=\"javascript:top.opener.document.location.reload());sleep(1000);\" >");
echo ('<td align="center">');
echo('<input type="hidden" name="buttonID" value="delete_user">');
echo ("<input type=\"submit\" name=\"submit\" class=\"button\" value=\"Delete User \">");
echo '</form></td>';
printf("<form action=\"sexyTabs.php?usr=$pullUser\" method=\"post\">");
echo ('<td align="center">');
echo('<input type="hidden" name="buttonID" value="delete_user_acct">');
echo ("<input type=\"submit\" name=\"submit\" class=\"button\" value=\"Delete User Accounting\" >");
echo '</form>';
echo ('</td></tr>');
echo "</table>
   </tbody>";
									   
?>					       
Return current item: phpMyPrepaid