Location: PHPKode > scripts > php ireport > phpireport v1.0 alpha revision 25/phpireport/editor.php
<?
include_only();

if($submit_message=='yes')
{
//echo $message;
if(is_user_loggedin()=='true')
{
$user_info = get_user_info();
$user_id = $user_info['id'];
}
$time = getmicrotime();
$key = getmicrotime().generate_random_string('20');

$user = mysql_real_escape_string($user);
$message = mysql_real_escape_string($message);

submit_message($user_id,$message,$time,$user,$key);

/////////
$write_networks = get_write_networks();
//print_r($write_networks);
for ($i = 0; $i <= count($write_networks)-1; $i++) {
    $network_id = $write_networks[$i]['id'];
	$report_info = get_report_by_key($key);
	$report_id = $report_info['id'];
	$time = getmicrotime();
	$state = '0';
	add_to_send_queue($network_id,$report_id,$time,$state);
}
////////
}

$editor = $editor . " 
<div id='editor_div' name='editor_div'>
<table>
<form method='post' action='index.php'>";

if(is_user_loggedin()=='false')
{
$editor = $editor .
"<tr><td>
<label>name:<br><input type='text' name='user' id='name'/></label>
</td></tr>
";
}
else
{
$user_info = get_user_info();
$editor = $editor .
"<tr><td>
<label>name: ".$user_info['username']."<br>
<input type='hidden' name='user_id' value='".$user_info['id']."'/>
<input type='hidden' name='user' />
</label>
</td></tr>
";
}


$editor = $editor .
"
<tr><td>
<label>report:<br><textarea rows='2' name='message' id='name'></textarea></label>
</td></tr>
<tr><td>
<input type='submit' value='Report' class='button'/>
<input type='hidden' name='submit_message' value='yes'/>
<input type='hidden' name='page' value='home' />
</td></tr>
</form>
</table>
</div>
";

?>
Return current item: php ireport