Data split: web & local machine

Data split: web & local machine

am 20.02.2006 21:04:20 von Miles Thompson

I have to generate a comma-separated(CSV) file of amounts and credit card
numbers for secure transmittal to the bank. The CSV file is read by a
bank-endorsed program, encrypted and transmitted.

Most of the billing information: amount, period date, name, billing number
is stored on the web server. The billing number and credit card type and
credit card number are stored locally, call it the cc_file. The local
storage format has not been decided on, the client is leaning towards
Excel, but is well aware of how easily data can be damaged or destroyed in
a spreadsheet.

The procedure I initially thought of, was generating a file on the web
side, emailing it to the client, then merging it with the cc_file to
generate the payment file for the bank. I foresee a very messy, and
fragile, macro in Excel to generate the merge.

Now I'm thinking more along the lines of having a local MySQL database. The
web side file will be created using SELECT INTO OUTFILE
, and that would be mailed to the client. That file would be
imported into the local MySQL database. A script / function would then
generate the payment file.

This local app I would write in PHP, using the PHP-GTK toolkit.

The other possibility would be to access the web database from the local
app, fetch the data directly and generate the file. That would involve
having two databases open at the same time, but should be ok - $db_local
and $db_remote.

Opinions and suggestions will be welcomed.

Regards - Miles Thompson


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 267.15.11/264 - Release Date: 2/17/2006

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Data split: web & local machine

am 21.02.2006 04:06:12 von Bastien Koert

do the last one, but have another empty db on the machine that only accepts
the data from the web server....protect and hide the cc data as long as
possible...then run a query behind the firewall to merge the data and send
it

bastien

>From: Miles Thompson
>To: php-db@lists.php.net
>Subject: [PHP-DB] Data split: web & local machine
>Date: Mon, 20 Feb 2006 16:04:20 -0400
>
>
>I have to generate a comma-separated(CSV) file of amounts and credit card
>numbers for secure transmittal to the bank. The CSV file is read by a
>bank-endorsed program, encrypted and transmitted.
>
>Most of the billing information: amount, period date, name, billing number
>is stored on the web server. The billing number and credit card type and
>credit card number are stored locally, call it the cc_file. The local
>storage format has not been decided on, the client is leaning towards
>Excel, but is well aware of how easily data can be damaged or destroyed in
>a spreadsheet.
>
>The procedure I initially thought of, was generating a file on the web
>side, emailing it to the client, then merging it with the cc_file to
>generate the payment file for the bank. I foresee a very messy, and
>fragile, macro in Excel to generate the merge.
>
>Now I'm thinking more along the lines of having a local MySQL database. The
>web side file will be created using SELECT INTO OUTFILE
>, and that would be mailed to the client. That file would be
>imported into the local MySQL database. A script / function would then
>generate the payment file.
>
>This local app I would write in PHP, using the PHP-GTK toolkit.
>
>The other possibility would be to access the web database from the local
>app, fetch the data directly and generate the file. That would involve
>having two databases open at the same time, but should be ok - $db_local
>and $db_remote.
>
>Opinions and suggestions will be welcomed.
>
>Regards - Miles Thompson
>
>
>--
>No virus found in this outgoing message.
>Checked by AVG Anti-Virus.
>Version: 7.1.375 / Virus Database: 267.15.11/264 - Release Date: 2/17/2006
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Data split: web & local machine

am 21.02.2006 21:31:21 von Martin Alsinet

There was a thread a while ago about credit cards

Storing Credit Cards, Passwords, Securely, two-way encryption
http://beeblex.com/lists/index.php/php.db/40981?s=3Dl:php.db

The part that really gives me the willys is:
>
> The procedure I initially thought of, was generating a file on the web
> side, emailing it to the client, then merging it with the cc_file to
=BFemailing a file with cc numbers? I would never use a service if I
knew that my cc number would go in an excel file via email, but thats
just me. Check the thread for some sobering remarks about cc security.

Martin

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Creating checkbox list.

am 22.02.2006 02:52:13 von Jeff Broomall

Good evening.

I'm sure this is something easy so I'm hoping you can simply steer me to a
good source.

I simply need to create a Checkbox list using data from my "groups" table.

I have a table with two fields:
1) groups_id
2) groups_name

The data contained is simple:

groups_id groups_name
----------- ----------------
1 Group A
2 Group B
3 Group C
4 Group D

I would like to dynamically create a checkbox selection similar to:

Group A

Group B

Group C

Group D


So I need a script that'll take this information from the groups table
and create the above. Can you help?

As I look at this, I believe I'm going to need to create an array for my
final "report." So I just added the [] after sel_group.

Thanks.

Ward

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Creating checkbox list.

am 22.02.2006 03:47:56 von Bastien Koert

I'll skip the sql (figuring you'll have that covered)

while($rows = mysql_fetch_array($result))
{
$id = $rows['group_id'] ;
$name = $rows['group_name'];

echo " value=\"$id\">$name
>";
}



Bastien


>From: "Jeff Broomall"
>To:
>Subject: [PHP-DB] Creating checkbox list.
>Date: Tue, 21 Feb 2006 20:52:13 -0500
>
>Good evening.
>
>I'm sure this is something easy so I'm hoping you can simply steer me to a
>good source.
>
>I simply need to create a Checkbox list using data from my "groups" table.
>
>I have a table with two fields:
>1) groups_id
>2) groups_name
>
>The data contained is simple:
>
>groups_id groups_name
>----------- ----------------
> 1 Group A
> 2 Group B
> 3 Group C
> 4 Group D
>
>I would like to dynamically create a checkbox selection similar to:
>
>Group A

>Group B

>Group C

>Group D

>
>So I need a script that'll take this information from the groups table
>and create the above. Can you help?
>
>As I look at this, I believe I'm going to need to create an array for my
>final "report." So I just added the [] after sel_group.
>
>Thanks.
>
>Ward
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Creating checkbox list.

am 22.02.2006 04:13:47 von MIGUEL ANTONIO GUIRAO AGUILAR

OK, let's see:
First, do the connection to your DB
$query= "select * from groups"; // get the data from your grous table
$ri=mysql_query($query, $li); // execute the query agains your table
while ($data=mysql_fetch_row($ri)) { // get the row in turn, $data is the array that holds your group data
// the following line prints the checkboxes along with it's values and description
echo("".$data[1]."
");
}

Miguel


----- Mensaje original -----
De: Jeff Broomall
Fecha: Martes, Febrero 21, 2006 7:52 pm
Asunto: [PHP-DB] Creating checkbox list.

> Good evening.
>
> I'm sure this is something easy so I'm hoping you can simply steer
> me to a
> good source.
>
> I simply need to create a Checkbox list using data from my "groups"
> table.
> I have a table with two fields:
> 1) groups_id
> 2) groups_name
>
> The data contained is simple:
>
> groups_id groups_name
> ----------- ----------------
> 1 Group A
> 2 Group B
> 3 Group C
> 4 Group D
>
> I would like to dynamically create a checkbox selection similar to:
>
> Group A

> Group B

> Group C

> Group D

>
> So I need a script that'll take this information from the groups table
> and create the above. Can you help?
>
> As I look at this, I believe I'm going to need to create an array
> for my
> final "report." So I just added the [] after sel_group.
>
> Thanks.
>
> Ward
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos.

This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may b
e used or reproduced in any manner whatsoever.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Creating checkbox list.

am 22.02.2006 05:03:19 von Luis M Morales C

--=-WmCHNvq4TH1bqPSOO53x
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,

first you need connect to the database y attach on this example a litle
extension class of Pear DB class. I suppose that your case use mysql
database.

this is an example:=20
------------------------------------------------------------ --------

require_once db.clas.php

$DB =3D array ();
$DB['type'] =3D 'mysql';
$DB['host'] =3D '10.10.1.7';
$DB['user'] =3D 'youruser';
$DB['password'] =3D 'yourpassword';
$DB['dbname'] =3D 'yourdb';

function myCheck($op){
global $DB;
$mdb =3D new mdb;
$out =3D "";
$q =3D "select * from checkbox_table order by groups_name";
=20
if($db->db_dbArray($DB, $q)){
for($i=3D0;$i_db['data']);$i++){
$checked =3D ($db->_db['data'][$i]['groups_id'] == $i) ? "checked"=
:
"";
$out .=3D " value=3D'{$db->_db['data'][$i]['groups_id']}'
{$checked}>{$db->_db['data'][$i]['groups_name']}
";
}
}
return $out;
}
?>

]?>"
ENCTYPE=3D"multipart/form-data">



------------------------------------------------------------ --------


On Tue, 2006-02-21 at 20:52 -0500, Jeff Broomall wrote:
> Good evening.
>=20
> I'm sure this is something easy so I'm hoping you can simply steer me to =
a=20
> good source.
>=20
> I simply need to create a Checkbox list using data from my "groups" table=
..
>=20
> I have a table with two fields:
> 1) groups_id
> 2) groups_name
>=20
> The data contained is simple:
>=20
> groups_id groups_name
> ----------- ----------------
> 1 Group A
> 2 Group B
> 3 Group C
> 4 Group D
>=20
> I would like to dynamically create a checkbox selection similar to:
>=20
> Group A

> Group B

> Group C

> Group D

>=20
> So I need a script that'll take this information from the groups table
> and create the above. Can you help?
>=20
> As I look at this, I believe I'm going to need to create an array for my=20
> final "report." So I just added the [] after sel_group.
>=20
> Thanks.
>=20
> Ward=20
>=20
--=20
------------------------------------------------------------ ---------------=
------
Luis Morales=20
Consultor de Tecnologia
Cel: +(58)416-4242091
------------------------------------------------------------ ---------------=
------
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
------------------------------------------------------------ ---------------=
------

--=-WmCHNvq4TH1bqPSOO53x
Content-Disposition: attachment; filename=db.class.php
Content-Type: application/x-php; name=db.class.php
Content-Transfer-Encoding: 7bit

if (!defined("DB")) {
define("DB","1");
require_once( 'DB.php' );

class mdb{
var $_db;

function db_Connect($p){
$db = $p['type'];
$dbhost = $p['host'];
$dbport = $p['port'];
$dbuser = $p['user'];
$dbpass = $p['password'];
$dbname = $p['dbname'];
$dsn = "$db://$dbuser:$dbpass@$dbhost:$dbport/$dbname";

if ( DB::isError( $this->_db['cnx'] = DB::connect( "{$dsn}" ) ) ) {
$this->_db['error']=DB::errorMessage($this->_db['cnx']);
$this->_db['debug']=$this->_db['cnx']->getDebugInfo();
return false;
}else{
return true;
}
}//db_Connect


function db_dbQuery($p,$q){
$out = false;
if($this->db_Connect($p)){
if(DB::isError($result = $this->_db['cnx']->query($q))){
$this->_db['error']=DB::errorMessage($result);
$this->_db['debug']=$result->getDebugInfo();
}else{
$out = true;
}
$this->db_Disconnect();
}

return $out;
}//db_dbQuery


function db_dbArray($p,$q){
$out = false;
if($this->db_Connect($p)){
if(DB::isError( $result = $this->_db['cnx']->query($q))) {
$this->_db['error']=DB::errorMessage($result);
$this->_db['debug']=$result->getDebugInfo();
}else{
while ($row =& $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$this->_db['data'][]=$row;
}
$out = true;
}
$this->db_Disconnect();
}
return $out;
}//dbQueryArray

function db_Disconnect(){
if ( DB::isError($this->_db['cnx']->disconnect()) ) {
$this->_db['error']=DB::errorMessage($this->_db['cnx']);
return false;
}else{
return true;
}
}//db_Disconnect

}//pgdb


}//db
?>


--=-WmCHNvq4TH1bqPSOO53x
Content-Type: text/plain; charset=us-ascii

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--=-WmCHNvq4TH1bqPSOO53x--

Generate Report

am 22.02.2006 05:06:47 von Jeff Broomall

I thank those who promptly responded to my first inquiry on the list.

This second request is, I assume, a tad more challanging.

I need a "Generate Report" function that'll allow the user to select one or
more "groups" and what columns he would like to view.

For instance,

Generate Report




















Select Group(s) Select Columns
Category One Category Two

Group A

Group B

Group C

Group D


Column
A

Column
B

Column
C

Column
D

Column
E

Column
F


Column
G

Column
H

Column
I

Column
J

Column
K

Column
L










Let's say the user wants to view Group A and Group B AND view content from
the Coulmn A, Column B, Column D, and Column K.

So a checkmark would be placed within each box and the "Generate Report"
button would be "hit" to generate a report with titles situated
horizontally.

I'm assuming I'll need to create an array for both "sel_group" and
"sel_cols" and then, I believe it's "implode" them into string values??? Am
I thinking correctly???

I know this query won't work...but this is the direction I'm headed...

$query = "SELECT $sel_cols FROM tasks WHERE groups_id=$sel_groups";

IOW, the columns from the sel_cols array would go there, and the group
or groups would go after the WHERE statement.

Then I guess I would have to figure out the code for the echo.

Am I at least in the ballpark???

Thank you and good night.

Jeff

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Generate Report

am 22.02.2006 05:26:44 von MIGUEL ANTONIO GUIRAO AGUILAR

It seems that you need to get your nose into your books!!
More about SQL statements!!

> I'm assuming I'll need to create an array for both "sel_group" and
> "sel_cols" and then, I believe it's "implode" them into string
> values??? Am
> I thinking correctly???
NO, YOU ONLY NEED TO WALK THRU YOUR ARRAYS TO GET THE DATA.

>
> I know this query won't work...but this is the direction I'm headed...
>
> $query = "SELECT $sel_cols FROM tasks WHERE groups_id=$sel_groups";
NO, IT WON'T WORK!
YOU NEED FIRST TO KNOW WHAT COLUMNS HAVE BEEN SELECTED, I RECOMMEND TO GIVE YOUR CHECHBOXES THE VALUE OF THE COLUMN NAMES IN THE TABLE
select "your columns $sel_cols" from tasks were group_id IN ($group_id1, $group_id2...)

>
> IOW, the columns from the sel_cols array would go there, and
> the group
> or groups would go after the WHERE statement.
>
> Then I guess I would have to figure out the code for the echo.
>
> Am I at least in the ballpark???
>
> Thank you and good night.
>
> Jeff
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos.

This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may b
e used or reproduced in any manner whatsoever.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Generate Report

am 22.02.2006 14:03:08 von Luis M Morales C

ok,

Let's go here..!

------------------------------- generate_report.php ------------------
// this script only build query

switch ($_REQUEST['submit']){
case "Generate":
// first extract group
$query = "";
if(count($_REQUEST['sel_group']) > 0){
$wval = array ();
foreach($_REQUEST['sel_group'] as $k => $v){
$wval[] = "groups_id='{$v}'";
}

//extract the columns
$scols = array ();
if(count($_REQUEST['sel_cols]') > 0){
foreach($_REQUEST['sel_group'] as $k => $v){
$scols[] = "{$v}";
}

//building query
$where = join(' AND ', $wval);
$sel_cols = join(',', $scols);
$query = "SELECT {$sel_cols} FROM tasks WHERE {$where}";
}

}

//if $query is empty you can catch this case as an error because
there is not any group or selected columns

break;

default:
//reset your form
unset($_REQUEST);
}

?>


Generate Report




















Select
Group(s)
Select Columns
Category One Category Two

Group A

Group B

Group C

Group D


Column
A

Column
B

Column
C

Column
D

Column
E

Column
F


Column
G

Column
H

Column
I

Column
J

Column
K

Column
L









-------------------------- end generate_report.php ------------------


Good Luck Buddy!!


Regards,

Luis Morales

On Tue, 2006-02-21 at 23:06 -0500, Jeff Broomall wrote:
> I thank those who promptly responded to my first inquiry on the list.
>
> This second request is, I assume, a tad more challanging.
>
> I need a "Generate Report" function that'll allow the user to select one or
> more "groups" and what columns he would like to view.
>
> For instance,
>
>
Generate Report
>
>

>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Select Group(s)Select Columns
Category OneCategory Two

> Group A

> Group B

> Group C

> Group D

>

> Column
> A

> Column
> B

> Column
> C

> Column
> D

> Column
> E

> Column
> F

>

> Column
> G

> Column
> H

> Column
> I

> Column
> J

> Column
> K

> Column
> L

>

>

>
>
>
>

>
>

>
> Let's say the user wants to view Group A and Group B AND view content from
> the Coulmn A, Column B, Column D, and Column K.
>
> So a checkmark would be placed within each box and the "Generate Report"
> button would be "hit" to generate a report with titles situated
> horizontally.
>
> I'm assuming I'll need to create an array for both "sel_group" and
> "sel_cols" and then, I believe it's "implode" them into string values??? Am
> I thinking correctly???
>
> I know this query won't work...but this is the direction I'm headed...
>
> $query = "SELECT $sel_cols FROM tasks WHERE groups_id=$sel_groups";
>
> IOW, the columns from the sel_cols array would go there, and the group
> or groups would go after the WHERE statement.
>
> Then I guess I would have to figure out the code for the echo.
>
> Am I at least in the ballpark???
>
> Thank you and good night.
>
> Jeff
>
--
------------------------------------------------------------ ---------------------
Luis Morales
Consultor de Tecnologia
Cel: +(58)416-4242091
------------------------------------------------------------ ---------------------
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
------------------------------------------------------------ ---------------------

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php