phrase)?$obj->phrase_default:$obj->phrase; //return '*'.$ph.'*'; return $ph; } $pageno = isset($_GET['pageno'])?$_GET['pageno']:1; $perpage = 10; function getPaging($currentPage, $totalPages, $prefix = '') { if($totalPages>1) { $query_string = preg_replace(array("@pageno=[0-9&]*@","@[&]*$@"),"",$_SERVER["QUERY_STRING"]); $query_string = empty($query_string)?'':'&'.$query_string; $Pagination[] = ''; $Pagination = implode("", $Pagination); } else { $Pagination = ''; } return $Pagination; } function myfragment($str, $n, $delim='...') { // {{{ $len = strlen($str); if ($len > $n) { preg_match('/(.{' . $n . '}.*?)\b/', $str, $matches); return trim($matches[1]) . $delim; } else { return $str; } } // }}} include_once('admin/include/config.php'); $link = mysql_connect($host, $user, $pass) or die("Could not connect : " . mysql_error()); mysql_select_db($db_name) or die("Could not select database"); $today = date('Y-m-d'); if(empty($_GET) && empty($_POST)) { $config_result = mysql_query("SELECT `value` AS index_page_redirect FROM `config` WHERE `option` = 'index_page_redirect'"); $config = mysql_fetch_object($config_result); if(!empty($config->index_page_redirect)) { header('location:'.$config->index_page_redirect); exit; } } include_once('lang/'.$lang.'.php'); if(isset($_POST['email'])) { //print_r($_POST); exit(); $email = trim(stripslashes($_POST['email'])); $q = "SELECT * FROM newsletter WHERE email LIKE '".mysql_real_escape_string($email)."'"; $r = mysql_query($q); if(mysql_num_rows($r)>0) { $q = "UPDATE newsletter SET categories = '~".implode('~',$_POST['subscribed_cats'])."~' WHERE email LIKE '".mysql_real_escape_string($email)."'"; } else { $q = "INSERT INTO newsletter SET categories = '~".implode('~',$_POST['subscribed_cats'])."~', email = '".mysql_real_escape_string($email)."', id_user = 'depot'"; } mysql_query($q); header('Location:./?email='.$email); exit(); } elseif(isset($_POST['contact_partner'])) { include_once('class.phpmailer.php'); $announce_query = 'SELECT * FROM announce WHERE id = '.(int)$_POST['contact_announce_id']; $announce_result = mysql_query($announce_query); $announce_object = mysql_fetch_object($announce_result); $partner_query = "SELECT * FROM users_tab WHERE username_user = '".$announce_object->id_user."'"; $partner_result = mysql_query($partner_query); $partner_obj = mysql_fetch_object($partner_result); print_r($_POST); $mail = new PHPMailer(); $mail->From = $_POST['contact_email']; $mail->FromName = $_POST['contact_name']; $mail->Subject = 'Depot des Faillites - '.$announce_object->title; $mail->IsHTML(true); $mail->Body = nl2br(stripslashes($_POST['contact_message'])); //$mail->ClearAllRecipients(); $mail->AddAddress($partner_obj->email); $mail->AddCC($_POST['contact_email']); $mail->Send(); header('Location:./?announce='.(int)$_POST['contact_announce_type']); exit(); } ?> Depot des Faillites