function getmanfullrevall($manid) { //printf('manid: '.$manid.''); //$cloud = mysql_query("SELECT man_id, title_orig, genre, notes, stat_id, per_id, datesubmitted FROM tbl_manuscript WHERE man_id=$manid") or die(mysql_error()); $query = "SELECT man_id, title_orig, genre, notes, stat_id, per_id, datesubmitted FROM tbl_manuscript WHERE man_id={$manid} ORDER by dateSubmitted ASC"; if (!($res = mysqlConnection::getConnection()->query($query))) { die('There was an error running the query [' . $query->error . ']'); } $num_rows = $res->num_rows; if ($num_rows < 1) { printf("You do not have any active reviews currently assigned.<br /> See the left hand menu for your options."); } else { // $arr = mysql_fetch_assoc($cloud); $arr = $res->fetch_assoc(); $title = $arr['title_orig']; $genre = $arr['genre']; $notes = $arr['notes']; $statid = $arr['stat_id']; $submitted = $arr['datesubmitted']; $perid = $arr['per_id']; $author = authname($perid); printf(' <div id="review" style="border-top:1px solid #ccc;"> <table> <tr><td style="width:105px">Manuscript ref:</td><td>#' . $arr['man_id'] . '  <a href="reviewmanuscript.php?manid=' . $arr['man_id'] . '">My Review</a></td></tr> <tr><td>Author:</td><td>' . $author . '</td></tr> <tr><td>Title:</td><td>' . $title . '</td></tr> <tr><td>Genre:</td><td>' . $genre . '</td></tr> <tr><td>Notes:</td><td>' . $notes . '</td></tr>'); getstatus($arr['stat_id']); printf('<tr><td>Date submitted:</td><td>' . $submitted . '</td></tr> </table></div>'); } }
<?php header('Content-Type: application/json'); $rest_json = file_get_contents("php://input"); $_POST = json_decode($rest_json, true); $_POST = parse_str($rest_json, $parameters); $aResult = array(); include './model/mysqlConnection.php'; if ($parameters['arguments']['0'] == null) { echo 'Wrong Parameters'; die; // die('Wrong Parameters'); } $query = "UPDATE tbl_people SET notify = 'No' where per_id = {$parameters['arguments']['0']}"; if (!($res = mysqlConnection::getConnection()->query($query))) { die('There was an error running the query [' . $query->error . ']'); } echo json_encode(array('id' => 3)); ?>
} // Check if $uploadOk is set to 0 by an error // if everything is ok, try to upload file if (move_uploaded_file($_FILES["uploadedFile"]["tmp_name"], $target_file)) { // echo "The file ". basename( $_FILES["uploadedFile"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; echo json_encode(array('errorMsg' => 'Sorry, there was an error uploading your file.')); die; } $uploadedFile = file_get_contents($target_file); $uploadedFile = addslashes($uploadedFile); $currentTime = date("Y-m-d H:i:s"); $query = "insert into tbl_manuscript(per_id,stat_id,dateSubmitted, dateStatus, title_orig, genre,notes ) values('{$per_id}','1','{$currentTime}','{$currentTime}','{$title}','{$category}','{$notes}')"; if (!($res = mysqlConnection::getConnection()->query($query))) { die('There was an error running the query [' . $query->error . ']'); } $result = mysqlConnection::getConnection()->insert_id; // echo $result; $query = "insert into tbl_doc(doc_size,doc_filename,doc_date, full_partial, doc_type, man_id) values('{$fileSize}','{$fileName}','{$currentTime}','F','{$_FILES['uploadedFile']['type']}','{$result}')"; if (!($res = mysqlConnection::getConnection()->query($query))) { die('There was an error running the query [' . $query->error . ']'); } if ($res) { echo json_encode(array('id' => mysqlConnection::getConnection()->insert_id)); } else { echo json_encode(array('errorMsg' => 'Some errors occured.')); } } catch (RuntimeException $e) { echo $e->getMessage(); }