Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mevdschee committed Aug 5, 2023
1 parent d12525c commit 5d87d19
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion server.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$dir = $_SERVER['DOCUMENT_ROOT'];
$file = realpath($dir . $_SERVER['SCRIPT_NAME']);
if (!file_exists('config/config.php')) {
require 'vendor/mintyphp/tools/configurator.php';die();
require 'vendor/mintyphp/tools/configurator.php';
die();
}
if (file_exists($file) && (strpos($file, $dir) === 0)) {
return false;
Expand Down
3 changes: 3 additions & 0 deletions skel/pages/add(admin).phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

/**
* @var mixed|null $data
<?php foreach ($references as $column => $referencedTable): ?>
* @var mixed|null $<?php echo $camelize($referencedTable); ?>
<?php endforeach;?>
*/

use MintyPHP\Session;
Expand Down
4 changes: 2 additions & 2 deletions skel/pages/delete($id).php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use MintyPHP\DB;
use MintyPHP\Router;

$data = DB::selectOne('SELECT * FROM `<?php echo $table; ?>` WHERE `id` = ?', $id);
$data = DB::selectOne("SELECT * FROM `<?php echo $table; ?>` WHERE `id` = ?", $id);

if (!empty($_POST)) {
$errors = [];
$rows = DB::delete('DELETE FROM `<?php echo $table; ?>` WHERE `id` = ?', $id);
$rows = DB::delete("DELETE FROM `<?php echo $table; ?>` WHERE `id` = ?", $id);
if ($rows) {
Router::redirect('<?php echo $path; ?>/<?php echo $table; ?>/index');
}
Expand Down
2 changes: 1 addition & 1 deletion skel/pages/edit($id).php
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
Router::redirect("<?php echo $path; ?>/<?php echo $table; ?>/view/$id");
}
} else {
$data = DB::selectOne('SELECT * FROM `<?php echo $table; ?>` WHERE `<?php echo $primaryKey; ?>` = ?', $id);
$data = DB::selectOne("SELECT * FROM `<?php echo $table; ?>` WHERE `<?php echo $primaryKey; ?>` = ?", $id);
}
3 changes: 3 additions & 0 deletions skel/pages/edit(admin).phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/**
* @var string|null $id
* @var mixed|null $data
<?php foreach ($references as $column => $referencedTable): ?>
* @var mixed|null $<?php echo $camelize($referencedTable); ?>
<?php endforeach;?>
*/

use MintyPHP\Session;
Expand Down
3 changes: 3 additions & 0 deletions skel/pages/index(admin).phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

/**
* @var mixed|null $data
<?php foreach ($references as $column => $referencedTable): ?>
* @var mixed|null $<?php echo $camelize($referencedTable); ?>
<?php endforeach;?>
*/

?>
Expand Down
2 changes: 1 addition & 1 deletion skel/pages/view($id).php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use MintyPHP\DB;

$data = DB::selectOne('SELECT * FROM `<?php echo $table; ?>` WHERE `<?php echo $primaryKey; ?>` = ?', $id);
$data = DB::selectOne("SELECT * FROM `<?php echo $table; ?>` WHERE `<?php echo $primaryKey; ?>` = ?", $id);

<?php foreach ($references as $column => $referencedTable): $referencedColumn = $primaryKeys[$referencedTable]; ?>
$<?php echo $camelize($referencedTable); ?> = DB::selectPairs("SELECT `<?php echo $referencedColumn; ?>`, `<?php echo $displayFields[$referencedTable]; ?>` FROM `<?php echo $referencedTable; ?>`");
Expand Down
3 changes: 3 additions & 0 deletions skel/pages/view(admin).phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/**
* @var string|null $id
* @var mixed|null $data
<?php foreach ($references as $column => $referencedTable): ?>
* @var mixed|null $<?php echo $camelize($referencedTable); ?>
<?php endforeach;?>
*/

?>
Expand Down

0 comments on commit 5d87d19

Please sign in to comment.