Beispiel #1
0
function editPage($id)
{
    include_once 'login.php';
    include_once 'database_conn.php';
    include_once 'showEventFunction.php';
    $pageHeader = "Event Edit Page";
    $sql = "SELECT * FROM te_events WHERE eventID = {$id}";
    $rslt = mysqli_query($conn, $sql) or die(mysqli_error($conn));
    // error message return if return empty result
    $row = mysqli_fetch_row($rslt);
    $venues = getFromDb($conn, "SELECT * FROM te_venue");
    $categories = getFromDb($conn, "SELECT * FROM te_category");
    $output = "<h1>{$pageHeader}</h1>";
    $i = 1;
    $output .= "<form id=\"editForm\" action=\"handleEditPage.php\" method=\"post\">";
    $output .= "<table border=0 >";
    $output .= createRowData("Title", createTextField("title", $row[$i++]));
    $output .= createRowData("Description", createTextArea("desc", $row[$i++], 5, 40));
    $output .= createRowData("Venue Name", createCombobox("venue", $row[$i++], $venues));
    $output .= createRowData("Category", createCombobox("category", $row[$i++], $categories));
    $output .= createRowData("Start Time", createDate("startTime", $row[$i++]));
    $output .= createRowData("End Time", createDate("endTime", $row[$i++]));
    $output .= createRowData("Price", createTextField("price", $row[$i++]));
    $output .= "<tr><td><input type=\"submit\" name=\"submit\" value=\"Submit\"></td></tr>";
    $output .= "<input type=\"hidden\" name=\"e_id\" value=\"{$id}\">";
    $output .= "</table></form>";
    mysqli_free_result($rslt);
    mysqli_close($conn);
    return $output;
}
  		<input type="checkbox" name="commentsEnabled" id="commentsEnabled" value="1" <?php 
    echo $thisPilot->commentsEnabled ? 'checked' : '';
    ?>
 />
  	  </label>
	
	    <?php 
    require_once dirname(__FILE__) . '/FN_editor.php';
    if (L_auth::isModerator($userID)) {
        $toolbar = 'Leonardo';
        $allowUploads = false;
    } else {
        $toolbar = 'LeonardoSimple';
        $allowUploads = false;
    }
    createTextArea($flight->userServerID, $flight->userID, 'comments', $flight->comments, 'flight_comments', $toolbar, $allowUploads, 700, 200);
    ?>
	  
		</td>
    </tr>

    <tr>
      <td><div align="right" class="styleItalic"><?php 
    echo _RELEVANT_PAGE;
    ?>
 </div></td>
      <td colspan="3">
        http://<input name="linkURL" type="text" id="linkURL" size="50" value="">		</td>
    </tr>
	<?php 
    for ($i = 0; $i < $CONF_photosPerFlight; $i++) {
                echo $area->desc;
                ?>
"/>		
				<?php 
            }
            ?>
				</td>
				
		  </tr>
		  <tr>
			<td>Description (in english) </td>
			<td> 
			 <?php 
            if ($areaAction != 'Delete') {
                require_once dirname(__FILE__) . '/FN_editor.php';
                createTextArea(0, 0, 'descInt', $area->descInt, 'takeoff_description', 'Leonardo', true, 710, 600);
            } else {
                ?>
				<input type="text" name="descInt" size="40" value="<?php 
                echo $area->desc;
                ?>
"/>		
				<?php 
            }
            ?>
             
						</td>
		  </tr>
		  
		  <tr>
			<td>Min Latitude </td>
echo $waypt->link;
?>
" size="60" >
              <input type="submit" name="Submit2" value="<?php 
echo "APPLY CHANGES";
?>
" />
            </font></td>
          </tr>
          <tr>
            <td colspan="4" bgcolor="#E7E6CB"><div align="center"><strong><font color="#003366">Description</font></strong></div></td>
          </tr>
          <tr>
            <td colspan="4" valign="top" bgcolor="#CFE2CF">
			  <?php 
createTextArea(0, 0, 'description', $waypt->description, 'takeoff_description', 'Leonardo', true, 710, 400);
?>
            
			</td>
          </tr>
          <tr>
            <td colspan="4"><div align="right"></div>
				<div align="center">
				  <input type="submit" name="Submit" value="<?php 
echo "APPLY CHANGES";
?>
">
				  <input type="hidden" name="editWaypoint" value="1">  	     
		        </div></td>
          </tr>
        </table>