Jump to content


gizmola

Member Since 06 May 2003
Offline Last Active Aug 23 2016 11:23 PM

Posts I've Made

In Topic: TWIG Security

10 August 2016 - 12:10 AM

Twig code is compiled into php code, at least when used in a symfony project. There is absolutely no way you should have twig template files under the web root as Jacques commented earlier. Quite frankly with a front controller, there is really no code other than the front controller and static assets that should go under the webroot.

In Topic: Export to CSV (Excel)

04 August 2016 - 03:42 AM

As for the code, it seems clear that there is something missing in the export method of the class.

At line 148 of your script:

 
		foreach ($warranties as $warranty_id) {
This is the loop that should be outputting data, but $warranties is undeclared or initialized, so the loop would never be entered into.

I don't know a whole lot about opencart plugins, nor do I understand the model system, or the specifics of your model, but if I were to make an educated guess:

Just prior to line 148 something like this would be expected:
 
$warranties = $this->model_catalog_product_warranties->getProductWarranties();

In Topic: Export to CSV (Excel)

04 August 2016 - 03:13 AM

Hello guys,
 
I am trying to modify OpenCart plugin to be able to export certain data to Excel file format. What I managed to do is this. When clicked on Export button, .CSV file is generated, but it is empty. Actual data is missing. What am I doing wrong? Can somebody alter my code? It drives me freaking nuts. PHP file is attached. Thank you.attachicon.gifproduct_warranties.php
 
P.S. Am also willing to pay for this, I guess small code edit.


I just want to point out that .csv is not an excel specific format. It is something that traditionally excel has been able to import, but there are also many databases that can import csv files in most cases.

There are libraries which can be used to create excel format files more directly. For example there is this project: https://github.com/PHPOffice/PHPExcel

In Topic: Software to read thoughts and convert to type

28 June 2016 - 03:36 AM

I've been typing for way too long. Took my first typing class in 7th grade, so about 35 years ago. Maybe someday instead of keyboards we can just put on our typing helmets and get to work :)


You'd probably be surprised how many people use text-to-speech and dictate their written material. I think it would be very tough to make that work for coding though.

In Topic: Is it possible to do these things?

28 June 2016 - 03:34 AM

These questions have nothing to do with php do they? I'm moving your question to the javascript subboard.

As far as opening a new window vs. a tab. that is behavior that is controlled by the browser, but essentially, you are using the correct technique, in specifying that the target be "_blank".

Use firebug or some similar browser javascript debugger to see what is going wrong.


I'm not really sure what you are trying to do with Question 2. Please elaborate with an example.