<?
	session_start();
	
	$repIDre = $_GET['edidre'];
	
	include "../../Connections/connect_mysql.php";
	
	if($repIDre){
		$sqle=" select * from report_tb where repID=" . $repIDre . "; ";
		$resulte = mysql_query($sqle) or die(mysql_error());
		$recorde=mysql_fetch_array($resulte);
		$repName = $recorde['repName'];
		$repLink = $recorde['repLink'];
	}
?>
<?
	mysql_close($c);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Untitled Document</title>
  
</head>

<body>
	<div class="row">
	<div class="col-md-12">
		<form id="frmcomp" class="form-inline">
        	<div class="form-group mx-sm-3 mb-2">
    			<input type="text" class="form-control" id="rept1" placeholder=" ชื่อรายงาน " onBlur="javascript:chkdlgadduser(this.id);" value="<?=$repName?>">
  			</div>
            <div class="form-group mx-sm-5 mb-2">
    			<input type="text" class="form-control" id="rept2" placeholder=" Link path " onBlur="javascript:chkdlgadduser(this.id);" value="<?=$repLink?>" style="width:500px;">
  			</div>
            	<? if($repIDre){ ?>
					<button type="button" class="btn btn-primary" id="btneditrept" onClick="javascript:saveeditrept2(<?=$repIDre?>,'rept',2);"><i class='fa fa-pencil-square-o'></i> บันทึกแก้ไขรายการ</button>
                    <button type="button" class="btn btn-danger" id="btneditcancelrept" onClick="javascript:canceleditrept();"><i class='fa fa-reply-all'></i> ยกเลิกแก้ไขรายการ</button>
			   <? }else{ ?>
            		<button type="button" class="btn btn-primary" id="btnaddrept" onClick="javascript:addrept('rept',2);"><i class='fa fa-plus-circle'></i> เพิ่มรายการ</button>
                <?
				}
				?>
        </form>    
    </div>
    <div class="row">
    	<div class="col-md-12">
        	<hr>
        </div>
    </div>
</div>

</body>
</html>