ready for 1st upload
authorKilian Saffran <ksaffran@dks.lu>
Tue, 19 Feb 2019 13:22:34 +0000 (14:22 +0100)
committerKilian Saffran <ksaffran@dks.lu>
Tue, 19 Feb 2019 13:22:34 +0000 (14:22 +0100)
20 files changed:
api.php
cfg.php [new file with mode: 0644]
dev/db/juridig_db.defaultdata.mysql.sql [new file with mode: 0644]
dev/db/juridig_db.schema.mysql.sql [new file with mode: 0644]
index.php
lib/database.php
lib/processdata.php
lib/sendemail.php
style.css
tmpl/navs/profile.php
tmpl/pages/avocats.php
tmpl/pages/home.php
tmpl/pages/profile/changepassword.php
tmpl/pages/profile/rendezvous/clientlist.php
tmpl/pages/profile/rendezvous/exception.php
tmpl/pages/profile/rendezvous/rendezvous.php
tmpl/pages/profile/rendezvous/rendezvouslist.php
tmpl/pages/profile/rendezvous/timesheet.php
tmpl/pages/profile/rendezvous/timesheetlist.php
tmpl/pages/rendezvous.php

diff --git a/api.php b/api.php
index c2666e4..e49ca16 100644 (file)
--- a/api.php
+++ b/api.php
@@ -5,7 +5,7 @@
     header('Content-Type: application/json');
     if (isset($_GET)){
         if (isset($_GET["action"]) && $_GET["action"] == "rdvday"){
-            $sql = "select hour_values,weekdays,option1_name,option1_values,option2_name,option2_values,option3_name,option3_values,option4_name,option4_values from wp_dksrdv_timesheets where id_user=".$_GET["id"]." and startdate <= CURRENT_DATE order by startdate DESC LIMIT 1;
+            $sql = "select hour_values,weekdays,option1_name,option1_values,option2_name,option2_values,option3_name,option3_values,option4_name,option4_values from timesheets where id_user=".$_GET["id"]." and startdate <= CURRENT_DATE order by startdate DESC LIMIT 1;
             ";
             $timesheet = $db->dbquery($sql);
             $allweek = array('1','2','3','4','5','6','0');
diff --git a/cfg.php b/cfg.php
new file mode 100644 (file)
index 0000000..4bd0867
--- /dev/null
+++ b/cfg.php
@@ -0,0 +1,11 @@
+<?php
+#$baseurl ="/juridig";
+$baseurl ="/";
+$dbcfg = array(
+    "dbhost" => "sql615.your-server.de",
+    //"dbhost" => "localhost",
+    "dbname" => "juridig_db",
+    "dbuser" => "juridig",
+    "dbpwd" => "fnx4HYwYCKRNR694"
+);
+?>
\ No newline at end of file
diff --git a/dev/db/juridig_db.defaultdata.mysql.sql b/dev/db/juridig_db.defaultdata.mysql.sql
new file mode 100644 (file)
index 0000000..d0d9f9e
--- /dev/null
@@ -0,0 +1,19 @@
+LOCK TABLES `emailtemplates` WRITE;
+INSERT INTO `emailtemplates` VALUES (1,'user_registration_confirmation','Bonjour %%userprename%% %%usersurname%%,<br/>\r\n<br/>\r\nMerci pour votre création de compte sur juridig.lu,\r\n<br/><br/>\r\nvotre code d\'activation: <b>%%activationcode%%</b><br/>\r\n<br/>\r\nMeilleurs salutations,<br/>\r\n<br/>\r\nJuridig.lu Support Team','select userprename,usersurname from users where id=\'%%id%%\';','support@dks.lu','Confirmation requis pour votre création de compte sur juridig.lu'),
+(2,'client_registration_confirmation','Bonjour %%clientprename%% %%clientsurname%%,<br/>\r\n<br/>\r\nMerci pour votre création de compte sur juridig.lu,\r\n<br/><br/>\r\nPour confirmer et activer votre compte nous vous prions de\r\nclicker sur le liens ci dessous.<br/><br/>\r\n\r\n<a href=\"%%activationlink%%\">Confimer l\'activation</a>\r\n\r\nsi c\'étais pas vous, nous vous prions de clicker sur le liens ci-dessous pour que nous pouvons bloquer, respectivement supprimer les coordonnées de cette addresse de juridig.lu!<br/>\r\n\r\n<a href=\"%%revocationlink%%\">Refuser l\'activation</a>\r\n\r\nMeilleurs salutations,\r\n\r\nJuridig.lu Support Team','select * from clients where clientemail=\'%%clientemail%%\';','support@dks.lu','Confirmation requis pour votre création de compte sur juridig.lu'),
+(3,'user_invoice',NULL,NULL,'support@dks.lu',NULL),
+(4,'user_expiration_notice',NULL,NULL,'support@dks.lu',NULL),
+(5,'client_rendezvous_confirmation',NULL,NULL,'support@dks.lu',NULL),
+(6,'client_rendezvous_status_change',NULL,NULL,'support@dks.lu',NULL),
+(7,'user_rendezvous',NULL,NULL,'support@dks.lu',NULL),
+(8,'user_rendezvous_status_change',NULL,NULL,'support@dks.lu',NULL),
+(9,'user_forgotpasswd','Bonjour %%userprename%% %%usersurname%%,<br/><br/>\r\n\r\nvous avez demandé un nouveau mot de passe via juridig.lu,\r\n\r\n<u>nouveau mot de passe</u>: %%newpassword%%<br/><br/>\r\n\r\nvotre Equipe de jurique.lu\r\n\r\n\r\n\r\n','select userprename,usersurname from users where id=\'%%id%%\';','support@dks.lu','Nouveau mot de passe pour le site juridig.lu');
+UNLOCK TABLES;
+
+
+LOCK TABLES `users` WRITE;
+INSERT INTO `users` VALUES (1,'Kilian','Saffran','ksaffran@dks.lu','+352 691 504 574','4,rue Principale','3770','Tétange',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'rendezvous',NULL,1,NULL,'e32fcfd9a94184555236bcbc94169316','administrator','2019-02-06 17:40:39',NULL),
+(10,'Kilian','Saffran','kilian@saffran.lu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'HP62CLCg',NULL,NULL,'ed59000e1c6cd4dbddfb298b57fa3bcd','client','2019-02-12 15:35:28',NULL);
+
+UNLOCK TABLES;
+
diff --git a/dev/db/juridig_db.schema.mysql.sql b/dev/db/juridig_db.schema.mysql.sql
new file mode 100644 (file)
index 0000000..8768664
--- /dev/null
@@ -0,0 +1,97 @@
+CREATE TABLE `emailtemplates` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `ident` varchar(255) DEFAULT NULL,
+  `emailtext` longtext,
+  `emaildatasql` longtext,
+  `from` longtext,
+  `mailsubject` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE `events` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `id_user` bigint(20) DEFAULT NULL,
+  `id_client` bigint(20) DEFAULT NULL,
+  `eventdate` date DEFAULT NULL,
+  `eventoptions` longtext,
+  `eventstarttime` time DEFAULT NULL,
+  `eventendtime` time DEFAULT NULL,
+  `eventuuid` varchar(255) DEFAULT NULL,
+  `eventhour` varchar(255) DEFAULT NULL,
+  `user_status` varchar(255) DEFAULT NULL,
+  `client_status` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE `exceptions` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `id_user` bigint(20) DEFAULT NULL,
+  `startdate` date DEFAULT NULL,
+  `enddate` date DEFAULT NULL,
+  `hour_values` longtext,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE `timesheets` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `id_user` bigint(20) DEFAULT NULL,
+  `startdate` date DEFAULT NULL,
+  `hour_values` longtext,
+  `weekdays` varchar(255) DEFAULT NULL,
+  `option1_name` varchar(255) DEFAULT NULL,
+  `option1_values` longtext,
+  `option2_name` varchar(255) DEFAULT NULL,
+  `option2_values` longtext,
+  `option3_name` varchar(255) DEFAULT NULL,
+  `option3_values` longtext,
+  `option4_name` varchar(255) DEFAULT NULL,
+  `option4_values` longtext,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE `userclients` (
+  `id_client` bigint(20) DEFAULT NULL,
+  `id_user` bigint(20) DEFAULT NULL,
+  `clientblocked` tinyint(4) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE `users` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `usersurname` varchar(255) DEFAULT NULL,
+  `userprename` varchar(255) DEFAULT NULL,
+  `useremail` varchar(255) DEFAULT NULL,
+  `userphone` varchar(255) DEFAULT NULL,
+  `useraddress` varchar(255) DEFAULT NULL,
+  `userzip` varchar(255) DEFAULT NULL,
+  `usercity` varchar(255) DEFAULT NULL,
+  `userspecialisations` longtext,
+  `userdescription` longtext,
+  `consultmon` varchar(255) DEFAULT NULL,
+  `consulttue` varchar(255) DEFAULT NULL,
+  `consultwed` varchar(255) DEFAULT NULL,
+  `consultthu` varchar(255) DEFAULT NULL,
+  `consultfri` varchar(255) DEFAULT NULL,
+  `consultsat` varchar(255) DEFAULT NULL,
+  `consultsun` varchar(255) DEFAULT NULL,
+  `userblocked` tinyint(4) DEFAULT NULL,
+  `servicesexpiration` date DEFAULT NULL,
+  `services` longtext,
+  `activationkey` varchar(255) DEFAULT NULL,
+  `id_user` bigint(20) DEFAULT NULL,
+  `usercompany` varchar(255) DEFAULT NULL,
+  `md5pwd` varchar(512) DEFAULT NULL,
+  `usergroup` varchar(255) DEFAULT NULL,
+  `created` datetime DEFAULT CURRENT_TIMESTAMP,
+  `userprice` decimal(10,0) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE `usersession` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `sessionid` varchar(255) NOT NULL,
+  `id_user` bigint(20) DEFAULT NULL,
+  `lastlogin` datetime DEFAULT CURRENT_TIMESTAMP,
+  `useragent` varchar(500) DEFAULT NULL,
+  `remoteaddr` varchar(50) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
index fbe0296..94e073f 100644 (file)
--- a/index.php
+++ b/index.php
@@ -4,9 +4,9 @@
   $p = "home";
   $sp= array();
   $msg = null;
-  $baseurl="/juridig_next";
+  //$baseurl="/";
   $user = null;
-
+  include ('cfg.php');
   include ('lib/database.php');
   include ('lib/processdata.php');
   include ('lib/sendemail.php');
@@ -20,6 +20,7 @@
     $user = getsessiondata($_COOKIE["juridig"]);
     
   }
+  
   if (isset($_GET["p"])){
     $sp = explode("/",$_GET["p"]);
     $p = $sp[0];
index 830ed4e..cde58f4 100644 (file)
@@ -3,9 +3,11 @@
 class dksdb {
     public $link;
     public function connect() {
+                       global $dbcfg;
                $dbh = null;
                try {
-                       $dbh = new PDO('mysql:host=localhost;dbname=wp_dksalu_db2', 'wp_dksalu_2', 'F9Za8LXy7Rp4GBdn');
+                       $dbh = new PDO('mysql:host='.$dbcfg["dbhost"].';dbname='.$dbcfg["dbname"], $dbcfg["dbuser"], $dbcfg["dbpwd"]);
+                       //$dbh = new PDO('mysql:host=localhost;dbname=juridig_db', 'juridig', 'fnx4HYwYCKRNR694');
                $this->link = $dbh;
                    $this->link->query("SET NAMES 'utf8'");
            } catch (PDOException $e) {
index b2f4f4b..01c2a5c 100644 (file)
@@ -1,19 +1,19 @@
 <?php
-    function process_postdata($pdt){
+    function process_postdata($pdt,$user){
         global $user;
         $submittype="";
-        // print_r($pdt);
+        
         foreach ( $pdt as $k => $value){
             //echo "$k<br/>";
             if (substr($k, 0, 7) === 'submit_' ){
                 $submittype=$k;
             } 
         }
-        //echo "<pre>Submit type:".$submittype."</pre>";
+        unset($pdt[$submittype]);
         if ($user){
             switch ($submittype){
                 case 'submit_password':
-                    
+                    save_data('users',$pdt);
                     break;
                 case 'submit_user':
     
@@ -31,7 +31,7 @@
     
                     break;
                 case 'submit_profile':
-    
+                    save_data('users',$pdt);
                     break;
                 case 'submit_rendezvous':
     
                     break;
             }
         }
-        
-             
         return;
     }
 
     function register_user($pdt){
         global $db,$msg,$p;
         //do we have already an account for this user?
-        $haveuser = $db->dbquery("SELECT count(*) as cnt FROM wp_dksrdv_users WHERE useremail='".$pdt["useremail"]."';");
+        $haveuser = $db->dbquery("SELECT count(*) as cnt FROM users WHERE useremail='".$pdt["useremail"]."';");
         if ($haveuser["cnt"] > 0){
             $msg = '<div class="alert alert-danger">Un utilisateur '.$pdt["useremail"].' existe déjà!</div>';
             return;
@@ -81,9 +79,9 @@
             $pdt["usergroup"] = "admin";
         }
         $pdt["aktivationcode"] = generateRandomString(8);
-        $sql2 = " INSERT INTO wp_dksrdv_users (usersurname, userprename, useremail, md5pwd,usergroup,activationkey) VALUES ('".$pdt["usersurname"]."','".$pdt["userprename"]."','".$pdt["useremail"]."',md5('".$pdt["userpassword"]."'),'".$pdt["usergroup"]."','".$pdt["aktivationcode"]."');";
+        $sql2 = " INSERT INTO users (usersurname, userprename, useremail, md5pwd,usergroup,activationkey) VALUES ('".$pdt["usersurname"]."','".$pdt["userprename"]."','".$pdt["useremail"]."',md5('".$pdt["userpassword"]."'),'".$pdt["usergroup"]."','".$pdt["aktivationcode"]."');";
         $db->dbexec($sql2);
-        $sql3 = "select id,useremail as email,activationkey as activationcode from wp_dksrdv_users where useremail='".$pdt["useremail"]."';";
+        $sql3 = "select id,useremail as email,activationkey as activationcode from users where useremail='".$pdt["useremail"]."';";
         $mdata = $db->dbquery($sql3);
         $send = sendemail('user_registration_confirmation',$mdata);
         if ($send == 0){
         global $db,$msg,$p,$sp;
         $email = $db->secvalue($email);
         $akey = $db->secvalue($akey);
-        $hasuser = $db->dbquery("select * from wp_dksrdv_users where useremail='".$email."' and activationkey='".$akey."'");
+        $hasuser = $db->dbquery("select * from users where useremail='".$email."' and activationkey='".$akey."'");
         if (count($hasuser) > 0){
-        $hasuser = $db->dbquery("select * from wp_dksrdv_users where useremail='".$email."' and activationkey='".$akey."'");
-          $db->dbexec("update wp_dksrdv_users set activationkey=null where useremail='".$email."' and activationkey='".$akey."'");
+        $hasuser = $db->dbquery("select * from users where useremail='".$email."' and activationkey='".$akey."'");
+          $db->dbexec("update users set activationkey=null where useremail='".$email."' and activationkey='".$akey."'");
           $msg = '<div class="alert alert-success">le compte a été activé!</div>';
           $p = 'profile';
           $sp = array('profile');
     function sendnewpassword($email){
         global $db,$msg;
         $email = $db->secvalue($email);
-        $sql = "select id,useremail from wp_dksrdv_users where useremail='".$email."';";
+        $sql = "select id,useremail from users where useremail='".$email."';";
         $tmpuser = $db->dbquery($sql);
         if (count($tmpuser) > 0){
             $newpasswd = randomPassword(10,'lower_case,upper_case,numbers,special_symbols');
-            $sql2 = "UPDATE wp_dksrdv_users SET md5pwd='md5(".$newpasswd.")' WHERE useremail='".$email."';";
+            $sql2 = "UPDATE users SET md5pwd='md5(".$newpasswd.")' WHERE useremail='".$email."';";
             $db->dbexec($sql2);
             $send = sendemail('user_forgotpasswd',array("email" => $email, "newpassword" => $newpasswd,"id" => $tmpuser["id"]));
             if ($send == 0){
 
     function checklogin($user,$passwd){
         global $db;
-        $sql = "select * from wp_dksrdv_users where useremail='".$db->secvalue($user)."' and md5pwd=md5('".$db->secvalue($passwd)."');"; 
+        $sql = "select * from users where useremail='".$db->secvalue($user)."' and md5pwd=md5('".$db->secvalue($passwd)."');"; 
        
         $user = $db->dbquery($sql);
    
         $sid = null;
         if (count($user) > 0){
             $sid = generateRandomString();
-            $sql = "INSERT INTO wp_dksalu_db2.usersession (sessionid, id_user, lastlogin, useragent, remoteaddr)
+            $sql = "INSERT INTO usersession (sessionid, id_user, lastlogin, useragent, remoteaddr)
             VALUES('".$sid."', ".$user['id'].", CURRENT_TIMESTAMP, '".$_SERVER['HTTP_USER_AGENT']."', '".$_SERVER['REMOTE_ADDR']."');";
             $db->dbexec($sql);
             setcookie("juridig",$sid);
 
     function getsessiondata($sessid){
         global $db;
-        $user = $db->dbquery("SELECT us.* from usersession ses LEFT JOIN wp_dksrdv_users us on (ses.id_user=us.id) where ses.sessionid='".$sessid."';");
+        $user = $db->dbquery("SELECT us.* from usersession ses LEFT JOIN users us on (ses.id_user=us.id) where ses.sessionid='".$sessid."';");
         return $user;
     }
 
          
         return $password; 
     }
+
+    function save_data($dbtable,$data){
+        global $db,$msg;
+        
+        $type = "ins";
+        $sql ="";
+        if ($data['id'] && $data['id'] != ""){
+            $type = "upd";
+        }
+        if ($type == "ins"){
+            $sql1 = array();
+            $sql2 = array();
+            foreach($data as $col => $val){
+                array_push($sql1,$col);
+                if ($val == ""){
+                    array_push($sql2,'null');
+                } else {
+                    array_push($sql2,"'".$db->secvalue($val)."'");
+                }
+                
+            }
+            $sql = "INSERT INTO $dbtable (".join(",",$sql1).") VALUES (".join(",",$sql2).");";
+        } else if ($type == "upd"){
+            $sql1 = array();
+            $data['id'] = $db->secvalue($data['id']);
+            foreach($data as $col => $val){
+                if ($col == 'id'){ continue;}
+                $scval = 'null';
+                if ($val != ""){
+                    $scval = "'".$db->secvalue($val)."'";
+                }
+                array_push($sql1,$col."=".$scval);
+                
+            }
+            $sql = "UPDATE $dbtable SET ".join(",",$sql1)." WHERE id='".$data['id']."';";
+        }
+        echo '<pre style="color: red;">'.$sql.'</pre>';
+        $rows = $db->dbexec($sql);
+        $msg = '<div class="alert alert-success">Les données ont été sauvegardés!</div>';
+        
+        
+        return $rows;
+    }
 ?>
\ No newline at end of file
index 4bdf849..18b5721 100644 (file)
@@ -5,7 +5,7 @@
         $body = "";
         $subject = "";
         $maildata = array();
-        $tmpl = $db->dbquery("select * from wp_dksrdv_emailtemplates where ident='".$template."';");
+        $tmpl = $db->dbquery("select * from emailtemplates where ident='".$template."';");
         //print_r($tmpl);        if (count($tmpl) > 0){
             $datasql = $tmpl['emaildatasql'];
             foreach ($data as $key => $value){
index d0b1058..53cac4c 100644 (file)
--- a/style.css
+++ b/style.css
@@ -12,7 +12,7 @@ main {
 
 .sidebar {
   background: #343a40 !important;
-  min-height: 80vh;
+  /* min-height: 80vh; */
 }
 
 .sidebar > .dropdown-item {
index 0976f86..28794ac 100644 (file)
@@ -4,7 +4,7 @@
   <div class="navbar-collapse">
 
     <ul class="navbar-nav mr-auto" id="menu-navigationmenu">
-      <li class="nav-item" ><a class="nav-link" href="<?php echo $baseurl; ?>/avocats">Annulaire des avocats</a>
+      <li class="nav-item" ><a class="nav-link" href="<?php echo $baseurl; ?>/avocats">Annuaire des avocats</a>
 
     </ul>
 
index abc3fdb..c27447a 100644 (file)
@@ -1,27 +1,28 @@
 <?php
-  $sql = "SELECT * from wp_dksrdv_users where usergroup in ('administrator','avocat');";
+  $sql = "SELECT * from users where usergroup in ('administrator','avocat');";
   $avocats = $db->dbqueryall($sql);
   if ($avocats){
 ?>
 <div class="row justify-content-center">
-<h1>Annulaire des avocats au Luxembourg</h1>
+<h1>Annuaire des avocats au Luxembourg</h1>
 </div>
 <div class="row justify-content-center">
-<div class="card" style="width: 100%;">
-  <div class="card-header">
-    Recherche rapide:
-  </div>
-  <div class="form-inline">
-    <input class="form-control" style="width: 90%;" type="text"><button class="btn btn-primary">Rechercher</button>
+
+<div class="col-sm-6" style="width: 100%;">
+  <div class="input-group">
+    <input class="form-control"  type="text" aria-label="Recipient's username" aria-describedby="button-search">
+    <div class="input-group-append">
+    <button class="btn btn-outline-primary" type="button" id="button-search">Rechercher</button>
+    </div>
   </div>
 </div>
-</div>
 
 <?php
 foreach ($avocats as $avo) {
   //print_r($avo);
+  
   echo '<div class="col-sm-12" style="margin-bottom: 10px;"><div class="card ">
-  <div class="card-header">'.$avo['usersurname'].' '.$avo['userprename'].' '.(($avo['usercompany'] != "")?'<small>'.$avo['usercompany'].'</small>':'').'</div>
+  <div class="card-header">'.$avo['usersurname'].' '.$avo['userprename'].' '.(($avo['usercompany'] != "")?'<small style="font-weight: bold;">('.$avo['usercompany'].')</small>':'').'</div>
   <div class="card-body">
     <div class="row">
     <div class="col-sm-3">
@@ -35,20 +36,22 @@ foreach ($avocats as $avo) {
       <i class="fas fa-at"></i>: <a a href="mailto://'.(($avo['useremail'] != "")?$avo['useremail']:'').'">'.(($avo['useremail'] != "")?$avo['useremail']:'').'</a>
     </div>
     <div class="col-sm-3">
-      <h4>Heures de consultation</h4>'.(($avo['consultmon'] != "")?'Lundi: '.$avo['consultmon'].'<br>':'')
-      .(($avo['consulttue'] != "")?'Mardi: '.$avo['consulttue'].'<br>':'')
-      .(($avo['consultwed'] != "")?'Mercredi: '.$avo['consultwed'].'<br>':'')
-      .(($avo['consultthu'] != "")?'Jeudi: '.$avo['consultthu'].'<br>':'')
-      .(($avo['consultfri'] != "")?'Vendredi: '.$avo['consultfri'].'<br>':'')
-      .(($avo['consultsat'] != "")?'Vendredi: '.$avo['consultsat'].'<br>':'')
-      .(($avo['consultsun'] != "")?'Vendredi: '.$avo['consultsun'].'<br>':'').
+      <h4>Heures de consultation</h4>'.(($avo['consultmon'] != "")?'<label style="font-weight: bold; width: 80px; margin-bottom: 0px;">Lundi:</label>'.$avo['consultmon'].'<br>':'')
+      .(($avo['consulttue'] != "")?'<label style="font-weight: bold; width: 80px; margin-bottom: 0px;">Mardi:</label>'.$avo['consulttue'].'<br>':'')
+      .(($avo['consultwed'] != "")?'<label style="font-weight: bold; width: 80px; margin-bottom: 0px;">Mercredi:</label>'.$avo['consultwed'].'<br>':'')
+      .(($avo['consultthu'] != "")?'<label style="font-weight: bold; width: 80px; margin-bottom: 0px;">Jeudi:</label>'.$avo['consultthu'].'<br>':'')
+      .(($avo['consultfri'] != "")?'<label style="font-weight: bold; width: 80px; margin-bottom: 0px;">Vendredi:</label>'.$avo['consultfri'].'<br>':'')
+      .(($avo['consultsat'] != "")?'<label style="font-weight: bold; width: 80px; margin-bottom: 0px;">Samedi:</label>'.$avo['consultsat'].'<br>':'')
+      .(($avo['consultsun'] != "")?'<label style="font-weight: bold; width: 80px; margin-bottom: 0px;">Dimanche:</label>'.$avo['consultsun'].'<br>':'').
     '</div>
-    <div class="col-sm-3">
-    <h4>Specialisation</h4>
-    <ul>
-    '.(($avo['userspecialisations'] != "")?'<li>'.join('</li><li>',$avo['userspecialisations']).'</li>':'').'
-    </ul>
-    </div>
+    <div class="col-sm-3">';
+    
+    if ($avo['userspecialisations'] != ""){
+      $spa = explode(',',$avo['userspecialisations']);
+      echo '<h4>Specialisation</h4>
+    <ul style="list-style: none;"><li>'.join('</li><li>',$spa).'</li></ul>';
+    }
+    echo '</div>
     </div>
     <p>'.(($avo['userdescription'] != "")?$avo['userdescription']:'').'</p>
   </div>';
index 3862f02..c0c5c5b 100644 (file)
@@ -15,7 +15,7 @@ adresse mail et n° de tél
 Vous</p>
 <h5>Option:</h5>
 <p>Créer un compte client pour gérer tous vos rendez-vous demnadés par juridig.lu</p>
-<a class="btn btn-secondary" href="">Création de compte client</a>
+<a class="btn btn-secondary" href="<?php echo $baseurl.'/register'; ?>">Création de compte client</a>
             </div>
         </div>
     </div>
@@ -23,7 +23,7 @@ Vous</p>
         <div class="card">
             <div class="card-header"><h4>Vous êtes avocat au Luxembourg?</h4></div>
             <div class="card-body">
-            <strong>Nos Applications gratiuites</strong>
+            <strong>Nos Applications gratuites</strong>
             <div class="row">
                 <div class="col-sm-12">
                 <div class="card">   
@@ -31,14 +31,14 @@ Vous</p>
                         <div class="row">
                         <div class="col-sm-3">
                         <img src="<?php echo $baseurl; ?>/img/apple-icon-57x57.png">
-                        <h6>Annulaire d'avocats</h6>
+                        <h6>Annuaire d'avocats du Luxembourg</h6>
                         </div>
                         <div class="col-sm-8">
                         <p class="card-text"<ul><strong>Incription gratuite!!!</strong>
                     <li>pour tous les avocats (avec l'adresse officielle (@barreau.lu) au Luxembourg!</li>
                     <li>l'inscription est requise pour être retrouvable dans le moteur de recherche de JuriDig</li>
                 </ul></p>
-                <a class="btn btn-secondary" href="">Création de compte d'avocat</a>
+                <a class="btn btn-secondary" href="<?php echo $baseurl.'/register'; ?>">Création de compte d'avocat</a>
                         </div>
                         </div>
                         </div>
index 6364b9e..24e2814 100644 (file)
@@ -1,5 +1,6 @@
 <form id="dksrdv_userpassword" name="dksrdv_userpassword" class="dks needs-validation" method="POST" novalidate>
   <div class="row">
+  <input type="hidden" id="id" name="id" value="<?php echo $user['id']; ?>" />
         <div class="col-sm-12"><h6>Nouveau mot de passe</h6></div>
   <div class="col-sm-4">
                             <div class="form-group">
index eb37cc8..2967c7b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
     $sql = "SELECT cl.id,case when cl.userblocked = 1 or ucl.clientblocked=1 then 1 else 0 end as clientblocked,
     cl.useremail,cl.userphone,cl.usersurname,cl.userprename 
-    from wp_dksrdv_users cl left join wp_dksrdv_userclients ucl on (cl.usergroup='client' and cl.id=ucl.id_client) where ucl.id_user=".$user['id'].";";
+    from users cl left join userclients ucl on (cl.usergroup='client' and cl.id=ucl.id_client) where ucl.id_user=".$user['id'].";";
     $tablelist = $db->dbqueryall($sql);
 ?>
 
index 701c944..7a172ab 100644 (file)
@@ -6,7 +6,7 @@
         'hour_values' => ''
     );
     if (isset($_GET['id']) && ($_GET['id'] != '')){
-        $sql = "select id, startdate, enddate, hourvalues from wp_dksrdv_exceptions where id=".$db->secvalue($_GET['id'])." and id_user=".$user['id'].";";
+        $sql = "select id, startdate, enddate, hourvalues from exceptions where id=".$db->secvalue($_GET['id'])." and id_user=".$user['id'].";";
         $dbexception= $db->dbquery($sql);
         if (count($dbexception) > 0){
                 $exception = $dbexception;
index b9eab99..80742db 100644 (file)
@@ -1,8 +1,8 @@
 <?php
     
-    $sql = "select ev.id,DATE_FORMAT(ev.eventdate,'%d.%m.%Y') as eventdate,ev.eventhour,ev.eventoptions,us.userprename,us.usersurname,ev.user_status,ev.client_status from wp_dksrdv_events ev LEFT JOIN wp_dksrdv_users usr on (ev.id_client=usr.id) where ev.id_user=".$user['id']." and ev.id='".$db->secvalue($_GET['id'])."';";
+    $sql = "select ev.id,DATE_FORMAT(ev.eventdate,'%d.%m.%Y') as eventdate,ev.eventhour,ev.eventoptions,us.userprename,us.usersurname,ev.user_status,ev.client_status from events ev LEFT JOIN users usr on (ev.id_client=usr.id) where ev.id_user=".$user['id']." and ev.id='".$db->secvalue($_GET['id'])."';";
     if ($user['usergroup'] == 'client'){
-        $sql = "select ev.id,DATE_FORMAT(ev.eventdate,'%d.%m.%Y') as eventdate,ev.eventhour,us.userprename,us.usersurname,ev.user_status,ev.client_status from wp_dksrdv_events ev LEFT JOIN wp_dksrdv_users usr on (ev.id_user=usr.id) where ev.id_user=".$user['id']." and ev.id='".$db->secvalue($_GET['id'])."';";
+        $sql = "select ev.id,DATE_FORMAT(ev.eventdate,'%d.%m.%Y') as eventdate,ev.eventhour,us.userprename,us.usersurname,ev.user_status,ev.client_status from events ev LEFT JOIN users usr on (ev.id_user=usr.id) where ev.id_user=".$user['id']." and ev.id='".$db->secvalue($_GET['id'])."';";
     }
     $dbrendezvous= $db->dbquery($sql);
         if (count($dbrendezvous) == 0){
index d539473..3a4f4e5 100644 (file)
@@ -1,7 +1,7 @@
 <?php
-$sql = "select ev.id,DATE_FORMAT(ev.eventdate,'%d.%m.%Y') as eventdate,ev.eventhour,ev.eventoptions,us.userprename,us.usersurname,ev.user_status,ev.client_status from wp_dksrdv_events ev LEFT JOIN wp_dksrdv_users usr on (ev.id_client=usr.id) where ev.id_user=".$user['id'].";";
+$sql = "select ev.id,DATE_FORMAT(ev.eventdate,'%d.%m.%Y') as eventdate,ev.eventhour,ev.eventoptions,us.userprename,us.usersurname,ev.user_status,ev.client_status from events ev LEFT JOIN users usr on (ev.id_client=usr.id) where ev.id_user=".$user['id'].";";
 if ($user['usergroup'] == 'client'){
-    $sql = "select ev.id,DATE_FORMAT(ev.eventdate,'%d.%m.%Y') as eventdate,ev.eventhour,us.userprename,us.usersurname,ev.user_status,ev.client_status from wp_dksrdv_events ev LEFT JOIN wp_dksrdv_users usr on (ev.id_user=usr.id) where ev.id_user=".$user['id'].";";
+    $sql = "select ev.id,DATE_FORMAT(ev.eventdate,'%d.%m.%Y') as eventdate,ev.eventhour,us.userprename,us.usersurname,ev.user_status,ev.client_status from events ev LEFT JOIN users usr on (ev.id_user=usr.id) where ev.id_user=".$user['id'].";";
 }
 $tablelist = $db->dbqueryall($sql);
 ?>
index fcfa228..638e213 100644 (file)
@@ -29,7 +29,7 @@
                 case when Position('6' in weekdays) > 0 then 'checked' else '' end as checkedsat, 
                 case when Position('0' in weekdays) > 0 then 'checked' else '' end as checkedsun,
                 option1_name, option1_values, option2_name, option2_values, option3_name, option3_values, option4_name, option4_values
-                from wp_dksrdv_timesheets where id=".$db->secvalue($_GET['id'])." and id_user=".$user['id'].";";
+                from timesheets where id=".$db->secvalue($_GET['id'])." and id_user=".$user['id'].";";
                 $dbtimesheet = $db->dbquery($sql);
                 if (count($dbtimesheet) > 0){
                         $timesheet = $dbtimesheet;
index ea13b7f..a9fd0d6 100644 (file)
@@ -5,7 +5,7 @@
  ts.option2_name,ts.option2_values,
  ts.option3_name,ts.option3_values, 
  ts.option4_name,ts.option4_values
- FROM wp_dksrdv_timesheets ts left join wp_users wu on (ts.id_user=wu.id) and ts.id_user=".$user['id'].";";
+ FROM timesheets ts left join wp_users wu on (ts.id_user=wu.id) and ts.id_user=".$user['id'].";";
  $tablelist = $db->dbqueryall($sql);
 ?>
 <h5>Mes Horaires</h5>
index db3736e..b98fa0f 100644 (file)
@@ -3,12 +3,12 @@
 $avolist = array();
 $selid = null;
 if (isset($_GET["id"]) && ($_GET['id'] != "")){
-//     $sql = "SELECT * from wp_dksrdv_users where id=".$db->secvalue($_GET['id'])." and usergroup in ('administrator','avocat');";
-//    // $sql = "SELECT * from wp_dksrdv_users where usergroup in ('administrator','avocat');";
+//     $sql = "SELECT * from users where id=".$db->secvalue($_GET['id'])." and usergroup in ('administrator','avocat');";
+//    // $sql = "SELECT * from users where usergroup in ('administrator','avocat');";
 //     $avocat = $db->dbquery($sql);
 $selid = $_GET['id'];
 }
-$sql = "SELECT id,userprename,usersurname,usercompany from wp_dksrdv_users where usergroup in ('administrator','avocat') and services LIKE '%rendezvous%';";
+$sql = "SELECT id,userprename,usersurname,usercompany from users where usergroup in ('administrator','avocat') and services LIKE '%rendezvous%';";
 $avolist = $db->dbqueryall($sql);
 
 ?>