Пример #1
0
<?php

include_once '../../../config/symbini.php';
include_once $SERVER_ROOT . '/classes/OccurrenceEditorManager.php';
include_once $SERVER_ROOT . '/classes/OccurrenceActionManager.php';
header("Content-Type: text/html; charset=" . $CHARSET);
$occId = $_GET['occid'];
$occIndex = $_GET['occindex'];
$crowdSourceMode = $_GET['csmode'];
$occManager = new OccurrenceEditorImages();
$occActionManager = new OccurrenceActionManager();
$occManager->setOccId($occId);
$specImgArr = $occManager->getImageMap();
?>
<div id="imagediv" style="width:795px;">
	<div style="float:right;cursor:pointer;" onclick="toggle('addimgdiv');" title="Add a New Image">
		<img style="border:0px;width:12px;" src="../../images/add.png" />
	</div>
	<div id="addimgdiv" style="display:<?php 
echo $specImgArr ? 'none' : '';
?>
;">
		<form name="imgnewform" action="occurrenceeditor.php" method="post" enctype="multipart/form-data" onsubmit="return verifyImgAddForm(this);">
			<fieldset style="padding:15px">
				<legend><b>Add a New Image</b></legend>
				<div style='padding:15px;width:90%;border:1px solid yellow;background-color:FFFF99;'>
					<div class="targetdiv" style="display:block;">
						<div style="font-weight:bold;font-size:110%;margin-bottom:5px;">
							Select an image file located on your computer that you want to upload:
						</div>
				    	<!-- following line sets MAX_FILE_SIZE (must precede the file input field)  -->
<?php

include_once '../../../config/symbini.php';
include_once $serverRoot . '/classes/OccurrenceActionManager.php';
$occid = array_key_exists('occid', $_REQUEST) ? $_REQUEST['occid'] : null;
$requesttype = array_key_exists('requesttype', $_REQUEST) ? $_REQUEST['requesttype'] : null;
$remarks = array_key_exists('remarks', $_REQUEST) ? $_REQUEST['remarks'] : '';
$uid = $SYMB_UID;
if ($uid != null) {
    $actionManager = new OccurrenceActionManager();
    $result = $actionManager->makeOccurrenceActionRequest($uid, $occid, $requesttype, $remarks);
    if ($result == null) {
        $returnValue = "Failed to add request. " . $actionManager->getErrorMessage();
    } else {
        $returnValue = "Added Request for {$requesttype} [{$result}]";
    }
}
echo $returnValue;