예제 #1
0
function UploadImage()
{
    global $URL;
    $idUser = $_SESSION['user_id'];
    $user = UserGetInfo($idUser);
    if (isset($_POST["UploadImage"])) {
        $target_dir = "../../ili-upload/";
        $target_file = $target_dir . basename($_FILES["fileToUpload"]['name']);
        $uploadOk = 1;
        $imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);
        $imageFilename = pathinfo($target_file, PATHINFO_FILENAME);
        $imageNewName = "logo";
        $NewTarget = $target_dir . $imageNewName . '.' . $imageFileType;
        // Check if image file is a actual image or fake image
        $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
        if ($check !== false) {
            /*echo "Ce fichier est une image - " . $check["mime"] . ".";*/
            $uploadOk = 1;
        } else {
            echo "Ce fichier n'est pas une image.";
            $uploadOk = 0;
        }
        // Check if file already exists
        /*if (file_exists($target_file)) {
        			echo "Fichier existe déjà.";
        			$uploadOk = 0;
        		}*/
        // Check file size
        if ($_FILES["fileToUpload"]["size"] > 500000) {
            echo "Le fichier est volumineux.";
            $uploadOk = 0;
        }
        // Allow certain file formats
        if ($imageFileType != "png") {
            echo "L'extension PNG uniquement est autorisé.";
            $uploadOk = 0;
        }
        // Check if $uploadOk is set to 0 by an error
        if ($uploadOk == 0) {
            echo "Erreur : Chargement!.";
            // if everything is ok, try to upload file
        } else {
            if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $NewTarget)) {
                /*echo "Fichier ". basename( $_FILES["fileToUpload"]["name"]). " Chargé.";*/
                NotifAllWrite('', '', '<a href="' . $URL . 'ili-modules/ets/info">' . $user->FamilyName . ' ' . $user->FirstName . ', a modifier le logo de l`entreprise');
                LogWrite("Modification de logo de l\\'entreprise");
                Redirect('ili-modules/ets/info');
            } else {
                echo "Erreur : Chargement!.";
            }
        }
    }
}
예제 #2
0
function MessageGet($idMessage)
{
    global $URL;
    $q1 = "SELECT * FROM `message` WHERE `idMessage`='{$idMessage}';";
    $r1 = QueryExcuteWhile($q1);
    while ($o1 = mysqli_fetch_object($r1)) {
        //msg_rep
        $q2 = "SELECT * FROM `message`, `discussion` WHERE `discussion`.`idMessage`=`message`.`idMessage` AND `message`.`idMessage`='{$idMessage}' ORDER BY `idDiscussion` DESC;";
        $r2 = QueryExcuteWhile($q2);
        while ($o2 = mysqli_fetch_object($r2)) {
            //envoi
            $sender2 = UserGetInfo($o2->FromUser);
            if (isset($sender2->ProfilePhoto)) {
                $img2 = $sender2->ProfilePhoto;
            } else {
                $img2 = '';
            }
            echo '
			<div class="msg-time-chat"> <a href="#" class="message-img"><img class="avatar" src="' . $img2 . '" alt=""></a>
				<div class="message-body msg-in">
					<div class="text">
						<p class="attribution"><a href="' . $URL . 'ili-users/user_profil?id=' . $sender2->idUser . '">' . $sender2->FamilyName . ' ' . $sender2->FirstName . '</a> ';
            DateDifference($o2->TimeStamp);
            echo '</p>
						<p> ' . $o2->Containt . ' </p>
					</div>
				</div>
			</div>
			';
        }
        //msg
        $sender = UserGetInfo($o1->FromUser);
        if (isset($sender->ProfilePhoto)) {
            $img = $sender->ProfilePhoto;
        } else {
            $img = '';
        }
        echo '
		<div class="msg-time-chat"> <a href="#" class="message-img"><img class="avatar" src="' . $img . '" alt=""></a>
			<div class="message-body msg-in">
				<div class="text">
					<p class="attribution"><a href="' . $URL . 'ili-users/user_profil?id=' . $sender->idUser . '">' . $sender->FamilyName . ' ' . $sender->FirstName . '</a> ';
        DateDifference($o1->TimeStamp);
        echo '</p>
					<p> ' . $o1->Containt . ' </p>
				</div>
			</div>
		</div>
		';
    }
}
예제 #3
0
function ContractRenew()
{
    $idUser = $_SESSION['user_id'];
    $User = $_SESSION['user_nom_prenom'];
    if (isset($_POST['idContract']) && isset($_POST['StartDate']) && isset($_POST['EndDate']) && isset($_POST['Amount']) && isset($_POST['EncashmentDate']) && isset($_POST['PaymentKind'])) {
        $idContract = addslashes($_POST['idContract']);
        $StartDate = addslashes($_POST['StartDate']);
        $EndDate = addslashes($_POST['EndDate']);
        $Amount = addslashes($_POST['Amount']);
        global $NowEN;
        $EncashmentDate = $NowEN;
        $PaymentKind = addslashes($_POST['PaymentKind']);
        if (isset($_POST['PaymentCode'])) {
            $PaymentCode = addslashes($_POST['PaymentCode']);
        } else {
            $PaymentCode = '';
        }
        if (isset($_POST['Bank'])) {
            $Bank = addslashes($_POST['Bank']);
        } else {
            $Bank = '';
        }
        if (isset($_POST['TransferDate'])) {
            $TransferDate = addslashes($_POST['TransferDate']);
        } else {
            $TransferDate = '';
        }
        $PayementAdd = QueryExcute("", "INSERT INTO `payment` VALUES (NULL, '{$EncashmentDate}', '', '{$PaymentKind}', '{$PaymentCode}', '{$Bank}', '{$TransferDate}', '{$Amount}', '{$idUser}');");
        if (!$PayementAdd) {
            // recupération idPayment
            $ObjectPayement = QueryExcute("mysqli_fetch_array", "SELECT max(`idPayment`) FROM `payment`");
            if ($ObjectPayement) {
                $idPayment = $ObjectPayement[0];
                $ContractcycleAdd = QueryExcute("", "INSERT INTO `contractcycle` VALUES(NULL, '{$idPayment}', '{$idContract}', '{$StartDate}', '{$EndDate}', '{$idUser}');");
                if (!$ContractcycleAdd) {
                    NotifAllWrite("", "", $User . " a renouveler le contrat #" . $idContract);
                    $user = UserGetInfo($idUser);
                    NotifAllWrite('', '', '<a href="' . $URL . 'ili-modules/contrat/contrat?id=' . $idContract . '">' . $user->FamilyName . ' ' . $user->FirstName . ', a renouveler le contrat : #' . $idContract . '</a>');
                    Redirect("ili-modules/contrat/liste");
                } else {
                    Redirect('ili-modules/contrat/renew/renew?id=' . $idContract . '&message=31');
                }
            }
        } else {
            Redirect('ili-modules/contrat/renew/renew?id=' . $idContract . '&message=32');
        }
    }
}
예제 #4
0
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>
			';
    }
}
예제 #5
0
<?php

include "../ili-functions/functions.php";
function UserDeban($idUser)
{
    $QueryUserDeban = "UPDATE users SET idRank='2' WHERE idUser='******' ;";
    QueryExcute('', $QueryUserDeban);
}
Authorization('2');
AuthorizedPrivileges('USERS', 'U');
$idUser = $_GET['id'];
$user = UserGetInfo($idUser);
if ($user == '') {
    Redirect('index?message=14');
} else {
    UserDeban($idUser);
    $idUserSession = $_SESSION['user_id'];
    $UserUpdated = UserGetInfo($idUser);
    $UserUpdater = UserGetInfo($idUserSession);
    NotifAllWrite($idUser, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $idUser . '">' . $UserUpdater->FamilyName . ' ' . $UserUpdater->FirstName . ' a débanni ' . $UserUpdated->FamilyName . ' ' . $UserUpdated->FirstName);
    LogWrite("Utilisateur : " . $user->idUser . " a ete debanni");
    Redirect('ili-users/user_edit?id=' . $idUser);
}
예제 #6
0
 if (isset($_POST['TransferDate'])) {
     $TransferDate = addslashes($_POST['TransferDate']);
 } else {
     $TransferDate = '';
 }
 $idUser = $_SESSION['user_id'];
 $ajout = QueryExcute("", "INSERT INTO `insurancecontract` VALUES ('{$idContract}', '{$idClient}', '{$TypeContract}', '{$NatureContract}');");
 if (!$ajout) {
     $ajout2 = QueryExcute("", "INSERT INTO `payment` VALUES (NULL, '{$EncashmentDate}', '', '{$PaymentKind}', '{$PaymentCode}', '{$Bank}', '{$TransferDate}', '{$Amount}', '{$idUser}');");
     if (!$ajout2) {
         $ObjectPayement = QueryExcute("mysqli_fetch_array", "SELECT max(`idPayment`) FROM `payment`");
         if ($ObjectPayement) {
             $idPayment = $ObjectPayement[0];
             $ajout3 = QueryExcute("", "INSERT INTO `contractcycle` VALUES(NULL, '{$idPayment}', '{$idContract}', '{$StartDate}', '{$EndDate}', '{$idUser}');");
             if (!$ajout3) {
                 $user = UserGetInfo($idUser);
                 NotifAllWrite('', '', '<a href="' . $URL . 'ili-modules/contrat/contrat?id=' . $idContract . '">' . $user->FamilyName . ' ' . $user->FirstName . ', a crée un nouveau contrat : #' . $idContract . '</a>');
                 LogWrite("Ajout contract ID : " . $idContract);
                 Redirect("ili-modules/contrat/liste");
             } else {
                 Redirect('ili-modules/contrat/add/add?clt=' . $id_clt . '&message=26');
             }
         } else {
             Redirect('ili-modules/contrat/add/add?clt=' . $id_clt . '&message=27');
         }
     } else {
         Redirect('ili-modules/contrat/add/add?clt=' . $id_clt . '&message=28');
     }
 } else {
     Redirect('ili-modules/contrat/add/add?clt=' . $id_clt . '&message=29');
 }
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>
			';
        }
    }
}
예제 #8
0
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>
		';
    }
}
예제 #9
0
		</div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">Annuler</button>
			<button onClick="document.location.href=\'remove?id=' . $ObjectClient->idClient . '\'" data-dismiss="modal" class="btn btn-primary">Confirm</button>
		</div>
	</div>
	';
}
Authorization('2');
AuthorizedPrivileges('CLIENTS', 'S');
$id_client = $_GET['id'];
$clt = ClientGetInfo($id_client);
if ($clt == '') {
    Redirect('index?message=18');
}
$createur = UserGetInfo($clt->CreatedBy);
function ListContract($id_client)
{
    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\t     AND \n\t   `client`.`idClient`='{$id_client}'\n\tGROUP BY `insurancecontract`.`idContract`\n\t";
    $result = QueryExcuteWhile($sql);
    while ($o = mysqli_fetch_array($result)) {
        $idContract = $o[0];
        echo '
		  <tr class="odd gradeX" id="tr" onclick="document.location=\'' . $URL . 'ili-modules/contrat/contrat?id=' . $o[0] . '\'">
			<td>' . $o[0] . '</td>
			<td>' . $o[4] . '</td>
			<td>' . $o[3] . '</td>
			<td>' . $o[5] . '</td>
			<td>' . $o[6] . '</td>
			<td>';
예제 #10
0
function UserSocialGet($idUser)
{
    $user = UserGetInfo($idUser);
    if ($user->fbAccount) {
        echo '<li><a href="' . $user->fbAccount . '" target="new"><i class="icon-facebook"></i> Compte Facebook</a></li>';
    } else {
        echo '<li><i class="icon-facebook"></i> Pas de Facebook </a></li>';
    }
    if ($user->linkedinAccount) {
        echo '<li><a href="' . $user->linkedinAccount . '" target="new"><i class="icon-linkedinAccount"></i> Compte Linkedin</a></li>';
    } else {
        echo '<li><i class="icon-linkedinAccount"></i> Pas de compte Linkedin </a></li>';
    }
    if ($user->githubAccount) {
        echo '<li><a href="' . $user->githubAccount . '" target="new"><i class="icon-github"></i> Compte github</a></li>';
    } else {
        echo '<li><i class="icon-github"></i> Pas de compte Github </a></li>';
    }
}
예제 #11
0
function Checkout($date1, $date2, $idUser)
{
    global $URL;
    $sql1 = "SELECT * FROM `payment` WHERE `EncashmentDate` BETWEEN '{$date1}' AND '{$date2}' AND `RecevedBy`='{$idUser}';";
    $sql2 = "SELECT * FROM `payment` WHERE `EncashmentDate` BETWEEN '{$date1}' AND '{$date2}';";
    if ($idUser) {
        $query = $sql1;
    } else {
        $query = $sql2;
    }
    $nobre_de_resultat = QueryExcute("mysqli_fetch_row", $query);
    $result = QueryExcuteWhile($query);
    echo '
		<div class="row-fluid">
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>#</th>
						<th>Contrat</th>
						<th class="hidden-480">Designation</th>
						<th class="hidden-480">Type</th>
						<th class="hidden-480">Date</th>
						<th class="hidden-480">Operateur</th>
						<th>Total</th>
					</tr>
				</thead>
			';
    while ($o = mysqli_fetch_object($result)) {
        $PaymentInfo = PaymentInfo($o->idPayment);
        $USER2 = UserGetInfo($o->RecevedBy);
        echo '
				<tbody>
					<tr>
						<td>' . $o->idPayment . '</td>
						<td>';
        if ($PaymentInfo) {
            echo $PaymentInfo->idContract;
        } else {
            echo '#';
        }
        echo '</td>
						<td class="hidden-480">';
        if ($o->Description) {
            echo $o->Description;
        } else {
            echo '<center>##</center>';
        }
        echo '</td>
						<td class="hidden-480">' . $o->PaymentKind . '</td>
						<td class="hidden-480">';
        echo FormatEnDateToFr($o->EncashmentDate);
        echo '</td>
						<td class="hidden-480">';
        echo $USER2->FamilyName . ' ' . $USER2->FirstName;
        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 Chéque(';
    CheckoutGetTotalOperationCash($date1, $date2, $idUser);
    echo ') : </strong> ';
    CheckoutGetAmmountTotalCash($date1, $date2, $idUser);
    echo ' TND</li>
					<li><strong>Total Espéce(';
    CheckoutGetTotalOperationCheck($date1, $date2, $idUser);
    echo ') : </strong> ';
    CheckoutGetAmmountTotalCheck($date1, $date2, $idUser);
    echo ' TND</li>
					<li><strong>Somme(';
    CheckoutGetTotalOperation($date1, $date2, $idUser);
    echo ') : </strong> ';
    CheckoutGetAmmountTotal($date1, $date2, $idUser);
    echo ' TND</li>
				</ul>
			</div>
		</div>
		';
}