0) { echo '
Return Code: '.$_FILES[$file]["error"].'
'; } else { $_FILESName = $temp[0].".".$temp[1]; $temp[0] = rand(0,3000); if(file_exists("uploads/".$path.'/'.$_FILES[$file]["name"])) { $return['error'] = '
'.$_FILES[$file]["name"].'Already Exists
'; } else { $originalFilename = $_FILES[$file]["name"]; $fileExtension = pathinfo($originalFilename, PATHINFO_EXTENSION); $uniqueIdentifier = uniqid(); $newfilename = 'product__' . $uniqueIdentifier . '.' . $fileExtension; $aa = 'product__'.$newfilename; $a = 'uploads/'.$path.'/'.$aa; $photo_address = '../uploads/'; $z = move_uploaded_file($_FILES[$file]["tmp_name"], $a); $return['file_name'] = $aa; $return['status'] = 1; } } } else { $return['status'] = 0; } return $return; } if(isset($_POST['status']) && $_POST['status']=='center_login') { $post = $_POST; $username = mysqli_real_escape_string($con,$post['username']); $password = mysqli_real_escape_string($con,$post['password']); $login = $con->query("SELECT * FROM centers where username = '".$username."' AND password = '".$password."' AND status = 1"); if($login->num_rows) { $row = $login->fetch_assoc(); $rand = rand(111111,999999); $_SESSION['center']['id'] = $row['id']; $_SESSION['center']['session_id'] = $rand; $_SESSION['center']['login'] = TRUE; $sess = $con->query("INSERT INTO `check_session` (`id`, `timestamp`, `user_id`, `session_id`) VALUES (NULL, CURRENT_TIMESTAMP, ' ".$row['id']."','".$rand."')"); if($sess){ echo ''; } } else { echo ''; } } if(isset($_POST['status']) && $_POST['status']=='student_login') { $post = $_POST; $username = mysqli_real_escape_string($con,$post['username']); $password = mysqli_real_escape_string($con,$post['password']); $login = $con->query("SELECT * FROM students where username = '".$username."' AND password = '".$password."' AND status = 1"); if($login->num_rows) { $row = $login->fetch_assoc(); $rand = rand(111111,999999); $_SESSION['student']['id'] = $row['id']; $_SESSION['student']['session_id'] = $rand; $_SESSION['student']['login'] = TRUE; $con->query("INSERT INTO `check_session` (`id`, `timestamp`, `user_id`, `session_id`) VALUES (NULL, CURRENT_TIMESTAMP, '".$row['id']."', '".$rand."')"); echo ''; } else { echo ''; } } if(isset($_POST['status']) && $_POST['status']=='contact_query') { if($_SESSION['digit']==$_POST['captcha']) { $chk = $con->query("INSERT INTO `contact_query` (`id`, `timestamp`, `name`, `mobile`, `email`, `message`) VALUES (NULL, CURRENT_TIMESTAMP, '".$_POST['name']."', '".$_POST['mobile']."', '".$_POST['email']."', '".$_POST['message']."')"); echo ''; } else { echo ''; } } $setting = []; $set = $con->query("SELECT * FROM setting"); while($rr = $set->fetch_assoc()) $setting[$rr['type']] = $setting[$rr['id']] = $rr['value']; $logo = $con->query("SELECT * FROM logo_setting where id = 1")->fetch_assoc(); define('WEB_LOGO','uploads/logo/'.$logo['logo']); define('WEB_FAVICON','uploads/logo/'.$logo['favicon']); function getSetting($key,$res=''){ global $setting; if(isset($setting[$key])){ $res = $setting[$key]; } return $res; } // Fetch SEO settings $seoSettings = $con->query("SELECT * FROM seo_settings")->fetch_assoc(); $webTitle = isset($seoSettings['web_title']) ? $seoSettings['web_title'] : 'Website'; $metaTitle = isset($seoSettings['meta_title']) ? $seoSettings['meta_title'] : ''; $metaDescription = isset($seoSettings['meta_description']) ? $seoSettings['meta_description'] : ''; $metaKeywords = isset($seoSettings['meta_keywords']) ? $seoSettings['meta_keywords'] : ''; $metaAuthor = isset($seoSettings['meta_author']) ? $seoSettings['meta_author'] : ''; $metaOgTitle = isset($seoSettings['meta_og_title']) ? $seoSettings['meta_og_title'] : ''; $metaOgDescription = isset($seoSettings['meta_og_description']) ? $seoSettings['meta_og_description'] : ''; // Fetch social links $socialLinks = $con->query("SELECT * FROM social_links")->fetch_assoc(); $headerMobile = isset($socialLinks['header_mobile']) ? $socialLinks['header_mobile'] : ''; $headerEmail = isset($socialLinks['header_email']) ? $socialLinks['header_email'] : ''; $headerFacebook = isset($socialLinks['header_facebook']) ? $socialLinks['header_facebook'] : ''; $headerTwitter = isset($socialLinks['header_twitter']) ? $socialLinks['header_twitter'] : ''; $headerInstagram = isset($socialLinks['header_instagram']) ? $socialLinks['header_instagram'] : ''; $headerLinkedin = isset($socialLinks['header_linkedin']) ? $socialLinks['header_linkedin'] : ''; $headerYoutube = isset($socialLinks['header_youtube']) ? $socialLinks['header_youtube'] : ''; $logo = $con->query("SELECT * FROM logo_setting where id = 1")->fetch_assoc(); ?> <?=$webTitle?> Skip to Main Content