function MessageGetInfo($idMessage) { $query = "SELECT * FROM `message` WHERE `idMessage`='{$idMessage}';"; $result = QueryExcuteWhile($query); $o = mysqli_fetch_object($result); return $o; }
function MessageDestinationGetList() { $idUser = $_SESSION['user_id']; $query = "SELECT `idUser`, `FamilyName`, `FirstName` FROM `users` WHERE `idUser`<>'{$idUser}' "; $result = QueryExcuteWhile($query); while ($o = mysqli_fetch_object($result)) { echo ' <option value="' . $o->idUser . '">' . $o->FamilyName . ' ' . $o->FirstName . '</option> '; } }
function LogExport() { global $URL; $Timestamp_Log = date("Ymd_His"); $result = QueryExcuteWhile("SELECT * FROM `logsystem`"); while ($o = mysqli_fetch_object($result)) { if ($o) { file_put_contents('./' . $Timestamp_Log . '.txt', $o->idLog . ' ' . $o->Timestamp . ' ' . $o->idUser . ' ' . $o->Description . "\n", FILE_APPEND); QueryExcute('', 'TRUNCATE `logsystem`;'); } } Redirect('log/index'); }
function ClientGetList() { $q = "SELECT * FROM client"; $r = QueryExcuteWhile($q); while ($o = mysqli_fetch_object($r)) { echo ' <tr class="odd gradeX" id="tr" onclick="document.location=\'client?id=' . $o->idClient . '\'"> <td></td> <td>' . $o->idClient . '</td> <td class="hidden-phone">' . $o->FamilyName . ' ' . $o->FirstName . '</td> <td class="hidden-phone">' . $o->Phone . '</td> </tr> '; } }
function LogRead() { $result = QueryExcuteWhile("SELECT * FROM `logsystem` ORDER BY idLog DESC"); while ($o = mysqli_fetch_object($result)) { echo ' <tr class="odd gradeX"> <th><input type="checkbox" class="group-checkable"/></th> <th>' . $o->idLog . '</th> <th><a href="ili-users/user_profil?id=' . $o->idUser . '">' . $o->idUser . '</a></th> <th class="hidden-phone">' . $o->Description . '</th> <th class="center hidden-phone">' . $o->Timestamp . '</th> </tr> '; } }
function ClientGetListSearch() { global $URL; $q = "SELECT * FROM client"; $r = QueryExcuteWhile($q); while ($o = mysqli_fetch_object($r)) { echo ' <tr id="tr" onclick="document.location=\'' . $URL . 'ili-modules/contrat/add/add?clt=' . $o->idClient . '\'"> <td><input type="checkbox" class="checkboxes" value="1" /></td> <td>' . $o->idClient . '</td> <td class="hidden-phone">' . $o->FamilyName . ' ' . $o->FirstName . '</td> <td class="hidden-phone">' . $o->Phone . '</td> </tr> '; } }
function MessageGetAll() { global $URL; $idUser = $_SESSION['user_id']; $q = "SELECT * FROM `message`\n\t\t\tWHERE\n\t\t\t(`FromUser`='{$idUser}' OR `ToUser`='{$idUser}')\n\t\t\tORDER BY `idMessage` DESC limit 5;"; $r = QueryExcuteWhile($q); while ($o = mysqli_fetch_object($r)) { $info_user = UserGetInfo($o->FromUser); $idMessage = $o->idMessage; $q1 = "SELECT * FROM `message`, `discussion`\n\t\t\tWHERE\n\t\t\t`discussion`.`idMessage`=`message`.`idMessage`\n\t\t\tAND\n\t\t\t`message`.`idMessage`='{$idMessage}'\n\t\t\tAND\n\t\t\t`idDiscussion`=(SELECT MAX(`idDiscussion`) FROM `discussion`)\n\t\t\t;"; $o1 = QueryExcute("mysqli_num_rows", $q1); if ($o1 >= '1') { $rx = QueryExcuteWhile($q1); $ox = mysqli_fetch_object($rx); } if ($o1 >= '1') { $idDiscussion = $ox->idDiscussion; } else { $idDiscussion = ''; } echo ' <tr> <td></td> <td> <a href="' . $URL . 'ili-users/user_profil?id=' . $o->FromUser . '">' . $info_user->FamilyName . ' ' . $info_user->FirstName . '</a> </td> <td class="hidden-phone"> <strong> <a href="' . $URL . 'ili-messages/read?id=' . $idMessage . '&id2=' . $idDiscussion . '">' . $o->Subject . '</a> </strong> </td> <td class="hidden-phone">'; if ($o1 >= '1') { MessageStatus($ox->idMessage, $idDiscussion); } else { MessageStatus($o->idMessage, ''); } MessageStatusChekIfLocked($o->idMessage); echo ' </td> <td class="hidden-phone">'; if ($o1 >= '1') { DateDifference($ox->TimeStamp); } else { DateDifference($o->TimeStamp); } echo ' </td> </tr> '; } }
function DebitChart() { $i = 0; $j = 0; for ($i = 01; $i <= 31; $i++) { if ($i < 10) { $date = '0' . $i . date("-m-Y"); } else { $date = date("Y-m-") . $i; } $r = QueryExcuteWhile("SELECT SUM(`Amount`) FROM `payment` WHERE `EncashmentDate`='{$date}' AND `Amount` < 0"); while ($o = mysqli_fetch_array($r)) { echo '[' . $i . ', '; if ($o[0]) { echo -$o[0] . '],'; } else { echo '0],'; } } } }
function ListContractRenew() { global $URL; $sql = "\n\tSELECT `insurancecontract`.`idContract`, `FirstName`, `FamilyName`, `TypeContract`, `KindContract`, MAX(`StartDate`), MAX(`EndDate`), `Amount`, `idCycle`,`client`.`idClient`\n\t \n\t FROM `insurancecontract`,`contractcycle`,`payment`,`client`\n\t \n\t WHERE `client`.`idClient`=`insurancecontract`.`idClient`\n\t\t AND\n\t `contractcycle`.`idContract`=`insurancecontract`.`idContract`\n\t\t AND \n\t `payment`.`idPayment`=`contractcycle`.`idPayment`\n AND\n `insurancecontract`.`KindContract`='Renouvelable'\n\tGROUP BY `insurancecontract`.`idContract`\n\t"; $result = QueryExcuteWhile($sql); while ($o = mysqli_fetch_array($result)) { $idContract = $o[0]; echo ' <tr id="tr" onclick="document.location=\'' . $URL . 'ili-modules/contrat/renew/renew?id=' . $o[0] . '\'"> <td>' . $o[0] . '</td> <td>' . $o[2] . ' ' . $o[1] . '</td> <td>' . $o[3] . '</td> <td>' . $o[5] . '</td> <td>' . $o[6] . '</td> <td>'; ExpireIn($o[6]); echo '</td> </tr> '; } }
function NotifGetAllNonSeen() { $idUser = $_SESSION['user_id']; $query = "SELECT * FROM `notificationsystem` WHERE `idUser`='{$idUser}' AND `Seen`='0' ORDER BY `idNotification` DESC LIMIT 3 "; $result = QueryExcuteWhile($query); if (mysqli_num_rows($result) > '0') { echo '<ul class="dropdown-menu extended notification">'; } while ($o = mysqli_fetch_object($result)) { echo ' <li> ' . $o->Description . ' <span class="small italic" style="margin-left:4%"><br>'; DateDifference($o->Timestamp); echo ' <br> <form action="" method="post" style="margin-bottom:-3%;margin-top:-10%;"> <input type="submit" value="Vu?" style="text-decoration:none;border:0;background:none;float:right; margin-left:10px;color:#22878E;line-height: 100%;font-size:12px;margin-top:5px;"/> <input type="hidden" name="vu" value="' . $o->idNotification . '"> </form> </span> </a> </li> '; } if (mysqli_num_rows($result) > '0') { echo ' <li> <form action="" method="post"> <input type="hidden" name="vu_tous" value="' . $idUser . '"> <center><input type="submit" value="Marquer tous comme Vus?" style="border:none;background: none;line-height: 100%;color:#22878E;font-size:12px;margin-bottom:0px;margin-top:15px;"></center> </form> </li> '; echo '</ul>'; } }
<div class="widget-body form"> <!-- BEGIN FORM--> <br> <form action="" class="form-horizontal" method="post"> <div class="control-group"> <h3>NB ! Veillez svp ne pas interrompre cette opération</h3> <h4>Si l'installation de base de données est effectuer avec succé vous serais automatiquement rediriger a l'étape suivante</h4> </div> <?php echo '<img src="../ili-style/img/loading.gif">'; $sql = file_get_contents("db.sql"); if ($sql) { if ($sql_array = explode(";", $sql)) { foreach ($sql_array as $val) { QueryExcuteWhile($val); } echo '<script language="Javascript">document.location.href="' . $URL . 'INSTALL/3"</script>'; } else { echo 'Une erreur est survenue l\'ors de l\'instalation de base des donneés'; } } else { echo 'Fichier SQL non disponible'; } ?> </form> <!-- END FORM--> </div> </div>
<!-- BEGIN PAGE CONTENT--> <div class="row-fluid"> <div class="span12"> <?php $r1 = QueryExcuteWhile("SELECT `Category` FROM `help` GROUP BY `Category`"); while ($o1 = mysqli_fetch_object($r1)) { $Category = $o1->Category; echo ' <div class="widget"> <div class="widget-title"> <h4><i class="icon-reorder"></i> ' . $Category . '</h4> <span class="tools"><a href="javascript:;" class="icon-chevron-down"></a></span> </div> <div class="widget-body" style="display: block;"> <div class="accordion in collapse" id="accordion1" style="height: auto;">'; $r2 = QueryExcuteWhile("SELECT * FROM `help` WHERE `Category`='{$Category}'"); while ($o2 = mysqli_fetch_object($r2)) { echo ' <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#' . $o1->Category . '" href="#' . $o1->Category . '_collapse_' . $o2->idHelp . '"> <i class=" icon-plus"></i> ' . $o2->Question . '</a> </div> <div id="' . $o1->Category . '_collapse_' . $o2->idHelp . '" class="accordion-body collapse" style="height: 0px;"> <div class="accordion-inner"> ' . $o2->Answer . '</div> </div> </div>'; } echo ' </div> </div> <!-- END EXAMPLE TABLE widget--> </div>
function MessageGetAllHeader() { global $URL; //get message source $idUser = $_SESSION['user_id']; $q1 = "SELECT * FROM `message` WHERE `ToUser`='{$idUser}' AND `Seen`='0' ORDER BY `idMessage` DESC LIMIT 2 "; $r1 = QueryExcuteWhile($q1); if (mysqli_num_rows($r1) > '0') { while ($o1 = mysqli_fetch_object($r1)) { $s1 = UserGetInfo($o1->FromUser); if (isset($s1->ProfilePhoto)) { $img1 = $s1->ProfilePhoto; } else { $img1 = ''; } echo ' <li> <a href="' . $URL . 'ili-messages/read?id=' . $o1->idMessage . '"> <span class="photo"> <img src="' . $img1 . '" alt="avatar" /> </span> <span class="subject"> <span class="from">' . $s1->FamilyName . ' ' . $s1->FirstName . '</span> </span> <span class="message"> ' . $o1->Subject . ' </span> <span class="small italic">'; DateDifference($o1->TimeStamp); echo '</span> </a> </li> '; } } //get rep messages $q2 = "SELECT * FROM `message`, `discussion`\n\t\t\tWHERE\n\t\t\t(`message`.`ToUser`='{$idUser}' OR `message`.`FromUser`='{$idUser}' )\n AND\n\t\t\t`discussion`.`ToUser`='{$idUser}'\n\t\t\tAND \n\t\t\t`message`.`Seen`='1'\n\t\t\tAND\n\t\t\t`discussion`.`idMessage`=`message`.`idMessage`\n\t\t\tAND\n\t\t\t`discussion`.`ToUser`='{$idUser}'\n\t\t\tAND\n\t\t\t`discussion`.`Seen`='0' LIMIT 2;\n\t\t\t"; $r2 = QueryExcuteWhile($q2); if (mysqli_num_rows($r2) > '0') { while ($o2 = mysqli_fetch_object($r2)) { $s2 = UserGetInfo($o2->FromUser); if (isset($s2->ProfilePhoto)) { $img2 = $s2->ProfilePhoto; } else { $img2 = ''; } echo ' <li> <a href="' . $URL . 'ili-messages/read?id=' . $o2->idMessage . '&id2=' . $o2->idDiscussion . '"> <span class="photo"> <img src="' . $img2 . '" alt="avatar" /> </span> <span class="subject"> <span class="from">' . $s2->FamilyName . ' ' . $s2->FirstName . '</span> </span> <span class="message"> ' . $o2->Subject . ' </span> <span class="small italic">'; DateDifference($o2->TimeStamp); echo '</span> </a> </li> '; } } }
function UserPrivilegesGet($idUser, $Rank) { if ($Rank == 2) { echo ' <ul class="nav nav-tabs nav-stacked" style="margin-left:-15%;"> <div class="widget-body"> <div class="space10"></div> <ul id="tree_2" class="tree"> <li> <a data-toggle="branch" class="tree-toggle" data-role="branch" href="#">Autorisations</a> <ul class="branch in"> '; $query = "SELECT `bloc` FROM `usersprivilege` WHERE `idUser`='{$idUser}'"; $result = QueryExcuteWhile($query); while ($o = mysqli_fetch_object($result)) { $query2 = "SELECT `s`, `c`, `u`, `d` FROM `usersprivilege` WHERE `idUser`='{$idUser}' AND `bloc`='{$o->bloc}';"; if ($o->bloc != 'CONTRAT' && $o->bloc != 'CAISSE') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch">'; if ($b->s) { echo '<li><a><p class="icon-eye-open"></p></a> Voir</li>'; } if ($b->c) { echo '<li><a><p class="icon-plus"></p></a> Créer</li>'; } if ($b->u) { echo '<li><a><p class="icon-edit"></p></a> Modifier</li>'; } if ($b->d) { echo '<li><a><p class="icon-trash"></p></a> Supprimer</li>'; } echo '</ul>'; } echo '</li>'; } if ($o->bloc == 'CONTRAT') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch">'; if ($b->s) { echo '<li><a><p class="icon-eye-open"></p></a> Voir</li>'; } if ($b->c) { echo '<li><a><p class="icon-file"></p></a> Créer</li>'; } if ($b->u) { echo '<li><a><p class="icon-repeat"></p></a> Renouveler</li>'; } if ($b->d) { echo '<li><a><p class="icon-trash"></p></a> Supprimer</li>'; } echo '</ul>'; } echo '</li>'; } if ($o->bloc == 'CAISSE') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch">'; if ($b->s) { echo '<li><a><p class="icon-book"></p></a> Journal</li>'; } if ($b->c) { echo '<li><a><p class="icon-signout"></p></a> Décaissement</li>'; } if ($b->u) { echo '<li><a><p class="icon-money"></p></a> Echéancier</li>'; } echo '</ul>'; } echo '</li>'; } } echo '</ul></li></ul></div></ul>'; } }
function UserPrivilegesGetUpdate($idUser) { global $URL; $user = UserGetInfo($idUser); if ($_SESSION['user_idRank'] >= 3 && $_SESSION['user_id'] != $idUser) { echo ' <ul class="nav nav-tabs nav-stacked" style="margin-left:-15%;"> <div class="widget-body"> <div class="space10"></div> <ul id="tree_2" class="tree"> <li> <a data-toggle="branch" class="tree-toggle" data-role="branch" href="#">Autorisations</a> <ul class="branch in">'; $query = "SELECT `bloc` FROM `usersprivilege` WHERE `idUser`='{$idUser}'"; $result = QueryExcuteWhile($query); while ($o = mysqli_fetch_object($result)) { if ($o->bloc != 'CONTRAT' && $o->bloc != 'CAISSE') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $query2 = "SELECT * FROM `usersprivilege` WHERE `idUser`='{$idUser}' AND `bloc`='{$o->bloc}';"; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch"> '; if ($b->s) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 's0" value="1"> <input type="checkbox" name="s0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-eye-open"></p></a> Voir </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 's1" value="1" onChange="this.form.submit()"> <a><p class="icon-eye-open"></p></a> Voir </form> </li> '; } if ($b->c) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'c0" value="1"> <input type="checkbox" name="c0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-plus"></p></a> Créer </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'c1" value="1" onChange="this.form.submit()"> <a><p class="icon-plus"></p></a> Créer </form> </li> '; } if ($b->u) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'u0" value="1"> <input type="checkbox" name="u0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-edit"></p></a> Modifier </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'u1" value="1" onChange="this.form.submit()"> <a><p class="icon-edit"></p></a> Modifier </form> </li> '; } if ($b->d) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'd0" value="1"> <input type="checkbox" name="d0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-trash"></p></a> Supprimer </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'd1" value="1" onChange="this.form.submit()"> <a><p class="icon-trash"></p></a> Supprimer </form> </li> '; } if (isset($_POST[$b->idPrivilege . 's0'])) { $query = "UPDATE `usersprivilege` SET s='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>VOIR</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 's1'])) { $query = "UPDATE `usersprivilege` SET s='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>VOIR</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c0'])) { $query = "UPDATE `usersprivilege` SET c='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>CREER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c1'])) { $query = "UPDATE `usersprivilege` SET c='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>CREER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u0'])) { $query = "UPDATE `usersprivilege` SET u='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>MODIFIER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege MODIFIER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u1'])) { $query = "UPDATE `usersprivilege` SET u='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>MODIFIER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege MODIFIER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'd0'])) { $query = "UPDATE `usersprivilege` SET d='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Suppression du privilége <strong>SUPPRIMER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege SUPPRIMER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'd1'])) { $query = "UPDATE `usersprivilege` SET d='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>SUPPRIMER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege SUPPRIMER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } echo ' </ul> '; } } if ($o->bloc == 'CONTRAT') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $query2 = "SELECT * FROM `usersprivilege` WHERE `idUser`='{$idUser}' AND `bloc`='{$o->bloc}';"; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch"> '; if ($b->s) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 's0" value="1"> <input type="checkbox" name="s0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-eye-open"></p></a> Voir </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 's1" value="1" onChange="this.form.submit()"> <a><p class="icon-eye-open"></p></a> Voir </form> </li> '; } if ($b->c) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'c0" value="1"> <input type="checkbox" name="c0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-file"></p></a> Créer </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'c1" value="1" onChange="this.form.submit()"> <a><p class="icon-file"></p></a> Créer </form> </li> '; } if ($b->u) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'u0" value="1"> <input type="checkbox" name="u0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-repeat"></p></a> Renouveler </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'u1" value="1" onChange="this.form.submit()"> <a><p class="icon-repeat"></p></a> Renouveler </form> </li> '; } if ($b->d) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'd0" value="1"> <input type="checkbox" name="d0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-trash"></p></a> Supprimer </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'd1" value="1" onChange="this.form.submit()"> <a><p class="icon-trash"></p></a> Supprimer </form> </li> '; } if (isset($_POST[$b->idPrivilege . 's0'])) { $query = "UPDATE `usersprivilege` SET s='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>VOIR</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 's1'])) { $query = "UPDATE `usersprivilege` SET s='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>VOIR</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c0'])) { $query = "UPDATE `usersprivilege` SET c='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>CREER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c1'])) { $query = "UPDATE `usersprivilege` SET c='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>CREER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u0'])) { $query = "UPDATE `usersprivilege` SET u='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>RENOUVELER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege RENOUVELER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u1'])) { $query = "UPDATE `usersprivilege` SET u='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>RENOUVELER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege RENOUVELER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'd0'])) { $query = "UPDATE `usersprivilege` SET d='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Suppression du privilége <strong>SUPPRIMER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege SUPPRIMER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'd1'])) { $query = "UPDATE `usersprivilege` SET d='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>SUPPRIMER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege SUPPRIMER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } echo ' </ul> '; } } if ($o->bloc == 'CAISSE') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $query2 = "SELECT * FROM `usersprivilege` WHERE `idUser`='{$idUser}' AND `bloc`='{$o->bloc}';"; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch"> '; if ($b->s) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 's0" value="1"> <input type="checkbox" name="s0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-book"></p></a> Journal </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 's1" value="1" onChange="this.form.submit()"> <a><p class="icon-book"></p></a> Journal </form> </li> '; } if ($b->c) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'c0" value="1"> <input type="checkbox" name="c0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-signout"></p></a> Décaissement </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'c1" value="1" onChange="this.form.submit()"> <a><p class="icon-signout"></p></a> Décaissement </form> </li> '; } if ($b->u) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'u0" value="1"> <input type="checkbox" name="u0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-money"></p></a> Echéancier </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'u1" value="1" onChange="this.form.submit()"> <a><p class="icon-money"></p></a> Echéancier </form> </li> '; } if (isset($_POST[$b->idPrivilege . 's0'])) { $query = "UPDATE `usersprivilege` SET s='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>JOURNAL</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 's1'])) { $query = "UPDATE `usersprivilege` SET s='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>JOURNAL</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c0'])) { $query = "UPDATE `usersprivilege` SET c='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>DECAISSEMENT</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c1'])) { $query = "UPDATE `usersprivilege` SET c='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>DECAISSEMENT</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u0'])) { $query = "UPDATE `usersprivilege` SET u='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>ECHEANCIER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege RENOUVELER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u1'])) { $query = "UPDATE `usersprivilege` SET u='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>ECHEANCIER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege RENOUVELER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } echo ' </ul> '; } } echo ' </li> '; } echo ' </ul> </li> </ul> </div> </ul> '; } }
function UserQualificationGet($idUser) { $Query = "SELECT * FROM `usersqualification` WHERE `idUser`='{$idUser}' ORDER BY `idQualification` DESC;"; if (QueryExcute('mysqli_num_rows', $Query) == '0') { echo "<strong>PAS DE COMPETANCE!</strong>"; } else { $Result = QueryExcuteWhile($Query); while ($O = mysqli_fetch_object($Result)) { if ($O->Value >= '0' && $O->Value <= '33') { $Color = 'danger'; } if ($O->Value > '33' && $O->Value <= '66') { $Color = 'warning'; } if ($O->Value > '66' && $O->Value <= '100') { $Color = 'success'; } echo ' <tr> <td class="span1"><span class="label label-inverse">' . $O->Label . '</span></td> <td> <div class="progress progress-' . $Color . ' progress-striped"> <div style="width: ' . $O->Value . '%" class="bar"></div> </div> </td> </tr>'; } } }
function UserGetList() { $query = "SELECT * FROM users, usersrank WHERE users.idRank=usersrank.idRank"; $result = QueryExcuteWhile($query); while ($o = mysqli_fetch_object($result)) { echo ' <div class="widget"> <div class="widget-title"> <h4><i class="'; UserGetIcon($o->idRank); echo '"></i> ' . $o->FamilyName . ' ' . $o->FirstName . '</h4> <span class="tools" style="margin-top:-2px;">'; GetUserPanel('USERS', $o->idUser, $o->idRank); echo ' <!-- Modale de confirmation de suppression --> <div id="myModal_del' . $o->idUser . '" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel_del' . $o->idUser . '" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="myModalLabel_del' . $o->idUser . '">Confirmation de suppression</h3> </div> <div class="modal-body"> <p>Vous êtes sur de vouloire supprimer le compte du <strong>' . $o->FamilyName . ' ' . $o->FirstName . '</strong>? <br> Cette action est <strong>irréversible!</strong></p> </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal" aria-hidden="true">Annuler</button> <button onClick=\'document.location.href="user_remove?id=' . $o->idUser . '";\' data-dismiss="modal" class="btn btn-primary">Confirm</button> </div> </div> <!-- Modale de confirmation de suppression --> <a href="javascript:;" class="icon-chevron-down"></a> </span> </div> <div class="widget-body"> <div class="span3"> <div class="text-center profil-pic">'; if ($o->ProfilePhoto != '') { echo '<img src="' . $o->ProfilePhoto . '" width="100%" height="226px;">'; } echo ' </div> <ul class="nav nav-tabs nav-stacked">'; if ($o->fbAccount) { echo '<li><a href="' . $o->fbAccount . '" target="new"><i class="icon-facebook"></i> Facebook</a></li>'; } if ($o->linkedinAccount) { echo '<li><a href="' . $o->linkedinAccount . '" target="new"><i class="icon-LinkedinAccount"></i> LinkedinAccount</a></li>'; } if ($o->githubAccount) { echo '<li><a href="' . $o->githubAccount . '" target="new"><i class="icon-githubAccount"></i> githubAccount</a></li>'; } echo ' </ul> </div> <div class="span6"> <h4>' . $o->FunctionPost . '<br/></h4> <table class="table table-borderless"> <tbody> <tr> <td class="span2">Grade :</td> <td>' . $o->Level . '</td> </tr> <tr> <td class="span2">Age :</td> <td>' . age($o->BirthDay) . ' ans</td> </tr> <tr> <td class="span2"> Email :</td> <td>' . $o->Email . '</td> </tr> <tr> <td class="span2"> Mobile :</td> <td> ' . $o->Phone . ' </td> </tr> </tbody> </table> <h4>Compétances</h4> <table class="table table-borderless"> <tbody>'; UserQualificationGet($o->idUser); echo '</tbody> </table> </div> <div class="span3"> <h4>Dérnier diplômes</h4> <ul class="icons push">'; UserDiplomaGet($o->idUser, '1'); echo '</ul> <h4>Dériniére expérience</h4> <ul class="icons push">'; UserExpiranceGet($o->idUser, '1'); echo '</ul> </div> <div class="space5"></div> </div> </div> '; } }
function Check($date1, $date2, $operation) { global $URL; $SQL_DC = "SELECT * FROM `payment` WHERE `PaymentKind`='CHEQUE' AND `TransferDate` BETWEEN '{$date1}' AND '{$date2}'"; $SQL_D = "SELECT * FROM `payment` WHERE `PaymentKind`='CHEQUE' AND `TransferDate` BETWEEN '{$date1}' AND 'date2' AND `Amount`>0;"; $SQL_C = "SELECT * FROM `payment` WHERE `PaymentKind`='CHEQUE' AND `TransferDate` BETWEEN '{$date1}' AND '{$date2}' AND `Amount`<0;"; if ($operation == 'DC') { $query = $SQL_DC; } elseif ($operation == 'D') { $query = $SQL_C; } elseif ($operation == 'C') { $query = $SQL_D; } $result = QueryExcuteWhile($query); echo '<div class="row-fluid"> <table class="table table-striped table-hover"> <thead> <tr> <th>#Paiement</th> <th>#Chéque</th> <th class="hidden-480">Date</th> <th class="hidden-480">Echéance</th> <th class="hidden-480">Opérateur</th> <th class="hidden-480">Type</th> <th class="hidden-480">Montant</th> </tr> </thead>'; while ($o = mysqli_fetch_object($result)) { $PaymentInfo = PaymentInfo($o->idPayment); echo ' <tbody> <tr> <td>' . $o->idPayment . '</td> <td>' . $o->PaymentCode . '</td> <td class="hidden-480">'; echo FormatEnDateToFr($o->EncashmentDate); echo '</td> <td class="hidden-480">'; echo FormatEnDateToFr($o->TransferDate); echo '</td> <td class="hidden-480">' . $o->RecevedBy . '</td> <td class="hidden-480">'; if ($o->Amount > 0) { echo 'CREDITS'; } elseif ($o->Amount < 0) { echo 'DEBITS'; } echo '</td> <td>'; printf('%0.3f', $o->Amount); echo ' TND</td> </tr> '; } echo ' </tbody> </table> </div> <div class="space20"></div> <div class="row-fluid"> <div class="span4 invoice-block pull-right"> <ul class="unstyled amounts"> <li><strong>Total Crédit('; CheckGetTotalOperationIn($date1, $date2); echo ') : </strong> '; CheckGetTotalAmmountIn($date1, $date2); echo ' TND</li> <li><strong>Total Débit('; CheckGetTotalOperationOut($date1, $date2); echo ') : </strong> '; CheckGetTotalAmmountOut($date1, $date2); echo ' TND</li> <li><strong>Somme('; CheckGetTotalOperation($date1, $date2, $operation); echo ') : </strong> '; CheckGetTotalAmmount($date1, $date2, $operation); echo ' TND</li> </ul> </div> </div> '; }
function CheckoutListForClient($idClient) { global $URL; $result = QueryExcuteWhile("SELECT `idPayment` FROM `contractcycle`, `insurancecontract` WHERE `contractcycle`.`idContract`=`insurancecontract`.`idContract` AND `insurancecontract`.`idClient`='{$idClient}';"); if ($result) { echo '<ol>'; while ($o = mysqli_fetch_object($result)) { echo '<li> <a href="' . $URL . 'ili-caisse/DetailsPayement.php?idPayment=' . $o->idPayment . '">' . $o->idPayment . '</a> </li>'; } echo '</ol>'; } }