This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Параметры | |
//$mail_to-email адресата | |
//$thema-тема письма | |
//$html-текст письма в html формате | |
//$patch - путь до файла который отправляем | |
//Можно использовать и при отправки без вложения | |
function send_mail($mail_to, $thema, $html, $path){ | |
if ($path) { | |
$fp = fopen($path,"rb"); | |
if (!$fp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$result=pg_query($this->db,"UPDATE sed_users SET \"ISONLINE\"=false WHERE ((CURRENT_DATE+LOCALTIME)-sed_users.\"LAST_ACTIVITY\") BETWEEN \"00:05:00\" AND \"100 days 23:59:59\""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function() { | |
$('.inputtext').val(function() { | |
$(this).attr('placeholder',$(this).val()); | |
return ''; | |
}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$uploadfile="<Root><Boobs><B1>ffff<B1></Boobs></Root>" | |
$dom = new domDocument; | |
$file=file_get_contents($uploadfile); | |
$dom->loadXML($file); | |
if (!$dom) { | |
echo 'Ошибка при обработке'; | |
exit; | |
} | |
$s = simplexml_import_dom($dom); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set("max_execution_time", "1500"); | |
$url='https://www.evernote.com/redesign/business/BusinessHomeAction/letters/'; | |
$abc=range('a','z'); | |
function getSslPage($url) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); | |
curl_setopt($ch, CURLOPT_HEADER, false); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
curl_setopt($ch, CURLOPT_URL, $url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$patch=$_SERVER["DOCUMENT_ROOT"]."/bitrix/script foto/News foto/".$dt."/".$nub."/"; | |
$source = str_replace($_SERVER["DOCUMENT_ROOT"], "/", $patch); | |
$f = scandir($patch); | |
foreach ($f as $file){ | |
if (!(preg_match('/\.(jpg)/', $file) || preg_match('/\.(JPG)/', $file))) { | |
$key = array_search($file, $f); | |
if ($key !== false){ | |
unset($f[$key]); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function translit($str){ | |
$alphavit = array( | |
/*--*/ | |
"а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d","е"=>"e", | |
"ё"=>"yo","ж"=>"j","з"=>"z","и"=>"i","й"=>"i","к"=>"k","л"=>"l", "м"=>"m", | |
"н"=>"n","о"=>"o","п"=>"p","р"=>"r","с"=>"s","т"=>"t", | |
"у"=>"y","ф"=>"f","х"=>"h","ц"=>"c","ч"=>"ch", "ш"=>"sh","щ"=>"sh", | |
"ы"=>"i","э"=>"e","ю"=>"u","я"=>"ya", | |
/*--*/ | |
"А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D","Е"=>"E", "Ё"=>"Yo", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$arSelect = Array("ID", "NAME", "TIMESTAMP_X"); | |
$arFilter = Array("IBLOCK_ID"=>"21", "<TIMESTAMP_X"=>"31.12.2013 23:59:59"); | |
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>1000), $arSelect); | |
echo $res->SelectedRowsCount(); | |
while($ob = $res->GetNextElement()) | |
{ | |
echo "<pre>"; | |
$arFields = $ob->GetFields(); | |
print_r($arFields); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$res = CIBlockSection::GetList( | |
Array('name' => 'asc'), | |
Array('IBLOCK_ID' =>'5' , 'ACTIVE' => 'Y') | |
); | |
while ($row = $res->GetNext()) | |
{ | |
echo $row['NAME'].'<br>'; | |
$rsParentSection = CIBlockSection::GetByID($row['ID']); | |
if ($arParentSection = $rsParentSection->GetNext()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
ini_set('display_errors',1); | |
ini_set('error_reporting',2047); | |
?> |
OlderNewer