Exemplo n.º 1
0
<?php

if (isset($_POST['db_name'])) {
    $_SESSION['db_name'] = $_POST['db_name'];
    //construction de la requète pour l'affichage de table
    $var = 'TABLE_NAME,TABLE_ROWS ';
    $from = 'INFORMATION_SCHEMA.TABLES ';
    $where = 'TABLE_SCHEMA="' . $_POST['db_name'] . '"';
    $type_return = 'object';
    $table_liste = $all_query->select_simple($var, $from, $where, $order = '', $type_return);
    echo '<br><br>';
    paragraphe_style('Listes des Tables Détaillées');
    ?>
	<table class="table-bordered table table-responsive" style="background:white;">
		<tr>
			<th style="width:50%;">Nom de la table</th>
			<th style="width:35%;">Nombre d'élements</th>
			<th style="width:15%;">Modification</th>
		</tr><?php 
    foreach ($table_liste as $row_object) {
        $table_current = $row_object->TABLE_NAME;
        ?>
			
			<tr>				
				<td style="padding-bottom:10px; padding-top:7px; width:50%;">
					<p style="padding-left:15px; font-size:17px; display:inline;"><?php 
        echo $row_object->TABLE_NAME;
        ?>
</p></td>
				<td style="padding-bottom:10px; padding-top:10px; width:35%;">
					<p style="padding-left:54px; font-size:17px; display:inline;">Nombre d'entrées : <?php 
Exemplo n.º 2
0
 public function db_search_in_table($table, $key_word, $all_table)
 {
     // premier foreach sur le tab de table si il y en a plusieurs donc faut un count
     if ($all_table == TRUE) {
         $table = $this->db_get_list_table();
         foreach ($table as $row => $values) {
             if ($values->TABLE_NAME == 'data_sync' || $values->TABLE_NAME == 'language' || $values->TABLE_NAME == 'ma_cmd_cli_det' || $values->TABLE_NAME == 'ma_offers_rows') {
                 unset($table[$row]);
             }
         }
         $i = 0;
         $j = 0;
         foreach ($table as $row_table) {
             $res_list_champs = $this->other_query('SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME= "' . $row_table->TABLE_NAME . '" AND TABLE_SCHEMA = "matedex"');
             foreach ($res_list_champs as $row) {
                 $req = 'SELECT * FROM ' . $row_table->TABLE_NAME . ' WHERE `' . $row->COLUMN_NAME . '` LIKE "%' . $key_word . '%" ORDER BY created_on';
                 $res_sql = $this->other_query('SELECT * FROM ' . $row_table->TABLE_NAME . ' WHERE `' . $row->COLUMN_NAME . '` LIKE "%' . $key_word . '%" ORDER BY created_on');
                 if ($res_sql) {
                     affiche_pre($req);
                     //affiche_pre($res_sql);
                     $i++;
                 } else {
                     $j++;
                 }
             }
         }
         // on a récupérer la liste des champs de la table
     } else {
         if ($all_table == FALSE) {
             $i = 0;
             $j = 0;
             foreach ($table as $row_table) {
                 $res_list_champs = $this->other_query('SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME= "' . $row_table . '"');
                 foreach ($res_list_champs as $row) {
                     $i++;
                     $req = "SELECT * FROM '.{$row_table}.' WHERE `'.{$row->COLUMN_NAME}.'` LIKE " % '.$key_word.' % " ORDER BY created_on";
                     $res_sql = $this->other_query("SELECT * FROM '.{$row_table}.' WHERE `'.{$row->COLUMN_NAME}.'` LIKE " % '.$key_word.' % " ORDER BY created_on");
                     if ($res_sql) {
                         affiche_pre($req);
                         //affiche_pre($res_sql);
                         $i++;
                     } else {
                         $j++;
                     }
                 }
             }
             // on a récupérer la liste des champs de la table
         }
     }
     return paragraphe_style("Aucune lignée n'a été détéctée : " . $j . " , nombre de ligne retournée : " . $i);
 }
Exemplo n.º 3
0
<?php

if ($_GET['action'] == 'add_new_column') {
    $afficher_form = 1;
    if ($afficher_form == 1) {
        paragraphe_style('Fonction Add column to ' . $_GET['table_selected']);
        ?>
		<div class='contenu_compte'>
			<div class="row">
					<div class="col-lg-12">
					<form class="form-inline" style="margin:auto;" role="form" action="?nav=manage_bsd&action=add_new_column&table_selected=<?php 
        echo $_GET['table_selected'];
        ?>
" method="POST">
						<div class="form-group has-success" style="margin-right:30px;">
							<div class="input-group">
								<div style="width: 200px;" class="input-group-addon"><?php 
        echo $_GET['table_selected'];
        ?>
</div>
									<input style='width:450px;' type="text" class="form-control" name="lines">
								</div>
							</div> 
							<button style="width: 650px; margin-top:15px;" type="submit" class="btn btn-default">Submit</button>
					</form>
				</div>
			</div>
		</div><?php 
        $afficher_form = 0;
    }
    if (isset($_POST['lines'])) {
Exemplo n.º 4
0
        if ($_GET['nav_matos'] == 'afficher_article') {
            if (isset($_GET['id_categ'])) {
                paragraphe_style('Id de la catégorie : ' . $_GET['id_categ']);
                paragraphe_style('Nom de la catégorie : ' . $_GET['name_categ']);
                $where = 'id=' . $_GET['id_categ'];
                $res_fx = $all_query->select_simple($var = '*', $from = 'materiel_liste', $where, $order = '', $type_return = 'object');
                foreach ($res_fx as $key => $value) {
                    ?>
				
				<div class="col-lg-4" style="margin-bottom:15px;">
					<div class="col-lg-12 without-padding" style="background:#BFBFBF; box-shadow:3px 3px 8px black;"><?php 
                    foreach ($value as $key_2 => $value_2) {
                        if ($key_2 == 'id_category' || $key_2 == 'id') {
                            continue;
                        } else {
                            paragraphe_style($key_2 . ' : ' . $value_2);
                        }
                    }
                    ?>
			
					</div>
				</div><?php 
                }
            }
        } else {
            if ($_GET['nav_matos'] == 'editer') {
            }
        }
    }
}
?>
Exemplo n.º 5
0
<?php 
if (isset($_GET['update_data'])) {
    paragraphe_style('Veuillez Noter les modifications ajoutées');
    paragraphe_style('La ligne choisie');
    $where = 'id =' . $_GET['id'];
    $from = $_GET['table_selected'];
    $var = '*';
    $res_fx = $all_query->select_simple($var, $from, $where, $order = '', $type = 'object');
    render_tab($res_fx);
    paragraphe_style('Formulaire de remplacement');
    render_form_update($res_fx);
    // ici mettre les verif
    if (!count($res_fx)) {
        echo 'Error: Record not found nothing to update !';
    } else {
        $prefix = '';
        $field2update = array();
        foreach ($res_fx[0] as $col_name => $value) {
            if ($col_name == 'id') {
                continue;
            }
            if (isset($_POST[$prefix . $col_name]) && $_POST[$prefix . $col_name] != $value) {
                $field2update[$col_name] = $_POST[$prefix . $col_name];
            }
        }
        if (count($field2update) == 0 && (isset($_POST['post_data']) && $_POST['post_data'] == 1)) {
            echo 'Nothing to update';
        } elseif (count($field2update) > 0) {
            $ctx_res = new stdClass();
            $ctx_res->table = $_GET['table_selected'];
Exemplo n.º 6
0
<?php

if ($_GET['action'] == 'insert_new_data') {
    paragraphe_style('Completer les champs d\'insertion');
    $res_fx = $all_query->select_simple($var = 'COLUMN_NAME', $from = 'INFORMATION_SCHEMA.COLUMNS', $where = 'table_name="' . $_GET['table_selected'] . '"', $order = '', $type = 'object');
    render_tab($res_fx);
    paragraphe_style('Formulaire d\'insertion');
    render_form_insert($res_fx);
    if (isset($_POST) && !empty($_POST)) {
        $ctx_post = new stdClass();
        $ctx_post->table = $_GET['table_selected'];
        $ctx_post->ctx = $_POST;
        if ($_GET['table_selected'] == 'campagnes') {
            if (empty($_POST['nom'])) {
                $_POST['nom'] = 'Non Connue';
            }
            if (empty($_POST['mot'])) {
                $_POST['mot'] = 'Non Connue';
            }
            if (empty($_POST['date_debut'])) {
                $_POST['date_debut'] = 'Non Connue';
            }
            if (empty($_POST['date_fin'])) {
                $_POST['date_fin'] = 'Non Connue';
            }
            if (empty($_POST['clics'])) {
                $_POST['clics'] = 'Non Connue';
            }
            if (empty($_POST['rentabilite'])) {
                $_POST['rentabilite'] = 'Non Connue';
            }
Exemplo n.º 7
0
function render_form_insert_champ_uniquement($list_champ)
{
    if (!$list_champ) {
        paragraphe_style('Erreur cette table ne contient aucun champs');
        return;
    }
    ?>
	<div class='contenu_compte'>
		<div class="row">
				<div class="col-lg-12">
				<form class="form-inline" style="margin:auto;" role="form" action="" method="POST">
					<br><?php 
    foreach ($list_champ as $key => $value) {
        foreach ($value as $key_2 => $value_2) {
            ?>
		
							
								<div class="form-group 
										<?php 
            if ($key_2 == 'id' || $key_2 == 'id_category') {
                echo 'has-error';
            } else {
                echo 'has-success';
            }
            ?>
" style="margin-right:30px;">

								    <div class="input-group">
								      	<div style="width: 200px;" class="input-group-addon"><?php 
            echo $key_2;
            ?>
</div>
										<input style='width:450px;' type="text"
											<?php 
            echo $key_2 == 'id' ? 'disabled id="disabledInput"' : 'id="inputSuccess1"';
            ?>
											<?php 
            echo $key_2 == 'id_category' ? 'disabled id="disabledInput" placeholder="' . $value_2 . '"' : 'id="inputSuccess1"';
            ?>
 
											 class="form-control" name="<?php 
            echo $key_2;
            ?>
">

								    </div>
								</div> 
								<br><?php 
        }
    }
    ?>
													
									
								<button style="width: 650px; margin-top:15px;" type="submit" class="btn btn-default">Submit</button>
				</form>
			</div>
		</div>
	</div>
<?php 
}
Exemplo n.º 8
0
<?php

if ($_GET['nav'] == 'manage_bsd') {
    if (!isset($_GET['table_selected'])) {
        paragraphe_style("Veuillez Selectionner la Base De Données sur laquelle travailler");
        require_once 'select_db.php';
        listing_bsd_for_manage();
        //on séléctionne la base de données à utiliser quand on arrive sur le manage bsd
        //la fonction listening bsd permet d'afficher les base et en auto reload la déléctionne pour afficher les données
        // la sélection de la base passe par le POST
        if (isset($_POST['db_name'])) {
            $_SESSION['db_name'] = $_POST['db_name'];
        }
        // on récupère le nom de la base choisie en SESSION on sais jamais
        require 'select_table.php';
        // et mtn on utilise cette db_name pour afficher la liste des tables avec un count dessus
    }
    if (isset($_GET['update_data'])) {
        require 'update_data.php';
    }
    if (isset($_GET['confirm_delete_data'])) {
        require 'delete_data.php';
    }
    if (isset($_GET['action']) == 'delete_complete') {
        require 'delete_data.php';
    }
    if (isset($_GET['action']) == 'insert_new_data') {
        require 'insert_data.php';
    }
    if (isset($_GET['action']) == 'add_new_column') {
        require 'insert_column.php';
Exemplo n.º 9
0
							<a style="margin-left:15px; text-decoration:none;" 
							href="?nav=manage_bsd&update_data&id=<?php 
            echo $value->id;
            ?>
&table_selected=<?php 
            echo $_GET['table_selected'];
            ?>
">
								<span style='font-size:24px;' class="glyphicon glyphicon-pencil"></span>
							</a>
							<a style="margin-left:15px; text-decoration:none;" 
							href="?nav=manage_bsd&confirm_delete_data&id=<?php 
            echo $value->id;
            ?>
&table_selected=<?php 
            echo $_GET['table_selected'];
            ?>
">
								<span style='font-size:24px;' class="glyphicon glyphicon-remove"></span>
							</a>
						</td>
					</tr><?php 
        }
        ?>
			
		</table><?php 
    }
} else {
    echo '<br><br>';
    paragraphe_style('Veuillez Selectionner une table');
}