PHP Builder Forum IndexPHP Builder
free solutions for web developers
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in            Calendar



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!

BETA version 4.1.6 is available now for downloading.
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PHP Builder Forum Index -> Current BETA version {download}
View previous topic :: View next topic  
Author Message
administrator
Site Admin
Site Admin


Joined: 05 Oct 2006
Posts: 538
:
Location: Israel

Items

PostPosted: Sat Jun 30, 2007 5:57 pm    Post subject: BETA version 4.1.6 is available now for downloading. Reply with quote

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 (&amp;)
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
View user's profile Send private message Send e-mail Visit poster's website
zewa666
Site Moderator
Site Moderator


Joined: 01 Feb 2007
Posts: 606
:


Items

PostPosted: Sun Jul 01, 2007 9:02 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Sun Jul 01, 2007 12:23 pm    Post subject: Method : setMultirowOperations - examples Reply with quote

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&oacute; el registro : ".$registro." <br>";

                    }
                    else {
//                        echo "Update - No se actualiz&oacute; 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&oacute; el registro : ".$registro." <br>";

                    }
                    else {
//                        echo "Update - No se actualiz&oacute; el registro : ".$registro." <br>";
                    }

            }

        }
        else {
//                echo "Replace - No se encontraron registros en el archivo de datos<br>";
            }
}


Except better suggestion Rolling Eyes


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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Sun Jul 01, 2007 12:53 pm    Post subject: method : setMultirowOperations v/s Refreshing (F5) Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Sun Jul 01, 2007 12:56 pm    Post subject: Export to XML / Excel - Do not work correctly Reply with quote

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 Embarassed
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Sun Jul 01, 2007 2:37 pm    Post subject: Two observations, in the directory: datagrid\examples Reply with quote

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 Wink
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
zewa666
Site Moderator
Site Moderator


Joined: 01 Feb 2007
Posts: 606
:


Items

PostPosted: Sun Jul 01, 2007 5:51 pm    Post subject: Reply with quote

hi fcallez ...

what I wanted to know is what the function right now performs, because I cant see anywhere a mailsending happening Smile

Greetings
Zewa
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Sun Jul 01, 2007 6:02 pm    Post subject: Reply with quote

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 Shocked
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Sun Jul 01, 2007 6:16 pm    Post subject: setHttpGetVars - Does this method Operate correctly ? Reply with quote

Hi :

Code:

Code:
##  *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.)

  $http_get_vars = array("act");
  $dgrid->setHttpGetVars($http_get_vars);


Created link :

http://localhost/datagrid146/examples/index.php?act=&amp;f_mode=view&amp;f_sort_field=5&amp;f_sort_type=ASC&f_page_size=25

And the value of the variable: act ?



Proposed code :

Code:

$http_get_vars  = array(
      "values"      => array("100", "200"),
      "options"     => array("val1", "val2")
  );


  $dgrid->setHttpGetVars($http_get_vars);


Created link :

http://localhost/datagrid146/examples/index.php?val1=100&amp;val2=200&amp;f_mode=view&amp;f_sort_field=5&amp;f_sort_type=ASC&f_page_size=25


Is the suggestion right?

Excellent functionality..


Thanks Shocked
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
zewa666
Site Moderator
Site Moderator


Joined: 01 Feb 2007
Posts: 606
:


Items

PostPosted: Sun Jul 01, 2007 6:41 pm    Post subject: Reply with quote

ahh ok I understand ... thought that was a fixed up function ready to go.

thx again for explanation

Greetings
Zewa
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Mon Jul 02, 2007 4:02 pm    Post subject: Suggestions-default_order_field-default_order_type Reply with quote

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")."\"'>&nbsp;"; // Adding 02/07/07
echo "</td>"; // Adding 02/07/07

echo "</tr>";
echo "</table>";
}

....

function setUrlStringSorting(&$curr_url, $amp="&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 Rolling Eyes
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
fcallez
Expert
Expert


Joined: 07 Mar 2007
Posts: 174
:
Location: Pucallpa - Perú

Items

PostPosted: Mon Jul 02, 2007 6:25 pm    Post subject: Re: setHttpGetVars - Does this method Operate correctly ? Reply with quote

Hi :

I, reading, studying, understanding the code, and everything is working OK, excellent functionality. Thanks Shocked

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 Wink Shocked
_________________
Franklin Calle Zapata
fcallez@gmail.com
skype : fcallez
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Matt Bittner
Junior
Junior


Joined: 22 Oct 2006
Posts: 41
:
Location: Omaha, NE, USA

Items

PostPosted: Thu Jul 05, 2007 11:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
administrator
Site Admin
Site Admin


Joined: 05 Oct 2006
Posts: 538
:
Location: Israel

Items

PostPosted: Fri Jul 06, 2007 9:16 am    Post subject: Reply with quote

Quote:
For more information, turn on debug mode."
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Matt Bittner
Junior
Junior


Joined: 22 Oct 2006
Posts: 41
:
Location: Omaha, NE, USA

Items

PostPosted: Fri Jul 06, 2007 10:04 am    Post subject: Reply with quote

<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
View user's profile Send private message Visit poster's website
     
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PHP Builder Forum Index -> Current BETA version {download} All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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
PHP Builder topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

FREE FORUM HOSTING by AtFreeForum. Terms of Service - Privacy Policy
FASHION ACCESSORIES - BLING BLING - LADIES WATCHES - KOREAN CHILDREN CLOTHING - ONLINE BARGAIN STORE - FASHION JEWELLERIES