helen Posted October 19, 2003 Share Posted October 19, 2003 Here's the error with 'r+' instead of 'w': Warning: Unable to access C:\margin-report.csv in /home/httpd/vhosts/mysite.com/httpdocs/catalog/admin/margin_report.php on line 245 Warning: fopen("C:\margin-report.csv", "r+") - No such file or directory in /home/httpd/vhosts/mysite.com/httpdocs/catalog/admin/margin_report.php on line 245 Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/mysite.com/httpdocs/catalog/admin/margin_report.php on line 246 Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/mysite.com/httpdocs/catalog/admin/margin_report.php on line 247 Your exported csv file has been saved at: C:\margin-report.csv Thanks again, Chris! Quote Link to comment Share on other sites More sharing options...
blueline Posted October 19, 2003 Author Share Posted October 19, 2003 Ok, you are going to have to use the w then. Do you even have an actual file name margin-report.csv in your C:\ folder? If so, it's blank right...? -Chris Quote Chris Sullivan Link to comment Share on other sites More sharing options...
blueline Posted October 20, 2003 Author Share Posted October 20, 2003 Is anyone else having this problem? Thanks, -Chris Quote Chris Sullivan Link to comment Share on other sites More sharing options...
helen Posted October 20, 2003 Share Posted October 20, 2003 No, the file isn't saving at all. No C:\margin-report.csv. Quote Link to comment Share on other sites More sharing options...
lopes_andre Posted October 21, 2003 Share Posted October 21, 2003 Hi, This contribution will work with OSC MS2? Regards Andre. Quote Link to comment Share on other sites More sharing options...
TaFfin Posted October 21, 2003 Share Posted October 21, 2003 Yes it does. Regards, TaFfin Quote SIGnificant.....right? Link to comment Share on other sites More sharing options...
blueline Posted October 22, 2003 Author Share Posted October 22, 2003 TaFfin - have you got the new version to work properly? Thanks, -Chris Quote Chris Sullivan Link to comment Share on other sites More sharing options...
TaFfin Posted October 22, 2003 Share Posted October 22, 2003 Chris, It works ok it's just that the directory where the file is saved is wrong. On my testing server the file I named 'test' is saved at c:\ instead of a directory of the website. The file produced is indeed a workable CSV file BTW. I use IIS with PHP. Regards, TaFfin Quote SIGnificant.....right? Link to comment Share on other sites More sharing options...
blueline Posted October 22, 2003 Author Share Posted October 22, 2003 TaFfin, glad to hear that it is working. I actually made it so that the .csv file would be saved to the local machine instead of the server on purpose. Figured most people would want immediate access to the file. Any suggestions? -Chris Quote Chris Sullivan Link to comment Share on other sites More sharing options...
aurora_gfx Posted January 15, 2004 Share Posted January 15, 2004 (edited) Hi There, I'm having a problem with the Margin Report Link in Admin>Reports. instead of producing the filename 'admin/margin_report.php' is just has: admin/FILENAME_STATS_MARGIN_REPORT I have checked all the files and define values and all seem okay. Any ideas? Regards Mark. Edited January 15, 2004 by aurora_gfx Quote Link to comment Share on other sites More sharing options...
blueline Posted January 15, 2004 Author Share Posted January 15, 2004 Sorry, but I would recommend that you recheck your definitions in the filenames.php file, as that is where the problem is coming from. Quote Chris Sullivan Link to comment Share on other sites More sharing options...
defender39 Posted January 16, 2004 Share Posted January 16, 2004 seems to me that this is not a report if it doesnt calculate profit... this needs to be added asap Quote Link to comment Share on other sites More sharing options...
blueline Posted January 16, 2004 Author Share Posted January 16, 2004 Why don't you tell me all the things you'd like this to do and I will see what I can do. Quote Chris Sullivan Link to comment Share on other sites More sharing options...
Guest Posted January 16, 2004 Share Posted January 16, 2004 Hi Chris This is a great mod... I have it working completely at the moment and I have also converted the $ to ? (as I'm in the UK). The problem with the CVS is a filenames definition - you also will not be able to sort by manufacturer. I cannot remember what needs to be changed as I never noted it! Sorry, but just make sure you have the same filename definiton throughout. Chris I have Tax inclusive & Exclusive pricing on my site - margin reports only shows exclusive price for me - could you possibly add it to work out the inclusive price as well? Also, could you make it sort by categories as well as manufacturers? You have done great regardless! Thank you Jiten Quote Link to comment Share on other sites More sharing options...
ozcsys Posted March 6, 2004 Share Posted March 6, 2004 I used this on a site and had no problems and everything worked fine but I just tried installing it again twice and I am getting the same error message when I go to admin/catalog Categories / Products Status Action Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\web\demo\catalog\admin\includes\functions\database.php on line 99 I tried it both on a production server and a local test site and I received the exact same message. Any ideas?? Quote The Knowledge Base is a wonderful thing. Do you have a problem? Have you checked out Common Problems? There are many very useful osC Contributions Are you having trouble with a installed contribution? Have you checked out the support thread found Here BACKUP BACKUP BACKUP!!! You did backup, right?? Link to comment Share on other sites More sharing options...
blueline Posted March 6, 2004 Author Share Posted March 6, 2004 In my experience that means that there is either a SQL query in your select statement, or you have a typo when using mysq_fetch_array. Double check those two things and I think you'll find your problem -Chris Quote Chris Sullivan Link to comment Share on other sites More sharing options...
ozcsys Posted March 6, 2004 Share Posted March 6, 2004 In my experience that means that there is either a SQL query in your select statement, or you have a typo when using mysq_fetch_array. Double check those two things and I think you'll find your problem -Chris Thanks!! I went back and manually added the differences to the statments with select in them instead of cutting and pasting from the directions and that fixed the problem. Now that I think about it I had already made changes to those lines for another contribution last time I installed this and had to do it manually the first time which is why I did not have any problems. Quote The Knowledge Base is a wonderful thing. Do you have a problem? Have you checked out Common Problems? There are many very useful osC Contributions Are you having trouble with a installed contribution? Have you checked out the support thread found Here BACKUP BACKUP BACKUP!!! You did backup, right?? Link to comment Share on other sites More sharing options...
dr_lucas Posted March 27, 2004 Share Posted March 27, 2004 (edited) Why don't you tell me all the things you'd like this to do and I will see what I can do. Thanks for your beautiful contribution, Chris! :) It would be very useful if there will be also a gross profit report (per item and of course total), calculated by the amount of (item sold * item-money-margin). Also, if possible, sometimes sellers receive some items from their vendors in different price (usually cheaper) after a while, so this profit report should be able to get this info, for example: I bought from my vendor 10 DVD players for $150 each and I am selling them for $200 each, but after 3 days (when I already sold 6 DVDs) another vendor offer me the same DVDs for $100, so I buy from him 15 pcs. and add them to the stock, which is now 19 DVDs (the remaining 4 DVDs + the cheaper 10), and offer them in the same price like before - $200, or offer the whole 19 pcs. in a cheaper price. The profit report should be able to calculate & reflect that obviously... If you can do that, it would be awesome! Thanks in advance. Edited March 27, 2004 by dr_lucas Quote Did I help you? Click "Like" or "Thanks"! It's free of charge. :)My contributions:Total Configuration (newly updated 07/2018, for both osC 2.2 and 2.3.4.1 BS Frozen CE)User Tracking with Admin 1.0 (newly updated 07/2018)FedEx - Web Services v9, FAQ System , Who's Online Enhancement, Order Editor, MoneyBookers IPN, Ship in Cart (MS2), Admin Products Paging, Margin Report v1.00, 2Checkout INS / IPN (Instant Notification System) for MS2.2, Visitor Web Stats, Time Zone Offset - Adjust to match your location, Category Meta Tags Link to comment Share on other sites More sharing options...
Guest Posted March 28, 2004 Share Posted March 28, 2004 (edited) Hi, Just installed the margin report and have it all working apart from the csv report part. When i click on the csv report link (link button or text doent show at all) the page is redirected to the following. xxx://www.xxxxxxxxx/catalog/admin/FILENAME_MARGIN_REPORT?action=export&sql=select++p.products_id%2C+p.products_price+as+products_price%2C+p.products_cost%2C+pd.products_name%2C+IF%28s.status%2C+s.specials_new_products_price%2C+NULL%29+as+specials_price%2C+if%28s.status%2C+s.specials_new_products_price-p.products_cost%2C+p.products_price-p.products_cost%29+as+margin_dollars%2C+if%28s.status%2C+%28s.specials_new_products_price-p.products_cost%29%2Fs.specials_new_products_price*100%2C+%28p.products_price-p.products_cost%29%2Fp.products_price*100%29+as+margin_percentage%2C+p2c.categories_id+as+category%2C+c.parent_id+as+parent+from+products+p%2C+products_to_categories+p2c%2C+categories+c%2C+products_description+pd+left+join+specials+s+on+p.products_id+%3D+s.products_id+where+pd.language_id+%3D+%271%27+and+p.products_id+%3D+pd.products_id+and+p2c.products_id+%3D+p.products_id+and+c.categories_id+%3D+p2c.categories_id+order+by+pd.products_name&file=coityfov&submit.x=17&submit.y=11] it doesnt produce the report. Can any one help. Keep smiling Colin Edited March 28, 2004 by segdoune Quote Link to comment Share on other sites More sharing options...
blueline Posted March 28, 2004 Author Share Posted March 28, 2004 Well, it's been so long since I wrote this contribution that I don't know for sure....but I don't remember the sql query being sent as a GET variable.....so I would double check that. Also, you clearly don't have FILENAME_MARGIN_REPORT defined, otherwise your page would redirect as xxx://www.xxxxxxxxx/catalog/admin/margin_report.php?action=export instead of xxx://www.xxxxxxxxx/catalog/admin/FILENAME_MARGIN_REPORT?action=export HTH Quote Chris Sullivan Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2004 Share Posted March 29, 2004 Hi, Getting there with this mod. Got the link working nearly ok, Now receiving the following error, Warning: fopen(C:\test2): failed to open stream: Permission denied in /home/coysoqjo/public_html/catalog/admin/margin_report.php on line 245 Appols about my lack of knowledge with php. How can i fix this. All help greatly appreaciated. Keep smiling Colin Quote Link to comment Share on other sites More sharing options...
blueline Posted March 29, 2004 Author Share Posted March 29, 2004 Create a folder at C:\report and change the permissions so that it's not "read-only". You're having a permissions problem. Quote Chris Sullivan Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2004 Share Posted March 29, 2004 Thanks for the input but it didnt work. How can i save it to the server instead of my c drive. Cheers Colin Quote Link to comment Share on other sites More sharing options...
blueline Posted March 29, 2004 Author Share Posted March 29, 2004 Just change "C:/whatever" to "/home/your/path" and chmod the directory Quote Chris Sullivan Link to comment Share on other sites More sharing options...
Guest Posted March 30, 2004 Share Posted March 30, 2004 Hi Chris. I appreaciate the help but I still cant get it to work. Ive done all that you ask without any joy. Is there any other things that you can think of. Ive re checked all the code and it looks ok. Keep smiling Colin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.