NEW FEATURE: added admin name and email address to be configurable
[e-DoKo.git] / functions.php
index be8897453ab574d2b0f2f4c4e9f8f52745bddf53..7ee180e946b9d2f8c248b9062e428b1d866ac61d 100644 (file)
@@ -28,7 +28,7 @@ function myisset()
   /* returns 1 if all names passed as args are defined by a GET or POST statement,
    * else return 0
    */
-
+  
   $ok   = 1;
   $args = func_get_args();
   
@@ -41,10 +41,17 @@ function myisset()
   return $ok;
 }
 
+function myerror($message)
+{
+  echo "<span class=\"error\">".htmlspecialchars($message)."</span>\n";
+  mymail($ADMIN_EMAIL,$EmailName." Error in Code",$message);
+  return;
+}
+
 function pos_array($c,$arr)
 {
   $ret = 0;
-
+  
   $i   = 0;
   foreach($arr as $a)
     {
@@ -335,7 +342,8 @@ function card_value($card)
     case 48:                  
       return 0;
     default:
-      echo "something went wrong, please contact the admin. ErrorCode: 2 - $card<br>";
+      myerror("something went wrong, please contact $ADMIN_NAME at $ADMIN_EMAIL. ErrorCode: 2 - $card<br>");
+      echo "something went wrong, please contact $ADMIN_NAME at $ADMIN_EMAIL. ErrorCode: 2 - $card<br>";
       return 0;
     }
 }