<?php
/************************************************************/
/*	                     RUNCMS                             */
/* Relaible - Unique - Nocost &  Simplicity & ease off use  */
/*              < http://www.runcms.org >                   */
/************************************************************/

// Original Author: Nobse
// Author Website : http://www.exoops.de
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
include_once("./admin_header.php");
include_once("../class/pm.class.php");
global $db;

$result = $db->query("SELECT * FROM ".$db->prefix('priv_msgs')."");
$aa = 0;
while ($myrow = $db->fetch_array($result)) {
	$subject = $myrow['subject'];
	$from_userid = $myrow['from_userid'];
	$to_userid = $myrow['to_userid'];
	$time = $myrow['msg_time'];
	$text = $myrow['msg_text'];
	$read = $myrow['read_msg'];
	
	$msg_id = $db->genId($db->prefix('private_msgs').'_msg_id_seq');
	
	$sql = "
		INSERT INTO ".$db->prefix("private_msgs")." SET
		msg_id=".intval($msg_id).",
		msg_image='icon1.gif',
		msg_attachment='',
		subject='$subject',
		from_userid=".intval($from_userid).",
		to_userid=".intval($to_userid).",
		msg_time=".intval($time).",
		msg_text='$text',
		read_msg=".intval($read).",
		type='user',
		allow_html=1,
		allow_smileys=1,
		allow_bbcode=1";
		  
	$result1 = $db->query($sql);		  	   
$aa++;		
}

xoops_cp_header();
OpenTable();
echo "<br><br><br>";
echo $aa._AM_PM_UPDATE;
echo "<br><br><br>";
CloseTable();
xoops_cp_footer();
?>