From: Kilian Saffran Date: Wed, 13 Mar 2019 16:32:22 +0000 (+0100) Subject: bug fixes mailaddress in search and evaliation activation X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=f18f7a321ee6de2590f55c6fe8f07b92ec5ece48;p=juridig.git bug fixes mailaddress in search and evaliation activation --- diff --git a/index.php b/index.php index 8252e39..354dd72 100644 --- a/index.php +++ b/index.php @@ -25,7 +25,7 @@ $sp = explode("/",$_GET["p"]); $p = $sp[0]; } - if ($p == "rendezvous") && (count($sp) == 2){ + if (($p == "rendezvous") && (count($sp) == 2)){ //TODO: get id by ident name // $userident = $db->dbquery("select id from users where ident="); // if ($userident){ diff --git a/lib/processdata.php b/lib/processdata.php index a0efd96..b5ba8cb 100644 --- a/lib/processdata.php +++ b/lib/processdata.php @@ -22,7 +22,7 @@ save_rendezvous($pdt); break; case 'submit_profile': - if (!isset($pdt["uservisibility"])) { $pdt["uservisibility"] = "";} + //if (!isset($pdt["uservisibility"])) { $pdt["uservisibility"] = "";} save_data('users',$pdt); break; // case 'submit_profileetude': @@ -389,22 +389,22 @@ function activate_evaluation($gdt){ global $db,$user,$msg; - $sql = "select us.service,us.expiration,us.payeddate,us.isevaluation,apps.name from userservices us join apps on (us.id_app=apps.id) where us.id_app='".$gdt["id"]."' and us.id_user=".$user["id"].";"; + $sql = "select us.service,us.expiration,us.payeddate,us.isevaluation,apps.name from userservices us join apps on (us.id_app=apps.id) where us.id_app='".$gdt["app"]."' and us.id_user=".$user["id"].";"; $eval = $db->dbquery($sql); if ($eval){ - $msg = '
Vous avez déjà testé le service '.$eval["name"].'
'; + $msg = '
Vous avez déjà testé le service '.$eval["name"].'
'; } else { - $sql = "select id,app,name,evaluationdays from apps where id=".$gdt["id"]; + $sql = "select id,app,name,evaluationdays from apps where id=".$gdt["app"]; $eapp = $db->dbquery($sql); if ($eapp["evaluationdays"] == null){ - $msg = '
Cette Application n\'a pas une periode d\'évaluation
'; + $msg = '
Cette Application n\'a pas une periode d\'évaluation
'; }else { $evaldate = date('Y-m-d',strtotime("+".$eapp["evaluationdays"]." days")); $evaldateshow = date('d.m.Y',strtotime("+".$eapp["evaluationdays"]." days")); - $sql = "INSERT INTO userservices (id_user,service,expiration,isevaluation,id_app) VALUES (".$user["id"].",".$eapp["app"].",date('".$evaldate."'),1,".$gdt["id"].")"; + $sql = "INSERT INTO userservices (id_user,service,expiration,isevaluation,id_app) VALUES (".$user["id"].",'".$eapp["app"]."',date('".$evaldate."'),1,".$eapp["id"].")"; $db->dbexec($sql); - $msg = '
Periode d\'évaluation a été activé jusqu\'au '.$evaldateshow.'
'; + $msg = '
Periode d\'évaluation a été activé jusqu\'au '.$evaldateshow.'
'; } @@ -431,4 +431,17 @@ } } } + + function crypt_mailaddress($mailadr){ + $n = 0; + $r = ""; + $mailadr = 'mailto:'.$mailadr; + $xdata = str_split($mailadr); + for($i=0; $i < count($xdata); $i++ ){ + $n = ord( $xdata[$i] ); + if( $n >= 8364 ){$n = 128;} + $r .= chr($n+1); + } + return $r; + } ?> \ No newline at end of file diff --git a/site.js b/site.js index 3571c61..90c69f3 100644 --- a/site.js +++ b/site.js @@ -120,4 +120,21 @@ function initstandard(){ }); } +} + +function imsg(data){ + var tmp = h1(data); + console.log(tmp); + window.location.href=tmp; +} + +function h1(s) { + var n = 0; + var r = ""; + for( var i = 0; i < s.length; i++){ + n = s.charCodeAt( i ); + if( n >= 8364 ){n = 128;} + r += String.fromCharCode( n - 1 ); + } + return r; } \ No newline at end of file diff --git a/tmpl/blocks/avocatsearch.php b/tmpl/blocks/avocatsearch.php index f56bb8c..3141309 100644 --- a/tmpl/blocks/avocatsearch.php +++ b/tmpl/blocks/avocatsearch.php @@ -53,10 +53,10 @@ foreach ($avocats as $avo) { echo '
'.(($avo['userzip'] != "")?$avo['userzip']:'').' '.(($avo['usercity'] != "")?$avo['usercity']:'').'
'; } if ($avo['userphone'] != ''){ - echo '
: '.$avo['userphone'].'
'; + echo '
: '.$avo['userphone'].'
'; } if ($avo['useremail']){ - echo ': '.$avo['useremail'].''; + echo ': '; } echo ''; } diff --git a/tmpl/css.php b/tmpl/css.php index 5fb6e0a..97c759d 100644 --- a/tmpl/css.php +++ b/tmpl/css.php @@ -1,8 +1,8 @@ - - - - - - + + + + + + - \ No newline at end of file + \ No newline at end of file diff --git a/tmpl/javascript.php b/tmpl/javascript.php index e6ab0cc..ceb91a3 100644 --- a/tmpl/javascript.php +++ b/tmpl/javascript.php @@ -8,4 +8,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/tmpl/pages/profile/package.php b/tmpl/pages/profile/package.php index 37e3086..ae94fc5 100644 --- a/tmpl/pages/profile/package.php +++ b/tmpl/pages/profile/package.php @@ -27,7 +27,7 @@
Evaluation
jours gratuit

- " class="btn btn-block btn-primary text-uppercase">Activer + " class="btn btn-block btn-primary text-uppercase">Activer