From: Kilian Saffran Date: Tue, 19 Mar 2019 14:45:04 +0000 (+0100) Subject: near to version 1 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=bf2449d50045cd88d31d63a41b11c7240519ad85;p=juridig.git near to version 1 --- diff --git a/api.php b/api.php index 83691a3..eb49a6e 100644 --- a/api.php +++ b/api.php @@ -10,11 +10,11 @@ $num_wd = date('w',strtotime($_GET['day'])); $str_wd = strtolower(date('D',strtotime($_GET['day']))); $sql ="select ".$str_wd."_values as hour_values,option1_name,option1_values,option2_name,option2_values,option3_name,option3_values,option4_name,option4_values from timesheets where startdate <= date('".$_GET['day']."') and weekdays LIKE '%".$num_wd."%' and id_user=".$iduser." order by startdate desc LIMIT 1;"; - error_log("GET RDVDAY:".$sql); + $daydata = $db->dbquery($sql); $sql ="select dayhours from exceptions where daydate=date('".$_GET['day']."') and id_user=".$iduser.";"; $exception = $db->dbquery($sql); - // $daydata["exception"] = explode(',',$exception["dayhours"]); + if ($daydata["hour_values"] != ""){ $daydata["hour_values"] = explode(',',$daydata["hour_values"]); } else { @@ -35,7 +35,7 @@ //exclude taken rdv times $sql = "select eventhour from events where eventdate=date('".$_GET['day']."') and id_user='".$iduser."' and (user_status != 'canceled' or client_status != 'canceled')"; $takenevents = $db->dbquery($sql); - // $daydata["taken"] = explode(',',$takenevents["eventhour"]); + if ($daydata["hour_values"] != null){ $dhnew = array(); if ($takenevents != null){ diff --git a/lib/process_payment.php b/lib/process_payment.php index c79247c..b5f1dc6 100644 --- a/lib/process_payment.php +++ b/lib/process_payment.php @@ -15,7 +15,7 @@ function send_invoice(){ REPLACE(FORMAT(payedamount, 2),'.',',') as payedamount from invoicedata where id_user=".$user["id"]." order by invoicedate DESC,id DESC LIMIT 1;"; $pdfdata = $db->dbquery($sql); $pdffile = create_pdfinvoice($pdfdata); - $msg .= '
'.$pdffile; + //$msg .= '
'.$pdffile; if ($pdffile != ""){ $send = sendemail('user_invoice',array("email" => $user["useremail"],"id" => $user["id"]),array($pdffile)); if ($send == 0){ @@ -107,11 +107,11 @@ function activate_evaluation($gdt){ global $db,$user,$msg; $sql = "select id,service,expiration,payeddate,isevaluation from userservices where id_app='".$gdt["id"]."' and id_user=".$user["id"].";"; $eval = $db->dbquery($sql); - // $msg = $sql; + if ($eval){ if ($gdt["enable"] == "0"){ $gdt["enable"] = 'null';} $sql = "UPDATE userservices set enabled=".$gdt["enable"]." WHERE id=".$eval["id"].";"; - // $msg .= '
'.$sql; + $db->dbexec($sql); } else { $sql = "select id,evaluationdays,app from apps where id=".$gdt["id"].";"; @@ -119,7 +119,6 @@ function activate_evaluation($gdt){ if (($eapp) && ($eapp["evaluationdays"] == null)){ $sql = "INSERT INTO userservices (id_user,service,id_app,enabled) VALUES (".$user["id"].",'".$eapp["app"]."',".$gdt["id"].",".$gdt["enable"].")"; - // $msg .= '
'.$sql; $db->dbexec($sql); } } diff --git a/lib/process_profile.php b/lib/process_profile.php index 0661618..4478eb5 100644 --- a/lib/process_profile.php +++ b/lib/process_profile.php @@ -75,7 +75,7 @@ function checklogin($username,$passwd){ $luser = $db->dbquery($sql); $sid = null; $retuser=null; - //echo "
$sql
".$luser["cnt"]."
"; + if ($luser["cnt"] == 1){ $sid = generateRandomString(); $sql = "INSERT INTO usersession (sessionid, id_user, lastlogin, useragent, remoteaddr) @@ -83,12 +83,11 @@ function checklogin($username,$passwd){ $db->dbexec($sql); setcookie("juridig",$sid); $retuser = getsessiondata($sid); - - //$p='profile'; + }else { setcookie("juridig",""); $msg='
Utilisateur et/ou mot de passe non connu!
'; - //$p='/home'; + } return $retuser; } diff --git a/lib/process_rdv.php b/lib/process_rdv.php index 7c6f8b7..2f75d04 100644 --- a/lib/process_rdv.php +++ b/lib/process_rdv.php @@ -48,11 +48,11 @@ // $msg .= $senddata; // $send = 0; if ($send == 0){ - $msg .= '
Votre demande à été enregistrée!
+ $msg = '
Votre demande à été enregistrée!
Nous vous avons envoyés un email avec un lien de confirmation.
Après confirmation votre demande sera tranférée au avocat!
'; } else { - $msg .= '
Erreur! quelque chose n\'a pas bien fonctionnée!
'; + $msg = '
Erreur! quelque chose n\'a pas bien fonctionnée!
'; } } @@ -67,7 +67,7 @@ function rdv_changestatus($rdv){ from events ev left join users usr on (ev.id_user=usr.id) left join users cl on (ev.id_client=cl.id) where ev.clientuuid='".$db->secvalue($rdv["uuid"])."' or ev.useruuid='".$db->secvalue($rdv["uuid"])."'"; - // $msg .= "SQL 1: $sql
"; + $event = $db->dbquery($sql); $sql = ""; $newrdv = 0; @@ -89,7 +89,7 @@ function rdv_changestatus($rdv){ $sql = "UPDATE events SET user_status='canceled' where useruuid='".$rdv["uuid"]."'"; } } - // $msg .= "SQL 2: $sql
"; + if ($sql != ""){ $res = $db->dbexec($sql); if ($res !== false){ diff --git a/lib/processdata.php b/lib/processdata.php index f46944d..d9db952 100644 --- a/lib/processdata.php +++ b/lib/processdata.php @@ -74,18 +74,29 @@ function process_postdata($pdt){ } function process_getdata($gdt){ - global $baseurl,$p,$db,$user; + global $baseurl,$p,$db,$user,$sp; // print_r($gdt); if ($user != null){ if (isset($gdt["action"])){ switch ($gdt['action']){ case 'logout': - $db->dbexec("delete from usersession where sessionid='".$user["sessionid"]."';"); + $db->dbexec("delete from usersession where sessionid='".$user["sessionid"]."' and id_user=".$user["id"].";"); $user=array(); setcookie("juridig",""); $p='home'; break; - + case 'deleterdv': + $db->dbexec("delete from events where id='".$gdt["id"]."' and id_user='".$user["id"]."';"); + break; + case 'deletetimesheet': + $db->dbexec("delete from timesheets where id='".$gdt["id"]."' and id_user='".$user["id"]."';"); + break; + case 'block': + $db->dbexec("insert into userclients (id_client,id_user,clientblocked) VALUES ('".$gdt["clientid"]."','".$user["id"]."','1')"); + break; + case 'unblock': + $db->dbexec("delete from userclients WHERE id_client='".$gdt["clientid"]."' and id_user='".$user["id"]."'"); + break; } } diff --git a/phpinfo.php b/phpinfo.php deleted file mode 100644 index c9f5eeb..0000000 --- a/phpinfo.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/site.js b/site.js index ab3862d..a7ddfc2 100644 --- a/site.js +++ b/site.js @@ -23,31 +23,21 @@ $( document ).ready(function() { function handleFileSelect(evt) { - var files = evt.target.files; // FileList object + var files = evt.target.files; var utype = ""; if ($("form").attr('id') == "dksrdv_catalog"){ $("form").prepend(''); - - // Loop through the FileList and render image files as thumbnails. for (var i = 0, f; f = files[i]; i++) { - - // Only process image files. if (!f.type.match('image.*')) { continue; } - var reader = new FileReader(); - - // Closure to capture the file information. reader.onload = (function(theFile) { return function(e) { $("#preview").attr("src",e.target.result); $("#"+utype+"photo").val(e.target.result); - //console.log($("#userphoto")); }; })(f); - - // Read in the image file as a data URL. reader.readAsDataURL(f); } } @@ -60,8 +50,6 @@ function removephoto(utype){ } } - - function initstandard(){ var forms = document.querySelectorAll('form.dks'); if (forms.length > 0){ @@ -75,7 +63,6 @@ function initstandard(){ tinymce.init({ selector: '.richeditarea', - //height: 300, branding: false, menubar:false, statusbar: false, @@ -88,7 +75,6 @@ function initstandard(){ function imsg(data){ var tmp = h1(data); - console.log(tmp); window.location.href=tmp; } diff --git a/tmpl/blocks/avocatsearch.php b/tmpl/blocks/avocatsearch.php index 4405eef..223e6ae 100644 --- a/tmpl/blocks/avocatsearch.php +++ b/tmpl/blocks/avocatsearch.php @@ -6,7 +6,7 @@ left join `catalog` cat on (usr.id=cat.id_user) where usr.usergroup in ('avocat') and usr.userblocked is null and usr.activationkey is null group by usr.id order by cat.company,cat.surname,cat.prename;"; $avocats = $db->dbqueryall($sql); - // echo "$sql"; + ?>
diff --git a/tmpl/javascript.php b/tmpl/javascript.php index d5d840d..43a6671 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/rendezvous/clientlist.php b/tmpl/pages/profile/rendezvous/clientlist.php index 72c914f..feabcb4 100644 --- a/tmpl/pages/profile/rendezvous/clientlist.php +++ b/tmpl/pages/profile/rendezvous/clientlist.php @@ -2,7 +2,7 @@ $sql = "select cl.id as id_client,ev.id_user,cl.usersurname,cl.userprename,cl.userphone,cl.useremail,case when uc.clientblocked=1 then 1 else 0 end as clientblocked,cl.userblocked as globalblocked from events ev left join users cl on (cl.id=ev.id_client) left join userclients uc on (uc.id_client=cl.id and uc.id_user=".$user['id'].") group by cl.id;"; - //echo $sql; + $tablelist = $db->dbqueryall($sql); ?> @@ -29,9 +29,9 @@ if ($row["globalblocked"] == "1"){ echo 'blocké par juridig.lu'; } else if ($row["clientblocked"] == "1"){ - echo ''; + echo ''; } else { - echo ''; + echo ''; } ?> @@ -42,4 +42,8 @@ ?> - \ No newline at end of file + + \ No newline at end of file diff --git a/tmpl/pages/profile/rendezvous/rendezvouslistold.php b/tmpl/pages/profile/rendezvous/rendezvouslistold.php index fcc6bcf..6a152df 100644 --- a/tmpl/pages/profile/rendezvous/rendezvouslistold.php +++ b/tmpl/pages/profile/rendezvous/rendezvouslistold.php @@ -64,7 +64,7 @@ $tablelist = $db->dbqueryall($sql); echo 'INCONNUE'; }; ?> - + -
@@ -63,14 +58,11 @@
\ No newline at end of file diff --git a/tmpl/pages/rendezvous.php b/tmpl/pages/rendezvous.php index a1524d2..ffe80b2 100644 --- a/tmpl/pages/rendezvous.php +++ b/tmpl/pages/rendezvous.php @@ -5,7 +5,7 @@ $selid = null; if (isset($_GET["id"]) && ($_GET['id'] != "")){ $selid = $_GET['id']; $sql = "SELECT usr.id,usr.userprename,usr.usersurname from users usr left join userservices srv on (usr.id=srv.id_user) where srv.service='rendezvous' and srv.expiration >= CURRENT_DATE and usr.id='".$_GET["id"]."';"; -// echo $sql; + $avosel = $db->dbquery($sql); } ?> diff --git a/tmpl/pages/rendezvousevent.php b/tmpl/pages/rendezvousevent.php index e9f4245..f5403f1 100644 --- a/tmpl/pages/rendezvousevent.php +++ b/tmpl/pages/rendezvousevent.php @@ -39,7 +39,7 @@
-
Votre Rendez-Vous
+
Votre Rendez-Vous
@@ -96,7 +96,7 @@ ?>
-
Votre Rendez-Vous
+
Votre Rendez-Vous
Votre Nom
@@ -123,7 +123,7 @@ echo 'INCONNUE'; }; ?>
Votre Nom
Tél. Client">
E-mail Client">