copy of file
<?php require_once('../Connections/connamsterdam.php'); ?>
<?php require_once("../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "administrator,user";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../users/noAccess.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
$updateSQL = sprintf("UPDATE company SET name=%s, adress=%s, postalcode=%s, phonenr=%s, url=%s, email=%s, category=%s, ranking=%s, info=%s, image=%s, addon=%s, userID=%s WHERE companyID=%s",
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['adress'], "text"),
GetSQLValueString($_POST['postalcode'], "text"),
GetSQLValueString($_POST['phonenr'], "int"),
GetSQLValueString($_POST['url'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['category'], "text"),
GetSQLValueString($_POST['ranking'], "text"),
GetSQLValueString($_POST['info'], "text"),
GetSQLValueString($_FILES['image']['name'], "text"),
GetSQLValueString($_POST['addon'], "date"),
GetSQLValueString($_POST['userID'], "int"),
GetSQLValueString($_POST['companyID'], "int"));
mysql_select_db($database_connamsterdam, $connamsterdam);
$Result1 = mysql_query($updateSQL, $connamsterdam) or die(mysql_error());
$updateGoTo = "../users/user_specs.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
$colname_rs_editCompany = "-1";
if (isset($_GET['companyID'])) {
$colname_rs_editCompany = $_GET['companyID'];
}
mysql_select_db($database_connamsterdam, $connamsterdam);
$query_rs_editCompany = sprintf("SELECT * FROM company WHERE companyID = %s", GetSQLValueString($colname_rs_editCompany, "int"));
$rs_editCompany = mysql_query($query_rs_editCompany, $connamsterdam) or die(mysql_error());
$row_rs_editCompany = mysql_fetch_assoc($rs_editCompany);
$totalRows_rs_editCompany = mysql_num_rows($rs_editCompany);?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../uploads/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_POST["default"]))?$_POST["default"]:"") ."",
'ResizeType' => "1",
'ResizeWidth' => "240",
'ResizeHeight' => "180",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "../uploads/thumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "100",
'ResizeHeight' => "80",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_2 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["submit"])){
WA_DFP_UploadFiles("WA_UploadResult1", "image", "0", "", "true", $WA_UploadResult1_Params);
}
?>
<?php
thnx,
Tom.