/*/****************************************************/
// Функции
/****************************************************/
/********************************************/
// функция формирования даты
/********************************************/
function cdate($createdate){
$monthday = substr($createdate,0,2);
$month = substr($createdate,3,2);
$year = substr($createdate,6,4);
$hour = date("G");
$minute = date("i");
$cdate = mktime($hour,$minute,0,$month,$monthday,$year);
return $cdate;
}
/********************************************/
// функция определения года
/********************************************/
function cyear($createdate){
$year = substr($createdate,6,4);
return $year;
}
/********************************************/
// функция проверки файла-картинки (фото)
/********************************************/
function check_img($img, $widthlim, $heightlim){
global $db;
list($width_img, $height_img, $type_img, $attr) = getimagesize($img);
if($width_img>$widthlim) {
$db->close();
header ("Location: main.php?p=error&msg=12&value=".$widthlim."");
exit;
}
if($height_img > $heightlim) {
$db->close();
header ("Location: main.php?p=error&msg=13&value=".$heightlim."");
exit;
}
if($type_img != 1 && $type_img != 2) {
$db->close();
header ("Location: main.php?p=error&msg=4");
exit;
} else {
switch ($type_img){
case 1: $ext_img = "gif"; break;
case 2: $ext_img = "jpg"; break;
}
}
$param = array($width_img, $height_img, $ext_img);
return $param;
}
/*****************************************/
function size_pre($own) {
include ("../include/config.php");
include ("../include/connect.php");
$body = '';
$size = $db->Execute("select * from ".$prefix."_size where own=$own");
$body = "
Ширина: ".$size->fields['width_pre']."px";
if($size->fields['height_pre']!=0) $body .= ", Высота: ".$size->fields['height_pre']."px!!!";
if($size->fields['size_pre']!=0) $body.="
Размер загружаемого файла не должен превышать ".$size->fields['size_pre'] ." Kb";
$body.= "
Файл может быть формата только GIF или JPG";
return $body;
}
function size_big($own) {
include ("../include/config.php");
include ("../include/connect.php");
$own=$_REQUEST['own'];
$body = '';
$size = $db->Execute("select * from ".$prefix."_size where own=$own");
$body="
Ширина: ".$size->fields['width_big']."px";
if($size->fields['height_big']!=0) $body .= ", Высота: ".$size->fields['height_big']."px!!!";
if($size->fields['size_big']!=0) $body.="
Размер загружаемого файла не должен превышать ".$size->fields['size_big'] ." Kb";
$body.= "
Файл может быть формата только GIF или JPG";
return $body;
}
function size($own) {
include ("../include/config.php");
include ("../include/connect.php");
$own = $_REQUEST['own'];
$body = '';
$size = $db->Execute("select * from ".$prefix."_size where own=$own");
$body .= "
";
if($size->fields['size_pre']!=0) $body .= "
Размер загружаемого файла не должен превышать ".$size->fields['size_pre'] ." Mb";
$body .= "
Файл может быть форматов ZIP / DOC / XLS
";
$body .= "fields['img'.$pr];
$width = $ph->fields['width'.$pr];
$height = $ph->fields['height'.$pr];
$param = array($img, $width, $height);
return $param;
}
?>
$fio = '';
$email = '';
$org = '';
$post = '';
$messagetxt = '';
$contact = '';
$mestxt = '';
for ($i=1; $i<=6; $i++) $cn[$i] = '';
for ($i=1; $i<=6; $i++) $cn_cb[$i] = '';
?>
Guestbook » Write to us
Ask questions, make proposals.
We’ll be glad if you are interested in our company and its activities.
Your message will be posted on the site after approval of the site’s administrator.
$fio = '';
$email = '';
$org = '';
$post = '';
$messagetxt = '';
$contact = '';
$mestxt = '';
for ($i=1; $i<=6; $i++) $cn[$i] = '';
for ($i=1; $i<=6; $i++) $cn_cb[$i] = '';
?>