Editeur Editez un fichier

Edition d'un fichier

Editez le fichier applications/nuasix/api_table_commands.php
<?php
//_________________________________________________________________________________
//Récupération toutes les commandes de cette application
$reqSelectCommands      = getQueries("api_commands", array("application_id" => $idApplication, 'command_type' => 'select', 'command_status' => 1));
$selectCommands         = $reqSelectCommands['result'];
$reqInsertCommands      = getQueries("api_commands", array("application_id" => $idApplication, 'command_type' => 'insert', 'command_status' => 1));
$insertCommands         = $reqInsertCommands['result'];
$reqDeleteCommands      = getQueries("api_commands", array("application_id" => $idApplication, 'command_type' => 'delete', 'command_status' => 1));
$deleteCommands         = $reqDeleteCommands['result'];
$reqUpdateCommands      = getQueries("api_commands", array("application_id" => $idApplication, 'command_type' => 'update', 'command_status' => 1));
$updateCommands         = $reqUpdateCommands['result'];
//Récupération toutes les tables de cette application
$reqTables              = getQueries("api_infos_tables", array("application_id" => $idApplication));
$tables                 = $reqTables['result'];
//_________________________________________________________________________________
//_________________________________________________________________________________
//Récupération des commandes de la table
if(isset($_GET['element'])) {
    $idTable            = encrypt_decrypt("decrypt", rawurldecode($_GET['element']), $key_user, $iv_user);
    
    //Récupération données table
    $reqTable           = getQueries("api_infos_tables", array("idInfoTable" => $idTable));
    $table              = $reqTable['result'][0];
    
    //Récupération commande select
    $reqSelectCommand   = getQueries("api_infos_tables_commands LEFT JOIN api_commands ON api_infos_tables_commands.command_id = api_commands.idCommand ", 
                                     array("api_commands.command_type" => "select", "api_infos_tables_commands.table_id" => $idTable));
    $selectCommand      = $reqSelectCommand['result'][0];

    //Récupération commande insert
    $reqInsertCommand   = getQueries("api_infos_tables_commands LEFT JOIN api_commands ON api_infos_tables_commands.command_id = api_commands.idCommand ", 
                                     array("api_commands.command_type" => "insert", "api_infos_tables_commands.table_id" => $idTable));
    $insertCommand      = $reqInsertCommand['result'][0];
    
    //Récupération commande delete
    $reqDeleteCommand   = getQueries("api_infos_tables_commands LEFT JOIN api_commands ON api_infos_tables_commands.command_id = api_commands.idCommand ", 
                                     array("api_commands.command_type" => "delete", "api_infos_tables_commands.table_id" => $idTable));
    $deleteCommand      = $reqDeleteCommand['result'][0];
    
    //Récupération commande update
    $reqUpdateCommand   = getQueries("api_infos_tables_commands LEFT JOIN api_commands ON api_infos_tables_commands.command_id = api_commands.idCommand ", 
                                     array("api_commands.command_type" => "update", "api_infos_tables_commands.table_id" => $idTable));
    $updateCommand      = $reqUpdateCommand['result'][0];
}
//_________________________________________________________________________________
//_________________________________________________________________________________
//Récupère des données techniques
/*
$sth                    = $bdd -> query('SHOW TABLE STATUS');
$dbSize                 = 0;
$row                    = $sth -> fetch(PDO::FETCH_ASSOC);
$dbSize                 = $row["Data_length"];
$decimals               = 2;  
$mbytes                 = round($dbSize/(1024*1024),$decimals);
*/
//Version PHP et DB
$versionPHP             = phpversion();
$sth                    = $bdd -> query('SELECT VERSION()');
$versionDB              = $sth -> fetch();
//_________________________________________________________________________________
//_________________________________________________________________________________
//Mise à jour des attributions
if(isset($_POST['update-attributions'])) {
    
    //Récupérer les données du formulaire
    $commandSelect          = htmlspecialchars($_POST['select_command']);
    $commandInsert          = htmlspecialchars($_POST['insert_command']);
    $commandDelete          = htmlspecialchars($_POST['delete_command']);
    $commandUpdate          = htmlspecialchars($_POST['update_command']);


    //Suppression des liens actuels de la table
    dbRowDelete('api_infos_tables_commands', 'table_id = '.$idTable.'');
    
    //_________________________________________________________________________________
    //Lien table select
    $form       = array('command_id'                => $commandSelect, 
                        'table_id'                  => $idTable, 
                        'user_id'                   => $user -> getUserId() ); 

    $flag       = dbRowInsert2('api_infos_tables_commands', $form);
    //_________________________________________________________________________________
    //_________________________________________________________________________________
    //Lien table insert
    $form       = array('command_id'                => $commandInsert, 
                        'table_id'                  => $idTable, 
                        'user_id'                   => $user -> getUserId() ); 

    $flag       = dbRowInsert2('api_infos_tables_commands', $form);
    //_________________________________________________________________________________
    //_________________________________________________________________________________
    //Lien table delete
    $form       = array('command_id'                => $commandDelete, 
                        'table_id'                  => $idTable, 
                        'user_id'                   => $user -> getUserId() ); 

    $flag       = dbRowInsert2('api_infos_tables_commands', $form);
    //_________________________________________________________________________________
    //_________________________________________________________________________________
    //Lien table update
    $form       = array('command_id'                => $commandUpdate, 
                        'table_id'                  => $idTable, 
                        'user_id'                   => $user -> getUserId() ); 

    $flag       = dbRowInsert2('api_infos_tables_commands', $form);
    //_________________________________________________________________________________
    
    //Refresh
    redirect($_SERVER['REQUEST_URI']);
}
//_________________________________________________________________________________
?>
                    <div class="content d-flex flex-column flex-column-fluid" id="kt_content">
						<!--begin::Container-->
						<div class="container-xxl" id="kt_content_container">
							<!--begin::Navbar-->
							<div class="card mb-5 mb-xl-10">
								<div class="card-body pt-9 pb-0">
									<!--begin::Details-->
									<div class="d-flex flex-wrap flex-sm-nowrap mb-3">
										<!--begin::Info-->
										<div class="flex-grow-1">
											<!--begin::Title-->
											<div class="d-flex justify-content-between align-items-start flex-wrap mb-2">
												<!--begin::User-->
												<div class="d-flex flex-column">
													<!--begin::Name-->
													<div class="d-flex align-items-center mb-2">
														<a href="#" class="text-gray-900 text-hover-primary fs-2 fw-bolder me-1"><?= $base_donnees?></a>
														<a href="#">
															<!--begin::Svg Icon | path: icons/duotune/general/gen026.svg-->
															<span class="svg-icon svg-icon-1 svg-icon-primary">
																<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
																	<path d="M10.0813 3.7242C10.8849 2.16438 13.1151 2.16438 13.9187 3.7242V3.7242C14.4016 4.66147 15.4909 5.1127 16.4951 4.79139V4.79139C18.1663 4.25668 19.7433 5.83365 19.2086 7.50485V7.50485C18.8873 8.50905 19.3385 9.59842 20.2758 10.0813V10.0813C21.8356 10.8849 21.8356 13.1151 20.2758 13.9187V13.9187C19.3385 14.4016 18.8873 15.491 19.2086 16.4951V16.4951C19.7433 18.1663 18.1663 19.7433 16.4951 19.2086V19.2086C15.491 18.8873 14.4016 19.3385 13.9187 20.2758V20.2758C13.1151 21.8356 10.8849 21.8356 10.0813 20.2758V20.2758C9.59842 19.3385 8.50905 18.8873 7.50485 19.2086V19.2086C5.83365 19.7433 4.25668 18.1663 4.79139 16.4951V16.4951C5.1127 15.491 4.66147 14.4016 3.7242 13.9187V13.9187C2.16438 13.1151 2.16438 10.8849 3.7242 10.0813V10.0813C4.66147 9.59842 5.1127 8.50905 4.79139 7.50485V7.50485C4.25668 5.83365 5.83365 4.25668 7.50485 4.79139V4.79139C8.50905 5.1127 9.59842 4.66147 10.0813 3.7242V3.7242Z" fill="#00A3FF" />
																	<path class="permanent" d="M14.8563 9.1903C15.0606 8.94984 15.3771 8.9385 15.6175 9.14289C15.858 9.34728 15.8229 9.66433 15.6185 9.9048L11.863 14.6558C11.6554 14.9001 11.2876 14.9258 11.048 14.7128L8.47656 12.4271C8.24068 12.2174 8.21944 11.8563 8.42911 11.6204C8.63877 11.3845 8.99996 11.3633 9.23583 11.5729L11.3706 13.4705L14.8563 9.1903Z" fill="white" />
																</svg>
															</span>
															<!--end::Svg Icon-->
														</a>
														<span class="btn btn-sm btn-light-success fw-bolder ms-2 fs-8 py-1 px-3"><?= $_SESSION['current_application_prefix']?></span>
													</div>
													<!--end::Name-->
													<!--begin::Info-->
													<div class="d-flex flex-wrap fw-bold fs-6 mb-4 pe-2">
														<a href="#" class="d-flex align-items-center text-gray-400 text-hover-primary me-5 mb-2">
														<!--begin::Svg Icon | path: assets/media/icons/duotune/general/gen019.svg-->
                                                        <span class="svg-icon svg-icon-muted svg-icon-2hx"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
                                                        <path d="M17.5 11H6.5C4 11 2 9 2 6.5C2 4 4 2 6.5 2H17.5C20 2 22 4 22 6.5C22 9 20 11 17.5 11ZM15 6.5C15 7.9 16.1 9 17.5 9C18.9 9 20 7.9 20 6.5C20 5.1 18.9 4 17.5 4C16.1 4 15 5.1 15 6.5Z" fill="black"/>
                                                        <path opacity="0.3" d="M17.5 22H6.5C4 22 2 20 2 17.5C2 15 4 13 6.5 13H17.5C20 13 22 15 22 17.5C22 20 20 22 17.5 22ZM4 17.5C4 18.9 5.1 20 6.5 20C7.9 20 9 18.9 9 17.5C9 16.1 7.9 15 6.5 15C5.1 15 4 16.1 4 17.5Z" fill="black"/>
                                                        </svg></span>
                                                        <!--end::Svg Icon--><?= $versionDB[0]?></a>
													</div>
													<!--end::Info-->
												</div>
												<!--end::User-->
                                                <?php
                                                if(isset($idTable)) {?>
                                                <!--begin::Actions-->
												<div class="d-flex my-4">
													<!--begin::Menu-->
													<div class="me-0">
														<button class="btn btn-sm btn-icon btn-bg-light btn-active-color-primary" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end">
															<i class="bi bi-three-dots fs-3"></i>
														</button>
														<!--begin::Menu 3-->
														<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg-light-primary fw-bold w-200px py-3" data-kt-menu="true">
															<!--begin::Heading-->
															<div class="menu-item px-3">
																<div class="menu-content text-muted pb-2 px-3 fs-7 text-uppercase">Attribution</div>
															</div>
															<!--end::Heading-->
															<!--begin::Menu item-->
															<div class="menu-item px-3">
																<a href="#" class="menu-link text-danger px-5" data-action="delete" data-table="<?= encrypt_decrypt("encrypt", "api_infos_tables_commands", $key_user, $iv_user)?>" data-column_primary="<?= encrypt_decrypt("encrypt", "table_id", $key_user, $iv_user)?>" data-id="<?= encrypt_decrypt("encrypt", $idTable, $key_user, $iv_user)?>" data-method="custom">Supprimer toutes les attributions</a>
															</div>
															<!--end::Menu item-->
														</div>
														<!--end::Menu 3-->
													</div>
													<!--end::Menu-->
												</div>
												<!--end::Actions-->    
                                                <?php
                                                }
                                                ?>
											</div>
											<!--end::Title-->
										</div>
										<!--end::Info-->
									</div>
									<!--end::Details-->
									<!--begin::Navs-->
									<ul class="nav nav-stretch nav-line-tabs nav-line-tabs-2x border-transparent fs-5 fw-bolder">
										<!--begin::Nav item-->
										<li class="nav-item mt-2">
											<a class="nav-link text-active-primary ms-0 me-10 py-5" href="index.php?page_slug=api_tables">Tables</a>
										</li>
										<!--end::Nav item-->
										<!--begin::Nav item-->
										<li class="nav-item mt-2">
											<a class="nav-link text-active-primary ms-0 me-10 py-5" href="index.php?page_slug=api_columns">Colonnes</a>
										</li>
										<!--end::Nav item-->
										<!--begin::Nav item-->
										<li class="nav-item mt-2">
											<a class="nav-link text-active-primary ms-0 me-10 py-5" href="index.php?page_slug=api_joints">Jointures</a>
										</li>
										<!--end::Nav item-->
                                        <!--begin::Nav item-->
										<li class="nav-item mt-2">
											<a class="nav-link text-active-primary ms-0 me-10 py-5 active" href="index.php?page_slug=api_table-commands">Commandes</a>
										</li>
										<!--end::Nav item-->
									</ul>
									<!--begin::Navs-->
								</div>
							</div>
							<!--end::Navbar-->
                            <?php
                            if(isset($_GET['element'])) {?>
							<!--begin::Colonnes-->
							<div class="card mb-5 mb-xl-10">
								<!--begin::Card header-->
								<div class="card-header border-0 cursor-pointer" role="button" data-bs-toggle="collapse" data-bs-target="#columns" aria-expanded="true" aria-controls="columns">
									<div class="card-title m-0">
										<h3 class="fw-bolder m-0">Liste des attributions</h3>
									</div>
								</div>
								<!--begin::Card header-->
								<!--begin::Content-->
								<div id="tables" class="collapse show">
									<!--begin::Form-->
									<form class="form" action="" method="post">
										<!--begin::Card body-->
										<div class="card-body border-top px-9 py-9">
                                            <!--begin::Option-->
											<label class="form-check form-check-custom form-check-solid align-items-start">
												<!--begin::Label-->
												<span class="form-check-label d-flex flex-column align-items-start">
													<span class="fw-bolder fs-5 mb-0">Lecture des données</span>
													<!--begin::Input group-->
                                                    <div class="fv-row mb-7">
                                                        <!--begin::Input-->
                                                        <select data-control="select2" data-placeholder="Choisir une commande..." class="form-select form-select-solid form-select-lg fw-bold" name="select_command">
                                                            <option>Choisir une commande</option>
                                                            <?php
                                                            foreach($selectCommands as $command) {
                                                                $selected   = $command['idCommand'] == $selectCommand['idCommand'] ? "selected" : "";
                                                                echo '<option value="'.$command['idCommand'].'" '.$selected.'>'.$command['command_name'].'</option>';
                                                            }
                                                            ?>
                                                        </select>
                                                        <!--end::Input-->
                                                    </div>
                                                    <!--end::Input group-->
												</span>
												<!--end::Label-->
											</label>
											<!--end::Option-->
                                            <!--begin::Option-->
											<div class="separator separator-dashed my-6"></div>
											<!--end::Option-->
                                            <!--begin::Option-->
											<label class="form-check form-check-custom form-check-solid align-items-start">
												<!--begin::Label-->
												<span class="form-check-label d-flex flex-column align-items-start">
													<span class="fw-bolder fs-5 mb-0">Ecriture des données</span>
													<!--begin::Input group-->
                                                    <div class="fv-row mb-7">
                                                        <!--begin::Input-->
                                                        <select data-control="select2" data-placeholder="Choisir une commande..." class="form-select form-select-solid form-select-lg fw-bold" name="insert_command">
                                                            <option>Choisir une commande</option>
                                                            <?php
                                                            foreach($insertCommands as $command) {
                                                                $selected   = $command['idCommand'] == $insertCommand['idCommand'] ? "selected" : "";
                                                                echo '<option value="'.$command['idCommand'].'" '.$selected.'>'.$command['command_name'].'</option>';
                                                            }
                                                            ?>
                                                        </select>
                                                        <!--end::Input-->
                                                    </div>
                                                    <!--end::Input group-->
												</span>
												<!--end::Label-->
											</label>
											<!--end::Option-->
                                            <!--begin::Option-->
											<div class="separator separator-dashed my-6"></div>
											<!--end::Option-->
                                            <!--begin::Option-->
											<label class="form-check form-check-custom form-check-solid align-items-start">
												<!--begin::Label-->
												<span class="form-check-label d-flex flex-column align-items-start">
													<span class="fw-bolder fs-5 mb-0">Suppression des données</span>
													<!--begin::Input group-->
                                                    <div class="fv-row mb-7">
                                                        <!--begin::Input-->
                                                        <select data-control="select2" data-placeholder="Choisir une commande..." class="form-select form-select-solid form-select-lg fw-bold" name="delete_command">
                                                            <option>Choisir une commande</option>
                                                            <?php
                                                            foreach($deleteCommands as $command) {
                                                                $selected   = $command['idCommand'] == $deleteCommand['idCommand'] ? "selected" : "";
                                                                echo '<option value="'.$command['idCommand'].'" '.$selected.'>'.$command['command_name'].'</option>';
                                                            }
                                                            ?>
                                                        </select>
                                                        <!--end::Input-->
                                                    </div>
                                                    <!--end::Input group-->
												</span>
												<!--end::Label-->
											</label>
											<!--end::Option-->
                                            <!--begin::Option-->
											<div class="separator separator-dashed my-6"></div>
											<!--end::Option-->
                                            <!--begin::Option-->
											<label class="form-check form-check-custom form-check-solid align-items-start">
												<!--begin::Label-->
												<span class="form-check-label d-flex flex-column align-items-start">
													<span class="fw-bolder fs-5 mb-0">Mise à jour des données</span>
													<!--begin::Input group-->
                                                    <div class="fv-row mb-7">
                                                        <!--begin::Input-->
                                                        <select data-control="select2" data-placeholder="Choisir une commande..." class="form-select form-select-solid form-select-lg fw-bold" name="update_command">
                                                            <option>Choisir une commande</option>
                                                            <?php
                                                            foreach($updateCommands as $command) {
                                                                $selected   = $command['idCommand'] == $updateCommand['idCommand'] ? "selected" : "";
                                                                echo '<option value="'.$command['idCommand'].'" '.$selected.'>'.$command['command_name'].'</option>';
                                                            }
                                                            ?>
                                                        </select>
                                                        <!--end::Input-->
                                                    </div>
                                                    <!--end::Input group-->
												</span>
												<!--end::Label-->
											</label>
											<!--end::Option-->
										</div>
										<!--end::Card body-->
										<!--begin::Card footer-->
										<div class="card-footer d-flex justify-content-end py-6 px-9">
											<button class="btn btn-primary px-6" type="submit" name="update-attributions">Enregistrer</button>
										</div>
										<!--end::Card footer-->
									</form>
									<!--end::Form-->
								</div>
								<!--end::Content-->
							</div>
							<!--end::Colonnes-->    
                            <?php
                            } else {?>
                            <!--begin::Tables-->
							<div class="card mb-5 mb-xl-10">
								<!--begin::Card header-->
								<div class="card-header border-0 cursor-pointer" role="button" data-bs-toggle="collapse" data-bs-target="#tables" aria-expanded="true" aria-controls="tables">
									<div class="card-title m-0">
										<h3 class="fw-bolder m-0">Choisissez une table pour éditer les attributions</h3>
									</div>
								</div>
								<!--begin::Card header-->
								<!--begin::Content-->
								<div id="tables" class="collapse show">
                                    <!--begin::Card body-->
                                    <div class="card-body border-top px-9 py-9">
                                        <div class="table-responsive">
                                            <!--begin::Table-->
                                            <table class="table align-middle gs-0 gy-5">
                                                <!--begin::Table head-->
                                                <thead>
                                                    <tr>
                                                        <th class="p-0 w-50px"></th>
                                                        <th class="p-0 min-w-40px"></th>
                                                    </tr>
                                                </thead>
                                                <!--end::Table head-->
                                                <!--begin::Table body-->
                                                <tbody>
                                                    <?php
                                                    foreach($tables as $table) {?>
                                                    <tr>
                                                        <td>
                                                            <a href="index.php?page_slug=api_table-commands&element=<?= rawurlencode(encrypt_decrypt("encrypt", $table['idInfoTable'], $key_user, $iv_user))?>" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"><?= $table['info_table_name']?></a>
                                                            <span class="text-muted fw-bold d-block fs-7"><?= $table['info_table_description']?></span>
                                                        </td>
                                                        <td class="text-end">
                                                            <a href="index.php?page_slug=api_table-commands&element=<?= rawurlencode(encrypt_decrypt("encrypt", $table['idInfoTable'], $key_user, $iv_user))?>" class="btn btn-sm btn-icon btn-bg-light btn-active-color-primary">
                                                                <!--begin::Svg Icon | path: icons/duotune/arrows/arr064.svg-->
                                                                <span class="svg-icon svg-icon-2">
                                                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
                                                                        <rect opacity="0.5" x="18" y="13" width="13" height="2" rx="1" transform="rotate(-180 18 13)" fill="black"></rect>
                                                                        <path d="M15.4343 12.5657L11.25 16.75C10.8358 17.1642 10.8358 17.8358 11.25 18.25C11.6642 18.6642 12.3358 18.6642 12.75 18.25L18.2929 12.7071C18.6834 12.3166 18.6834 11.6834 18.2929 11.2929L12.75 5.75C12.3358 5.33579 11.6642 5.33579 11.25 5.75C10.8358 6.16421 10.8358 6.83579 11.25 7.25L15.4343 11.4343C15.7467 11.7467 15.7467 12.2533 15.4343 12.5657Z" fill="black"></path>
                                                                    </svg>
                                                                </span>
                                                                <!--end::Svg Icon-->
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    <?php
                                                    }
                                                    ?>
                                                </tbody>
                                                <!--end::Table body-->
                                            </table>
                                            <!--end::Table-->
                                        </div>
                                    </div>
                                    <!--end::Card body-->
								</div>
								<!--end::Content-->
							</div>
							<!--end::Tables-->    
                            <?php
                            }
                            ?>
							<!--begin::Modals-->
                            <!--begin::Modal - Add task-->
                            <div class="modal fade" id="add-item" tabindex="-1" aria-hidden="true">
                                <!--begin::Modal dialog-->
                                <div class="modal-dialog modal-dialog-centered mw-650px">
                                    <!--begin::Modal content-->
                                    <div class="modal-content">
                                        <!--begin::Modal header-->
                                        <div class="modal-header" id="kt_modal_add_user_header">
                                            <!--begin::Modal title-->
                                            <h2 class="fw-bolder">Créer une colonne</h2>
                                            <!--end::Modal title-->
                                            <!--begin::Close-->
                                            <div class="btn btn-icon btn-sm btn-active-icon-primary" data-kt-users-modal-action="close">
                                                <!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg-->
                                                <span class="svg-icon svg-icon-1">
                                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
                                                        <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="black" />
                                                        <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="black" />
                                                    </svg>
                                                </span>
                                                <!--end::Svg Icon-->
                                            </div>
                                            <!--end::Close-->
                                        </div>
                                        <!--end::Modal header-->
                                        <!--begin::Modal body-->
                                        <div class="modal-body scroll-y mx-5 mx-xl-15 my-7">
                                            <!--begin::Form-->
                                            <form  class="form" action="" method="post">
                                                <!--begin::Scroll-->
                                                <div class="d-flex flex-column scroll-y me-n7 pe-7" id="kt_modal_add_user_scroll" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_modal_add_user_header" data-kt-scroll-wrappers="#kt_modal_add_user_scroll" data-kt-scroll-offset="300px">
                                                    <!--begin::Input group-->
                                                    <div class="fv-row mb-7">
                                                        <!--begin::Label-->
                                                        <label class="required fw-bold fs-6 mb-2">Nom</label>
                                                        <!--end::Label-->
                                                        <!--begin::Input-->
                                                        <input type="text" name="info_table_column_name" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Ex: customer_name" />
                                                        <!--end::Input-->
                                                    </div>
                                                    <!--end::Input group-->
                                                    <!--begin::Input group-->
                                                    <div class="fv-row mb-7">
                                                        <!--begin::Label-->
                                                        <label class="required fw-bold fs-6 mb-2">Description</label>
                                                        <!--end::Label-->
                                                        <!--begin::Input-->
                                                        <textarea name="info_table_column_description" class="form-control form-control-solid mb-3 mb-lg-0"></textarea>
                                                        <!--end::Input-->
                                                    </div>
                                                    <!--end::Input group-->
                                                    <!--begin::Input group-->
                                                    <div class="fv-row mb-7">
                                                        <!--begin::Label-->
                                                        <label class="required fw-bold fs-6 mb-2">Type de donnée SQL</label>
                                                        <!--end::Label-->
                                                        <!--begin::Input-->
                                                        <select data-control="select2" data-placeholder="Choisir un type..." class="form-select form-select-solid form-select-lg fw-bold" name="info_table_column_type">
                                                            <?php
                                                            foreach($settings as $optionGroup => $array) {
                                                                echo '<optgroup label="'.$optionGroup.'">';
                                                                foreach($array as $value => $option)
                                                                     echo '<option value="'.$value.'">'.$option.'</option>';
                                                                echo '</optgroup>';
                                                            }
                                                            ?>
                                                        </select>
                                                        <!--end::Input-->
                                                    </div>
                                                    <!--end::Input group-->
                                                    <!--begin::Input group-->
                                                    <div class="fv-row mb-7">
                                                        <!--begin::Label-->
                                                        <label class="required fw-bold fs-6 mb-2">Taille</label>
                                                        <!--end::Label-->
                                                        <!--begin::Input-->
                                                        <input type="number" name="info_table_column_length" class="form-control form-control-solid mb-3 mb-lg-0" />
                                                        <!--end::Input-->
                                                    </div>
                                                    <!--end::Input group-->
                                                    <!--begin::Input group-->
                                                    <div class="mb-7">
                                                        <!--begin::Label-->
                                                        <label class="required fw-bold fs-6 mb-5">Chiffrement</label>
                                                        <!--end::Label-->
                                                        <!--begin::Accessibilité-->
                                                        <!--begin::Input row-->
                                                        <div class="d-flex fv-row">
                                                            <!--begin::Radio-->
                                                            <div class="form-check form-check-custom form-check-solid">
                                                                <!--begin::Input-->
                                                                <input class="form-check-input me-3" name="info_table_column_encrypt" type="radio" value="0" id="info_table_column_encrypt_0" checked />
                                                                <!--end::Input-->
                                                                <!--begin::Label-->
                                                                <label class="form-check-label" for="info_table_column_encrypt_0">
                                                                    <div class="fw-bolder text-gray-800">Ne pas chiffrer</div>
                                                                    <div class="text-gray-600">Les données seront visibles en brut dans la base de donnée</div>
                                                                </label>
                                                                <!--end::Label-->
                                                            </div>
                                                            <!--end::Radio-->
                                                            <div class='separator separator-dashed my-5'></div>

                                                        </div>
                                                        <!--end::Input row-->
                                                        <!--begin::Input row-->
                                                        <div class="d-flex fv-row">
                                                            <!--begin::Radio-->
                                                            <div class="form-check form-check-custom form-check-solid">
                                                                <!--begin::Input-->
                                                                <input class="form-check-input me-3" name="info_table_column_encrypt" type="radio" value="1" id="info_table_column_encrypt_1" />
                                                                <!--end::Input-->
                                                                <!--begin::Label-->
                                                                <label class="form-check-label" for="info_table_column_encrypt_1">
                                                                    <div class="fw-bolder text-gray-800">Chiffrer</div>
                                                                    <div class="text-gray-600">Les données seront chiffrées avec vos deux clés de chiffrement.</div>
                                                                </label>
                                                                <!--end::Label-->
                                                            </div>
                                                            <!--end::Radio-->
                                                            <div class='separator separator-dashed my-5'></div>

                                                        </div>
                                                        <!--end::Input row-->
                                                        <!--end::Accessibilité-->
                                                    </div>
                                                    <!--end::Input group-->
                                                </div>
                                                <!--end::Scroll-->
                                                <!--begin::Actions-->
                                                <div class="text-center pt-15">
                                                    <button type="reset" class="btn btn-light me-3" data-kt-users-modal-action="cancel">Annuler</button>
                                                    <button type="submit" class="btn btn-primary" data-kt-users-modal-action="submit" name="add-column">
                                                        <span class="indicator-label">Ajouter</span>
                                                        <span class="indicator-progress">2 secondes...
                                                        <span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
                                                    </button>
                                                </div>
                                                <!--end::Actions-->
                                            </form>
                                            <!--end::Form-->
                                        </div>
                                        <!--end::Modal body-->
                                    </div>
                                    <!--end::Modal content-->
                                </div>
                                <!--end::Modal dialog-->
                            </div>
                            <!--end::Modal - Add task-->
							<!--end::Modals-->
						</div>
						<!--end::Container-->
					</div>

Conseils et liens

Liens vers des ressources utiles pour l'édition de fichier