Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
clpassaerelle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fatima SALL
clpassaerelle
Commits
857828f2
Commit
857828f2
authored
Feb 18, 2026
by
sallFatimata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajouter
parent
7eb41bae
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
813 additions
and
588 deletions
+813
-588
Routes.php
app/Config/Routes.php
+2
-0
Dashboard.php
app/Controllers/Dashboard.php
+8
-6
C_sys_menu.php
app/Controllers/Securite/C_sys_menu.php
+5
-5
C_sys_user.php
app/Controllers/Securite/C_sys_user.php
+130
-41
M_personnel.php
app/Models/securite/M_personnel.php
+17
-0
M_user.php
app/Models/securite/M_user.php
+50
-1
V_menu.php
app/Views/securite/V_menu.php
+46
-49
V_profil.php
app/Views/securite/V_profil.php
+25
-29
V_smenu.php
app/Views/securite/V_smenu.php
+17
-18
V_user.php
app/Views/securite/V_user.php
+476
-423
layout.php
app/Views/template/layout.php
+17
-6
left_sidebar.php
app/Views/template/left_sidebar.php
+9
-6
right_content.php
app/Views/template/right_content.php
+8
-4
right_sidebar.php
app/Views/template/right_sidebar.php
+0
-0
tableaubordre.php
app/Views/template/tableaubordre.php
+3
-0
No files found.
app/Config/Routes.php
View file @
857828f2
...
...
@@ -11,6 +11,7 @@ $routes->get('/', 'C_connexion::index');
$routes
->
post
(
'/login'
,
'C_connexion::login'
);
$routes
->
get
(
'/deconnexion'
,
'C_connexion::deconnexion'
);
$routes
->
get
(
'/Dashboard'
,
'Dashboard::index'
);
$routes
->
get
(
'/tableaubordre'
,
'Dashboard::tableaubordre'
);
// menu
$routes
->
get
(
'menu'
,
'Securite\C_sys_menu::index'
);
$routes
->
post
(
'menu/store'
,
'Securite\C_sys_menu::store'
);
...
...
@@ -45,4 +46,5 @@ $routes->post('saveUser','Securite\C_sys_user::save');
$routes
->
get
(
'user/recherche'
,
'Securite\C_sys_user::getIENInfo'
);
$routes
->
post
(
'users/Status'
,
'Securite\C_sys_user::toggleStatus'
);
$routes
->
get
(
'user/getIEFByIA/(:num)'
,
'Securite\C_sys_user::getIEFByIA/$1'
);
$routes
->
post
(
'user/delete/(:num)'
,
'Securite\C_sys_user::delete/$1'
);
// authentification
\ No newline at end of file
app/Controllers/Dashboard.php
View file @
857828f2
...
...
@@ -9,14 +9,16 @@ class Dashboard extends BaseController
{
$session
=
session
();
// 🔒 Vérification simple de connexion
if
(
!
session
()
->
get
(
'logged_in'
))
{
if
(
!
session
()
->
get
(
'logged_in'
))
{
return
redirect
()
->
to
(
'/'
);
}
// $menu_roles = $session->get('menu_roles');
return
view
(
'template/layout'
);
}
public
function
tableaubordre
()
{
return
view
(
'template/tableaubordre'
);
}
}
\ No newline at end of file
}
\ No newline at end of file
app/Controllers/Securite/C_sys_menu.php
View file @
857828f2
...
...
@@ -48,12 +48,12 @@ class C_sys_menu extends BaseController
}
}
public
function
delete
(
$id
=
null
)
{
$Modelmenu
=
new
M_menu
();
{
$Modelmenu
=
new
M_menu
();
if
(
$Modelmenu
->
delete
(
$id
))
{
return
$this
->
response
->
setJSON
([
'success'
=>
true
]);
}
else
{
}
else
{
return
$this
->
response
->
setJSON
([
'success'
=>
false
]);
}
}
}
}
}
\ No newline at end of file
app/Controllers/Securite/C_sys_user.php
View file @
857828f2
...
...
@@ -14,7 +14,7 @@ class C_sys_user extends BaseController
$modelprofil
=
new
M_profil
();
$data
[
'all_user'
]
=
$modeluser
->
getUsersWithProfil
();
$data
[
'profils'
]
=
$modelprofil
->
findAll
();
$data
[
'ias'
]
=
$modeluser
->
getAllIA
();
//
$data['ias'] = $modeluser->getAllIA();
return
view
(
"securite/V_user"
,
$data
);
}
public
function
getSearchIEN
(
$ienOrmail
)
...
...
@@ -42,17 +42,16 @@ class C_sys_user extends BaseController
public
function
save
(){
$modeluser
=
new
M_user
();
$session
=
session
();
$data
=
[
$data
=
[
'prenom'
=>
$this
->
request
->
getPost
(
'prenom'
),
'nom'
=>
$this
->
request
->
getPost
(
'nom'
),
'IEN'
=>
$this
->
request
->
getPost
(
'IEN'
),
'ia'
=>
$this
->
request
->
getPost
(
'ia'
),
'ief'
=>
$this
->
request
->
getPost
(
'ief'
),
'nom_structure'
=>
$this
->
request
->
getPost
(
'nom_structure'
),
'code_str'
=>
$this
->
request
->
getPost
(
'code_str'
),
'email_pro'
=>
$this
->
request
->
getPost
(
'email_pro'
),
'id_type_profil'
=>
$this
->
request
->
getPost
(
'id_type_profil'
),
'password'
=>
$this
->
request
->
getPost
(
'password'
),
];
];
if
(
$modeluser
->
insert
(
$data
)){
return
redirect
()
->
to
(
'/user'
)
->
with
(
'success'
,
'utilisateur ajouter avec succès'
);
}
else
{
...
...
@@ -60,7 +59,7 @@ class C_sys_user extends BaseController
}
}
public
function
getUsers
()
{
{
$users
=
$this
->
userModel
->
findAll
();
$data
=
[];
foreach
(
$users
as
$u
){
...
...
@@ -74,9 +73,6 @@ class C_sys_user extends BaseController
}
return
$this
->
response
->
setJSON
([
'data'
=>
$data
]);
}
public
function
toggleStatus
()
{
$userId
=
$this
->
request
->
getPost
(
'user_id'
);
...
...
@@ -95,42 +91,127 @@ public function toggleStatus()
}
//
// fonction API
// public function getIENInfo()
// {
// $userModel = new M_user();
// $ien = $this->request->getGet('ien'); // récupérer le paramètre ien
public
function
getIENInfo
()
{
$ien
=
$this
->
request
->
getGet
(
'ien'
);
// récupérer le paramètre ien
$email
=
$this
->
request
->
getGet
(
'email_pro'
);
if
(
!
$ien
)
{
return
$this
->
response
->
setStatusCode
(
400
)
->
setJSON
([
'error'
=>
'Paramètre IEN manquant'
]);
}
elseif
(
$email
)
{
$personnel
=
$this
->
PersonnelModel
->
where
(
'email_pro'
,
$email
)
->
findAll
();
}
// URL de l'API externe
$url
=
"https://apps.education.sn/C_personnel_api/getIEN_info?ien="
.
urlencode
(
$ien
);
// Appel à l'API externe
$ch
=
curl_init
(
$url
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
// uniquement si certificat SSL problème
$result
=
curl_exec
(
$ch
);
if
(
curl_errno
(
$ch
))
{
curl_close
(
$ch
);
return
$this
->
response
->
setStatusCode
(
500
)
->
setJSON
([
'error'
=>
'Erreur lors de la connexion à l\'API externe'
]);
// if (!$ien) {
// return $this->response->setStatusCode(400)
// ->setJSON(['error' => 'Paramètre IEN manquant']);
// }
// // URL API externe
// $url = "https://apps.education.sn/C_personnel_api/getIEN_info?ien=" . urlencode($ien);
// // Appel API
// $ch = curl_init($url);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// $result = curl_exec($ch);
// if (curl_errno($ch)) {
// curl_close($ch);
// return $this->response->setStatusCode(500)
// ->setJSON(['error' => 'Erreur lors de la connexion à l\'API externe']);
// }
// curl_close($ch);
// // $apiData = json_decode($result, true);
// // // Fusion infos base + API
// // if (isset($apiData['personnel'][0])) {
// // $apiData['personnel'][0]['NOM_STRUCTURE'] = $user['NOM_STRUCTURE'] ?? '';
// // $apiData['personnel'][0]['type_structure'] = $user['type_structure'] ?? '';
// // }
// $apiData = json_decode($result, true);
// if (isset($apiData['personnel'][0])) {
// $codeStr = $apiData['personnel'][0]['code_str'];
// // Chercher la structure directement par code_str
// $structure = $userModel->getStructureByCodeStr($codeStr);
// $apiData['personnel'][0]['NOM_STRUCTURE'] = $structure['NOM_STRUCTURE'] ?? '';
// $apiData['personnel'][0]['type_structure'] = $structure['type_structure'] ?? '';
// }
// // Retour JSON
// return $this->response->setHeader('Access-Control-Allow-Origin', '*')
// ->setContentType('application/json')
// ->setBody(json_encode($apiData));
// }
// fonction API
public
function
getIENInfo
()
{
$userModel
=
new
M_user
();
$ien
=
$this
->
request
->
getGet
(
'ien'
);
if
(
!
$ien
)
{
return
$this
->
response
->
setStatusCode
(
400
)
->
setJSON
([
'error'
=>
'Paramètre IEN manquant'
]);
}
// ==============================
// 1️⃣ Tentative appel API externe
// ==============================
$url
=
"https://apps.education.sn/C_personnel_api/getIEN_info?ien="
.
urlencode
(
$ien
);
$ch
=
curl_init
(
$url
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
5
);
// important pour éviter blocage
$result
=
curl_exec
(
$ch
);
$curlError
=
curl_errno
(
$ch
);
curl_close
(
$ch
);
// Vérifier si API fonctionne
if
(
!
$curlError
&&
$result
)
{
$apiData
=
json_decode
(
$result
,
true
);
if
(
isset
(
$apiData
[
'personnel'
][
0
]))
{
$codeStr
=
$apiData
[
'personnel'
][
0
][
'code_str'
]
??
null
;
if
(
$codeStr
)
{
$structure
=
$userModel
->
getStructureByCodeStr
(
$codeStr
);
$apiData
[
'personnel'
][
0
][
'NOM_STRUCTURE'
]
=
$structure
[
'NOM_STRUCTURE'
]
??
''
;
$apiData
[
'personnel'
][
0
][
'type_structure'
]
=
$structure
[
'type_structure'
]
??
''
;
}
return
$this
->
response
->
setJSON
(
$apiData
);
}
}
// ===================================
// 2️⃣ Si API ne marche pas → fallback BDD
// ===================================
$personnel
=
$userModel
->
getPersonnelByIEN
(
$ien
);
curl_close
(
$ch
);
if
(
$personnel
)
{
// Renvoie la réponse JSON telle quelle
return
$this
->
response
->
setHeader
(
'Access-Control-Allow-Origin'
,
'*'
)
->
setContentType
(
'application/json'
)
->
setBody
(
$result
);
return
$this
->
response
->
setJSON
([
'code'
=>
'1'
,
'message'
=>
'IEN trouvé localement (API indisponible)'
,
'personnel'
=>
[
$personnel
]
]);
}
return
$this
->
response
->
setStatusCode
(
404
)
->
setJSON
([
'code'
=>
'0'
,
'message'
=>
'IEN introuvable (API et base locale)'
]);
}
// modification
public
function
edit
(
$id
){
$modeluser
=
new
M_user
();
$data
[
'all_user'
]
=
$modeluser
->
find
(
$id
);
...
...
@@ -142,8 +223,7 @@ public function toggleStatus()
'prenom'
=>
$this
->
request
->
getPost
(
'prenom'
),
'nom'
=>
$this
->
request
->
getPost
(
'nom'
),
'IEN'
=>
$this
->
request
->
getPost
(
'IEN'
),
'ia'
=>
$this
->
request
->
getPost
(
'ia'
),
'ief'
=>
$this
->
request
->
getPost
(
'ief'
),
'nom_structure'
=>
$this
->
request
->
getPost
(
'nom_structure'
),
'code_str'
=>
$this
->
request
->
getPost
(
'code_str'
),
'email_pro'
=>
$this
->
request
->
getPost
(
'email_pro'
),
'id_type_profil'
=>
$this
->
request
->
getPost
(
'id_type_profil'
),
...
...
@@ -155,7 +235,16 @@ public function toggleStatus()
return
redirect
()
->
back
()
->
withInput
()
->
with
(
'error'
,
'Échec '
);
}
}
// delete
public
function
delete
(
$id
=
null
)
{
$modeluser
=
new
M_user
();
if
(
$modeluser
->
delete
(
$id
))
{
return
$this
->
response
->
setJSON
([
'success'
=>
true
]);
}
else
{
return
$this
->
response
->
setJSON
([
'success'
=>
false
]);
}
}
// la table atlas
public
function
getIEFByIA
(
$code_ia
)
...
...
app/Models/securite/M_personnel.php
0 → 100644
View file @
857828f2
<?php
namespace
App\Models\securite
;
use
CodeIgniter\Model
;
class
M_personnel
extends
Model
{
protected
$table
=
'sys_personnel'
;
protected
$primaryKey
=
'id_personnel'
;
protected
$allowedFields
=
[
'nom_pers'
,
'prenom_pers'
,
'email_pro'
,
'id_type_profil'
,
'numero_telephone'
,
'adresse'
,
'ien_pers'
,
''
];
protected
$useTimestamps
=
true
;
protected
$createdField
=
'date_creation'
;
protected
$updatedField
=
'date_modification'
;
protected
$deletedField
=
'date_supprission'
;
}
\ No newline at end of file
app/Models/securite/M_user.php
View file @
857828f2
...
...
@@ -8,7 +8,7 @@ class M_user extends Model
{
protected
$table
=
'sys_users'
;
protected
$primaryKey
=
'id'
;
protected
$allowedFields
=
[
'prenom'
,
'nom'
,
'email_pro'
,
'statut'
,
'IEN'
,
'password'
,
'id_type_profil'
,
'code_str'
,
'ia'
,
'ief'
];
protected
$allowedFields
=
[
'prenom'
,
'nom'
,
'
nom_structure'
,
'
email_pro'
,
'statut'
,
'IEN'
,
'password'
,
'id_type_profil'
,
'code_str'
,
'ia'
,
'ief'
];
protected
$useTimestamps
=
true
;
...
...
@@ -153,4 +153,53 @@ public function getFilteredMenus()
->
getResultArray
();
}
// JOINTURE entre la table cod_structure et user
// public function getUserWithStructure($ien)
// {
// $builder = $this->db->table('sys_users p');
// $builder->select("
// p.nom,
// p.prenom,
// p.email_pro,
// p.code_str,
// p.ien,
// s.NOM_STRUCTURE,
// CASE
// WHEN s.NOM_STRUCTURE LIKE 'IA%' THEN 'IA'
// WHEN s.NOM_STRUCTURE LIKE 'IEF%' THEN 'IEF'
// ELSE 'Autre'
// END AS type_structure
// ");
// $builder->join('cod_structure s', 'p.code_str = s.CODE_ADMINISTRATIF', 'left');
// $builder->where('p.ien', $ien);
// return $builder->get()->getRowArray();
// }
public
function
getStructureByCodeStr
(
$codeStr
)
{
return
$this
->
db
->
table
(
'cod_structure'
)
->
select
(
"
NOM_STRUCTURE,
CASE
WHEN NOM_STRUCTURE LIKE 'IA%' THEN 'IA'
WHEN NOM_STRUCTURE LIKE 'IEF%' THEN 'IEF'
ELSE 'Autre'
END AS type_structure
"
)
->
where
(
'CODE_ADMINISTRATIF'
,
$codeStr
)
->
get
()
->
getRowArray
();
}
//
public
function
getPersonnelByIEN
(
$ien
)
{
return
$this
->
db
->
table
(
'personnel'
)
->
where
(
'ien_pers'
,
$ien
)
->
get
()
->
getRowArray
();
}
}
\ No newline at end of file
app/Views/securite/V_menu.php
View file @
857828f2
<?php
echo
view
(
'template/header'
);
?>
<?php
echo
view
(
'template/top_bar'
);
?>
<?php
echo
view
(
'template/left_sidebar'
);
?>
<?php
echo
view
(
'template/footer'
);
?>
<?=
$this
->
extend
(
'template/layout'
)
?>
<?=
$this
->
section
(
'content'
)
?>
<div
class=
"content-page"
>
<!-- Start content -->
...
...
@@ -37,7 +35,7 @@
<thead>
<tr>
<th>
Libelle
</th>
<
th>
Code
</th
>
<
!-- <th>Code</th> --
>
<th>
Etat
</th>
<th>
Action
</th>
</tr>
...
...
@@ -46,7 +44,7 @@
<?php
foreach
(
$menus
as
$menu
)
:
?>
<tr
id=
"row-
<?=
$menu
[
'id_menu'
]
?>
"
>
<td>
<?=
$menu
[
'libelle'
]
?>
</td>
<
td>
<?=
$menu
[
'code'
]
?>
</td
>
<
!-- <td><p?= $menu['code'] ?></td> --
>
<td>
<?php
if
(
$menu
[
'etat'
]
==
1
)
:
?>
<span
class=
"badge bg-success"
>
Actif
</span>
<?php
else
:
?>
...
...
@@ -108,7 +106,7 @@
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-light waves-effect"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"submit"
class=
"btn btn-
danger
waves-effect waves-light save-category"
>
Enregistrer
</button>
class=
"btn btn-
success
waves-effect waves-light save-category"
>
Enregistrer
</button>
</div>
</form>
</div>
...
...
@@ -153,7 +151,7 @@
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-light waves-effect"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"submit"
class=
"btn btn-
danger
waves-effect waves-light save-category"
>
Enregistrer
</button>
class=
"btn btn-
success
waves-effect waves-light save-category"
>
Enregistrer
</button>
</div>
</form>
</div>
...
...
@@ -162,11 +160,9 @@
</div>
</div>
<script
src=
"https://code.jquery.com/jquery-3.7.1.min.js"
></script>
<script
src=
"https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"
></script>
<script
src=
"https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"
></script>
<?=
$this
->
endSection
()
?>
<?=
$this
->
section
(
'scripts'
)
?>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'
#datatable
'
).
DataTable
({
...
...
@@ -229,46 +225,47 @@ $(document).ready(function() {
});
});
// suppression
$
(
document
).
on
(
'
click
'
,
'
.delete-btn
'
,
function
()
{
var
table
=
$
(
'
#datatable
'
).
DataTable
();
const
id
=
$
(
this
).
data
(
'
id
'
);
const
row
=
$
(
this
).
closest
(
'
tr
'
);
const
typeName
=
row
.
find
(
'
td:eq(0)
'
).
text
()
+
'
'
+
row
.
find
(
'
td:eq(1)
'
).
text
();
$
(
document
).
on
(
'
click
'
,
'
.delete-btn
'
,
function
()
{
var
table
=
$
(
'
#datatable
'
).
DataTable
();
const
id
=
$
(
this
).
data
(
'
id
'
);
const
row
=
$
(
this
).
closest
(
'
tr
'
);
const
typeName
=
row
.
find
(
'
td:eq(0)
'
).
text
()
+
'
'
+
row
.
find
(
'
td:eq(1)
'
).
text
();
Swal
.
fire
({
title
:
'
Confirmer la suppression
'
,
html
:
`Voulez-vous vraiment supprimer <strong>
${
typeName
}
</strong> ?`
,
type
:
'
warning
'
,
showCancelButton
:
true
,
confirmButtonColor
:
'
#d33
'
,
cancelButtonColor
:
'
#3085d6
'
,
confirmButtonText
:
'
Oui, supprimer
'
,
cancelButtonText
:
'
Annuler
'
}).
then
((
result
)
=>
{
if
(
result
.
value
)
{
$
.
ajax
({
url
:
'
<?=
site_url
(
'menu/delete'
)
?>
/
'
+
id
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
data
:
{
'
<?=
csrf_token
()
?>
'
:
'
<?=
csrf_hash
()
?>
'
},
success
:
function
(
response
)
{
if
(
response
.
success
)
{
table
.
row
(
row
).
remove
().
draw
(
false
);
Swal
.
fire
(
'
Succès
'
,
response
.
message
,
'
success
'
);
}
else
{
Swal
.
fire
(
'
Erreur
'
,
response
.
message
,
'
error
'
);
Swal
.
fire
({
title
:
'
Confirmer la suppression
'
,
html
:
`Voulez-vous vraiment supprimer <strong>
${
typeName
}
</strong> ?`
,
type
:
'
warning
'
,
showCancelButton
:
true
,
confirmButtonColor
:
'
#d33
'
,
cancelButtonColor
:
'
#3085d6
'
,
confirmButtonText
:
'
Oui, supprimer
'
,
cancelButtonText
:
'
Annuler
'
}).
then
((
result
)
=>
{
if
(
result
.
value
)
{
$
.
ajax
({
url
:
'
<?=
site_url
(
'menu/delete'
)
?>
/
'
+
id
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
data
:
{
'
<?=
csrf_token
()
?>
'
:
'
<?=
csrf_hash
()
?>
'
},
success
:
function
(
response
)
{
if
(
response
.
success
)
{
table
.
row
(
row
).
remove
().
draw
(
false
);
Swal
.
fire
(
'
Succès
'
,
response
.
message
,
'
success
'
);
}
else
{
Swal
.
fire
(
'
Erreur
'
,
response
.
message
,
'
error
'
);
}
},
error
:
function
()
{
Swal
.
fire
(
'
Erreur
'
,
'
Erreur serveur
'
,
'
error
'
);
}
},
error
:
function
()
{
Swal
.
fire
(
'
Erreur
'
,
'
Erreur serveur
'
,
'
error
'
);
}
});
}
});
}
});
});
});
});
</script>
\ No newline at end of file
</script>
<?=
$this
->
endSection
()
?>
\ No newline at end of file
app/Views/securite/V_profil.php
View file @
857828f2
<?php
echo
view
(
'template/header'
);
?>
<?php
echo
view
(
'template/top_bar'
);
?>
<?php
echo
view
(
'template/left_sidebar'
);
?>
<?php
echo
view
(
'template/footer'
);
?>
<?=
$this
->
extend
(
'template/layout'
)
?>
<?=
$this
->
section
(
'content'
)
?>
<div
class=
"content-page"
>
<!-- Start content -->
...
...
@@ -110,7 +109,7 @@
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-light waves-effect"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"submit"
class=
"btn btn-
primary
waves-effect waves-light save-category"
>
Enrègistrer
</button>
class=
"btn btn-
success
waves-effect waves-light save-category"
>
Enrègistrer
</button>
</div>
</form>
</div>
...
...
@@ -150,7 +149,7 @@
<!-- <button type="button" class="btn btn-light waves-effect"
data-dismiss="modal">Close</button> -->
<button
type=
"submit"
class=
"btn btn-
primary
waves-effect waves-light save-category"
>
Enregistrer
</button>
class=
"btn btn-
success
waves-effect waves-light save-category"
>
Enregistrer
</button>
</div>
</form>
</div>
...
...
@@ -165,7 +164,7 @@
<div
class=
"modal-header bg-info text-white"
>
<h5
class=
"modal-title"
><i
class=
"fa fa-cog me-1"
></i>
GESTION DES RÔLES
</h5>
<button
type=
"button"
id=
"checkAll"
class=
"btn btn-success"
>
Cocher tout
Cocher tout
</button>
<!-- <button type="button" id="uncheckAll" class="btn btn-danger">
...
...
@@ -192,13 +191,9 @@
</div>
</div>
</div>
<?=
$this
->
endSection
()
?>
<script
src=
"https://code.jquery.com/jquery-3.7.1.min.js"
></script>
<script
src=
"https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"
></script>
<script
src=
"https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"
></script>
<script
src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/sweetalert2@11"
></script>
<?=
$this
->
section
(
'scripts'
)
?>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'
#datatable
'
).
DataTable
({
...
...
@@ -525,25 +520,26 @@ $('#document').ready(function() {
alert(
'
⚠
Erreur
serveur
'
);
});
});
});
// Lorsque l
'
on
clique
sur
"
checkAll
"
$
(
document
).
on
(
'
click
'
,
'
#checkAll
'
,
function
()
{
// coche toutes les cases sans déclencher change
$
(
'
.perm
'
).
prop
(
'
checked
'
,
true
);
// si tu veux absolument déclencher le change une seule fois après tout
$
(
'
.perm
'
).
trigger
(
'
change
'
);
});
// ❌ Tout décocher
$
(
document
).
on
(
'
click
'
,
'
#uncheckAll
'
,
function
()
{
$
(
'
.perm:checked)
'
).
each
(
function
()
{
$
(
this
).
prop
(
'
checked
'
,
false
).
trigger
(
'
change
'
);
});
// Lorsque l
'
on
clique
sur
"
checkAll
"
$
(
document
).
on
(
'
click
'
,
'
#checkAll
'
,
function
()
{
// coche toutes les cases sans déclencher change
$
(
'
.perm
'
).
prop
(
'
checked
'
,
true
);
// si tu veux absolument déclencher le change une seule fois après tout
$
(
'
.perm
'
).
trigger
(
'
change
'
);
});
// ❌ Tout décocher
$
(
document
).
on
(
'
click
'
,
'
#uncheckAll
'
,
function
()
{
$
(
'
.perm:checked)
'
).
each
(
function
()
{
$
(
this
).
prop
(
'
checked
'
,
false
).
trigger
(
'
change
'
);
});
});
});
</script>
\ No newline at end of file
</script>
<?=
$this
->
endSection
()
?>
\ No newline at end of file
app/Views/securite/V_smenu.php
View file @
857828f2
<?php
echo
view
(
'template/header'
);
?>
<?php
echo
view
(
'template/top_bar'
);
?>
<?php
echo
view
(
'template/left_sidebar'
);
?>
<?php
echo
view
(
'template/footer'
);
?>
<?=
$this
->
extend
(
'template/layout'
)
?>
<?=
$this
->
section
(
'content'
)
?>
<div
class=
"content-page"
>
...
...
@@ -39,7 +37,7 @@
<tr>
<th>
libelle_sous_menu
</th>
<th>
Menu
</th>
<
th>
Code
</th
>
<
!-- <th>Code</th> --
>
<th>
Etat
</th>
<th>
Action
</th>
</tr>
...
...
@@ -50,7 +48,7 @@
<td>
<?=
$smenu
[
'libelle_sous_menu'
]
?>
</td>
<td>
<?=
$smenu
[
'libelle'
]
?>
</td>
<
td>
<?=
$smenu
[
'code_sous_menu'
]
?>
</td
>
<
!-- <td><p?= $smenu['code_sous_menu'] ?></td> --
>
<td>
<?php
if
(
$smenu
[
'etat_sous_menu'
]
==
1
)
:
?>
<span
class=
"badge bg-success"
>
Actif
</span>
<?php
else
:
?>
...
...
@@ -111,7 +109,8 @@
</div>
<div
class=
"col-md-6"
>
<label
class=
"control-label"
>
Choisir etat
</label>
<select
class=
"form-control form-white"
data-placeholder=
"etat"
name=
"etat_sous_menu"
required
>
<select
class=
"form-control form-white"
data-placeholder=
"etat"
name=
"etat_sous_menu"
required
>
<option
value=
"1"
>
Actif
</option>
<option
value=
"-1"
>
Dèsactive
</option>
...
...
@@ -121,7 +120,7 @@
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-light waves-effect"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"submit"
class=
"btn btn-
danger
waves-effect waves-light save-category"
>
Enregistrer
</button>
class=
"btn btn-
success
waves-effect waves-light save-category"
>
Enregistrer
</button>
</div>
</form>
</div>
...
...
@@ -134,7 +133,7 @@
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h4
class=
"modal-title mt-0"
><strong>
Modifier
</strong>
un M
enu
</h4>
<h4
class=
"modal-title mt-0"
><strong>
Modifier
</strong>
le sous_m
enu
</h4>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
</div>
<div
class=
"modal-body"
>
...
...
@@ -149,8 +148,9 @@
id=
"edit_libelle"
name=
"libelle_sous_menu"
required
>
</div>
<div
class=
"col-md-6"
>
<label
for=
"edit_id_menu"
class=
"control-label"
>
Menu
</label>
<select
class=
"form-control form-white"
id=
"edit_id_menu"
data-placeholder=
"MENU"
name=
"id_menu"
required
>
<label
for=
"edit_id_menu"
class=
"control-label"
>
Menu
</label>
<select
class=
"form-control form-white"
id=
"edit_id_menu"
data-placeholder=
"MENU"
name=
"id_menu"
required
>
<option>
menu
</option>
<?php
foreach
(
$menus
as
$menu
)
:?>
<
option
value
=
"<?=
$menu['id_menu']
?>"
><?=
$menu
[
'libelle'
]
?>
</option>
...
...
@@ -176,7 +176,7 @@
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-light waves-effect"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"submit"
class=
"btn btn-
danger
waves-effect waves-light save-category"
>
Enregistrer
</button>
class=
"btn btn-
success
waves-effect waves-light save-category"
>
Enregistrer
</button>
</div>
</form>
</div>
...
...
@@ -184,11 +184,9 @@
</div>
</div>
</div>
<script
src=
"https://code.jquery.com/jquery-3.7.1.min.js"
></script>
<script
src=
"https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"
></script>
<script
src=
"https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"
></script>
<?=
$this
->
endSection
()
?>
<?=
$this
->
section
(
'scripts'
)
?>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'
#datatable
'
).
DataTable
({
...
...
@@ -235,7 +233,7 @@ $(document).ready(function() {
const
smenu
=
response
.
smenus
;
$
(
'
#edit_id_sous_menu
'
).
val
(
smenu
.
id_sous_menu
);
$
(
'
#edit_libelle
'
).
val
(
smenu
.
libelle_sous_menu
);
$
(
'
#edit_id_menu
'
).
val
(
smenu
.
id_menu
);
$
(
'
#edit_id_menu
'
).
val
(
smenu
.
id_menu
);
$
(
'
#edit_codesmenu
'
).
val
(
smenu
.
code_sous_menu
);
$
(
'
#edit_etatsmenu
'
).
val
(
smenu
.
etat_sous_menu
);
$
(
'
#formEdit
'
).
attr
(
'
action
'
,
'
<?=
site_url
(
'sousmenu/update'
)
?>
/
'
+
smenu
...
...
@@ -294,4 +292,5 @@ $(document).ready(function() {
});
</script>
\ No newline at end of file
</script>
<?=
$this
->
endSection
()
?>
\ No newline at end of file
app/Views/securite/V_user.php
View file @
857828f2
This diff is collapsed.
Click to expand it.
app/Views/template/layout.php
View file @
857828f2
<?php
echo
view
(
'template/header'
);
?>
<?php
echo
view
(
'template/top_bar'
);
?>
<?php
echo
view
(
'template/left_sidebar'
);
?>
<div
id=
"wrapper"
>
<?php
echo
view
(
'template/top_bar'
);
?>
<?php
echo
view
(
'template/left_sidebar'
);
?>
<main>
<?=
$this
->
renderSection
(
'content'
)
?>
</main>
</div>
<?php
echo
view
(
'template/footer'
);
?>
<!-- TODO: use managing_menu -->
<?php
echo
view
(
'template/right_content'
);
?>
<?php
echo
view
(
'template/right_sidebar'
);
?>
<?php
echo
view
(
'template/footer'
);
?>
\ No newline at end of file
<!-- JS commun à toutes les pages -->
<script
src=
"https://code.jquery.com/jquery-3.7.1.min.js"
></script>
<script
src=
"https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"
></script>
<script
src=
"https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"
></script>
<script
src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/sweetalert2@11"
></script>
<!-- JS spécifique à chaque vue -->
<?=
$this
->
renderSection
(
'scripts'
)
?>
app/Views/template/left_sidebar.php
View file @
857828f2
...
...
@@ -45,7 +45,7 @@
if
(
!
empty
(
$menu_roles
[
'DASH'
]))
:
?>
<li>
<a
href=
"
<?=
base_url
(
'
Dashboard
'
)
?>
"
>
<a
href=
"
<?=
base_url
(
'
tableaubordre
'
)
?>
"
>
<i
class=
"md md-home"
></i>
Tableau de bord
</a>
</li>
...
...
@@ -54,17 +54,20 @@
<li
class=
"has_sub"
>
<a
href=
"#"
class=
"waves-effect"
><i
class=
"fa fa-cog"
></i><span>
Configuration
</span><span
class=
"pull-right"
><i
class=
"md md-add"
></i></span></a>
<ul
class=
"list-unstyled"
>
<ul
class=
"list-unstyled"
>
<?php
if
(
!
empty
(
$smenu_roles
[
'TYPE_OFFRE'
][
'd_read'
]))
:
?>
<li><a
href=
"
<?=
base_url
(
'typeoffre'
)
?>
"
id=
"menu_type_offre"
>
Structure
</a></li>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$smenu_roles
[
'GESTION STRUCTURE'
][
'd_read'
]))
:
?>
<li><a
href=
"
<?=
base_url
(
'structure'
)
?>
"
id=
"menu_structure"
>
Structure
</a></li>
<?php
endif
;
?>
<?php
endif
;
?>
</ul>
</li>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$menu_roles
[
'SECURITE'
]))
:
?>
<li
class=
"has_sub"
>
<a
href=
"#"
class=
"waves-effect"
><i
class=
"md md-lock-outline"
></i><span>
Sécurité
</span><span
class=
"pull-right"
><i
class=
"md md-add"
></i></span></a>
<ul
class=
"list-unstyled"
>
...
...
@@ -81,12 +84,12 @@
<?php
endif
;
?>
<?php
if
(
!
empty
(
$smenu_roles
[
'UTILISATEUR'
][
'd_read'
]))
:
?>
<li><a
href=
"
<?=
base_url
(
'user'
)
?>
"
id=
"user_securite"
>
Utilisateur
</a></li>
<li><a
href=
"
<?=
base_url
(
'user'
)
?>
"
id=
"user_securite"
>
Utilisateur
</a></li>
<?php
endif
;
?>
</ul>
</li>
<?php
endif
;
?>
...
...
app/Views/template/right_content.php
View file @
857828f2
<div
class=
"content-page"
>
<?=
$this
->
extend
(
'template/layout'
)
?>
<?=
$this
->
section
(
'content'
)
?>
<div
class=
"content-page"
>
<!-- Start content -->
<div
class=
"content"
>
<div
class=
"container-fluid"
>
...
...
@@ -8,8 +11,8 @@
<div
class=
"col-sm-12"
>
<h4
class=
"pull-left page-title"
>
Tableau de bord
</h4>
<ol
class=
"breadcrumb pull-right"
>
<
!-- <
li><a href="#">Moltran</a></li>
<li class="active">Dashboard</li>
-->
<li><a
href=
"#"
>
Moltran
</a></li>
<li
class=
"active"
>
Dashboard
</li>
</ol>
</div>
</div>
...
...
@@ -510,4 +513,5 @@
</ul>
</div>
</div>
<!-- /Right-bar -->
\ No newline at end of file
<!-- /Right-bar -->
<?=
$this
->
endSection
()
?>
\ No newline at end of file
app/Views/template/right_sidebar.php
deleted
100644 → 0
View file @
7eb41bae
app/Views/template/tableaubordre.php
0 → 100644
View file @
857828f2
<!-- TODO: use managing_menu -->
<?php
echo
view
(
'template/right_content'
);
?>
<!-- <p?php echo view('template/right_sidebar'); ?> -->
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment