<?PHP

#############################################################################
#                              Site@School
# Site@School is a website management system designed for schools.
#
# link.php 
#$Id: link.php,v 1.1 2006/10/03 12:27:15 fstuurman Exp $
############################################################################
include ("../../../configuration/database.inc.php"); // connecting to database
mysql_connect("$db_server", "$db_username", "$db_password");
mysql_select_db("$db_name");

$query = "SELECT config_value FROM $table_configuration where config_key='language'"; // getting the language
$result = mysql_query($query) or die_script(mysql_error());
$language = mysql_result($result, 0);
include ("../../../languages/$language/$language.php"); // including language file
unset ($query);
unset ($result);
?>

<html style="width: 500; height: 430;">
<meta http-equiv="Content-Type" content="text/html; charset=<?PHP echo $sas_lang['lang_charset'] ?>"> 
<head>
<style type="text/css">
html, body {
  background: ButtonFace;
  color: ButtonText;
  font: 12px Tahoma,Verdana,sans-serif;
  margin: 0px;
  padding: 0px;
}
body { padding: 10px; }
select, input, button { font: 12px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
.space { padding: 2px; }

.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
</style>
</head>
<title><?PHP echo $sas_lang['internal_link'] ?></title>
<script type="text/javascript" src="popup.js"></script> 
<script type="text/javascript">

function Init() {
  __dlg_init();
  window.focus();
};

function onOK() {
  var required = {
    "f_url": "You must enter the URL"
  };
  for (var i in required) {
    var el = document.getElementById(i);
    if (!el.value) {
      alert(required[i]);
      el.focus();
      return false;
    }
  }
  // pass data back to the calling window
  var fields = ["f_url", "f_linkname", "f_anchor"];
  var param = new Object();
  for (var i in fields) {
    var id = fields[i];
    var el = document.getElementById(id);
    param[id] = el.value;
  }
  __dlg_close(param);
  return false;
};

function onCancel() {
  __dlg_close(null);
  return false;
};

</script>
<body onload="Init();">
<?PHP print "<div class=\"title\">".$sas_lang['internal_link'].":<br></div>" ; ?>
<form>
<iframe src="link1.php" name="lnkManager" id="lnkManager" width="450" height="230" marginwidth="0" marginheight="0" align="top" scrolling="auto" frameborder="1" hspace="0" vspace="0"></iframe>

<br><br><b><?PHP echo $sas_lang['html_code'] ?></b><br>
<input type=text id="f_url" size=\"75\" style="width:30em">
<br><b><?PHP echo $sas_lang['link_text'] ?></b><br>
<input type=text id="f_linkname" size="50" style="width:20em">
<br><b>Anchor name:</b><br><input type="text" name="anchor" id="f_anchor" style="width:20em"
title="Enter the anchor name for link" />
<p><button type="button" name="cancel" onclick="return onCancel();"><?PHP echo $sas_lang['cancel'] ?></button>&nbsp;&nbsp;&nbsp; 
<button type="button" name="ok" onclick="return onOK();"><?PHP echo$sas_lang['insert'] ?></button>
&nbsp;&nbsp;
</form>
</span>
</body></html>