Exemplo n.º 1
0
function GetUserPanel($page, $var1, $var2)
{
    global $URL;
    if ($page == 'USERS') {
        $IfUserHasActivity = IfUserHasActivity($var1);
        //ADMIN
        if ($_SESSION['user_idRank'] >= 3) {
            //C IN ALL
            echo '<a href="user_add" class="icon-plus tooltips" data-original-title="Ajouter"></a>';
            //U IN ALL
            echo '<a href="user_edit?id=' . $var1 . '" class="icon-edit tooltips" data-original-title="Modifier"></a>';
            //D IN ALL BUT HIM
            if ($IfUserHasActivity) {
                if ($_SESSION['user_id'] != $var1) {
                    echo '<a href="#myModal_del' . $var1 . '" class="icon-trash tooltips" data-toggle="modal" data-original-title="Supprimer"></a>';
                }
            }
            //B IN ALL BUT HIM
            if ($_SESSION['user_id'] != $var1) {
                if ($var2 == 1) {
                    echo '<a href="user_deban?id=' . $var1 . '" class="icon-repeat tooltips" data-original-title="Débannir"></a>';
                }
                if ($var2 == 2) {
                    echo '<a href="user_ban?id=' . $var1 . '" class="icon-ban-circle tooltips" data-original-title="Bannir"></a>';
                }
            }
            //S IN ALL
            echo '<a href="user_profil?id=' . $var1 . '" class="icon-eye-open tooltips" data-original-title="Voir plus"></a>';
        }
        //USER
        if ($_SESSION['user_idRank'] == 2) {
            $up = UserPrivileges("USERS", $_SESSION['user_id']);
            $s = $up->s;
            $c = $up->c;
            $u = $up->u;
            $d = $up->d;
            //C IN ALL
            if ($c) {
                echo '<a href="user_add" class="icon-plus tooltips" data-original-title="Ajouter"></a>';
            }
            //U IN ALL BUT ADMIN
            if ($u && $_SESSION['user_idRank'] >= $var2 || $_SESSION['user_id'] == $var1) {
                echo '<a href="user_edit?id=' . $var1 . '" class="icon-edit tooltips" data-original-title="Modifier"></a>';
            }
            //D IN ALL BUT HIM && ADMIN
            if ($IfUserHasActivity) {
                if ($d && $_SESSION['user_id'] != $var1 && $_SESSION['user_idRank'] >= $var2) {
                    echo '<a href="#myModal_del' . $var1 . '" class="icon-trash tooltips" data-toggle="modal" data-original-title="Supprimer"></a>';
                }
            }
            //B IF HE CAN UPDATE HE CAN BAN ALL BUT HIM && ADMIN
            if ($u && $_SESSION['user_id'] != $var1 && $_SESSION['user_idRank'] >= $var2) {
                if ($var2 == 1) {
                    echo '<a href="user_deban?id=' . $var1 . '" class="icon-repeat tooltips" data-original-title="Débannir"></a>';
                }
                if ($var2 == 2) {
                    echo '<a href="user_ban?id=' . $var1 . '" class="icon-ban-circle tooltips" data-original-title="Bannir"></a>';
                }
            }
            //S IN ALL BUT ADMIN
            if ($s && $_SESSION['user_idRank'] >= $var2 || $_SESSION['user_id'] == $var1) {
                echo '<a href="user_profil?id=' . $var1 . '" class="icon-eye-open tooltips" data-original-title="Voir plus"></a>';
            }
        }
    }
    if ($page == 'USER_PROFILE') {
        if ($_SESSION['user_idRank'] >= 3) {
            echo '<a href="user_edit?id=' . $var1 . '" class="icon-edit tooltips" data-original-title="Modifier"></a>';
        }
        if ($_SESSION['user_idRank'] == 2) {
            $up = UserPrivileges("USERS", $_SESSION['user_id']);
            $u = $up->u;
            if ($u || $_SESSION['user_id'] == $var1) {
                echo '<a href="user_edit?id=' . $var1 . '" class="icon-edit tooltips" data-original-title="Modifier"></a>';
            }
        }
    }
    if ($page == 'CLIENTS') {
        $ObjectClient = ClientGetInfo($var1);
        $IfClientHasActivity = IfClientHasActivity($var1);
        // ADMIN
        if ($_SESSION['user_idRank'] >= 3) {
            //C
            echo '<a href="add" class="icon-plus tooltips" data-original-title="Ajouter"></a>';
            //U=B
            echo '<a href="edit?id=' . $ObjectClient->idClient . '" class="icon-edit tooltips" data-original-title="Modifier"></a>';
            //D
            if (!$IfClientHasActivity) {
                echo '<a href="#myModal_del" class="icon-trash tooltips" data-toggle="modal" data-original-title="Supprimer"></a>';
            }
            //B=U
        }
        // USER
        if ($_SESSION['user_idRank'] == 2) {
            $up = UserPrivileges("CLIENTS", $_SESSION['user_id']);
            $s = $up->s;
            $c = $up->c;
            $u = $up->u;
            $d = $up->d;
            //S
            if (!$s) {
                echo '<script language="Javascript">document.location.href="../../index?message=17"</script>';
            }
            //C
            if ($c) {
                echo '<a href="add" class="icon-plus tooltips" data-original-title="Ajouter"></a>';
            }
            //U=B
            if ($u) {
                echo '<a href="edit?id=' . $ObjectClient->idClient . '" class="icon-edit tooltips" data-original-title="Modifier"></a>';
            }
            //D
            if (!$IfClientHasActivity) {
                if ($d) {
                    echo '<a href="#myModal_del" class="icon-trash tooltips" data-toggle="modal" data-original-title="Supprimer"></a>';
                }
            }
            //B=D
        }
    }
    if ($page == 'CLIENT_LIST') {
        //ADMIN
        if ($_SESSION['user_idRank'] >= 3) {
            //C
            echo '<a href="add" class="icon-plus tooltips" data-original-title="Ajouter"></a>';
        }
        //USER
        if ($_SESSION['user_idRank'] == 2) {
            $up = UserPrivileges("CLIENTS", $_SESSION['user_id']);
            $c = $up->c;
            //C
            if ($c) {
                echo '<a href="add" class="icon-plus tooltips" data-original-title="Ajouter"></a>';
            }
        }
    }
    if ($page == 'CLIENT_CONTRACT') {
        // ADMIN
        if ($_SESSION['user_idRank'] >= 3) {
            //Cree => IF C
            echo '<a href="' . $URL . 'ili-modules/contrat/add/index" class="icon-file tooltips" data-toggle="modal" data-original-title="Nouveau Conrtat"></a>';
            //Renouveler => IF U
            if ($var2 == 'Renouvelable') {
                echo '<a href="' . $URL . 'ili-modules/contrat/renew/renew?id=' . $var1 . '" class="icon-repeat tooltips" data-toggle="modal" data-original-title="Renouveler Ce Contrat"></a>';
            }
        }
        // USER
        if ($_SESSION['user_idRank'] == 2) {
            $up_cnt = UserPrivileges("CONTRAT", $_SESSION['user_id']);
            $c = $up_cnt->c;
            $u = $up_cnt->u;
            //C
            if ($c) {
                echo '<a href="' . $URL . 'ili-modules/contrat/add/add_existant?clt=' . $var1 . '" class="icon-file tooltips" data-toggle="modal" data-original-title="Nouveau Conrtat"></a>';
            }
            //Renouveler => IF U
            if ($u) {
                if ($var2 == 'Renouvelable') {
                    echo '<a href="' . $URL . 'ili-modules/contrat/renew/renew?id=' . $var1 . '" class="icon-repeat tooltips" data-toggle="modal" data-original-title="Renouveler Ce Contrat"></a>';
                }
            }
        }
    }
}
Exemplo n.º 2
0
				</div>
			</div>
			<!-- END PAGE CONTENT--> 
			<!-- BEGIN PAGE CONTENT-->
			<div class="row-fluid">
				<div class="span12"> 
					<!-- BEGIN EXAMPLE TABLE widget-->
					<div class="widget">
						<div class="widget-title">
							<h4><i class="icon-reorder"></i> Contrat Client</h4>
							<span class="tools"> <a href="javascript:;" class="icon-chevron-down"></a> </span> </div>
						<div class="widget-body">
							<div class="span12">
								<?php 
if ($_SESSION['user_idRank'] == 2) {
    $up_cnt = UserPrivileges("CONTRAT", $_SESSION['user_id']);
    if ($up_cnt->s) {
        echo ' 
										<ul class="unstyled">
											<table class="table table-striped table-bordered table-advance table-hover" width="100%">
										   <thead>
											  <tr>
												 <th width="15%"><i class="icon-briefcase"></i> #Conrtat</th>
												 <th width="10%"><i class="icon-retweet"></i> Nature</th>
												 <th width="20%"><i class="icon-wrench"></i> Type</th>
												 <th width="15%"><i class="icon-signin"></i> Date Début</th>
												 <th width="15%"><i class="icon-signout"></i> Date Fin </th>
												 <th width="25%"><i class="icon-exclamation-sign"></i> Etat </th>
											  </tr>
										   </thead>
										   <tbody>';
Exemplo n.º 3
0
function user_side_bar()
{
    global $URL;
    // ADMIN
    if ($_SESSION['user_idRank'] >= 3) {
        echo '
		<li><a class="" href="' . $URL . 'ili-modules/client/liste"><span class="icon-box"><i class="icon-user"></i></span>Client</a></li>
		<li class="has-sub">
			<a href="javascript:;" class="">
				<span class="icon-box"> <i class="icon-file"></i></span> Contrat
				<span class="arrow"></span>
			</a>
			<ul class="sub">
				<li><a class="" href="' . $URL . 'ili-modules/contrat/liste">Liste</a></li>
				<li><a class="" href="' . $URL . 'ili-modules/contrat/add/index">Ajouter</a></li>
				<li><a class="" href="' . $URL . 'ili-modules/contrat/renew/search">Renouveler</a></li>
			</ul>
		</li>
		<li class="has-sub">
			<a href="javascript:;" class="">
				<span class="icon-box"> <i class="icon-money"></i></span> Caisse
				<span class="arrow"></span>
			</a>
			<ul class="sub">
				<li><a class="" href="' . $URL . 'ili-modules/caisse/journal">Journal</a></li>
				<li><a class="" href="' . $URL . 'ili-modules/caisse/echeancier">Echéancier</a></li>
				<li><a class="" href="' . $URL . 'ili-modules/caisse/decaissement">Décaissement</a></li>
				<li><a class="" href="' . $URL . 'ili-modules/caisse/recherche_paiement">Recherche Paiement</a></li>
				<li><a class="" href="' . $URL . 'ili-modules/caisse/recherche_cheque">Recherche Chéque</a></li>
			</ul>
		</li>
		';
    }
    if ($_SESSION['user_idRank'] == 2) {
        //CLIENT
        $up_clinet = UserPrivileges("CLIENTS", $_SESSION['user_id']);
        if ($up_clinet->s) {
            echo '<li><a class="" href="' . $URL . 'ili-modules/client/liste"><span class="icon-box"><i class="icon-user"></i></span>Client</a></li>';
        }
        //CONTRAT
        $up_contrat = UserPrivileges("CONTRAT", $_SESSION['user_id']);
        if ($up_contrat->s) {
            echo '
			<li class="has-sub">
				<a href="javascript:;" class="">
					<span class="icon-box"> <i class="icon-file"></i></span> Contrat
					<span class="arrow"></span>
				</a>
				<ul class="sub">
					<li><a class="" href="' . $URL . 'ili-modules/contrat/liste">Liste</a></li>';
            ?>
					<?php 
            if ($up_contrat->c) {
                echo '<li><a class="" href="' . $URL . 'ili-modules/contrat/add/index">Ajouter</a></li>';
            }
            ?>
					<?php 
            if ($up_contrat->u) {
                echo '<li><a class="" href="' . $URL . 'ili-modules/contrat/renew/search">Renouveler</a></li>';
            }
            ?>
					<?php 
            echo '
				</ul>
			</li>
		';
        }
        //CAISSE
        $up_caisse = UserPrivileges("CAISSE", $_SESSION['user_id']);
        if ($up_caisse->s) {
            echo '
			<li class="has-sub">
				<a href="javascript:;" class="">
					<span class="icon-box"> <i class="icon-money"></i></span> Caisse
					<span class="arrow"></span>
				</a>
				<ul class="sub">
					<li><a class="" href="' . $URL . 'ili-modules/caisse/journal">Journal</a></li>';
            ?>
					<?php 
            if ($up_caisse->u) {
                echo '<li><a class="" href="' . $URL . 'ili-modules/caisse/echeancier">Echéancier</a></li>';
            }
            ?>
					<?php 
            if ($up_caisse->c) {
                echo '<li><a class="" href="' . $URL . 'ili-modules/caisse/decaissement">Décaissement</a></li>';
            }
            ?>
					<?php 
            echo '
					<li><a class="" href="' . $URL . 'ili-modules/caisse/recherche_paiement">Recherche Paiement</a></li>
					<li><a class="" href="' . $URL . 'ili-modules/caisse/recherche_cheque">Recherche Chéque</a></li>
				</ul>
			</li>
			';
        }
    }
}