Esempio n. 1
0
			</div>
		
			<p>
				<?php 
connect();
if (isset($_GET['manid'])) {
    $manid = $_GET['manid'];
} else {
    $manid = $_SESSION['man_id'];
}
//printf('session manid: '.$_GET['manid'].'');
//printf('manid: '.$manid.'');
//printf('session manid: '.$_SESSION['man_id'].'');
printf('<h2>Upload Manuscript (optional):</h2>');
printf('<p><a href="mymanuscripts.php">Skip this step</a></p> ');
getman($manid);
printf('</p>
			<form name="doc" enctype="multipart/form-data" action="uploader.php" onsubmit="return validateForm();" method="POST">');
printf('<input type="hidden" name="manid" value=' . $manid . '>');
?>
				<input type="radio" name="partial" value="F" checked>Full manuscript&nbsp;
				<input type="radio" name="partial" value="P">Partial manuscript<br /><br />
				<input type="hidden" name="MAX_FILE_SIZE" value="16777216" />
				Choose a file to upload: <input name="file" type="file" /><br /><br />
				<input type="submit" value="Upload File" />
			</form> 
		</div>
		
		
<?php 
include 'footer.php';
Esempio n. 2
0
        $query = mysql_query("SELECT * FROM user WHERE sex = '" . intval($sex) . "' AND grade = '" . intval($grade) . "' LIMIT " . $max . ",1");
    }
    if ($query == FALSE) {
        return false;
    }
    if (mysql_num_rows($query) == 0) {
        return false;
    } else {
        return mysql_fetch_array($query);
    }
}
if (isset($_POST['grade'])) {
    $grade = intval($_POST['grade']);
}
if (isset($_POST['uid'])) {
    $uid = authcode($_POST['uid'], 'DECODE', 'axl', 600);
    $query_select = mysql_query("SELECT * FROM user WHERE uid = '" . intval($uid) . "' LIMIT 1");
    $row = mysql_fetch_array($query_select);
    $count = ++$row['count'];
    mysql_query("UPDATE user SET count = '" . $count . "' WHERE uid = '" . intval($uid) . "'");
}
if (isset($_POST['sex'])) {
    $sex = intval($_POST['sex']);
    $man1 = getman($sex, $grade);
    $man2 = getman($sex, $grade);
    while ($man1['uid'] == $man2['uid']) {
        $man2 = getman($sex);
    }
    $arr = array(0 => array('photo' => authcode($man1['uid'], 'ENCODE', 'axl', $expiry = 600), 'name' => trim($man1['name']), 'grade' => $man1['grade'], 'classx' => trim($man1['class'])), 1 => array('photo' => authcode($man2['uid'], 'ENCODE', 'axl', $expiry = 600), 'name' => trim($man2['name']), 'grade' => $man2['grade'], 'classx' => trim($man2['class'])));
    echo json_encode($arr);
}