TP Underground Lounge 07/08
-


Hinweise


Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 19.05.2005, 15:30   #1
TP-Supporter
 
Benutzerbild von mimamo
 
Registriert seit: Oct 2002
Ort: Berlin
mimamo macht alles soweit korrekt

file upload - falsche php einstellungen?


hallo zusammen,

mein fileuploadproblem - http://www.traum-projekt.com/forum/s...ad.php?t=65283 ist leider immer noch nicht ganz geloest.
inzwischen kann ich zwar dateien hochladen, diese landen aber noch nicht in dem richtigen verzeichnis.

aus dem dateinamen wird anstelle von 8c36_ipod.jpg
/srv/www/htdocs/web35/html/mima-multimedia/vdi-biete-suche/login/bilder/8c36_ipod.jpg

das bild mit dem "tollen" dateinamen liegt dann auch in dem verzeichnis .../login.
eigentlich sollte es (was auch auf meinem lokalen webserver funktioniert) mit dem richtigen dateinamen in dem verzeichnis .../login/bilder liegen.

kann es evtl. sein, dass hier noch irgendwelche php einstellungen auf dem online webspace falsch sind?

waere euch fuer tipps und hilfe dankbar.

MIMAMO
mimamo ist offline   Mit Zitat antworten


Alt 19.05.2005, 15:45   #2
TP-Specialist
 
Benutzerbild von rewboss
 
Registriert seit: Mar 2005
Ort: Unterfranken
rewboss ist ein richtiges Arbeitstier - DANKErewboss ist ein richtiges Arbeitstier - DANKErewboss ist ein richtiges Arbeitstier - DANKErewboss ist ein richtiges Arbeitstier - DANKErewboss ist ein richtiges Arbeitstier - DANKErewboss ist ein richtiges Arbeitstier - DANKE
Kannst du den PHP-Code posten?
rewboss ist offline   Mit Zitat antworten
Alt 19.05.2005, 15:54   #3
TP-Supporter
 
Benutzerbild von mimamo
 
Registriert seit: Oct 2002
Ort: Berlin
mimamo macht alles soweit korrekt
das script, in dem das bild ausgewaehlt und hochgeladen wird:
PHP-Code:
<?php session_start(); ?>
<?php ob_start
(); ?>
<?php
header
("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // date in the past
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0"false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
$ewCurSec 
0// Initialise

// User levels
define("ewAllowAdd"1true);
define("ewAllowDelete"2true);
define("ewAllowEdit"4true);
define("ewAllowView"8true);
define("ewAllowList"8true);
define("ewAllowReport"8true);
define("ewAllowSearch"8true);
define("ewAllowAdmin"16true);
?>
<?php
if (@$HTTP_SESSION_VARS["vdi-biete-suche-daten_status"] <> "login") {
    
header("Location:  login.php");
    exit();
} else {

    
// Restore Security Table - created in Login
    
$arrSecurity = @$HTTP_SESSION_VARS["ewSecurity"];

    
// Get Current Table Security
    
$sTmp1 = -1;
    for (
$i 1$i <= count($arrSecurity[0]); $i++) {
        if (
$arrSecurity[0][$i] == "vdi-biete-suche") {
            
$sTmp1 $i;
            break;
        }
    }
    
$ewCurLvl = @$HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserLevel"];
    if (
is_numeric($ewCurLvl) && $sTmp1 <> -1) {
        if (
$ewCurLvl == -1)  { // System Administrator
            
$ewCurSec 31;
        } elseif (
$ewCurLvl && $ewCurLvl <= 1) {
            
$ewCurSec $arrSecurity[$ewCurLvl][$sTmp1];
        }
    }
    if ((
$ewCurSec ewAllowadd) <> ewAllowadd) { header("Location: vdi2Dbiete2Dsuchelist.php"); exit();}
      if (@
$HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserID"] == "" && @$HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserLevel"] <> -1) { header("Location: login.php"); exit();}
}
?>
<?php

// Initialize common variables
$x_ID Null;
$x_Biete2DSuche Null;
$x_Schlagwort Null;
$x_Beschreibung Null;
$x_Ansprechpartner Null;
$x_Email Null;
$x_Telefonnummer Null;
$x_Website Null;
$x_Datum Null;
$x_PictureName Null;
$fs_x_PictureName 0;
$fn_x_PictureName "";
$ct_x_PictureName "";
$w_x_PictureName 0;
$h_x_PictureName 0;
$a_x_PictureName "";
$x_userID Null;
?>
<?php 
include ("db.php"?>
<?php 
include ("phpmkrfn.php"?>
<?php

// Get action
$sAction = @$HTTP_POST_VARS["a_add"];
if ((
$sAction == "") || (($sAction == NULL))) {
    
$sKey = @$HTTP_GET_VARS["key"];
    
$sKey = (get_magic_quotes_gpc()) ? stripslashes($sKey) : $sKey;
    if (
$sKey <> "") {
        
$sAction "C"// Copy record
    
}
    else
    {
        
$sAction "I"// Display blank record
    
}
}
else
{

    
// Get fields from form
    
$x_ID = @$HTTP_POST_VARS["x_ID"];
    
$x_Biete2DSuche = @$HTTP_POST_VARS["x_Biete2DSuche"];
    
$x_Schlagwort = @$HTTP_POST_VARS["x_Schlagwort"];
    
$x_Beschreibung = @$HTTP_POST_VARS["x_Beschreibung"];
    
$x_Ansprechpartner = @$HTTP_POST_VARS["x_Ansprechpartner"];
    
$x_Email = @$HTTP_POST_VARS["x_Email"];
    
$x_Telefonnummer = @$HTTP_POST_VARS["x_Telefonnummer"];
    
$x_Website = @$HTTP_POST_VARS["x_Website"];
    
$x_Datum = @$HTTP_POST_VARS["x_Datum"];
    
$x_PictureName = @$HTTP_POST_VARS["x_PictureName"];
    
$x_userID = @$HTTP_POST_VARS["x_userID"];
}
$conn phpmkr_db_connect(HOSTUSERPASS,DB);
switch (
$sAction)
{
    case 
"C"// Get a record to display
        
if (!LoadData($sKey,$conn)) { // Load Record based on key
            
$HTTP_SESSION_VARS["ewmsg"] = "KEINE DATENSÄTZE GEFUNDEN FUER KEY = " $sKey;
            
phpmkr_db_close($conn);
            
ob_end_clean();

            
header("Location: vdi2Dbiete2Dsuchelist.php");
            exit();
        }
        break;
    case 
"A"// Add
        
if (AddData($conn)) { // Add New Record
            
$HTTP_SESSION_VARS["ewmsg"] = "NEUER DATENSATHZ ERFOLGREICH HINZUGEFÜGT";
            
phpmkr_db_close($conn);
            
ob_end_clean();
            
header("Location: vdi2Dbiete2Dsuchelist.php");
            exit();
        }
        break;
}
?>
<?php 
include ("header.php"?>
<script type="text/javascript" src="ew.js"></script>
<script type="text/javascript">
<!--
EW_dateSep = "/"; // set date separator

//-->
</script>
<script type="text/javascript">
<!--
function EW_checkMyForm(EW_this) {
if (EW_this.x_Biete2DSuche && !EW_hasValue(EW_this.x_Biete2DSuche, "SELECT" )) {
    if (!EW_onError(EW_this, EW_this.x_Biete2DSuche, "SELECT", "Bitte wählen Sie BIETE oder SUCHE aus."))
        return false;
}
if (EW_this.x_Schlagwort && !EW_hasValue(EW_this.x_Schlagwort, "TEXT" )) {
    if (!EW_onError(EW_this, EW_this.x_Schlagwort, "TEXT", "Bitte vergeben Sie ein passendes  Schlagwort"))
        return false;
}
if (EW_this.x_Ansprechpartner && !EW_hasValue(EW_this.x_Ansprechpartner, "TEXT" )) {
    if (!EW_onError(EW_this, EW_this.x_Ansprechpartner, "TEXT", "Bitte tragen Sie einen Ansprechpartner ein"))
        return false;
}
if (EW_this.x_Email && !EW_hasValue(EW_this.x_Email, "TEXT" )) {
    if (!EW_onError(EW_this, EW_this.x_Email, "TEXT", "Bitte geben Sie die Email-Adresse des Ansprechpartners an."))
        return false;
}
if (EW_this.x_Telefonnummer && !EW_hasValue(EW_this.x_Telefonnummer, "TEXT" )) {
    if (!EW_onError(EW_this, EW_this.x_Telefonnummer, "TEXT", "Bitte geben Sie die Telefonnummer des Ansprechpartners an."))
        return false;
}
if (EW_this.x_Datum && !EW_hasValue(EW_this.x_Datum, "TEXT" )) {
    if (!EW_onError(EW_this, EW_this.x_Datum, "TEXT", "Bitte wählen Sie das Datum über den Kalender aus"))
        return false;
}
if (EW_this.x_Datum && !EW_checkdate(EW_this.x_Datum.value)) {
    if (!EW_onError(EW_this, EW_this.x_Datum, "TEXT", "Bitte wählen Sie das Datum über den Kalender aus"))
        return false;
}
return true;
}

//-->
</script>
<script type="text/javascript">
<!--

// HTMLArea settings
  _editor_url = "htmlarea/";
  _editor_lang = "en";
  _width_multiplier = 12;
  _height_multiplier = 25;
  _editor_toolbar = [
    [ "fontname", "fontsize", "formatblock", "space",
      "bold", "italic", "underline", "strikethrough", "separator",
      "copy", "cut", "paste"],
    [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
      "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
      "forecolor", "hilitecolor", "separator",
      "inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
      "showhelp", "about" ]
    ];
var EW_HTMLArea = [];

//-->
</script>
<script type="text/javascript" src="htmlarea/htmlarea.js"></script>
<script type="text/javascript" src="popcalendar.js"></script>
<!-- New popup calendar -->
<!--link rel="stylesheet" type="text/css" media="all" href="calendar/calendar-win2k-1.css" title="win2k-1" /-->
<!--script type="text/javascript" src="calendar/calendar.js"></script-->
<!--script type="text/javascript" src="calendar/calendar-en.js"></script-->
<!--script type="text/javascript" src="calendar/calendar-setup.js"></script-->
<p><span class="phpmaker">HINZUFÜGEN TABELLE: vdi biete suche<br><br><a href="vdi2Dbiete2Dsuchelist.php">ZURÜCK ZUR LISTENÜBERSICHT</a></span></p>
<form name="vdi2Dbiete2Dsucheadd" id="vdi2Dbiete2Dsucheadd" action="vdi2Dbiete2Dsucheadd.php" method="post" enctype="multipart/form-data">
<p>
<input type="hidden" name="a_add" value="A">
<input type="hidden" name="EW_Max_File_Size" value="2000000">
<table class="ewTable">
    <tr>
        <td class="ewTableHeader"><span>Biete Suche</span></td>
        <td class="ewTableAltRow"><span>
<?php
$x_Biete2DSucheList 
"<select name=\"x_Biete2DSuche\">";
$x_Biete2DSucheList .= "<option value=''>BITTE AUSWÄHLEN</option>";
    
$x_Biete2DSucheList .= "<option value=\"" htmlspecialchars("1"). "\"";
    if (@
$x_Biete2DSuche == "1") {
        
$x_Biete2DSucheList .= " selected";
    }
    
$x_Biete2DSucheList .= ">" "Biete" "</option>";
    
$x_Biete2DSucheList .= "<option value=\"" htmlspecialchars("2"). "\"";
    if (@
$x_Biete2DSuche == "2") {
        
$x_Biete2DSucheList .= " selected";
    }
    
$x_Biete2DSucheList .= ">" "Suche" "</option>";
$x_Biete2DSucheList .= "</select>";
echo 
$x_Biete2DSucheList;
?>
</span></td>
    </tr>
    <tr>
        <td class="ewTableHeader"><span>Schlagwort</span></td>
        <td class="ewTableAltRow"><span>
<input type="text" name="x_Schlagwort" id="x_Schlagwort" size="30" maxlength="255" value="<?php echo htmlspecialchars(@$x_Schlagwort?>">
</span></td>
    </tr>
    <tr>
        <td class="ewTableHeader"><span>Beschreibung</span></td>
        <td class="ewTableAltRow"><span>
<textarea cols="35" rows="10" id="x_Beschreibung" name="x_Beschreibung"><?php echo @$x_Beschreibung?></textarea>
<script type="text/javascript">

// Replace TextArea by HTMLArea
var config = new HTMLArea.Config();
config.toolbar = _editor_toolbar;
config.width = 35*_width_multiplier + 'px';
config.height = 10*_height_multiplier + 'px';
var ta = HTMLArea.getElementById("textarea", "x_Beschreibung");
var ha = ta ? (new HTMLArea(ta, config)) : null;
if (ha) {
ha.generate();
EW_HTMLArea.push(ha);
}
</script>
</span></td>
    </tr>
    <tr>
        <td class="ewTableHeader"><span>Ansprechpartner</span></td>
        <td class="ewTableAltRow"><span>
<input type="text" name="x_Ansprechpartner" id="x_Ansprechpartner" size="30" maxlength="255" value="<?php echo htmlspecialchars(@$x_Ansprechpartner?>">
</span></td>
    </tr>
    <tr>
        <td class="ewTableHeader"><span>Email</span></td>
        <td class="ewTableAltRow"><span>
<input type="text" name="x_Email" id="x_Email" size="30" maxlength="255" value="<?php echo htmlspecialchars(@$x_Email?>">
</span></td>
    </tr>
    <tr>
        <td class="ewTableHeader"><span>Telefonnummer</span></td>
        <td class="ewTableAltRow"><span>
<input type="text" name="x_Telefonnummer" id="x_Telefonnummer" size="30" maxlength="255" value="<?php echo htmlspecialchars(@$x_Telefonnummer?>">
</span></td>
    </tr>
    <tr>
        <td class="ewTableHeader"><span>Website</span></td>
        <td class="ewTableAltRow"><span>
<input type="text" name="x_Website" id="x_Website" size="30" maxlength="255" value="<?php echo htmlspecialchars(@$x_Website?>">
</span></td>
    </tr>
    <tr>
        <td class="ewTableHeader"><span>Datum</span></td>
        <td class="ewTableAltRow"><span>
<input type="text" name="x_Datum" id="x_Datum" value="<?php echo FormatDateTime(@$x_Datum,5); ?>">
&nbsp;<input type="image" src="images/ew_calendar.gif" alt="WÄHLEN SIE EIN DATUM AUS" onClick="popUpCalendar(this, this.form.x_Datum,'yyyy/mm/dd');return false;">
</span></td>
    </tr>
    <tr>
        <td class="ewTableHeader"><span>Picture Name</span></td>
        <td class="ewTableAltRow"><span>
<?php $x_PictureName ""// Clear BLOB related fields ?>
<input type="file" id="x_PictureName" name="x_PictureName" size="30">
</span></td>
    </tr>
</table>
<p>
<input type="button" name="Action" value="HINZUFÜGEN" onClick="EW_submitForm(this.form);">
</form>
<?php include ("footer.php"?>
<?php
phpmkr_db_close
($conn);
?>
<?php

//-------------------------------------------------------------------------------
// Function LoadData
// - Load Data based on Key Value sKey
// - Variables setup: field variables

function LoadData($sKey,$conn)
{
    global 
$HTTP_SESSION_VARS;
    
$sKeyWrk "" addslashes($sKey) . "";
    
$sSql "SELECT * FROM `vdi-biete-suche`";
    
$sSql .= " WHERE `ID` = " $sKeyWrk;
    
$sGroupBy "";
    
$sHaving "";
    
$sOrderBy "";
      if ((@
$HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserLevel"] <> -1) && (@$HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserID"] <> "")) { // Non system admin
            
$sSql .= " AND (`userID` = " $HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserID"] . ")";
      }
    if (
$sGroupBy <> "") {
        
$sSql .= " GROUP BY " $sGroupBy;
    }
    if (
$sHaving <> "") {
        
$sSql .= " HAVING " $sHaving;
    }
    if (
$sOrderBy <> "") {
        
$sSql .= " ORDER BY " $sOrderBy;
    }
    
$rs phpmkr_query($sSql,$conn) or die("ABFRAGE NICHT ERFOLGREICH" phpmkr_error() . ' SQL:' $sSql);
    if (
phpmkr_num_rows($rs) == 0) {
        
$LoadData false;
    }else{
        
$LoadData true;
        
$row phpmkr_fetch_array($rs);

        
// Get the field contents
        
$GLOBALS["x_ID"] = $row["ID"];
        
$GLOBALS["x_Biete2DSuche"] = $row["Biete-Suche"];
        
$GLOBALS["x_Schlagwort"] = $row["Schlagwort"];
        
$GLOBALS["x_Beschreibung"] = $row["Beschreibung"];
        
$GLOBALS["x_Ansprechpartner"] = $row["Ansprechpartner"];
        
$GLOBALS["x_Email"] = $row["Email"];
        
$GLOBALS["x_Telefonnummer"] = $row["Telefonnummer"];
        
$GLOBALS["x_Website"] = $row["Website"];
        
$GLOBALS["x_Datum"] = $row["Datum"];
        
$GLOBALS["x_PictureName"] = $row["PictureName"];
        
$GLOBALS["x_userID"] = $row["userID"];
    }
    
phpmkr_free_result($rs);
    return 
$LoadData;
}
?>
<?php

//-------------------------------------------------------------------------------
// Function AddData
// - Add Data
// - Variables used: field variables

function AddData($conn)
{
    global 
$HTTP_SESSION_VARS;
    global 
$HTTP_POST_VARS;
    global 
$HTTP_POST_FILES;
    global 
$HTTP_ENV_VARS;

    
// Add New Record
    
$sSql "SELECT * FROM `vdi-biete-suche`";
    
$sSql .= " WHERE 0 = 1";
    
$sGroupBy "";
    
$sHaving "";
    
$sOrderBy "";
    if (
$sGroupBy <> "") {
        
$sSql .= " GROUP BY " $sGroupBy;
    }
    if (
$sHaving <> "") {
        
$sSql .= " HAVING " $sHaving;
    }
    if (
$sOrderBy <> "") {
        
$sSql .= " ORDER BY " $sOrderBy;
    }

        
// check file size
        
$EW_MaxFileSize = @$HTTP_POST_VARS["EW_Max_File_Size"];
    if (!empty(
$HTTP_POST_FILES["x_PictureName"]["size"])) {
        if (!empty(
$EW_MaxFileSize) && $HTTP_POST_FILES["x_PictureName"]["size"] > $EW_MaxFileSize) {
            die(
"Max. file upload size exceeded");
        }
    }

    
// Field Biete-Suche
    
$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS["x_Biete2DSuche"]) : $GLOBALS["x_Biete2DSuche"];
    
$theValue = ($theValue != "") ? " '" $theValue "'" "NULL";
    
$fieldList["`Biete-Suche`"] = $theValue;

    
// Field Schlagwort
    
$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS["x_Schlagwort"]) : $GLOBALS["x_Schlagwort"];
    
$theValue = ($theValue != "") ? " '" $theValue "'" "NULL";
    
$fieldList["`Schlagwort`"] = $theValue;

    
// Field Beschreibung
    
$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS["x_Beschreibung"]) : $GLOBALS["x_Beschreibung"];
    
$theValue = ($theValue != "") ? " '" $theValue "'" "NULL";
    
$fieldList["`Beschreibung`"] = $theValue;

    
// Field Ansprechpartner
    
$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS["x_Ansprechpartner"]) : $GLOBALS["x_Ansprechpartner"];
    
$theValue = ($theValue != "") ? " '" $theValue "'" "NULL";
    
$fieldList["`Ansprechpartner`"] = $theValue;

    
// Field Email
    
$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS["x_Email"]) : $GLOBALS["x_Email"];
    
$theValue = ($theValue != "") ? " '" $theValue "'" "NULL";
    
$fieldList["`Email`"] = $theValue;

    
// Field Telefonnummer
    
$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS["x_Telefonnummer"]) : $GLOBALS["x_Telefonnummer"];
    
$theValue = ($theValue != "") ? " '" $theValue "'" "NULL";
    
$fieldList["`Telefonnummer`"] = $theValue;

    
// Field Website
    
$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS["x_Website"]) : $GLOBALS["x_Website"];
    
$theValue = ($theValue != "") ? " '" $theValue "'" "NULL";
    
$fieldList["`Website`"] = $theValue;

    
// Field Datum
    
$theValue = ($GLOBALS["x_Datum"] != "") ? " '" ConvertDateToMysqlFormat($GLOBALS["x_Datum"]) . "'" "NULL";
    
$fieldList["`Datum`"] = $theValue;

    
// Field PictureName
        
if ($HTTP_POST_FILES["x_PictureName"]["tmp_name"] != "none" && $HTTP_POST_FILES["x_PictureName"]["tmp_name"] != "") {
            
$destfile ewUploadPath(1) . ewUploadFileName($HTTP_POST_FILES["x_PictureName"]["name"]);
                    if (!
copy($HTTP_POST_FILES["x_PictureName"]["tmp_name"], $destfile)) // move file to destination path
                    
die("You didn't upload a file or the file couldn't be moved to" $destfile);

            
// File Name
            
$theName = (!get_magic_quotes_gpc()) ? addslashes(ewUploadFileName($HTTP_POST_FILES["x_PictureName"]["name"])) : ewUploadFileName($HTTP_POST_FILES["x_PictureName"]["name"]);
            
$fieldList["`PictureName`"] = " '" $theName "'";
            @
unlink($HTTP_POST_FILES["x_PictureName"]["tmp_name"]);
        }

    if ((@
$HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserLevel"] <> -1) && (@$HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserID"] <> "")) { // Non system admin
            
$fieldList["`userID`"] = "" $HTTP_SESSION_VARS["vdi-biete-suche-daten_status_UserID"] . "";
      }

    
// insert into database
    
$strsql "INSERT INTO `vdi-biete-suche` (";
    
$strsql .= implode(","array_keys($fieldList));
    
$strsql .= ") VALUES (";
    
$strsql .= implode(","array_values($fieldList));
    
$strsql .= ")";
    
phpmkr_query($strsql$conn) or die("ABFRAGE NICHT ERFOLGREICH" phpmkr_error() . ' SQL:' $sSql);

// ================================

    
return true;
}
?>
mimamo ist offline   Mit Zitat antworten
Alt 19.05.2005, 15:55   #4
TP-Supporter
 
Benutzerbild von mimamo
 
Registriert seit: Oct 2002
Ort: Berlin
mimamo macht alles soweit korrekt
und hier noch das script mit den ganzen funktionen
PHP-Code:
<?php

define
("DEFAULT_CURRENCY_SYMBOL""$");
define("DEFAULT_MON_DECIMAL_POINT"".");
define("DEFAULT_MON_THOUSANDS_SEP"",");
define("DEFAULT_POSITIVE_SIGN""");
define("DEFAULT_NEGATIVE_SIGN""-");
define("DEFAULT_FRAC_DIGITS"2);
define("DEFAULT_P_CS_PRECEDES"true);
define("DEFAULT_P_SEP_BY_SPACE"false);
define("DEFAULT_N_CS_PRECEDES"true);
define("DEFAULT_N_SEP_BY_SPACE"false);
define("DEFAULT_P_SIGN_POSN"3);
define("DEFAULT_N_SIGN_POSN"3);


define("DEFAULT_DATE_FORMAT""yyyy/mm/dd");
define("EW_DATE_SEPARATOR","/");

//-------------------------------------------------------------------------------
// Functions for default date format
// FormatDateTime
/*
Format a timestamp, datetime, date or time field from MySQL
$namedformat:
0 - General Date,
1 - Long Date,
2 - Short Date (Default),
3 - Long Time,
4 - Short Time,
5 - Short Date (yyyy/mm/dd),
6 - Short Date (mm/dd/yyyy),
7 - Short Date (dd/mm/yyyy)
*/

// Convert a date to MySQL format
function ConvertDateToMysqlFormat($dateStr)
{
    @list(
$datePt$timePt) = explode(" "$dateStr);
    
$arDatePt explode(EW_DATE_SEPARATOR$datePt);
    if (
count($arDatePt) == 3) {
        switch (
DEFAULT_DATE_FORMAT) {
        case 
"yyyy" EW_DATE_SEPARATOR "mm" EW_DATE_SEPARATOR&n