You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
function query_init ($query)
{
@ -35,7 +35,7 @@
function get_number_of_assurances ($userid)
{
$res = query_init ("SELECT count(*) AS `list` FROM `notary`
WHERE `notary`.`from` != `notary`.`to` AND `notary`.`from`='".intval($userid)."'");
WHERE `method` = 'Face to Face Meeting' AND `from`='".intval($userid)."' ");
$row = query_getnextrow($res);
return intval($row['list']);
@ -44,7 +44,7 @@
function get_number_of_assurees ($userid)
{
$res = query_init ("SELECT count(*) AS `list` FROM `notary`
WHERE `notary`.`from` != `notary`.`to` AND `notary`.`to`='".intval($userid)."'");
WHERE `method` = 'Face to Face Meeting' AND `to`='".intval($userid)."' ");
$row = query_getnextrow($res);
return intval($row['list']);
@ -52,39 +52,41 @@
function get_top_assurer_position ($no_of_assurances)
{
$res = query_init ("SELECT count(*) AS `list` FROM `notary`
GROUP BY `notary`.`from` HAVING count(*) > '".intval($no_of_assurances)."'");
$res = query_init ("SELECT count(*) AS `list` FROM `notary`
WHERE `method` = 'Face to Face Meeting'
GROUP BY `from` HAVING count(*) > '".intval($no_of_assurances)."'");
return intval(query_get_number_of_rows($res)+1);
}
function get_top_assuree_position ($no_of_assurees)
{
$res = query_init ("SELECT count(*) AS `list` FROM `notary`
GROUP BY `notary`.`to` HAVING count(*) > '".intval($no_of_assurees)."'");
WHERE `method` = 'Face to Face Meeting'
GROUP BY `to` HAVING count(*) > '".intval($no_of_assurees)."'");
return intval(query_get_number_of_rows($res)+1);
}
function get_given_assurances ($userid)
{
$res = query_init ("select * from `notary` where `notary`.`from`='".intval($userid)."' and `notary`.`from` != `to` order by `notary`.`id` asc");
$res = query_init ("select * from `notary` where `from`='".intval($userid)."' and `from` != `to` order by `id` asc");
return $res;
}
function get_received_assurances ($userid)
{
$res = query_init ("select * from `notary` where `notary`.`to`='".intval($userid)."' and `notary`.`from` != `notary`.`to` order by `notary`.`id` asc ");
$res = query_init ("select * from `notary` where `to`='".intval($userid)."' and `from` != `to` order by `id` asc ");
return $res;
}
function get_given_assurances_summary ($userid)
{
$res = query_init ("select count(*) as number,points,awarded,method from notary where `notary`.`from`='".intval($userid)."' group by points,awarded,method");
$res = query_init ("select count(*) as number,points,awarded,method from notary where `from`='".intval($userid)."' group by points,awarded,method");
return $res;
}
function get_received_assurances_summary ($userid)
{
$res = query_init ("select count(*) as number,points,awarded,method from notary where `notary`.`to`='".intval($userid)."' group by points,awarded,method");
$res = query_init ("select count(*) as number,points,awarded,method from notary where `to`='".intval($userid)."' group by points,awarded,method");
return $res;
}
@ -124,7 +126,7 @@
$awarded = 100;
}
else
$experience = 0;
$experience = 0;
switch ($row['method'])
{
@ -272,15 +274,6 @@
<?
}
function output_cats_needed()
{
?>
<tr>
<tdclass="DataTD"colspan=4><strongstyle='color: red'><?=_("You have to pass the CAcert Assurer Challenge (CATS-Test) to be an Assurer")?></strong></td>
</tr>
<?
}
// ************* output given assurances ******************