include("assets/dbconnect.php"); if($_SERVER["PHP_SELF"] != "login.php"){ if($_SESSION[loggedin]!= 1){ header("location: login.php"); exit(); } } if(isset($_GET['language'])){ $_SESSION['nation'] = ''.$_GET['language'].''; } /*if($_POST['searchsnippet']){ echo 'I am seaching snippet'; } if($_POST['searchid']){ echo 'I am seaching id'; }*/ if($_GET['action'] == 'logout'){ $_SESSION[loggedin] = 0; $_SESSION['nation'] = ''; $_SESSION['userid'] = ''; echo ''; } echo $whatLanguage = $_SESSION['nation']; $result = mysqli_query($con,"SELECT * FROM nf_countries WHERE iso='$whatLanguage'"); $row = mysqli_fetch_assoc($result); $countryid = $row['con_id']; $totalSnippetWords = ''; $result = mysqli_query($con,"SELECT * FROM nf_language WHERE lang='en'"); $totalcount = mysqli_num_rows($result); // # of total snippets to be translated //echo "Total snippets: ".$totalcount; while ($row = mysqli_fetch_assoc($result)){ $totalSnippetWords .= $row['text']; } $missingSnippetWords = ''; $result = mysqli_query($con,"SELECT * FROM nf_language WHERE lang='en' AND id NOT IN (SELECT fk_id FROM nf_language WHERE lang='$whatLanguage')"); $missingcount = mysqli_num_rows($result); // # of total snippets to be translated while ($row = mysqli_fetch_assoc($result)){ $missingSnippetWords .= $row['text']; } $translatedSnippetWords = ''; $result = mysqli_query($con,"SELECT * FROM nf_language WHERE lang='$whatLanguage'"); $nationalcount = mysqli_num_rows($result); // # of snippets already translated if($_SESSION['userid'] == 1){ //echo "snippets Translated: ".$nationalcount; } while ($row = mysqli_fetch_assoc($result)){ $translatedSnippetWords .= $row['text']; } $result = mysqli_query($con,"SELECT * FROM nf_appstoredescription WHERE lang='$whatLanguage'"); $nationaldescription = mysqli_num_rows($result); // # of snippets already translated $sql = mysqli_query($con,"SELECT * FROM nf_appstoredescription WHERE lang = 'en'"); $row = mysqli_fetch_array($sql); $englishHeadline = $row['title']; $englishContent = $row['content']; $englishKeywords = $row['keywords']; $sql = mysqli_query($con,"SELECT * FROM nf_appstoredescription WHERE lang = '$whatLanguage'"); $row = mysqli_fetch_array($sql); $nationalHeadline = $row['title']; $nationalContent = $row['content']; $nationalKeywords = $row['keywords']; if($_GET['print'] == "yes"){ include("print.php"); } ?>