ort_kurzbz in vilesci/stammdaten/Ort (Raum) änderbar

This commit is contained in:
Martin Tatzber
2014-02-11 09:51:37 +00:00
parent 620bef824e
commit ac41fe2ed4
2 changed files with 91 additions and 88 deletions
+5 -2
View File
@@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2006 Technikum-Wien /* Copyright (C) 2006 fhcomplete.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
@@ -51,6 +51,8 @@ class ort extends basis_db
public $insertvon; // varchar(32) public $insertvon; // varchar(32)
public $content_id; // integer public $content_id; // integer
public $ort_kurzbz_old; // string
/** /**
* Konstruktor * Konstruktor
* @param $ort_kurzbz Kurzbz des zu ladenden Ortes * @param $ort_kurzbz Kurzbz des zu ladenden Ortes
@@ -232,6 +234,7 @@ class ort extends basis_db
//bestehenden Datensatz akualisieren //bestehenden Datensatz akualisieren
$qry = 'UPDATE public.tbl_ort SET '. $qry = 'UPDATE public.tbl_ort SET '.
'ort_kurzbz='.$this->db_add_param($this->ort_kurzbz).', '.
'bezeichnung='.$this->db_add_param($this->bezeichnung).', '. 'bezeichnung='.$this->db_add_param($this->bezeichnung).', '.
'planbezeichnung='.$this->db_add_param($this->planbezeichnung).', '. 'planbezeichnung='.$this->db_add_param($this->planbezeichnung).', '.
'max_person='.$this->db_add_param($this->max_person).', '. 'max_person='.$this->db_add_param($this->max_person).', '.
@@ -248,7 +251,7 @@ class ort extends basis_db
'updateamum='.$this->db_add_param($this->updateamum).', '. 'updateamum='.$this->db_add_param($this->updateamum).', '.
'updatevon='.$this->db_add_param($this->updatevon).', '. 'updatevon='.$this->db_add_param($this->updatevon).', '.
'content_id='.$this->db_add_param($this->content_id).' '. 'content_id='.$this->db_add_param($this->content_id).' '.
'WHERE ort_kurzbz = '.$this->db_add_param($this->ort_kurzbz).';'; 'WHERE ort_kurzbz = '.$this->db_add_param(($this->ort_kurzbz_old!='')?$this->ort_kurzbz_old:$this->ort_kurzbz).';';
} }
if($this->db_query($qry)) if($this->db_query($qry))
+85 -85
View File
@@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2006 Technikum-Wien /* Copyright (C) 2006 fhcomplete.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
@@ -62,6 +62,7 @@
$standort_id = ''; $standort_id = '';
$telefonklappe = ''; $telefonklappe = '';
$content_id=''; $content_id='';
$ort_kurzbz_old = '';
$neu = "true"; $neu = "true";
@@ -82,6 +83,7 @@
$standort_id = $_POST["standort_id"]; $standort_id = $_POST["standort_id"];
$telefonklappe = $_POST["telefonklappe"]; $telefonklappe = $_POST["telefonklappe"];
$content_id = $_POST['content_id']; $content_id = $_POST['content_id'];
$ort_kurzbz_old = $_POST["ort_kurzbz_old"];
$sg_update = new ort(); $sg_update = new ort();
@@ -100,6 +102,7 @@
$sg_update->telefonklappe = $telefonklappe; $sg_update->telefonklappe = $telefonklappe;
$sg_update->standort_id = $standort_id; $sg_update->standort_id = $standort_id;
$sg_update->content_id = $content_id; $sg_update->content_id = $content_id;
$sg_update->ort_kurzbz_old = $ort_kurzbz_old;
if ($_POST["neu"] == "true") if ($_POST["neu"] == "true")
@@ -208,15 +211,16 @@
{ {
if($row->hierarchie>$hierarchiemax) if($row->hierarchie>$hierarchiemax)
$hierarchiemax=$row->hierarchie; $hierarchiemax=$row->hierarchie;
$htmlstr.= '<tr>'; $htmlstr.= '
$htmlstr.= '<td>'.$row->beschreibung.'</td>'; <tr>
$htmlstr.= '<td>'.$row->raumtyp_kurzbz.'</td>'; <td>'.$row->beschreibung.'</td>
$htmlstr.= '<td>'.$row->hierarchie.'</td>'; <td>'.$row->raumtyp_kurzbz.'</td>
$htmlstr.= '<td><a href="raum_details.php?type=raumtyp&ort_kurzbz='.$ort_kurzbz.'&method=delete&raumtyp_kurzbz='.$row->raumtyp_kurzbz.'">Entfernen</a></td>'; <td>'.$row->hierarchie.'</td>
$htmlstr.= '</tr>'; <td><a href="raum_details.php?type=raumtyp&ort_kurzbz='.$ort_kurzbz.'&method=delete&raumtyp_kurzbz='.$row->raumtyp_kurzbz.'">Entfernen</a></td>
</tr>';
} }
$htmlstr.='</tbody></table>'; $htmlstr.='</tbody></table>
$htmlstr.='<form action="raum_details.php?type=raumtyp&ort_kurzbz='.$ort_kurzbz.'&method=add" method="POST"> <form action="raum_details.php?type=raumtyp&ort_kurzbz='.$ort_kurzbz.'&method=add" method="POST">
Raumtyp:<SELECT name="raumtyp_kurzbz">'; Raumtyp:<SELECT name="raumtyp_kurzbz">';
$raumtyp = new raumtyp(); $raumtyp = new raumtyp();
@@ -242,44 +246,41 @@
else else
{ {
if($ort_kurzbz != '') if($ort_kurzbz != '')
$htmlstr .= "<br><div class='kopf'>Raum <b>".$ort_kurzbz."</b></div>\n"; $htmlstr .= '<br><div class="kopf">Raum <b>'.$ort_kurzbz.'</b></div>';
else else
$htmlstr .="<br><div class='kopf'>Neuer Raum</div>\n"; $htmlstr .='<br><div class="kopf">Neuer Raum</div>';
$htmlstr .= "<form action='raum_details.php' method='POST' name='raumform'>\n"; $htmlstr .= '
$htmlstr .= "<table class='detail'>\n"; <form action="raum_details.php" method="POST" name="raumform">
<table class="detail">
<tr><td colspan="3">&nbsp;</tr>
$htmlstr .= " <tr><td colspan='3'>&nbsp;</tr>\n"; <tr>';
$htmlstr .= " <tr>\n";
// erste Spalte start // erste Spalte start
$htmlstr .= " <td valign='top'>\n"; $htmlstr .= '
<td valign="top">
$htmlstr .= " <table>\n"; <table>
$htmlstr .= " <tr>\n"; <tr>
$htmlstr .= " <td>Kurzbezeichnung</td>\n"; <td>Kurzbezeichnung</td>
$htmlstr .= " <td><input class='detail' type='text' name='ort_kurzbz' size='12' maxlength='16' value='".$ort_kurzbz."' onchange='submitable()'></td>\n"; <td><input class="detail" type="text" name="ort_kurzbz" size="12" maxlength="16" value="'.$ort_kurzbz.'" onchange="submitable()"></td>
$htmlstr .= " <td>Bezeichnung</td>\n"; <td>Bezeichnung</td>
$htmlstr .= " <td><input class='detail' type='text' name='bezeichnung' size='32' maxlength='64' value='".$bezeichnung."' onchange='submitable()'></td>\n"; <td><input class="detail" type="text" name="bezeichnung" size="32" maxlength="64" value="'.$bezeichnung.'" onchange="submitable()"></td>
$htmlstr .= " <td>Planbezeichnung</td>\n"; <td>Planbezeichnung</td>
$htmlstr .= " <td><input class='detail' type='text' name='planbezeichnung' size='12' maxlength='8' value='".$planbezeichnung."' onchange='submitable()'></td>\n"; <td><input class="detail" type="text" name="planbezeichnung" size="12" maxlength="8" value="'.$planbezeichnung.'" onchange="submitable()"></td>
$htmlstr .= " </tr>\n"; </tr>
$htmlstr .= " <tr>\n"; <tr>
$htmlstr .= " <td>Max Person</td>\n"; <td>Max Person</td>
$htmlstr .= " <td><input class='detail' type='text' name='max_person' size='12' maxlength='8' value='".$max_person."' onchange='submitable()'></td>\n"; <td><input class="detail" type="text" name="max_person" size="12" maxlength="8" value="'.$max_person.'" onchange="submitable()"></td>
$htmlstr .= " <td>Dislozierung</td>\n"; <td>Dislozierung</td>
$htmlstr .= " <td><input class='detail' type='text' name='dislozierung' size='16' maxlength='8' value='".$dislozierung."' onchange='submitable()'></td>\n"; <td><input class="detail" type="text" name="dislozierung" size="16" maxlength="8" value="'.$dislozierung.'" onchange="submitable()"></td>
$htmlstr .= " <td>Kosten</td>\n"; <td>Kosten</td>
$htmlstr .= " <td><input class='detail' type='text' name='kosten' size='18' maxlength='16' value='".$kosten."' onchange='submitable()'></td>\n"; <td><input class="detail" type="text" name="kosten" size="18" maxlength="16" value="'.$kosten.'" onchange="submitable()"></td>
$htmlstr .= " </tr>\n"; </tr>
$htmlstr .= " <tr>\n"; <tr>
$htmlstr .= " <td>Stockwerk</td>\n"; <td>Stockwerk</td>
$htmlstr .= " <td><input class='detail' type='text' name='stockwerk' size='8' maxlength='5' value='".$stockwerk."' onchange='submitable()'></td>\n"; <td><input class="detail" type="text" name="stockwerk" size="8" maxlength="5" value="'.$stockwerk.'" onchange="submitable()"></td>
$htmlstr .= " <td>Standort</td>\n"; <td>Standort</td>
$htmlstr .= " <td>"; <td>
$htmlstr .= " <SELECT name='standort_id'>"; <SELECT name="standort_id">
$htmlstr.=" <OPTION value=''>-- keine Auswahl --</OPTION>\n"; <OPTION value="">-- keine Auswahl --</OPTION>';
$standort = new standort(); $standort = new standort();
if($standort->getStandorteWithTyp('Intern')) if($standort->getStandorteWithTyp('Intern'))
{ {
@@ -290,18 +291,19 @@
else else
$selected=''; $selected='';
$htmlstr.="<OPTION value='$row->standort_id' $selected>$row->kurzbz</OPTION>\n"; $htmlstr.='<OPTION value="'.$row->standort_id.'" '.$selected.'>'.$row->kurzbz.'</OPTION>';
} }
} }
$htmlstr .= " </SELECT>"; $htmlstr .= '
$htmlstr .= " </td>\n"; </SELECT>
$htmlstr .= " <td>Telefonklappe</td>\n"; </td>
$htmlstr .= " <td><input class='detail' type='text' name='telefonklappe' size='3' maxlength='8' value='".$telefonklappe."' onchange='submitable()'></td>\n"; <td>Telefonklappe</td>
$htmlstr .= " </tr>\n"; <td><input class="detail" type="text" name="telefonklappe" size="3" maxlength="8" value="'.$telefonklappe.'" onchange="submitable()"></td>
$htmlstr .= " <tr>\n"; </tr>
$htmlstr .= " <td valign='top'>Lehre</td>\n"; <tr>
$htmlstr .= " <td>\n"; <td valign="top">Lehre</td>
<td>';
if($lehre == 't') if($lehre == 't')
{ {
$chk1 = "checked"; $chk1 = "checked";
@@ -310,51 +312,49 @@
{ {
$chk1 = ''; $chk1 = '';
} }
$htmlstr .= " <input type='checkbox' name='lehre' value='t'".$chk1." onchange='submitable()'>"; $htmlstr .= '<input type="checkbox" name="lehre" value="t"'.$chk1.' onchange="submitable()"></td>
$htmlstr .= " </td>\n"; <td valign="top">Reservieren</td>
$htmlstr .= " <td valign='top'>Reservieren</td>\n"; <td>';
$htmlstr .= " <td>\n";
if($reservieren == 't') if($reservieren == 't')
{ {
$chk2 = "checked"; $chk2 = 'checked';
} }
else else
{ {
$chk2 = ''; $chk2 = '';
} }
$htmlstr .= " <input type='checkbox' name='reservieren' value='t'".$chk2." onchange='submitable()'>"; $htmlstr .= '<input type="checkbox" name="reservieren" value="t"'.$chk2.' onchange="submitable()"></td>
$htmlstr .= " </td>\n"; <td valign="top">Aktiv</td>
$htmlstr .= " <td valign='top'>Aktiv</td>\n"; <td>';
$htmlstr .= " <td>\n";
if($aktiv == 't') if($aktiv == 't')
{ {
$chk3 = "checked"; $chk3 = 'checked';
} }
else else
{ {
$chk3 = ''; $chk3 = '';
} }
$htmlstr .= " <input type='checkbox' name='aktiv' value='t'".$chk3." onchange='submitable()'>"; $htmlstr .= '<input type="checkbox" name="aktiv" value="t"'.$chk3.' onchange="submitable()"></td>
$htmlstr .= " </td>\n"; </tr>
$htmlstr .= " </tr>\n"; <tr>
$htmlstr .= " <tr>\n"; <td valign="top">Lageplan</td>
$htmlstr .= " <td valign='top'>Lageplan</td>\n"; <td><textarea name="lageplan" cols="37" rows="5" onchange="submitable()">'.$lageplan.'</textarea></td>
$htmlstr .= " <td><textarea name='lageplan' cols='37' rows='5' onchange='submitable()'>".$lageplan."</textarea></td>\n"; <td valign="top">Ausstattung</td>
$htmlstr .= " <td valign='top'>Ausstattung</td>\n"; <td><textarea name="ausstattung" cols="37" rows="5" onchange="submitable()">'.$ausstattung.'</textarea></td>
$htmlstr .= " <td><textarea name='ausstattung' cols='37' rows='5' onchange='submitable()'>".$ausstattung."</textarea></td>\n"; <td valign="top">ContentID</td>
$htmlstr .= " <td valign='top'>ContentID</td>\n"; <td valign="top"><input type="text" name="content_id" size="5" onchange="submitable()" value="'.$content_id.'" /></td>
$htmlstr .= " <td valign='top'><input type='text' name='content_id' size='5' onchange='submitable()' value='".$content_id."' /></td>\n"; </tr>
$htmlstr .= " </tr>\n"; </table>
$htmlstr .= "</table>\n"; <br>
$htmlstr .= "<br>\n"; <input type="hidden" name="ort_kurzbz_old" value="'.$ort_kurzbz.'" />
$htmlstr .= "<div align='right' id='sub'>\n"; <div align="right" id="sub">
$htmlstr .= " <span id='submsg' style='color:red; visibility:hidden;'>Datensatz ge&auml;ndert!&nbsp;&nbsp;</span>\n"; <span id="submsg" style="color:red; visibility:hidden;">Datensatz ge&auml;ndert!&nbsp;&nbsp;</span>
$htmlstr .= " <input type='hidden' name='neu' value='".$neu."'>"; <input type="hidden" name="neu" value="'.$neu.'">
$htmlstr .= " <input type='submit' value='Speichern' name='schick'>\n"; <input type="submit" value="Speichern" name="schick">
$htmlstr .= " <input type='button' value='Reset' onclick='unchanged()'>\n"; <input type="button" value="Reset" onclick="unchanged()">
$htmlstr .= "</div>"; </div>
$htmlstr .= "</form>"; </form>
$htmlstr .= "<div class='inserterror'>".$errorstr."</div>"; <div class="inserterror">'.$errorstr.'</div>';
} }
?> ?>
<!DOCTYPE HTML> <!DOCTYPE HTML>