File: reseller.php

package info (click to toggle)
dtc 0.35.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,824 kB
  • sloc: php: 50,739; sh: 8,596; makefile: 572; perl: 148; xml: 25
file content (53 lines) | stat: -rw-r--r-- 2,425 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php

//////////////////////////////////////
// Database management for one user //
//////////////////////////////////////
// Todo : add a button for creating a MySql databe for one user
// and add credential to it !
function drawReseller($admin){
	global $lang;
	global $txt_draw_tatabase_your_list;
	global $conf_mysql_db;
	global $adm_login;
	global $adm_pass;
	global $pro_mysql_admin_table;
	
	global $conf_demo_version;
	global $conf_post_or_get;

	$hidden = "<input type=\"hidden\" name=\"adm_login\" value=\"$adm_login\">
		<input type=\"hidden\" name=\"addrlink\" value=\"".$_REQUEST["addrlink"]."\">
		<input type=\"hidden\" name=\"adm_pass\" value=\"$adm_pass\">";

	$out = "<b><u>". _("Your child accounts:") ."</u></b>";
	$out .= "<table>
	<tr><td>". _("Login") ."</td><td>". _("Password") ."</td><td>". _("Action") ."</td></tr>";
	if($admin["info"]["ob_head"] != ""){
		$next_adm = $admin["info"]["ob_head"];
		while($next_adm != $adm_login){
			$q = "SELECT * FROM $pro_mysql_admin_table WHERE adm_login='$next_adm';";
			$r = mysql_query($q)or die("Cannot query $q line ".__LINE__." file ".__FILE__." sql said ".mysql_error());
			$n = mysql_num_rows($r);
			if($n != 1)	die("Could not fetch one of the child accounts !!!");
			$a = mysql_fetch_array($r);
			$next_adm = $a["ob_next"];
			$out .= "<tr><td><form method=\"$conf_post_or_get\" action=\"?\">$hidden
			<input type=\"hidden\" name=\"action\" value=\"change_child_account_values\">
			<input type=\"hidden\" name=\"account_name\" value=\"".$a["adm_login"]."\">".$a["adm_login"]."</td>
			<td><input type=\"text\" name=\"new_adm_pass\" value=\"\"></td><td><input type=\"submit\" value=\"." . _("Save") . "\"></form>
			<form method=\"$conf_post_or_get\" action=\"?\">$hidden
			<input type=\"hidden\" name=\"action\" value=\"delete_child_account\">
			<input type=\"hidden\" name=\"account_name\" value=\"".$a["adm_login"]."\"><input type=\"submit\" value=\"". _("Del") . "\"></form></td></tr>";
		}
//		TMDselectTables("treeindex",$pro_mysql_admin_table,"childrens");
	}
	$out .= "<tr><td><form method=\"$conf_post_or_get\" action=\"?\">
	$hidden<input type=\"hidden\" name=\"action\" value=\"add_child_account\">
	<input type=\"text\" name=\"new_adm_login\" value=\"\"></td>
	<td><input type=\"text\" name=\"new_adm_pass\" value=\"\"></td>
	<td><input type=\"submit\" value=\"" . _("Create") . "\"></form></td></tr></table>";
	return $out;
}

?>