Example #1
0
         }
         $V = strip_tags($V);
         if (ArrGet($ColumnCommands, $RowKeys[$II], "type", 0) == "image") {
             if (is_file($FrontEndImageLocationRoot . "/" . $ColumnCommands[$RowKeys[$II]]["filelocation"][0] . "/" . $V)) {
                 echo "<td style='" . $Style . " text-align: center;'>\r\n\t\t\t\t\t\t\t\t\t\t<a href='" . ($FrontEndImageLocationLocal . "/" . $ColumnCommands[$RowKeys[$II]]["filelocation"][0] . "/" . $V) . "' target='_blank'>\r\n\t\t\t\t\t\t\t\t\t\t\t<img src='" . ($FrontEndImageLocationLocal . "/" . $ColumnCommands[$RowKeys[$II]]["filelocation"][0] . "/" . $V) . "' style='height: 70px; margin: auto;' />\r\n\t\t\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\t</td>";
             } else {
                 echo "<td style='" . $Style . " text-align: center;'></td>";
             }
         } else {
             if (ArrGet($ColumnCommands, $RowKeys[$II], "type", 0) == "timestamp") {
                 $V = date("Y-m-d G:i", $Item[$RowKeys[$II]]);
             }
             echo "<td style='" . $Style . "'>" . $V . "</td>";
         }
     }
     $Options = ArrGet($TableOptions, $_GET["param_0"], "Options") ? explode(",", $TableOptions[$_GET["param_0"]]["Options"]) : array();
     // Special
     if (in_array("entries", $Options)) {
         $Optins = count($DB->Query("SELECT id FROM comp_entries WHERE comp_id=:comp_id AND `options` LIKE :options", array("comp_id" => $Item["id"], "options" => "%optin:1%")));
         $Total = count($DB->Query("SELECT id FROM comp_entries WHERE comp_id=:comp_id", array("comp_id" => $Item["id"])));
         echo "<td style='" . $Style . " text-align: center;'>" . $Link->Get("select/comp_entries?Where=comp_id%3D%3D" . $Item["id"] . "&Order=ORDER%20BY%20RAND()&Limit=", "entries (" . $Optins . "/" . $Total . ")") . "</td>";
     }
     if (count($Options) == 0 || in_array("edit", $Options)) {
         echo "<td style='" . $Style . " text-align: center;'>" . $Link->Get("edit/" . $_GET["param_0"] . "/" . $Item["id"], "edit") . "</td>";
     }
     if (count($Options) == 0 || in_array("delete", $Options)) {
         echo "<td style='" . $Style . " text-align: center;'>" . $Link->Get("select/" . $_GET["param_0"] . "/?delete=" . $Item["id"], "delete", array("class" => "delete")) . "</td>";
     }
     echo "</tr>";
 }
 ?>
Example #2
0
        $Image->process($FrontEndImageLocationRoot . str_replace("//", "/", "/" . $DirectoryString));
        if ($Image->processed) {
            $NewName = array($Image->file_dst_name_body, $Image->file_dst_name_ext);
        } else {
            $Error = "File upload error (" . $Image->file_src_mime . ")";
        }
    } else {
        $Error = $Image->error;
    }
}
?>

<h2>File Manager</h2>

<?php 
if (!isset($Error) && ArrGet($_FILES, "image", "name") != "") {
    echo "<input value='" . str_replace("//", "/", $FrontEndImageLocationLocal . "/" . $DirectoryString . "/" . implode(".", $NewName)) . "' style='padding: 5px; width: 95%; margin: auto;' />";
} else {
    if (isset($Error)) {
        echo "<h3 style='color: #BA1F24;'>" . $Error . "</h3>";
    }
}
?>

<div style="width: 50%;">
<?php 
$FormGen = new FormGen();
$PreHTML = "<table style='width: 100%;'><tr><td><img src='" . $PHPZevelop->Path->GetImage("components/no-image-icon.jpg", true) . "' style='width: 100px;' class='PreviewImage' /></td><td>";
$PostHTML = "</td></tr></table>";
$FormGen->AddElement(array("type" => "file", "name" => "image", "class" => "ImageSelector"), array("prehtml" => $PreHTML, "posthtml" => $PostHTML));
$FormGen->AddElement(array("name" => "renameto", "placeholder" => "eg image.png", "style" => "width: 230px;"));
Example #3
0
        }
    }
    //IMAGE
    $PHPZevelop->Location("edit/" . $_GET["param_0"] . "/" . $LastInsertId);
}
?>

<h2>Adding to table <?php 
echo ucfirst(str_replace("_", " ", $_GET["param_0"]));
?>
</h2>
<br />

<?php 
// File manager
if (ArrGet($TableOptions, $_GET["param_0"], "FileManager") == "true") {
    if (!isset($TableOptions[$_GET["param_0"]]["FileManagerDefaultLocation"])) {
        $TableOptions[$_GET["param_0"]]["FileManagerDefaultLocation"] = "";
    }
    ?>
	<iframe src="<?php 
    $PHPZevelop->Path->GetPage("file-manager-full/" . $TableOptions[$_GET["param_0"]]["FileManagerDefaultLocation"]);
    ?>
"
		style="width: 99.5%; height: 90px; border: none; margin: auto; background: none;"></iframe>
	<?php 
}
?>

<?php 
$FormGen = new FormGen();
Example #4
0
/**
 * Returns database configuration defined in phpunit.xml.
 *
 * @param string $dbName The database configuration name.
 *
 * @return array
 */
function getUnitTestDbConfig($dbName)
{
    $timezone = ArrGet($GLOBALS, 'TEST_DB_' . $dbName . '_TIMEZONE', '');
    return [DbConnector::DB_CFG_DRIVER => ArrGet($GLOBALS, 'TEST_DB_' . $dbName . '_DRIVER', ''), DbConnector::DB_CFG_HOST => ArrGet($GLOBALS, 'TEST_DB_' . $dbName . '_HOST', ''), DbConnector::DB_CFG_USERNAME => ArrGet($GLOBALS, 'TEST_DB_' . $dbName . '_USERNAME', ''), DbConnector::DB_CFG_PASSWORD => ArrGet($GLOBALS, 'TEST_DB_' . $dbName . '_PASSWORD', ''), DbConnector::DB_CFG_DATABASE => ArrGet($GLOBALS, 'TEST_DB_' . $dbName . '_DATABASE', ''), DbConnector::DB_CFG_PORT => ArrGet($GLOBALS, 'TEST_DB_' . $dbName . '_PORT', 3306), DbConnector::DB_CFG_CONNECT => true, DbConnector::DB_CFG_TIMEZONE => $timezone, DbConnector::DB_CFG_DEBUG => true];
}