Item Created
Submission successful. Print and tag the item with a qr code:";
$rand = FLOOR(10000*RAND());
echo " ";
echo "";
exec('cd;qrencode -o /data/www/Jaiswal-Lab/inventory/tmp-images/qr_code' . $rand . ".png '$qr_code'");
} else if($_GET['type'] == "note") {
$database = "lab_inventory";
$user = "lab-inventory-user";
$password = "lab-inventory-user_pw";
$host = "floret.cgrb.oregonstate.local:3306";
$connection=mysql_connect($host,$user,$password);
mysql_select_db($database);
$name = $_POST['note_name'];
$note = $_POST['note'];
$id = $_POST['item_id'];
if($id != null) {
$query = "insert into notes (id,note,curator,date) values ($id,'$note','$name',$date)";
mysql_query($query);
echo "Thank you for your note submission. Submission was successful, and future queries of this item will have your note attached.";
} else {
echo "Sorry, that is not a valid QR Code. Please rescan the item or double check the code you entered.";
}
}
?>