C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\heimam\tcpro\absicon.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
/**
 * absicon.php
 * 
 * Displays the dialog to assign an icon to an absence type
 * 
 * @package TeamCalPro
 * @version 3.3.001 
 * @author George Lewe
 * @copyright Copyright (c) 2004-2010 by George Lewe
 * @link http://www.lewe.com
 * @license http://www.lewe.com/tcpro/doc/license.txt Extended GNU Public License
 */

//echo "<script type=\"text/javascript\">alert(\"Debug: \");</script>";

/**
 * Set parent flag to control access to child scripts 
 */
define'_VALID_TCPRO');

/**
 * Includes 
 */
require ("config.tcpro.php");
require_once (
"includes/functions.tcpro.php");
getOptions();
if (
strlen($CONF['options']['lang'])) require ("includes/lang/" $CONF['options']['lang'] . ".tcpro.php");
else                                  require (
"includes/lang/english.tcpro.php");

require_once(
"includes/tcconfig.class.php");
require_once(
"includes/tcabsence.class.php");
require_once(
"includes/tclog.class.php");
require_once(
"includes/tclogin.class.php");

$A = new tcAbsence;
$C = new tcConfig;
$L = new tcLogin
$LOG = new tcLog;

/**
 * Check if allowed 
 */
if (!checkAuth("admin")) {
   
// Not authorized. Get outta here
   
jsReload("index.php");
}

/**
 * What's the request 
 */
$thisabsence $_REQUEST['absence'];
$A->findBySymbol($thisabsence);
$thisabsencename $A->dspname;
$thisicon=$A->iconfile;

/**
 * Delete User 
 */
if ( isset($_POST['btn_apply']) ) {

   foreach(
$_POST as $key=>$value) {
      if (
$key=="icon") {
         if (
$value=="noicon"$A->iconfile "";
         else                  
$A->iconfile $value;
         
$A->update($thisabsence);
      }
   }
   
/**
    * Log this event
    */
   
$LOG->log("logAbsence",$L->checkLogin(),"Absence icon changed: $thisabsence : $thisicon");
}
elseif (isset (
$_POST['btn_done'])) {

   
jsCloseAndReload("absences.php");

}

/**
 * Show HTML header
 * Use this file to adjust your meta tags and such
 */
require("includes/header.html.inc.php");
?>
<body>
   <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
   <table width="100%">
      <tr>
         <td valign="top">

            <!--  ICONS =========================================================== -->
            <form name="assign" class="form" method="POST" action="<?=$_SERVER['PHP_SELF']."?absence=".$thisabsence."&amp;lang=".$CONF['options']['lang']?>">
            <table class="dlg" cellspacing="0">
               <tr>
                  <td class="dlg-header" colspan="10">
                     <?php printDialogTop($LANG['absicon_title'].$thisabsencename,"absence_icons.html","ico_icon.png"); ?>
                  </td>
               </tr>
               <!-- Sub Captions -->
               <tr>
               <?php
               $printrow
=1;
               
$scanFor = array (
                  
"gif",
                  
"jpg",
                  
"png"
               
);
               
$scanarray scanDirectory($CONF['app_icon_dir'], $scanFor);
               if (!
strlen($A->iconfile)) $iconcheck="CHECKED"; else $iconcheck="";   
               echo 
"<td class=\"dlg-row".$printrow."\">\n";
               echo 
"\t<input name=\"icon\" id=\"noicon\" type=\"radio\" value=\"noicon\" ".$iconcheck.">";
               echo 
$LANG['absicon_none']."\n";
               echo 
"</td>";
               
$i=2;
               foreach (
$scanarray as $iconfile) { 
                  if (
$printrow == 1$printrow 2;
                  else                
$printrow 1;
                  if (
$iconfile==$A->iconfile$iconcheck="CHECKED"; else $iconcheck="";   
                  echo 
"<td class=\"dlg-row".$printrow."\">\n";
                  echo 
"\t<input name=\"icon\" id=\"".$iconfile."\" type=\"radio\" value=\"".$iconfile."\" ".$iconcheck.">";
                  echo 
"<img src=\"".$CONF['app_icon_dir'].$iconfile."\" border=\"0\" align=\"absmiddle\" alt=\"".$iconfile."\">\n";
                  echo 
"</td>";
                  if (
$i>9) { 
                     
$i=1;
                     echo 
"</tr>";
                     echo 
"<tr>";
                  }
                  else {
                     
$i++; 
                  }  
               }
               if (
$i<=9) { 
                  for (
$k=$i$k<=10$k++) {
                     if (
$printrow == 1$printrow 2;
                     else                
$printrow 1;
                     echo 
"<td class=\"dlg-row".$printrow."\">&nbsp;</td>";
                  }
                  echo 
"</tr>";
               }
               
?>
               <tr>
                  <td class="dlg-menu" colspan="10">
                     <input name="btn_upload" type="button" class="button" onclick="javascript:this.blur();openPopup('upload.php?target=icon','upload','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,titlebar=0,resizable=0,dependent=1,width=500,height=440');" value="<?=$LANG['btn_upload']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
                     <input name="btn_refresh" type="submit" class="button" value="<?=$LANG['btn_refresh']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
                     <input name="btn_apply" type="submit" class="button" value="<?=$LANG['btn_apply']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
                     <input name="btn_help" type="button" class="button" onclick="javascript:this.blur(); openPopup('help/<?=$CONF['options']['helplang']?>/html/index.html?absence_icons.html','help','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,titlebar=0,resizable=0,dependent=1,width=740,height=500');" value="<?=$LANG['btn_help']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
                     <input name="btn_close" type="button" class="button" onclick="javascript:window.close();" value="<?=$LANG['btn_close']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
                     <input name="btn_done" type="submit" class="button" value="<?=$LANG['btn_done']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
                  </td>
               </tr>
            </table>
            </form>
            <br />
         </td>
      </tr>
   </table>
    
<?php
require("includes/footer.html.inc.php");
?>