Example #1
0
<?php

//if(!isset($_SERVER['HTTP_REFERER'])){
//    header("location: ../../access_denied.php?data=You don't have direct access to this page");
//}
require_once 'db/horizon_issueclass.php';
define('INCLUDE_CHECK', true);
if (isset($_GET['id'])) {
    $ti = $_GET['id'];
} else {
    die("First Go to horizon managemant page");
}
$b = Horizon_IssueClass::getHorizonIssueObject($ti);
if ($b === 0) {
    die("inalid horizon issue");
}
?>
<form method="post" id="updateform" enctype="multipart/form-data" action="server/horizon/horizon_update_server.php"> 
     
           <label for="id">Horizon ID<span style="color:red;">*</span>:</label>
           <input type="text" value="<?php 
echo $b->horizon_id;
?>
" name="id" class="text ui-widget-content ui-corner-all" id="id" required readonly="true" />
   
       <label for="version">Horizon Version<span style="color:red;">*</span>:</label>
       <input type="text" readonly="true" name="version" value="<?php 
echo $b->horizon_version;
?>
" class="text ui-widget-content ui-corner-all" id="version" required maxlength="40" />
      
require_once '../../db/site_log_class.php';
require_once '../../db/user_class.php';
session_start();
function gen_random_string($length = 16)
{
    $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
    //length:36
    $final_rand = '';
    for ($i = 0; $i < $length; $i++) {
        $final_rand .= $chars[rand(0, strlen($chars) - 1)];
    }
    return $final_rand;
}
if (isset($_POST['id'])) {
    $id = $_POST['id'];
    $object = Horizon_IssueClass::getHorizonIssueObject($_POST['id']);
} else {
    die("some thing wrong.");
}
if (isset($_POST['version'])) {
    $version = $_POST['version'];
} else {
    die("Insert version.");
}
if (isset($_POST['date'])) {
    $date = $_POST['date'];
} else {
    die("Insert Date.");
}
if (isset($_POST['url'])) {
    $issueURL = $_POST['url'];