Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /home/futura-en/htdocs/php/launch.php on line 21
readImage($name); $x = $image->getImageWidth(); $y = $image->getimageheight(); $nx = $x; $ny = $y; if ($x>=$w || $y>=$h) { if ($x>0) $rx=$w/$x; if ($y>0) $ry=$h/$y; if ($rx>$ry) { $r=$rx; } else { $r=$ry; } $nx=intval($x*$r); $ny=intval($y*$r); } $image->thumbnailimage($nx,$ny); $image->writeimage($dest_name); $image->clear(); $image->destroy(); $image = new Imagick(); $image->readImage($dest_name); $x = $image->getImageWidth(); $y = $image->getimageheight(); $h = (isset($h)) ? $h : $y; $image->cropImage($w,$h,($x-$w)/2,($y-$h)/2); $image->writeimage($dest_name); $image->clear(); $image->destroy(); } public static function getThumb($file, $width, $height=null){ $host = explode($_SERVER['SCRIPT_NAME'], $_SERVER['SCRIPT_FILENAME']); //if(file_exists($file)){ $hashName = md5($file); $extname = pathinfo($file, PATHINFO_EXTENSION); $newName = '/resources/looks/'.$hashName.'-'.$width.'_'.$height.'.'.$extname; if(!file_exists($newName)){ self::imageResize($file, $host[0].$newName, $width, $height); } return $newName; //} else { // return false; //} } public static function getListById($id){ $sql = MySQL::getInstance(); $result = $sql->query("SELECT * FROM `data_list` WHERE `id`=".$id); if($result && $result->num_rows > 0) { $list = $sql->toArray($result); return array('id'=>$list[0]['id'], 'name'=>$list[0]['value']); } else { return array('id'=>null, 'name'=>null); } } public static function getListElementsById($id){ $sql = MySQL::getInstance(); $result = $sql->query("SELECT * FROM `data_list` WHERE `list_id`=".$id); $resp = array(); if($result && $result->num_rows > 0) { foreach($sql->toArray($result) as $line){ $resp[] = array('id'=>$line['id'], 'name'=>$line['value']); } } return $resp; } public static function getDictElementsById($id){ $sql = MySQL::getInstance(); $result = $sql->query("SELECT * FROM `data_dictionary` WHERE `list_id`=".$id); $resp = array(); if($result && $result->num_rows > 0) { foreach($sql->toArray($result) as $line){ $resp[] = array('id'=>$line['id'], 'name'=>$line['value']); } } return $resp; } public static function getImageById($id){ $sql = MySQL::getInstance(); $query = "SELECT * FROM `file_list` WHERE `id`=".$sql->valid($id); $result = $sql->query($query); if($result && $result->num_rows > 0){ $result = $sql->toArray($result); return "http://relise.futura.org.ua/uploads/view/data/".$id.".".$result[0]['type']; } return null; } public static function sendData($dataArray, $viewid){ $dataArray['do'] = 'try_action'; $dataArray['try_login'] = LOGIN; $dataArray['try_password'] = PASS; $dataArray['try_admin'] = 0; $action = '/view/save/'.$viewid; $data = http_build_query($dataArray); $host = HOST; $curl = curl_init($host.$action); curl_setopt($curl, CURLOPT_POST, count($dataArray)); curl_setopt($curl, CURLOPT_POSTFIELDS,$data); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec ($curl); curl_close($curl); return $server_output; } public static function mergeToArray($str){ if($str === null || $str == ""){ return array(); }else{ $res = array(); preg_match_all('/\\|([^\\|]+)\\|/', $str, $matches); foreach($matches[1] as $s){ if($s != ""){ $res[] = $s; } } return $res; } } public static function checkCaptcha($str){ $captchaLink = "https://www.google.com/recaptcha/api/siteverify?secret=6Lc9JQATAAAAACsPnoxaw8ygdffZB14f6Qu7vVJc&response=".$str; $rc = json_decode(file_get_contents($captchaLink)); return $rc; } public static function getRandomString($length=6){ $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } } ?>
Fatal error: Uncaught Error: Class 'Tools' not found in /home/futura-en/htdocs/php/class/Project.php:29 Stack trace: #0 /home/futura-en/htdocs/projects.php(8): Project->getProjects(Object(User)) #1 {main} thrown in /home/futura-en/htdocs/php/class/Project.php on line 29