Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. I should mention that I've never used the TinyButStrong template engine. So I'm just guessing here. But have you tried adding the <option> tag to the following line: <select class="upload-video-form-input" style="width:160px;" size="1" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);"> [var.fields_all;htmlconv=no]</select> ([var.lang_select_one])</li>
  2. The topic has been marked solved. If you need anything else, you can start a new topic...or click the "Mark Unsolved" button in the lower-right corner of your post above.
  3. For what it's worth, the error_log() code is executed before $render is defined. See the following snippet: error_log("Render: " . print_r($render, TRUE), 3, "/var/tmp/my-errors.log"); error_log("Obj: ". print_r($obj, TRUE), 3, "/var/tmp/my-errors.log"); error_log("Parent: ". print_r($parent, TRUE), 3, "/var/tmp/my-errors.log"); $render = $this->getRender("object");
  4. Have you tried adding another <option> tag right after the open <select> tag? The value attribute would be set to blank. <option value="">Choose One</option>
  5. Try setting the width for the anchor tag. .submenu a { padding-top:4%; display:inline-block; width:200px; }
  6. This echo "<option value=".$squadre[$num5]." " Needs to be changed to something like this echo "<option value='".$squadre[$num5]."' " Of course, that doesn't address the security issues mentioned by Jacques1.
  7. Have you tried removing the extra HTML? For "bs_kf_production_price_week.php", instead of <html> <head> <title>Production</title> </head> <body> <div class="wrapper"> <?php $grandTotal = 0; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql=" SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) AS DATE ,ISNULL(trans, 'NON') AS trans ,ISNULL(Transactions.item, Snumbers.item) AS item ,count(serial) AS qty ,tuser ,sum(M1_KF.dbo.PartUnitSalePrices.imhUnitSalePrice) as TotalPrice FROM Orbedata.dbo.SNumbers LEFT OUTER JOIN OrbeData.dbo.Transactions ON snum = serial INNER JOIN M1_KF.dbo.PartUnitSalePrices ON Orbedata.dbo.transactions.item = M1_KF.dbo.PartUnitSalePrices.imhPartID WHERE tdate>=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0) and tdate<=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6) AND trans = 'fpr' GROUP BY DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) ,ISNULL(trans, 'NON') ,ISNULL(Transactions.item, Snumbers.item) ,tuser ,Orbedata.dbo.transactions.qty order by tuser,item "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } while (odbc_fetch_row($result)) { $scanner=odbc_result($result,"tuser"); $Item=odbc_result($result,"item"); $Qty=odbc_result($result,"qty"); $Price=odbc_result($result,"TotalPrice"); $num = number_format($Price, 2); $grandTotal += $Price; $num2 = number_format( $grandTotal, 2); } odbc_close($connect); echo "$num2"; ?> </div> </body> </html> Try <?php $grandTotal = 0; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql=" SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) AS DATE ,ISNULL(trans, 'NON') AS trans ,ISNULL(Transactions.item, Snumbers.item) AS item ,count(serial) AS qty ,tuser ,sum(M1_KF.dbo.PartUnitSalePrices.imhUnitSalePrice) as TotalPrice FROM Orbedata.dbo.SNumbers LEFT OUTER JOIN OrbeData.dbo.Transactions ON snum = serial INNER JOIN M1_KF.dbo.PartUnitSalePrices ON Orbedata.dbo.transactions.item = M1_KF.dbo.PartUnitSalePrices.imhPartID WHERE tdate>=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0) and tdate<=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6) AND trans = 'fpr' GROUP BY DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) ,ISNULL(trans, 'NON') ,ISNULL(Transactions.item, Snumbers.item) ,tuser ,Orbedata.dbo.transactions.qty order by tuser,item "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } while (odbc_fetch_row($result)) { $scanner=odbc_result($result,"tuser"); $Item=odbc_result($result,"item"); $Qty=odbc_result($result,"qty"); $Price=odbc_result($result,"TotalPrice"); $num = number_format($Price, 2); $grandTotal += $Price; $num2 = number_format( $grandTotal, 2); } odbc_close($connect); echo "$num2"; ?>
  8. Is the code for all / most of the pages very similar...maybe a different database name here and a table name there? If so, you could look into creating a function using the code used by all / most of the scripts. And then pass any specific information, like a table name, as function arguments.
  9. Side note: have you considered putting the database connection code into a separate include file? That way you could import the code as need. And you would only need to update the database password, for example, in one location.
  10. Is there a reason for including all the HTML tags? It seems like the include file could be cut down to something like this: <?php $grandTotal = 0; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $sql=" SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) AS DATE ,ISNULL(trans, 'NON') AS trans ,ISNULL(Transactions.item, Snumbers.item) AS item ,count(serial) AS qty ,tuser ,sum(M1_KF.dbo.PartUnitSalePrices.imhUnitSalePrice) as TotalPrice FROM Orbedata.dbo.SNumbers LEFT OUTER JOIN OrbeData.dbo.Transactions ON snum = serial INNER JOIN M1_KF.dbo.PartUnitSalePrices ON Orbedata.dbo.transactions.item = M1_KF.dbo.PartUnitSalePrices.imhPartID WHERE tdate>=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0) and tdate<=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6) AND trans = 'fpr' GROUP BY DATEADD(dd, 0, DATEDIFF(dd, 0, tdate)) ,ISNULL(trans, 'NON') ,ISNULL(Transactions.item, Snumbers.item) ,tuser ,Orbedata.dbo.transactions.qty order by tuser,item "; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } while (odbc_fetch_row($result)) { $scanner=odbc_result($result,"tuser"); $Item=odbc_result($result,"item"); $Qty=odbc_result($result,"qty"); $Price=odbc_result($result,"TotalPrice"); $num = number_format($Price, 2); $grandTotal += $Price; $num2 = number_format( $grandTotal, 2); } odbc_close($connect); echo "$num2"; ?> Or better yet, you could create your own function using the above code and then returning the value of $num2. More information about creating functions can be found here: http://php.net/manual/en/functions.user-defined.php
  11. What does the code for "bs_kf_production_price_week.php" look like?
  12. That works when running the queries at the "localhost" level. However, it doesn't seem to do anything when running queries at the database level in phpMyAdmin. It doesn't flag an error. It just seems to ignore that statement altogether.
  13. Huh...option 3 actually works! It doesn't seem to matter which database I'm in when clicking the SQL tab and running the query. And the technique even works at the "localhost" level. For what it's worth, the "USE databasename" option didn't work. If you're in the wrong database, an INSERT query, for example, still works if that database happens to have a table with the same name used in the query. I was hoping the phpMyAdmin would at least flag the error. Thanks Barand!
  14. When running a query in phpMyAdmin, is there a way to make sure the correct database is selected before executing the query? I know that the following code lets you see which database is selected: SELECT DATABASE(); But I'm not sure how to use the information to prevent queries from running when the wrong database is selected.
  15. If you are asking how to get the information from the form, you would use $_POST. More information can be found here: http://php.net/manual/en/reserved.variables.post.php
  16. To fix the error handling, see Example #1 here: http://php.net/manual/en/function.mysql-query.php Of course, you will want to move away from the mysql_* functions as soon as possible, as benanamen and Jacques1 have suggested.
  17. It looks like you are using the file() function as an array here: $data = file('Images/'.$id.'.txt')[10]; I imagine the "[10]" part isn't necessary.
  18. Did you write the code? If not, where does the code come from?
  19. Welcome ris_geek82! And congratulations on the family!
  20. Based on the code shown, $orderInfo isn't defined. It looks like all the data is stored in the following arrays: $sample1_received $sample2_received $sample1_completed $sample2_completed What would you like to happen in the following line? $csvLine = array( 'DATE' => $orderInfo[''], 'SAMPLE1 ITEMS RECEIVED' => $orderInfo[''], 'SAMPLE1 ITEMS COMPLETED' => $orderInfo[''], 'SAMPLE2 ITEMS RECEIVED' => $orderInfo[''], 'SAMPLE2 ITEMS COMPLETED' => $orderInfo[''], ); Are the values, where you currently have $orderInfo[''], supposed to be a string...or an array? Side note: the mysql_ functions were removed in the latest release of PHP. You will want to use a different API soon. More information can be found here: http://php.net/manual/en/mysqlinfo.api.choosing.php
  21. You could define all the icons you want to use, like what was done here: var icon = new google.maps.MarkerImage("http://maps.google.com/mapfiles/ms/micons/blue.png", new google.maps.Size(32, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 32)); And then modify the addMarker() function to accept a new parameter to use when choosing the icon to display. The while loop which calls addMarker() would then be modified to say which icon to use. Side note: the mysql_* functions have been removed from the newest version of PHP. You'll want to switch as soon as possible. More information can be found here: http://php.net/manual/en/mysqlinfo.api.choosing.php
  22. ...assuming that's all the OP wants to do. But good point.
  23. You are missing some quotes and other components. You could try the following: <?php $database = array(); $database['host'] = "localhost"; $database['port'] = '3306'; $database['name'] = "forumtest"; $database['username'] = "root"; $database['password'] = "Password"; $link = mysql_connect($database['host'], $database['username'], $database['password']); if ($link) { echo "Connected to a database".$database['name']; }else{ echo "connect to a database" . $database['name'] . "failed<br/>"; echo "Error: ".mysql_error(); } ?> With that said, the mysql_* functions were removed in the newest version of PHP, as benanamen was hinting at. More information can be found here: http://php.net/manual/en/mysqlinfo.api.choosing.php
  24. Every time the loop executes, the $products variable is being overridden. So the output will only contain the last record. You could try something like this: $products = array(); while($list_products = mysql_fetch_assoc($query_products)) { $products[]['id'] = $list_products['id']; $products[]['status'] = $list_products['status']; $products[]['code'] = $list_products['code']; $products[]['name'] = $list_products['name']; $products[]['amount'] = $list_products['amount']; $dump = array(); } And then use a foreach loop to output the products.
  25. I imagine the error is displayed when you first visit the form...before submitting it? Is that correct? Basically, the $_POST variable is only populated after the form is submitted. To determine if a form (set to POST) is submitted, you can use the following: if($_SERVER['REQUEST_METHOD'] == 'POST') { $errorMessage = ""; //...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.