Statistics
| Branch: | Revision:

root / evote / changeElection.php @ f52a1778

History | View | Annotate | Download (946 Bytes)

1
<?php
2
 include_once("db_tools.php");
3
 include_once("tools.php");
4

    
5

    
6
$_POST = filterParameters($_POST);
7
$rows = array();
8
$success = "false";
9
$message = "";
10
$newElectionName = "";
11
$SQL =  "SELECT * FROM election WHERE ELE_Code = ".$_POST['newElectionCode']." AND ELE_USE_Code = ".$_SESSION['EVOT_UserCode'];
12
$conn = db_connect();
13
$rs = mysql_query($SQL, $conn) or die(mysql_error());
14
// ?? ??? ??????? ???? ? ??????? Election ? ??? ?????? ???? ???????? user ??? ?????? ??????.
15
if (mysql_num_rows($rs)>0) {
16
 $row = mysql_fetch_assoc($rs);
17
 $_SESSION['EVOT_ElectionCode'] = $_POST['newElectionCode'];
18
 $_SESSION['EVOT_ElectionName'] = $row['ELE_Name'];
19
 $newElectionName =  $row['ELE_Name'];
20
 $success = "true";
21
 
22
} else {
23
  $message = "Something went wrong";
24
}
25

    
26

    
27
echo ('{"success":"'.$success.'", "message":"'.$message.'", "newElectionName":"'.$newElectionName.'"}');
28

    
29

    
30
db_disconnect();
31
?>