 | PHP Builder free solutions for web developers
|
|
|
COMPUSORY UPGRADE!!! Request an upgrade NOW! 32+ Pre-installed Modifications! 3 Server Locations to choose from: USA, UK and JAPAN.
11th December 2012 - phpBB88: All servers are upgraded to run using SSD drive. Click Here to report problems!
| View previous topic :: View next topic |
| Author |
Message |
administrator Site Admin


Joined: 05 Oct 2006 Posts: 538 : Location: Israel
Items
|
Posted: Sat Jun 30, 2007 5:57 pm Post subject: BETA version 4.1.6 is available now for downloading. |
|
|
BETA version 4.1.6 of PHP DataGrid is available for downloading from
>> here <<
Examples of using and code syntax see in code_template.php file.
Main additions and improvements:
Feature: [added] new type "linktoedit" for view mode
Feature: [added] display order of columns defined by user, not by order in SELECT SQL
Feature: [added] new parameter "unique" for columns in edit mode
Feature: [added] new parameters for type texarea: "rows"=>"7" and "cols"=>"50"
Feature: [improved] method getRequestVars() renamed in getVariable()
Feature: [improved] downloading of export files
Feature: [improved] detecting filed properties while auto code generation
Feature: [improved] selecting and highlighting rows
Feature: [improved] removed unnecessary sql statments on updating/deleting
Bug: [Fixed] small bug in setModes() function
Bug: [Fixed] strtolower() small bug in some place
Bug: [Fixed] wrong URL after the click on 'Reset' button
Bug: [Fixed] missing WHERE in SQL SELECT error
Bug: [Fixed] LCASE error for Oracle and MSSQL
Bug: [Fixed] canceling of row highlighting, with click on delete button in IE
Bug: [Fixed] wrong syntax with NUMROWS processing for Oracle
Bug: [Fixed] syntax error in setSqlByDbType() and setSqlLimitByDbType()
Bug: [Fixed] FireFox error on carrying out multirow operations and pagging (&)
Bug: [Fixed] empty data error on required numeric fileds while updating
Bug: [Fixed] error on deleting last row from the last page |
|
| Back to top |
|
 |
zewa666 Site Moderator


Joined: 01 Feb 2007 Posts: 606 :
Items
|
Posted: Sun Jul 01, 2007 9:02 am Post subject: |
|
|
hows the mail sending working?
i check the rows id like and click onto the button. He asks me if I'm sure, and after pressing ok, nothing happens.
Greetings
Zewa |
|
| Back to top |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Sun Jul 01, 2007 12:23 pm Post subject: Method : setMultirowOperations - examples |
|
|
Good day
You will have to create his own code after the following:
| Code: | ## +---------------------------------------------------------------------------+
## | 8. Bind the DataGrid: |
## +---------------------------------------------------------------------------+
## *** set debug mode & messaging options
$dgrid->bind();
ob_end_flush();
##
|
Example :
| Code: |
$tabla = "tblcountries";
$clave = "countryID";
$campo = "population";
$valor = 25000;
$tooltip = "Modifica lo seleccionado, campo : " .$campo. ", con el valor : " .$valor. ". ";
$campo1 = "population";
$valor1 = 75000;
$tooltip1 = "Modifica lo seleccionado, campo : " .$campo1. ", con el valor : " .$valor1. ". ";
|
.....
| Code: |
$multirow_operations = array(
"delete" => array("view"=>true, "tooltip"=>"Elimina lo seleccionado", "image"=>"delete.gif"),
"details" => array("view"=>true, "tooltip"=>"Detalle de lo seleccionado", "image"=>"details.gif"),
"replace" => array("view"=>true, "flag_name"=>$campo."flag", "flag_value"=>$valor, "tooltip"=>$tooltip, "image"=>"banana.gif"),
"replace1" => array("view"=>true, "flag_name"=>$campo1."flag", "flag_value"=>$valor1, "tooltip"=>$tooltip1, "image"=>"yay.gif") |
....
| Code: | ## +---------------------------------------------------------------------------+
## | 8. Bind the DataGrid: |
## +---------------------------------------------------------------------------+
## *** set debug mode & messaging options
$dgrid->bind();
ob_end_flush();
##
#######################################################
## +---------------------------------------------------------------------------+
## | Evalua modos de la tabla maestra
## +---------------------------------------------------------------------------+
$mode = (isset($_GET['f_mode'])) ? $_GET['f_mode'] : "";
$pid = (isset($_GET['f_rid'])) ? $_GET['f_rid'] : "";
//echo "este es el valor de f_mode : ".$mode."<br>";
//echo "este es el valor de f_rid : ".$pid."<br>";
$pid=ereg_replace("-",",",$pid);
## +---------------------------------------------------------------------------+
## | Modo : delete , elimina en forma automática los detalles
## +---------------------------------------------------------------------------+
if($mode == "delete"){
$sql = "DELETE FROM ".$detalle." WHERE ".$codigo." IN ( ".$pid." )";
// echo "Delete - sql : ".$sql."<br>";
mysql_query($sql);
$eliminados=mysql_affected_rows();
if($eliminados > 0){
echo "Se eliminaron : ".$eliminados." registros de detalle<br>";
}
}
## +-----------------------------------------------------------------------------------------------+
## | Modo : replace , efectúa cambio en la información de acuerdo a los requerimientos del usuario
## +-----------------------------------------------------------------------------------------------+
if($mode == "replace"){
$sql = "SELECT * FROM ".$tabla." WHERE ".$clave." IN ( ".$pid." )";
$result = mysql_query($sql);
// echo "Replace 1 - sql : ".$sql."<br>";
if ($result) {
while ($frow = mysql_fetch_array($result)) {
$registro = $frow['countryID']; // OJO cambiar
$query = "UPDATE `" . $tabla . "` SET ";
$query .= "`" .$campo."` = '" . $_GET['populationflag'] . "' "; // OJO cambiar
$query .= " WHERE ";
$query .= "`" .$clave ."` = " . ($registro) . " ";
// echo "Replace 2 - sql : ".$query."<br>";
$resultu = mysql_query($query);
if ($resultu) {
// echo "Update - Se actualizó el registro : ".$registro." <br>";
}
else {
// echo "Update - No se actualizó el registro : ".$registro." <br>";
}
}
}
else {
// echo "Replace - No se encontraron registros en el archivo de datos<br>";
}
}
## +-----------------------------------------------------------------------------------------------+
## | Modo : replace1 , efectúa cambio en la información de acuerdo a los requerimientos del usuario
## +-----------------------------------------------------------------------------------------------+
if($mode == "replace1"){
$sql = "SELECT * FROM ".$tabla." WHERE ".$clave." IN ( ".$pid." )";
$result = mysql_query($sql);
// echo "Replace 1 - sql : ".$sql."<br>";
if ($result) {
while ($frow = mysql_fetch_array($result)) {
$registro = $frow['countryID'];
$query = "UPDATE `" . $tabla . "` SET ";
$query .= "`" .$campo1."` = '" . $_GET['populationflag'] . "' ";
$query .= " WHERE ";
$query .= "`" .$clave ."` = " . ($registro) . " ";
// echo "Replace 2 - sql : ".$query."<br>";
$resultu = mysql_query($query);
if ($resultu) {
// echo "Update - Se actualizó el registro : ".$registro." <br>";
}
else {
// echo "Update - No se actualizó el registro : ".$registro." <br>";
}
}
}
else {
// echo "Replace - No se encontraron registros en el archivo de datos<br>";
}
}
|
Except better suggestion
You can try in the following link:
http://www.innovavirtual.org/datagrid/examples/index.php
Greetings
| zewa666 wrote: | hows the mail sending working?
i check the rows id like and click onto the button. He asks me if I'm sure, and after pressing ok, nothing happens.
Greetings
Zewa |
_________________ Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez |
|
| Back to top |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Sun Jul 01, 2007 12:53 pm Post subject: method : setMultirowOperations v/s Refreshing (F5) |
|
|
Hi
When the method is used:
setMultirowOperations
With the option:
| Code: |
"replace" => array("view"=>true, "flag_name"=>$campo, "flag_value"=>$valor, "tooltip"=>"Modifica lo seleccionado", "image"=>"add.gif") |
It requires "Refreshing" or to press the key F5
Greetings _________________ Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez |
|
| Back to top |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Sun Jul 01, 2007 12:56 pm Post subject: Export to XML / Excel - Do not work correctly |
|
|
Hi :
Open a new window and put salt in the following message:
Can not find such path: ../../export.xml !
Can not find such path: ../../export.csv !
Thanks  _________________ Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez |
|
| Back to top |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Sun Jul 01, 2007 2:37 pm Post subject: Two observations, in the directory: datagrid\examples |
|
|
Good day
Two observations, in the directory:
datagrid\examples
In programs:
code_example1.php
code_example2.php
1. Names of tables and fields in small letters,
example :
| Code: |
$sql=" SELECT "
."tblcountries.countryID, "
."tblcountries.regionID, "
."tblcountries.name, "
."tblcountries.goverment_email, "
."tblregions.name as region, "
."tblcountries.description, "
." DATE_FORMAT(independent_date, '%D - %Y') AS independent_date, "
."tblcountries.picture_URL, "
."FORMAT(tblcountries.population, 0) as population, "
."tblcountries.population as populationn, "
."(SELECT COUNT(tblpresidents.presidentID) FROM tblpresidents WHERE tblpresidents.CountryID = tblcountries.countryID) as presidents, "
." CASE WHEN tblcountries.is_democracy = 1 THEN 'Yes' ELSE 'No' END as is_democracy "
."FROM tblcountries INNER JOIN tblregions ON tblcountries.regionID=tblregions.regionID "; |
Thus the programs will run correctly, so much in Windows like in Linux
2. In the program: Code example1.php
At present:
."tblCountries.PictureURL, "
Correcting :
."tblcountries.picture_URL, "
-------------------------
Thanks  _________________ Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez |
|
| Back to top |
|
 |
zewa666 Site Moderator


Joined: 01 Feb 2007 Posts: 606 :
Items
|
Posted: Sun Jul 01, 2007 5:51 pm Post subject: |
|
|
hi fcallez ...
what I wanted to know is what the function right now performs, because I cant see anywhere a mailsending happening
Greetings
Zewa |
|
| Back to top |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Sun Jul 01, 2007 6:02 pm Post subject: |
|
|
Hello
You will not find it..
You have to create the code than evalue the flag_name and the flag_value
| Code: |
$multirow_operations = array(
"delete" => array("view"=>true),
"details" => array("view"=>true),
"my_operation_name" =>
array("view"=>true, "flag_name"=>"my_flag_name", "flag_value"=>"my_flag_value", "tooltip"=>"Do something with selected", "image"=>"image.gif") |
Excellent functionality, a highway ad infinitum ...
That would be very good, adding (The right-hand side of icons) a combo box with all those functionalities ( delete, details, my_operation_name_1, my_operation_name_2, ... my_operation_name_n)
Match to the phpmyadmin
Greetings  _________________ Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez |
|
| Back to top |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
|
| Back to top |
|
 |
zewa666 Site Moderator


Joined: 01 Feb 2007 Posts: 606 :
Items
|
Posted: Sun Jul 01, 2007 6:41 pm Post subject: |
|
|
ahh ok I understand ... thought that was a fixed up function ready to go.
thx again for explanation
Greetings
Zewa |
|
| Back to top |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Mon Jul 02, 2007 4:02 pm Post subject: Suggestions-default_order_field-default_order_type |
|
|
Hi, Suggestions :
code : code_examples.php
## *** set data source with needed options
$default_order_field = "region, countryID";
$default_order_type = "ASC, ASC";
$dgrid->dataSource($db_conn, $sql, $default_order_field, $default_order_type);
...
## *** set sorting option: true(default) or false
$sorting_option = true;
$dgrid->allowSorting($sorting_option);
code : datagrid.class.php
-------------------------------------------->>>>>>>>>>>
function dataSource($db_handl, $sql = "", $start_order = "", $start_order_type = ""){
....
$this->sql_view = str_replace(";", "", $sql);
$this->start_order = $start_order; // Adding 02/07/07
$this->start_order_type = $start_order_type; // Adding 02/07/07
....
function setFieldsFiltering($filter_fields_array = ""){
....
// $this->dataSource($this->db_handler, $this->sql_view); // Modify 02/07/07
$this->dataSource($this->db_handler, $this->sql_view, $this->start_order, $this->start_order_type); // Modify 02/07/07
....
function drawControlPanel(){
....
echo "</td>";
echo "<td align='right' width='20px'>"; // Adding 02/07/07
echo "<input class='class_button' type='button' value='".$this->lang['reset']."' onClick='document.location.href=\"".$this->HTTP_URL.$this->combineUrl("view")."\"'> "; // Adding 02/07/07
echo "</td>"; // Adding 02/07/07
echo "</tr>";
echo "</table>";
}
....
function setUrlStringSorting(&$curr_url, $amp="&"){
.....
}else {
if(!is_numeric($this->default_sort_field[0])){ $this->default_sort_field[0] = $this->getFieldOffset($this->default_sort_field[0]) + 1; }
// $curr_url .= $amp.$this->unique_prefix."sort_field=".$this->default_sort_field[0]; // Modify 02/07/07
}; // make pKey
if($sort_type != "") {
$this->sort_type = $sort_type;
// $curr_url .= $amp.$this->unique_prefix."sort_type=".$this->sort_type; // Modify 02/07/07
} else {
// $curr_url .= $amp.$this->unique_prefix."sort_type=".$this->default_sort_type[0]; // Modify 02/07/07
};
}
--------------------------------------------<<<<<<<<
Of course, this proposal is improvable
Greetings  _________________ Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez |
|
| Back to top |
|
 |
fcallez Expert


Joined: 07 Mar 2007 Posts: 174 : Location: Pucallpa - Perú
Items
|
Posted: Mon Jul 02, 2007 6:25 pm Post subject: Re: setHttpGetVars - Does this method Operate correctly ? |
|
|
Hi :
I, reading, studying, understanding the code, and everything is working OK, excellent functionality. Thanks
But :
Creating a new method, this would be able to be useful
------------------------------>>>>>>>
Code : code_examples.php
## *** set variables that used to the page
$http_get_vars_all = array(
"options" => array("val1", "val2", "val3", "val4", "val5"),
"values" => array("100", "200", "300", "500", "1000")
);
$dgrid->setHttpGetVarsall ($http_get_vars_all);
-------------------------------------------<<<<<<<<<<<<<<
Code : datagrid.class.php
function setHttpGetVarsall($http_get_vars_all = ""){
if(is_array($http_get_vars_all)){
foreach($http_get_vars_all as $hgvkey1 => $hgvValue1){
foreach($hgvValue1 as $hgvkey2 => $hgvValue2){
$this->http_get_vars_all [$hgvkey1] [$hgvkey2] = $hgvValue2;
}
}
}
}
.....
function saveHttpGetVars(){
if(is_array($this->http_get_vars) && (count($this->http_get_vars) > 0)){
foreach($this->http_get_vars as $key){
echo "<input type='hidden' name='".$key."' id='".$key."' value='".((isset($_REQUEST[$key]))?$_REQUEST[$key]:"")."'>";
}
}
// Adding
if(is_array($this->http_get_vars_all) && (count($this->http_get_vars_all) > 0)){
foreach($this->http_get_vars_all as $hgvkey1 => $hgvValue1){
foreach($hgvValue1 as $hgvkey2 => $hgvValue2){
}
}
$count_hgckey2=$hgvkey2+1;
for($ind=0;$ind<$count_hgckey2;$ind++) {
echo "<input type='hidden' name='".$this->http_get_vars_all['options'][$ind]."' id='".$this->http_get_vars_all['options'][$ind]."' value='".$this->http_get_vars_all['values'][$ind]."'>";
}
}
.........
function combineUrl($mode, $rid="", $amp="&"){
$ind = 0;
if(is_array($this->http_get_vars) && (count($this->http_get_vars) > 0)){
foreach($this->http_get_vars as $key){
if($ind == 0){ $a_url = "?"; $ind = 1; }
else $a_url .= $amp;
$a_url .= $key."=".((isset($_REQUEST[$key]))?$_REQUEST[$key]:"");
}
}
// Adding
if(is_array($this->http_get_vars_all) && (count($this->http_get_vars_all) > 0)){
foreach($this->http_get_vars_all as $hgvkey1 => $hgvValue1){
foreach($hgvValue1 as $hgvkey2 => $hgvValue2){
}
}
$count_hgckey2=$hgvkey2+1;
for($i=0;$i<$count_hgckey2;$i++) {
if($ind == 0){ $a_url = "?"; $ind = 1; }
else $a_url .= $amp;
$a_url .= $this->http_get_vars_all['options'][$i]."=".$this->http_get_vars_all['values'][$i];
}
}
-------------------------------------<<<<<<<<<<
Greetings  _________________ Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez |
|
| Back to top |
|
 |
Matt Bittner Junior

Joined: 22 Oct 2006 Posts: 41 : Location: Omaha, NE, USA
Items
|
Posted: Thu Jul 05, 2007 11:53 pm Post subject: |
|
|
Forgive me, but when I uploaded 4.1.6 and tried to open (run) the page that worked fine in 4.1.5 I receive the following error message:
"No data found! Please, check carefully your code syntax!
It may be case sensitive or there are some unexpected symbols.
For more information, turn on debug mode."
What are the changes made that stopped my code from executing? Frustrating... _________________ Matt Bittner
Modeling the Aircraft of the Soviet VVS
http://vvs.hobbyvista.com/index.php |
|
| Back to top |
|
 |
administrator Site Admin


Joined: 05 Oct 2006 Posts: 538 : Location: Israel
Items
|
Posted: Fri Jul 06, 2007 9:16 am Post subject: |
|
|
| Quote: | | For more information, turn on debug mode." |
|
|
| Back to top |
|
 |
Matt Bittner Junior

Joined: 22 Oct 2006 Posts: 41 : Location: Omaha, NE, USA
Items
|
Posted: Fri Jul 06, 2007 10:04 am Post subject: |
|
|
<sigh>
I understand, but my point was when you're changing the parameters and functionality to document what the changes are between versions.
Thanks for the tip on turning on debug mode, I now see that you stick in your own "WHERE 1=1" into the main SQL statement, which is totally messing up my own WHERE clause (to join all my tables together). How can I get around your "WHERE 1=1" and still have all my tables joined together? _________________ Matt Bittner
Modeling the Aircraft of the Soviet VVS
http://vvs.hobbyvista.com/index.php |
|
| Back to top |
|
 |
| |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|