<?
	$formname = "form_main_contact_card"; 
	$translation = \DynCom\mysyde\common\classes\Registry::get("translation");

  require_once("edit_contact.inc.php")
?>

<div class="toolbar-container">
	<ul class="toolbar_menu">
		<?= button("save",$translation->get("save"),$formname,"sendRequest('save', true)"); ?>
		<?= button("reset",$translation->get("restore"),$formname,"?action=edit"); ?>
	</ul>
</div>

<?php


  
 if ($messages !== null) {
	if(isset($messages) && count($messages)) {
		echo join("\r\n", $messages);
	}
}




	$birthday = new DateTime($GLOBALS['main_contact']['birthday']);
?>

<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
	<input type="hidden" name="filename" value="edit_contact" />
  
  <table class="cardform" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>
        <? input($translation->get("name"),"input_id","hidden",$GLOBALS["main_contact"]["id"],50,TRUE) ?>
        <? input($translation->get("name"),"input_name","text",$GLOBALS["main_contact"]["name"],50,TRUE) ?>
        <? input($translation->get("address"),"input_address","text",$GLOBALS["main_contact"]["address"],50,FALSE) ?>
        <? input($translation->get("post_code"),"input_post_code","code",$GLOBALS["main_contact"]["post_code"],30,FALSE) ?>
        <? input($translation->get("city"),"input_city","text",$GLOBALS["main_contact"]["city"],50,FALSE) ?>
      </td>
      <td>
        <? input($translation->get("birthday"),"input_birthday","date",$birthday->format('d.m.Y'),50) ?>
        <? input($translation->get("Nummer"),"input_phone_no","text",$GLOBALS["main_contact"]["phone_no"],50) ?>
        <? input($translation->get("email"),"input_email","text",$GLOBALS["main_contact"]["email"],100) ?>
      </td>
    </tr>
  </table>

</form>