function getRightContent_postLog ( )
{
    $oU = $_SESSION["oU"];

    $row_index = 0;
    $right_content = read_template($GLOBALS["_TPL_PATH"] . "workspace01.tpl");
    $oC = new clsConnection($GLOBALS["DBHOST"], $GLOBALS["DBNAME_UMS"], $GLOBALS["DBUSER_UMS"], $GLOBALS["DBPASS_UMS"]);
    if ($oC->c && $oC->errmsg == "") {
        $oGrp = new umgroup($oC);
        $oUg = new umusergroup($oC);
        $menuInfo = array();
        $grouping = array();
        $oUg->RSgroupByUsNoUgGpIDAdmin($oU->userID, "UgGpID"); //No Group Admin (GpID=1)
        while ($oUg->GetRecord()) {
            $oGrp->SearchByKey($oUg->UgGpID);
            $oGrp->GetRecord();
            if (isset($GLOBALS["_SYSDIR_PATH"][$oGrp->GpStID]) && $oGrp->GpStID != $GLOBALS["_ADDIN_BLOG"]) {
                $menuInfo[$row_index]["gpnamet"] = $oGrp->GpNameT;
                $menuInfo[$row_index]["gpstid"] = $oGrp->GpStID;
                $menuInfo[$row_index]["uggpid"] = $oUg->UgGpID;

                // Fixed group by system-id
                if (!isset($grouping[$oGrp->GpStID]))
                    $grouping[$oGrp->GpStID] = array();
                $grouping[$oGrp->GpStID][] = array("gpnamet" => $oGrp->GpNameT,
                                                   "gpstid" => $oGrp->GpStID,
                                                   "uggpid" => $oUg->UgGpID,
                                                   "linked" => $row_index);
                // End Fixed
                $row_index++;
            }
        }
        ksort($grouping);
        $group_max = 0;
        foreach ($grouping as $group) {
            $group_len = count($group);
            if ($group_len > $group_max)
                $group_max = $group_len;
        }

        $_SESSION["SubSys"] = $menuInfo;
		
		//------------
		?>
		<?php $spacer=$GLOBALS["_INFO_URL"]."img/spacer.gif";
		   $subsys_img=$GLOBALS["_INFO_URL"]."img/subsys.gif";
		 ?>
		 <table width="95%" border="0" cellspacing="0" cellpadding="0" summary="" bgcolor="#FFFFFF" align="center">
				<tr><td height="25"> </td></tr>
				<tr><td colspan="2"><img src="<?php echo $spacer; ?>" width="1" height="3" alt=""></td></tr>
				<tr valign="middle">
					<td align="center" colspan="2">
						<table width="100%" border="0" cellspacing="0" cellpadding="0" summary="">
							<tr valign="middle">
								<td align="left" style="width: 36px;"><img src="<?php echo $subsys_img; ?>" alt=""></td>
								<td align="left"><span style="font-size: 18pt; color: #A3A3A3; font-family: 'Ms sans serif', sans-serif; font-weight: bold;"><?php echo $GLOBALS["INFOSYS_MESG"]; ?></span></td>
								<td align="right" style="width: 30px;"><img src="<?php echo $spacer; ?>" alt=""></td>
								<td align="right" style="width: 30px;"><img src="<?php echo $spacer; ?>" alt="" width="1" height="23"></td>
							</tr>
						</table>
					</td>
				</tr>
			<tr><td colspan="2"><img src="<?php echo $spacer; ?>" width="1" height="3" alt=""></td></tr>
			<tr><td colspan="2"><img src="<?php echo $spacer; ?>" width="1" height="4" alt=""></td></tr>
			<tr><td colspan="2" bgcolor="#009933"><img src="<?php echo $spacer; ?>" width="1" height="4" alt=""></td></tr>
			</table>
		<?php 
		//------------show info
		
		$fileNameArr = array("eoffice2info.php","ebudget2info.php");
		$contentArr = array();
		$ct = 0;
		for($fn=0; $fn<count($fileNameArr); $fn++) {
			if(file_exists("../service/".$fileNameArr[$fn])) {
				if(file_get_contents("http://saraban.pi.ac.th".$GLOBALS["ROOT_URL"]."service/".$fileNameArr[$fn]."?psId=".$oU->userPsCode."&weburl=".$GLOBALS["ROOT_URL"])) {
					$contentArr[$ct] = $fn;
					
					$ct++;
				}
			}
		}
		if($oU->WgID!='9'){
			echo "<table width=\"95%\"><tr><td><fieldset>";
			if($ct) { echo "<br><legend><font color=\"#FFCC66\" size=3><b>§Ò¹·Õèµéͧ´Óà¹Ô¹¡ÒÃ</b></font></legend>"; }
			echo "<table width=\"100%\" border=0 >\n";
			for($ct=0; $ct<count($contentArr); $ct+=2) {
				echo "\t<tr>\n";
				if(isset($contentArr[$ct]))
					echo "\t\t<td width=\"50%\" align=\"left\" valign=\"top\" style=\"WORD-BREAK:BREAK-ALL\">".file_get_contents("http://saraban.pi.ac.th".$GLOBALS["ROOT_URL"]."service/".$fileNameArr[$contentArr[$ct]]."?psId=".$oU->userPsCode."&weburl=".$GLOBALS["ROOT_URL"])."</td>\n";
				if(isset($contentArr[$ct+1]))
					echo "\t\t<td width=\"50%\" align=\"left\" valign=\"top\" style=\"WORD-BREAK:BREAK-ALL\">".file_get_contents("http://saraban.pi.ac.th".$GLOBALS["ROOT_URL"]."service/".$fileNameArr[$contentArr[$ct+1]]."?psId=".$oU->userPsCode."&weburl=".$GLOBALS["ROOT_URL"])."</td>\n";
				echo "\t</tr>\n";
			}
			echo "</table></fieldset></td></tr></table>";
			if($ct) { echo "<br>"; }		
		}
		//--------------------------------


			$extended_content = "<font size=2>";
            $extended_content = $extended_content.buildGSystemMenu($grouping);
			$extended_content = $extended_content."</font>";
		
        $oC->Disconnect();
    } else {
        if ($GLOBALS["DEBUG_MODE"]) {
            if ($oConn->errmsg != "")
                $extended_content = "äÁèÊÒÁÒöµÔ´µèÍ°Ò¹¢éÍÁÙÅËÃ×ÍäÁèÁÕ°Ò¹¢éÍÁÙÅ·ÕèÃкØ.";
        } else {
            $extended_content = "";
        }
    }
    bind_content(array("INFOTITLE" => $GLOBALS["INFOSYS_MESG"],
                       "EXTENDED" => $extended_content), $right_content);
    return $right_content;
}
示例#2
0
function getRightContent_postLog ( )
{
    $oU = $_SESSION["oU"];

    $row_index = 0;
    $right_content = read_template($GLOBALS["_TPL_PATH"] . "workspace01.tpl");
    $oC = new clsConnection($GLOBALS["DBHOST"], $GLOBALS["DBNAME_UMS"], $GLOBALS["DBUSER_UMS"], $GLOBALS["DBPASS_UMS"]);
    if ($oC->c && $oC->errmsg == "") {
        $oGrp = new umgroup($oC);
        $oUg = new umusergroup($oC);
        $menuInfo = array();
        $grouping = array();
        $oUg->RSgroupByUsNoUgGpIDAdmin($oU->userID, "UgGpID"); //No Group Admin (GpID=1)
        while ($oUg->GetRecord()) {
            $oGrp->SearchByKey($oUg->UgGpID);
            $oGrp->GetRecord();
            if (isset($GLOBALS["_SYSDIR_PATH"][$oGrp->GpStID]) && $oGrp->GpStID != $GLOBALS["_ADDIN_BLOG"]) {
                $menuInfo[$row_index]["gpnamet"] = $oGrp->GpNameT;
                $menuInfo[$row_index]["gpstid"] = $oGrp->GpStID;
                $menuInfo[$row_index]["uggpid"] = $oUg->UgGpID;

                // Fixed group by system-id
                if (!isset($grouping[$oGrp->GpStID]))
                    $grouping[$oGrp->GpStID] = array();
                $grouping[$oGrp->GpStID][] = array("gpnamet" => $oGrp->GpNameT,
                                                   "gpstid" => $oGrp->GpStID,
                                                   "uggpid" => $oUg->UgGpID,
                                                   "linked" => $row_index);
                // End Fixed
                $row_index++;
            }
        }
        ksort($grouping);
        $group_max = 0;
        foreach ($grouping as $group) {
            $group_len = count($group);
            if ($group_len > $group_max)
                $group_max = $group_len;
        }

        $_SESSION["SubSys"] = $menuInfo;
		$psId=$oU->userPsCode;
		$psWgID=$oU->WgID;
		//------------
		?>
		<?php $spacer=$GLOBALS["_INFO_URL"]."img/spacer.gif";
		   $subsys_img=$GLOBALS["_INFO_URL"]."img/subsys.gif";
		   $myhost=$GLOBALS["HOST_NAME"];
		 ?>
		 <table width="95%" border="0" cellspacing="0" cellpadding="0" summary="" bgcolor="#FFFFFF" align="center">
				<tr><td height="25"> </td></tr>
				<tr><td colspan="2"><img src="<?php echo $spacer; ?>" width="1" height="3" alt=""></td></tr>
				<tr valign="middle">
					<td align="center" colspan="2">
						<table width="100%" border="0" cellspacing="0" cellpadding="0" summary="">
							<tr valign="middle">
								<td align="left" style="width: 36px;"><img src="<?php echo $subsys_img; ?>" alt=""></td>
								<td align="left"><span style="font-size: 18pt; color: #A3A3A3; font-family: 'Ms sans serif', sans-serif; font-weight: bold;"><?php echo $GLOBALS["INFOSYS_MESG"]; ?></span></td>
								<td align="right" style="width: 30px;"><img src="<?php echo $spacer; ?>" alt=""></td>
								<td align="right" style="width: 30px;"><img src="<?php echo $spacer; ?>" alt="" width="1" height="23"></td>
							</tr>
						</table>
					</td>
				</tr>
			<tr><td colspan="2"><img src="<?php echo $spacer; ?>" width="1" height="3" alt=""></td></tr>
			<tr><td colspan="2"><img src="<?php echo $spacer; ?>" width="1" height="4" alt=""></td></tr>
			<tr><td colspan="2" bgcolor="#009933"><img src="<?php echo $spacer; ?>" width="1" height="4" alt=""></td></tr>
			</table>
			<!--script src="http://code.jquery.com/jquery-latest.js"></script-->
			<script type="text/javascript" language="JavaScript" src="js/jquery-latest.js"></script>
			<div id='showtest2' align=left></div>
				<script type='text/javascript'>

				var loader = '<div align=\"center\">Loading...</div>';
				$('div#showtest2').empty().append(loader)
					var url = 'http://'+'<?php echo $myhost?>'+'/mispbri/info/mod/showwork.php?psId='+<?php echo $psId?>+'&psWgID='+<?php echo $psWgID?>;
						$.ajax(
							{
		   						type: 'GET',
							   	url: url,
							   	data: '',
							   	success: 
								    function(t) 
						          	{
						           		$('div#showtest2').empty().append(t);
						       	   	},
							   	error:
								   	function()
								   	{
								    	$('div#showtest2').append('-');
								   	}
						});	
				</script>

<?php


			$extended_content = "<font size=2>";
            $extended_content = $extended_content.buildGSystemMenu($grouping);
			$extended_content = $extended_content."</font>";
		
        $oC->Disconnect();
    } else {
        if ($GLOBALS["DEBUG_MODE"]) {
            if ($oConn->errmsg != "")
                $extended_content = "äÁèÊÒÁÒöµÔ´µèÍ°Ò¹¢éÍÁÙÅËÃ×ÍäÁèÁÕ°Ò¹¢éÍÁÙÅ·ÕèÃкØ.";
        } else {
            $extended_content = "";
        }
    }
    bind_content(array("INFOTITLE" => $GLOBALS["INFOSYS_MESG"],
                       "EXTENDED" => $extended_content), $right_content);
    return $right_content;
}