Changeset 1803

Show
Ignore:
Timestamp:
04/29/07 22:45:51 (1 year ago)
Author:
franck
Message:

Le bureau ne dépend plus de register_globals (tester en register_globals off et error_reporting E_ALL)
Ajout de jQuery pour le menu et pour les futurs développements JS
Ajout d'une demande de suppression pour les listes mailmans
... je sais plus :)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/branches/franck-desktop/bureau/admin/adm_add.php

    r1797 r1803  
    3939 
    4040$fields = array ( 
     41        "login"     => array ("request", "string", ""), 
     42        "pass"      => array ("request", "string", ""), 
     43        "passconf"  => array ("request", "string", ""), 
    4144        "canpass"   => array ("request", "integer", 1), 
     45        "prenom"    => array ("request", "string", ""), 
     46        "nom"       => array ("request", "string", ""), 
     47        "nmail"     => array ("request", "string", ""), 
    4248); 
    4349getFields($fields); 
     
    5258<form method="post" action="adm_doadd.php"> 
    5359<table border="1" cellspacing="0" cellpadding="4"> 
    54 <tr><th><label for="login"><?php __("Username"); ?></label></th><td> 
    55         <input type="text" class="int" name="login" id="login" value="<?php echo $login; ?>" size="20" maxlength="64" /> 
    56 </td></tr> 
    57 <tr> 
    58         <th><label for="pass"><?php __("Initial password"); ?></label></th> 
    59         <td><input type="password" id="pass" name="pass" class="int" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td> 
     60        <tr> 
     61                <th><label for="login"><?php __("Username"); ?></label></th> 
     62                <td><input type="text" class="int" name="login" id="login" value="<?php echo $login; ?>" size="20" maxlength="64" /></td> 
     63        </tr> 
     64        <tr> 
     65                <th><label for="pass"><?php __("Initial password"); ?></label></th> 
     66                <td><input type="password" id="pass" name="pass" class="int" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td> 
     67        </tr> 
     68        <tr> 
     69                <th><label for="passconf"><?php __("Confirm password"); ?></label></th> 
     70                <td><input type="password" id="passconf" name="passconf" class="int" value="<?php echo $passconf; ?>" size="20" maxlength="64" /></td> 
     71        </tr> 
     72        <tr> 
     73                <th><label for="canpass"><?php __("Can he change its password"); ?></label></th> 
     74                <td> 
     75                        <select class="inl" name="canpass" id="canpass"> 
     76<?php 
     77 
     78for($i = 0; $i < count($bro->l_icons); $i++) 
     79
     80        echo "<option value=\"" . $i . "\""; 
     81        if ($canpass == $i) 
     82                echo " selected=\"selected\""; 
     83        echo ">" . _($bro->l_icons[$i]) . "</option>"; 
     84
     85 
     86?> 
     87                        </select> 
     88                </td> 
     89        </tr> 
     90        <tr> 
     91                <th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th> 
     92                <td><input class="int" type="text" id="nom" name="nom" value="<?php echo $nom; ?>" size="20" maxlength="128" />&nbsp;/&nbsp;<input type="text" name="prenom" id="prenom" value="<?php echo $prenom; ?>" class="int" size="20" maxlength="128" /></td> 
     93        </tr> 
     94        <tr> 
     95                <th><label for="nmail"><?php __("Email address"); ?></label></th> 
     96                <td><input type="text" name="nmail" id="nmail" class="int" value="<?php echo $nmail; ?>" size="30" maxlength="128" /></td> 
     97        </tr> 
     98        <tr> 
     99                <th><label for="type"><?php __("Account type"); ?></label></th> 
     100                <td> 
     101                        <select name="type" id="type" class="inl"> 
     102<?php 
     103 
     104$db->query("SELECT DISTINCT(type) FROM defquotas ORDER BY type"); 
     105while($db->next_record()) 
     106
     107        $type = $db->f("type"); 
     108        echo "<option value=\"" . $type . "\""; 
     109        if ($type == "default") 
     110                echo " selected=\"selected\""; 
     111        echo ">" . $type . "</option>"; 
     112
     113 
     114?> 
     115                        </select> 
     116                </td> 
    60117</tr> 
    61 <tr> 
    62         <th><label for="passconf"><?php __("Confirm password"); ?></label></th> 
    63         <td><input type="password" id="passconf" name="passconf" class="int" value="<?php echo $passconf; ?>" size="20" maxlength="64" /></td> 
    64 </tr> 
    65 <tr> 
    66         <th><label for="canpass"><?php __("Can he change its password"); ?></label></th> 
    67         <td><select class="inl" name="canpass" id="canpass"> 
    68         <?php 
    69         for($i=0;$i<count($bro->l_icons);$i++) { 
    70           echo "<option"; 
    71           if ($canpass==$i) echo " selected=\"selected\""; 
    72           echo " value=\"$i\">"._($bro->l_icons[$i])."</option>"; 
    73         } 
    74 ?></select> 
    75         </td> 
    76 </tr> 
    77 <tr> 
    78         <th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th> 
    79         <td><input class="int" type="text" id="nom" name="nom" value="<?php echo $nom; ?>" size="20" maxlength="128" />&nbsp;/&nbsp;<input type="text" name="prenom" id="prenom" value="<?php echo $prenom; ?>" class="int" size="20" maxlength="128" /></td> 
    80 </tr> 
    81 <tr> 
    82         <th><label for="nmail"><?php __("Email address"); ?></label></th> 
    83         <td><input type="text" name="nmail" id="nmail" class="int" value="<?php echo $nmail; ?>" size="30" maxlength="128" /></td> 
    84 </tr> 
    85 <tr> 
    86         <th><label for="type"><?php __("Account type"); ?></label></th> 
    87         <td><select name="type" id="type" class="inl"> 
    88         <?php 
    89         $db->query("SELECT distinct(type) FROM defquotas ORDER by type"); 
    90         while($db->next_record()) { 
    91           $type = $db->f("type"); 
    92           echo "<option value=\"$type\""; 
    93           if($type == 'default') 
    94             echo " selected"; 
    95           echo ">$type</option>"; 
    96         } 
    97 ?></select> 
    98 </tr> 
    99 <? if (variable_get('hosting_tld')) { ?> 
    100 <tr> 
    101         <th colspan="2"><label><input type="checkbox" name="create_dom" value="1" /> 
    102         <?php print _("Create the domain username.").variable_get('hosting_tld'); ?></label></th> 
     118<?php if (variable_get("hosting_tld")) { ?> 
     119        <tr> 
     120                <th colspan="2"><label><input type="checkbox" name="create_dom" value="1" /><?php print _("Create the domain username.") . variable_get("hosting_tld"); ?></label></th> 
     121                </tr> 
     122        <tr> 
     123<?php } ?> 
     124                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create a new member"); ?>" /></td> 
    103125        </tr> 
    104 <tr> 
    105 <? } ?> 
    106         <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create a new member"); ?>" /></td> 
    107 </tr> 
    108126</table> 
    109127</form> 
  • alternc/branches/franck-desktop/bureau/admin/adm_defquotas.php

    r1802 r1803  
    8888<h4><?php echo _("Accounts of type"). " \"" . $qname . "\"" ?></h4> 
    8989<table border="0" cellpadding="4" cellspacing="0"> 
    90 <tr><th><?php __("Quotas") ?></th><th><?php __("Default Value"); ?></th></tr> 
     90        <tr> 
     91                <th><?php __("Quotas") ?></th> 
     92                <th><?php __("Default Value"); ?></th> 
     93        </tr> 
    9194<?php 
    9295 
     
    97100 
    98101?> 
    99 <tr class="lst<?php echo $col; ?>"> 
    100 <td><label for="<?php echo $key; ?>"><?php echo $aqname; ?></label></td> 
    101 <td><input type="text" class="int" size="16" maxlength="16" name="<?php echo $key; ?>" id="<?php echo $key; ?>" value="<?php echo $q[$aqtype]; ?>" /></td></tr> 
     102        <tr class="lst<?php echo $col; ?>"> 
     103                <td><label for="<?php echo $key; ?>"><?php echo $aqname; ?></label></td> 
     104                <td><input type="text" class="int" size="16" maxlength="16" name="<?php echo $key; ?>" id="<?php echo $key; ?>" value="<?php echo isset($q[$aqtype]) ? $q[$aqtype] : ""; ?>" /></td> 
     105        </tr> 
    102106<?php 
    103107 
  • alternc/branches/franck-desktop/bureau/admin/adm_doadd.php

    r802 r1803  
    3232require_once("../class/config.php"); 
    3333 
    34 if (!$admin->enabled) { 
     34$fields = array ( 
     35        "login"      => array ("request", "string", ""), 
     36        "pass"       => array ("request", "string", ""), 
     37        "passconf"   => array ("request", "string", ""), 
     38        "canpass"    => array ("request", "integer", 1), 
     39        "prenom"     => array ("request", "string", ""), 
     40        "nom"        => array ("request", "string", ""), 
     41        "nmail"      => array ("request", "string", ""), 
     42        "create_dom" => array ("request", "string", ""), 
     43        "type"       => array ("request", "string", ""), 
     44); 
     45getFields($fields); 
     46 
     47if (!$admin->enabled) 
     48
    3549        __("This page is restricted to authorized staff"); 
    3650        exit; 
    3751} 
    3852 
    39 if ($pass != $passconf) { 
     53if ($pass != $passconf) 
     54
    4055        $error = _("Passwords do not match"); 
    41         include("adm_add.php"); 
     56        include ("adm_add.php"); 
    4257        exit(); 
    4358} 
    44 if (!($u=$admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type))) { 
    45         $error=$err->errstr(); 
     59 
     60if (!($u = $admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type))) 
     61
     62        $error = $err->errstr(); 
    4663        include ("adm_add.php"); 
    4764        exit; 
    48 } else { 
    49  
     65
     66else 
     67
    5068  // Add here all what you want when an account is created ! 
    5169  $mem->su($u); 
    52    
     70 
    5371  /* 
    5472   * 0 = pas d'hébergement dns, en effet, pas besoin vu que les 
     
    6078   * 1 = force = ne tient pas compte du whois ou des droits de tld 
    6179   */ 
    62   if ($create_dom) { 
    63     if (variable_get("hosting_tld"))
    64       # make sure we don't have multiple dots there 
    65       $dom->lock(); 
    66       $dom->add_domain($login.".".preg_replace("/^\.\.*/", "", variable_get("hosting_tld")),0,1,1); 
    67       $dom->unlock(); 
    68     } else { 
    69       $err->log("no 'hosting_tld' variable defined in `variables` table, not creating domain"); 
    70    
    71   } 
    72   $ftp->add_ftp($login,"",$pass,"/"); 
    73   $mem->unsu(); 
    74   
    75  $error=_("The new member has been successfully created"); 
     80        if ($create_dom) 
     81       
     82                if (variable_get("hosting_tld")) 
     83                { 
     84                        # make sure we don't have multiple dots there 
     85                       $dom->lock(); 
     86                        $dom->add_domain($login . "." . preg_replace("/^\.\.*/", "", variable_get("hosting_tld")), 0, 1, 1); 
     87                       $dom->unlock(); 
     88               
     89                else 
     90                { 
     91                       $err->log("no 'hosting_tld' variable defined in `variables` table, not creating domain"); 
     92                } 
     93        } 
    7694 
    77  include("adm_list.php"); 
    78  exit; 
     95        $ftp->add_ftp($login, "", $pass, "/"); 
     96        $mem->unsu(); 
     97 
     98        $error = _("The new member has been successfully created"); 
     99 
     100        include("adm_list.php"); 
     101        exit; 
    79102} 
     103 
    80104?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_dodefquotas.php

    r1797 r1803  
    3232require_once("../class/config.php"); 
    3333 
    34 if (!$admin->enabled) { 
     34if (!$admin->enabled) 
     35
    3536        __("This page is restricted to authorized staff"); 
    3637        exit(); 
    3738} 
    3839 
    39 if($_POST["action"] == "add") { 
    40   $type = $_POST['type']; 
     40$fields = array ( 
     41        "action"      => array ("request", "string", ""), 
     42        "type"        => array ("request", "string", ""), 
     43        "del_confirm" => array ("request", "string", ""), 
     44); 
     45getFields($fields); 
    4146 
    42   if($quota->addtype($type)) { 
    43     $error=_("Account type"). " \"$type\" "._("added"); 
    44   } else { 
    45     $error=_("Account type"). " \"$type\" "._("could not be added"); 
     47if ($action == "add") 
     48
     49        if($quota->addtype($type)) 
     50        { 
     51                $error = _("Account type"). " \"" . $type . "\" " . _("added"); 
     52        } 
     53        else 
     54        { 
     55                $error = _("Account type"). " \"" . $type . "\" " . _("could not be added"); 
     56        } 
     57        include("adm_defquotas.php"); 
     58        exit(); 
     59
     60else if ($action == "delete") 
     61
     62        if (empty($type)) 
     63        { 
     64                include("adm_defquotas.php"); 
     65                exit(); 
     66        } 
     67 
     68        if ($del_confirm == "y") 
     69        { 
     70                if($type) 
     71                { 
     72                        if($quota->deltype($type)) 
     73                        { 
     74                                $error = _("Account type"). " \"" . $type . "\" " . _("deleted"); 
     75                        } 
     76                        else 
     77                        { 
     78                                $error = _("Account type") . " \"" . $type . "\" " . _("could not be deleted"); 
     79                        } 
     80                } 
     81                include("adm_defquotas.php"); 
     82                exit(); 
     83        } 
     84        else 
     85        { 
     86                include_once("head.php"); 
     87?> 
     88<h3><?php printf(_("Deleting quota %s"), $type); ?></h3> 
     89 
     90<form action="adm_dodefquotas.php" method="post"> 
     91<input type="hidden" name="action" value="delete" /> 
     92<input type="hidden" name="type" value="<?php echo $type ?>" /> 
     93<input type="hidden" name="del_confirm" value="y" /> 
     94<p class="error"><?php __("WARNING : Confirm the deletion of the quota"); ?></p> 
     95<p><?php echo $type; ?></p> 
     96<blockquote> 
     97        <input type="submit" class="inb" name="confirm" value="<?php __("Yes"); ?>" />&nbsp;&nbsp; 
     98        <input type="button" class="inb" name="cancel" value="<?php __("No"); ?>" onclick="document.location='adm_defquotas.php';" /> 
     99</blockquote> 
     100</form> 
     101<script type="text/javascript"> 
     102deploy("menu-adm"); 
     103</script> 
     104<?php 
     105 
     106                include_once("foot.php"); 
     107                exit(); 
    46108  } 
    47   include("adm_defquotas.php"); 
    48 } else if($_POST["action"] == "delete") { 
    49   if($_POST["del_confirm"] == "y"){ 
    50     if($_POST['type']) { 
    51       if($quota->deltype($_POST['type'])) { 
    52         $error=_("Account type"). " \"$type\" "._("deleted"); 
    53       } else { 
    54         $error=_("Account type"). " \"$type\" "._("could not be deleted"); 
    55       } 
    56     } 
    57     include("adm_defquotas.php"); 
    58   }else{ 
    59     include_once("head.php"); 
    60     ?> 
    61     <h3><?php printf(_("Deleting quota %s"),$_POST["type"]); ?> : </h3> 
     109
     110else if ($action == "modify") 
     111
     112        reset($_POST); 
     113        $c = array(); 
     114        foreach ($_POST as $key => $val) 
     115        { 
     116                if($key == "action") 
     117                continue; 
    62118 
    63     <form action="adm_dodefquotas.php" method="post"> 
    64       <input type="hidden" name="action" value="delete" /> 
    65       <input type="hidden" name="type" value="<?php echo $_POST["type"] ?>" /> 
    66       <input type="hidden" name="del_confirm" value="y" /> 
    67       <p class="error"><?php __("WARNING : Confirm the deletion of the quota"); ?></p> 
    68       <p><?php echo $_POST["type"]; ?></p> 
    69       <blockquote> 
    70         <input type="submit" class="inb" name="confirm" value="<?php __("Yes"); ?>" />&nbsp;&nbsp; 
    71         <input type="button" class="inb" name="cancel" value="<?php __("No"); ?>" onclick="document.location='adm_defquotas.php';" /> 
    72       </blockquote> 
    73     </form> 
    74                 <script type="text/javascript"> 
    75                 deploy("menu-adm"); 
    76                 </script> 
    77                 <?php include_once("foot.php"); ?> 
    78     <?php 
    79   } 
    80 } else if($_POST["action"] == "modify") { 
    81   reset($_POST); 
    82   $c=array(); 
    83   foreach($_POST as $key => $val) { 
    84     if($key == "action") 
    85       continue; 
     119                list($type, $q) = explode(":", $key, 2); 
     120                $c[$type][$q] = abs(intval($val)); 
     121        } 
    86122 
    87     list($type, $q) = explode(":", $key, 2); 
    88     $c[$type][$q] = abs(intval($val)); 
    89   } 
     123        if ($quota->setdefaults($c)) 
     124        { 
     125                $error = _("Default quotas successfully changed"); 
     126        } 
     127        else 
     128        { 
     129                $error = _("Default quotas could not be set."); 
     130        } 
     131        include("adm_defquotas.php"); 
     132        exit(); 
     133
    90134 
    91   if($quota->setdefaults($c)) { 
    92     $error=_("Default quotas successfully changed"); 
    93   } else { 
    94     $error=_("Default quotas could not be set."); 
    95   } 
    96   include("adm_panel.php"); 
    97 } 
    98135?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_doedit.php

    r982 r1803  
    3232require_once("../class/config.php"); 
    3333 
    34 if (!$admin->enabled) { 
    35   __("This page is restricted to authorized staff"); 
    36   exit(); 
    37 
    38 if (!$admin->checkcreator($uid)) { 
     34if (!$admin->enabled) 
     35
    3936  __("This page is restricted to authorized staff"); 
    4037  exit(); 
    4138} 
    4239 
    43 if ($pass != $passconf) { 
    44   $error = _("Passwords do not match"); 
    45   include("adm_edit.php"); 
     40$fields = array ( 
     41        "uid"        => array ("request", "integer", 0), 
     42        "enabled"    => array ("request", "integer", 0), 
     43        "pass"       => array ("request", "string", ""), 
     44        "passconf"   => array ("request", "string", ""), 
     45        "canpass"    => array ("request", "integer", 1), 
     46        "prenom"     => array ("request", "string", ""), 
     47        "nom"        => array ("request", "string", ""), 
     48        "nmail"      => array ("request", "string", ""), 
     49        "duration"   => array ("request", "integer", 0), 
     50); 
     51getFields($fields); 
     52 
     53if (!$admin->checkcreator($uid)) 
     54
     55  __("This page is restricted to authorized staff"); 
    4656  exit(); 
    4757} 
    4858 
    49 if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration)){ 
    50   $error=$err->errstr(); 
    51   include("adm_edit.php"); 
    52 } else { 
    53   $error=_("The member has been successfully edited"); 
    54   include("adm_list.php"); 
     59if ($pass != $passconf) 
     60
     61        $error = _("Passwords do not match"); 
     62        include ("adm_edit.php"); 
     63        exit(); 
    5564} 
     65 
     66if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration)) 
     67{ 
     68        $error = $err->errstr(); 
     69        include ("adm_edit.php"); 
     70} 
     71else 
     72{ 
     73        $error = _("The member has been successfully edited"); 
     74        include ("adm_list.php"); 
     75} 
     76 
    5677?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_doms.php

    r1797 r1803  
    6161 
    6262<tr class="lst<?php echo $col; ?>"> 
    63 <td><a href="adm_domlock.php?domain=<?php echo urlencode($c[$i][domaine]); ?>"><?php 
    64    if ($c[$i][noerase]) __("Unlock"); else __("Lock");  ?></a></td> 
    65 <td><?php echo $c[$i][domaine]; ?></td> 
    66 <td><?php echo $c[$i][login]; ?></td> 
    67                                     <td><?php if ($c[$i][noerase]) { 
     63<td><a href="adm_domlock.php?domain=<?php echo urlencode($c[$i]["domaine"]); ?>"><?php 
     64   if ($c[$i]["noerase"]) __("Unlock"); else __("Lock");  ?></a></td> 
     65<td><?php echo $c[$i]["domaine"]; ?></td> 
     66<td><?php echo $c[$i]["login"]; ?></td> 
     67                                    <td><?php if ($c[$i]["noerase"]) { 
    6868                        echo "<img src=\"icon/encrypted.png\" width=\"16\" height=\"16\" alt=\""._("Locked Domain")."\" />"; 
    6969                                    } ?></td> 
  • alternc/branches/franck-desktop/bureau/admin/adm_dorenew.php

    r982 r1803  
    3131require_once("../class/config.php"); 
    3232 
    33 if (!$admin->enabled) { 
    34   __("This page is restricted to authorized staff"); 
    35   exit(); 
    36 
    37 if (!$admin->checkcreator($uid)) { 
    38   __("This page is restricted to authorized staff"); 
    39   exit(); 
     33$fields = array ( 
     34        "uid"      => array ("request", "integer", 0), 
     35        "periods"  => array ("request", "integer", 0), 
     36); 
     37getFields($fields); 
     38 
     39if (!$admin->enabled) 
     40
     41        __("This page is restricted to authorized staff"); 
     42        exit(); 
    4043} 
    4144 
    42 if (!$admin->renew_mem($_REQUEST['uid'], $_REQUEST['periods'])){ 
    43   $error=$err->errstr(); 
    44   include("adm_edit.php"); 
    45 } else { 
    46   $error=_("The member has been successfully renewed"); 
    47   include("adm_list.php"); 
     45if (!$admin->checkcreator($uid)) 
     46
     47        __("This page is restricted to authorized staff"); 
     48        exit(); 
    4849} 
     50 
     51if (!$admin->renew_mem($uid, $periods)) 
     52{ 
     53        $error = $err->errstr(); 
     54        include ("adm_edit.php"); 
     55} 
     56else 
     57{ 
     58        $error = _("The member has been successfully renewed"); 
     59        include ("adm_list.php"); 
     60} 
     61 
    4962?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_edit.php

    r1797 r1803  
    3939 
    4040$fields = array ( 
    41         "uid"    => array ("request", "integer", 0), 
     41        "uid"        => array ("request", "integer", 0), 
     42        "enabled"    => array ("request", "integer", 0), 
     43        "pass"       => array ("request", "string", ""), 
     44        "passconf"   => array ("request", "string", ""), 
     45        "canpass"    => array ("request", "integer", 1), 
     46        "prenom"     => array ("request", "string", ""), 
     47        "nom"        => array ("request", "string", ""), 
     48        "nmail"      => array ("request", "string", ""), 
     49        "duration"   => array ("request", "integer", 0), 
     50        "periods"    => array ("request", "integer", 1), 
    4251); 
    4352getFields($fields); 
    4453 
    45 if (!$admin->checkcreator($uid)) { 
     54if (!$admin->checkcreator($uid)) 
     55
    4656        __("This page is restricted to authorized staff"); 
    4757        exit(); 
    4858} 
    4959 
    50 if (!$r=$admin->get($uid)) { 
    51         $error=$err->errstr(); 
     60if (!$r = $admin->get($uid)) 
     61
     62        $error = $err->errstr(); 
    5263} 
    5364 
     
    5566<h3><?php __("Member Edition"); ?></h3> 
    5667<?php 
    57         if ($error) { 
    58                 echo "<p class=\"error\">$error</p>"; 
    59         } 
     68 
     69if ($error) 
     70
     71        echo "<p class=\"error\">" . $error . "</p>"; 
     72
     73 
    6074?> 
    6175<form method="post" action="adm_doedit.php"> 
     
    111125        <td><select name="type" id="type"> 
    112126        <?php 
    113         $db->query("SELECT distinct(type) FROM defquotas ORDER by type"); 
     127        $db->query("SELECT DISTINCT(type) FROM defquotas ORDER BY type"); 
    114128        while($db->next_record()) { 
    115129          $type = $db->f("type"); 
     
    131145</table> 
    132146