summaryrefslogtreecommitdiff
path: root/includes/wot.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/wot.inc.php')
-rw-r--r--includes/wot.inc.php54
1 files changed, 44 insertions, 10 deletions
diff --git a/includes/wot.inc.php b/includes/wot.inc.php
index 6b3bcc8..f032307 100644
--- a/includes/wot.inc.php
+++ b/includes/wot.inc.php
@@ -14,7 +14,7 @@
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)
{
@@ -40,6 +40,15 @@
return intval($row['list']);
}
+
+ function get_number_of_ttpassurances ($userid)
+ {
+ $res = query_init ("SELECT count(*) AS `list` FROM `notary`
+ WHERE (`method`='Trusted Third Parties' or `method`='TTP-Assisted') AND `to`='".intval($userid)."' ");
+ $row = query_getnextrow($res);
+
+ return intval($row['list']);
+ }
function get_number_of_assurees ($userid)
{
@@ -52,8 +61,8 @@
function get_top_assurer_position ($no_of_assurances)
{
- $res = query_init ("SELECT count(*) AS `list` FROM `notary`
- WHERE `method` = 'Face to Face Meeting'
+ $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);
}
@@ -83,7 +92,7 @@
$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 `to`='".intval($userid)."' group by points,awarded,method");
@@ -129,7 +138,7 @@
$awarded = 100;
}
else
- $experience = 0;
+ $experience = 0;
switch ($row['method'])
{
@@ -310,7 +319,7 @@
$res = get_given_assurances(intval($userid));
while($row = mysql_fetch_assoc($res))
{
- $fromuser = get_user (intval($row['to']));
+ $fromuser = get_user (intval($row['to']));
$apoints = calc_experience ($row,$points,$experience,$sum_experience);
$name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['to']));
output_assurances_row (intval($row['id']),$row['date'],$row['when'],$name,$apoints,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience);
@@ -553,13 +562,13 @@ function AssureHead($confirmation,$checkname)
<td class="DataTD" colspan="2" align="left"><?=$checkname?></td>
</tr>
<?
- }
+ }
function AssureTextLine($field1,$field2)
{
?>
<tr>
- <td class="DataTD"><?=$field1?>:</td>
+ <td class="DataTD"><?=$field1.(empty($field1)?'':':')?></td>
<td class="DataTD"><?=$field2?></td>
</tr>
<?
@@ -587,7 +596,7 @@ function AssureMethodLine($text,$methods,$remark)
{
?>
<tr>
- <td class="DataTD"><?=$text?></td>
+ <td class="DataTD"><?=$text.(empty($text)?'':':')?></td>
<td class="DataTD">
<select name="method">
<?
@@ -611,7 +620,7 @@ function AssureInboxLine($type,$field,$value,$description)
{
?>
<tr>
- <td class="DataTD"><?=$field?>:</td>
+ <td class="DataTD"><?=$field.(empty($field)?'':':')?></td>
<td class="DataTD"><input type="text" name="<?=$type?>" value="<?=$value?>"><?=$description?></td>
</tr>
<?
@@ -629,3 +638,28 @@ function AssureFoot($oldid,$confirm)
<?
}
+// double with notray.inc
+function write_user_agreement($memid, $document, $method, $comment, $active=1, $secmemid=0){
+ // write a new record to the table user_agreement
+ $query="insert into `user_agreements` set `memid`=".$memid.", `secmemid`=".$secmemid.
+ ",`document`='".$document."',`date`=NOW(), `active`=".$active.",`method`='".$method."',`comment`='".$comment."'" ;
+ $res = mysql_query($query);
+}
+
+function check_date_format($date, $year=2000){
+ //checks if the date is entered in the right date format YYYY-MM-DD and if
+ if (!strpos($date,'-')) {
+ return FALSE;
+ }
+ $arr=explode('-',$date);
+ if (intval($arr[0])<=$year) {
+ return FALSE;
+ }
+ return checkdate(intval($arr[1]), intval($arr[2]), intval($arr[0]));
+
+}
+
+function check_date_differnce($date, $diff=1){
+ //returns false if the date is larger then today + time diffrence
+ return (strtotime($date)>=time+$diff*86400);
+}