/
home
/
u582540419
/
domains
/
sbco.in
/
public_html
/
loanDayAdmin
/
Upload File
HOME
<?php //error_reporting(0); setlocale(LC_ALL,'en_US.UTF-8'); setlocale(LC_MONETARY, 'en_IN'); if(is_session_started() === FALSE){ session_start(); } mysqli_report(MYSQLI_REPORT_STRICT); // ** Database settings - You can get this info from your web host ** // /** The name of the database for WordPress */ // define( 'DB_NAME', 'u600186160_HmVjG' ); // /** Database username */ // define( 'DB_USER', 'u600186160_xynHk' ); // /** Database password */ // define( 'DB_PASSWORD', 'yqWzLRHTR7' ); // /** Database hostname */ // define( 'DB_HOST', '127.0.0.1' ); $servername = "127.0.0.1"; $username = "u582540419_xynHk"; $password = "yqWzLRHTR7"; $dbname = "u582540419_HmV"; $con = new mysqli($servername, $username, $password, $dbname); if(!$con){ die("Connection failed: " . mysqli_connect_error()); } $result = $con->query("SET NAMES utf8"); $con->set_charset("utf8mb4"); /*--------------------------------------------------------- Helper Function ---------------------------------------------------------*/ function is_session_started(){ if ( php_sapi_name() !== 'cli' ) { if ( version_compare(phpversion(), '5.4.0', '>=') ) { return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE; } else { return session_id() === '' ? FALSE : TRUE; } } return FALSE; } function base_url(){ return "https://www.sbco.in/loanDayAdmin/"; } function optimize($source, $destination){ //echo "source:- $source - destination:- $destination<br><br>"; $im = new Imagick(); $im->readImage($source); $image_types = getimagesize($source); if ($image_types[2] === IMAGETYPE_JPEG){ $im->setImageFormat('jpeg'); $quality=25; }else if ($image_types[2] === IMAGETYPE_PNG){ $im->setImageFormat('png'); $quality=75; }else if ($image_types[2] === IMAGETYPE_GIF){ $im->setImageFormat('gif'); $quality=25; } $im->setImageCompression(Imagick::COMPRESSION_JPEG); $im->setImageCompressionQuality($quality); $im->stripImage(); $im->writeImage($destination); $im->destroy(); unlink($source); return $destination; } ?>