Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - machobymb

1
Questions / How work searching on List page?
Hi!

In my project (PhpRAD 2.7.3) are same table. When I publish the project, the serching work on something list page, on other list page it's not working.
The list pages are ajaxpage, and the searching is ajaxpage on all list page.

Or how work the searching template?

Update1: when I create a new project from the DB the generated page work fine: ajaxsearch is good. In the original project only the loading indicator move, after I see the full table, I don't see the filtered.
Where is the searching? In the Controller file or somewhere in JS?

I don't found errors with Firefox Webdeveloper tools.

Update2: On the List page have two tbody tag: a "page-data" class and a "search-data" class. When I make a ajaxsearch, page-data style modifed to "display: none", search-data is visited, but don't filtered.
Thx!
2
Issues / Re: MULTIPLE LIST PAGE
Hi! What is the solution? I'd like make a custom add page, with a modified query to a attrib in a table, but the function return with an empty list. The qwery is correct is phpmyadmin.
5
Questions / Custom download script (watermark, DomPDF)
I'd like create a custom download PHP script:
When I download a PDF file from LIST page, my script (current location: helpers/download.php) take TEXT watermark to PDF with DomPDF.
Generating URLs: '<a href="' . SITE_ADDR . 'helpers/download.php?f=' . $data['file_url'] . '&w=' . $data['watermark'] . '">' . $data['watermark'] . '</a>'
Generated URLs: http://localhost/helpers/download.php?f=http://localhost/uploads/custom.pdf&w=watermark
How can I make this?
My script:
Code: [Select]
<?php
defined('ROOT') or exit('No direct script access allowed');
use Dompdf\Dompdf;
use Dompdf\Options;
use Dompdf\FontMetrics;

if (isset($_GET['f']) && isset($_GET['w'])) {
    $pdf = $_GET['f'];
    $wm = $_GET['w'];

    $options = new Options();
    $options->set('isPhpEnabled', 'true');
 
    $dompdf = new Dompdf($options);
    $dompdf->render();
    $canvas = $dompdf->getCanvas();
    $fontMetrics = new FontMetrics($canvas, $options);
 
    $w = $canvas->get_width();
    $h = $canvas->get_height();
 
    $font = $fontMetrics->getFont('times');
 
    $txtHeight = $fontMetrics->getFontHeight($font, 75);
    $textWidth = $fontMetrics->getTextWidth($wm, $font, 75);
 
    $canvas->set_opacity(.7);
 
    $x = 0.1*$w;
    $y = 0.9*$h;
 
    $canvas->text($x, $y, $wm, $font, 75);
    $dompdf->stream($pdf, array("Attachment" => 1));

} else {
    $pdf = NULL;
}
?>
7
Suggestions / List pages generation and other functions problems
Hi!

If I generate a List page with many rows and many columns, the generation is very slow. I think it would be better if the generation was done through a variable (for example: $current_record), with concatenation rather than 'echo' commands. This would speed up the display. Also, I could suggest changing the 'echo' command to 'return' for some functions (for example: page_link, or Html::page_img).
9
General Discussion / Re: LDAP authentication
Have you managed to solve it since then? I also want to do that, I think you need to make changes to it on the IndexController.
10
Questions / Re: lookup field
When I create a lookup field, and I select an item in first field, in the second filed list iscorrect, but I
if I select an option in second list, the second list will empty. Why?
12
Questions / Custom SQL modified, but not updated id SharedController
Hi,

So far with minor or major bugs, but the program worked pretty well, but now I would update a query in one of the fields, but it doesn't update, so it doesn't work well after publishing. I have already posted the project to a new folder but it didn't help.

What can I do to be good?
13
Questions / Create custom function and use it problem ...
Hi,

I was created in helpers/Functions.php a new function:
Code: [Select]
function get_location_by_user_ip(): string {
$ip_list = get_user_ip();
$ipArray = explode(",", $ip_list);
$last_ip = end($ipArray);
return substr($last_ip, 0, strrpos($last_ip, '.'));
}

When I created a Query in with this function, in PHPMyAdmin is correct, but in PHPRad list is empty:
Code: [Select]
"SELECT DISTINCT id AS value, name AS label FROM table WHERE is_true=? AND id=(SELECT DISTINCT country_id FROM ip_addresses WHERE ip_addr LIKE ?)"   , array('1',get_location_by_user_ip())
14
Questions / Hashing password in log
Hi,

In log table the passwords are not hashed. In the BaseController I modified the line, and I hashing all JSON data (for example: userlogin event, and the datas are: username, password, hash-ed password). But I'd like that only the password value is hashed, or I'd like delete unhashed password from datas.
15
Questions / Re: Record logical locking
Solution: the "locked" attribute is 'true' or 'false' in the DB (varchar(5) type). And the logicalt locking is work.