<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”> <script type=“text/javascript”src=“js/jquery.js”></script> <script type=“text/javascript”>

function sendPost (frmId, value, url, target, conf) {

if(conf.length>0){
	if(!confirm(conf))
		return false;
}
var html = "";
if(url != "")
{
	if (jQuery("#"+frmId).length > 0) {
		jQuery("#"+frmId).attr("action",url);
	}
	else {
		jQuery("body").append("<form action=\""+url+"\" id=\""+frmId+"\" method=\"post\" ></form>")
	}
}
if (target != "") {
	jQuery("#"+frmId).attr("target",target);
}
if (value != "") {
	jQuery.each(value,function(index,value){
		if(jQuery("#"+frmId).find("input:hidden[name='"+index+"']").length == 0)
		{
			html += "<input type='hidden' name='"+index+"' value='"+value+"' id='"+index+"' />";
		}else{
			jQuery("input:hidden[name='"+index+"']").val(value);
		}
		temp = index;
	});
}
jQuery("#"+frmId).append(html).trigger("submit");

} </script> <style>

a {
	margin-left:10px;
	font: 16px Tahoma;
	color: #0B4C5F;
	outline: 0;
	text-decoration: none;
}
a:hover{
	text-decoration: none;
	color: #DF7401;
}

</style> <table border=“0” width=“65%” align=“center”>

<tr>
	<td>
	<?php
		$url = "http://bls.buu.ac.th/miscgi/index_codeigniter.php/eportfolio/export/exp_allpersonindept";
		$arr['dpId'] = 1;
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, 'arr='.serialize($arr));
		$rs = curl_exec($ch);
		curl_close($ch);
		
		$rs_curl_dp = simplexml_load_string($rs);
		//print_r($rs_curl_dp); die;
		if($rs_curl_dp){
			foreach($rs_curl_dp as $dp_index => $row_dp){
				?>
				<div style="font:bold 14px Tahoma;margin:25 10 10 20px;padding:5px;color:#264B87;
				list-style: none;  
			background: #fff;
			background: -moz-linear-gradient(#999, #000); 
			background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(1, #999));	
			background: -webkit-linear-gradient(#999, #000);	
			background: -o-linear-gradient(#999, #000);
			background: -ms-linear-gradient(#999, #000);
			background: linear-gradient(#fff, #fcfcfc, #d6eefb, #d6eefb);
			-moz-box-shadow: 0 2px 1px #089CDA;
			-webkit-box-shadow: 0 2px 1px #089CDA;
			box-shadow: 0 2px 1px #089CDA;"><?php echo $row_dp->dept_name; ?></div>
				<?php
				if($row_dp->persons){
					?>
					<table border="0" style="padding-left:40px;">
						<?php
						foreach($row_dp->persons->person as $index => $row_ps){
							?>
									
							<tr>
								<td>
								<img src="<?php echo $row_ps->picture; ?>" style="margin:3px;border:0px solid #ddd;padding:1px;box-shadow:0 0 10px #888;width:50px;height:54px;"></img>
								</td>
								<td>
									<p style="font:12px Tahoma;color:#088A4B;">
										<a  onClick="sendPost('hidform', {'ps_id':<?php echo $row_ps->person_id;?>}, '<?php echo $row_ps->portfolio_url;?>', '_blank', '')" >
											<?php echo $row_ps->name; ?> 	
										</a><br/>
										&nbsp;&nbsp;
										<?php
										if($row_ps->phone != ''){
											?>
											<?php echo " phone : ".$row_ps->phone.",";
										}
										?>
										<?php echo " e-mail : ".$row_ps->email;?>
									</p>	
								</td>
							</tr>
							<?php
						}
						?>
					</table>
					<?
				}
			}
		}
	?>
	</td>
</tr>

</table>