artvor 0 Light Poster

OMg.. i posted here about 20 question in this website .. and did not get 1 answer.. This website is unless..

artvor 0 Light Poster

?

artvor 0 Light Poster

Hello, it's about a week that I'm searching for a simple script that do this:
So when value is 0 checkbox must be not checked and the opposite if value is 1...
So when I check box it must send value= 1 to my mysql DB and if it's not checked value must be 0 (Obviously when i press update button)

Please.. please .. I'm bagging you.. can some one provide me this simple script (complete with php html and sql info)

Here is simple example of what i have:

CREATE TABLE `NewTable` (
`id`  smallint(4) NOT NULL AUTO_INCREMENT ,
`checked`  tinyint(4) NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id`)
)
;

This is HTML code:

<html><head></head><body> 
<table>
</td><td><input type="checkbox" > I don't do drugs</td></tr>
</td><td><input type="checkbox" > I'm drun </td></tr>
</td><td><input type="checkbox" > Trolololo</td></tr>   //  On load page this have to be chacked (taked value = 1 from DB)
</table>
</body></html>

That's it :)

Have a great day. Artem Vorobiev

artvor 0 Light Poster

OMG! I made IT!!!!!!!!!!!!!!!!!!!!!!
After 6 Fk hours... for sucj simple thing.. can't believe..

I just aded <div> tag! to the bold class .. OMG!!

<div style="width:90px;"> <ul class="titleNav">
<li class="bold">Conditions</li></ul></div>
<div>
<ul class="titleNav" onclick="CngClass();">
<li class="on"  ><a id="myHeader1" href="javascript:showonlyone('newboxes1');" >Deposit Methods</a></li>
<li class="off"  ><a id="myHeader2" href="javascript:showonlyone('newboxes2');" >Withdrawal Methods</a></li>
<li class="off"  ><a id="myHeader2" href="javascript:showonlyone('newboxes3');" >Accounts</a></li>
<li class="off"  ><a id="myHeader2" href="javascript:showonlyone('newboxes4');" >Regulation</a></li>
</ul>
</div>
</div>

I hope it help some one...

artvor 0 Light Poster

var lis=zxcul.getElementsByTagName('LI'); + ByID
the PLUS symbol is meant to "join" the "stuff" on the left with the "stuff" on the right, so get RID of the semicolon to the left of the PLUS symbol.

Nope...nope... I did not explane my self... well..

Just gop here: http://brokerhabitat.com/ava_fx/

See the condition menu.. try to navigate.. you see that condition become class="off" but I don't neet it to change.
So I was thinking to change only <li> with ID="chage" ..

Omg.. so simple and so complicated..
Some one some ideas?

artvor 0 Light Poster

This is what i have:

<ul class="titleNav" onclick="CngClass();">

<li class="bold">Conditions</li>
<li class="on" id="change" ><a id="myHeader1" href="javascript:showonlyone('newboxes1');" >Deposit Modes</a></li>
<li class="off" id="change" ><a id="myHeader2" href="javascript:showonlyone('newboxes2');" >Withdrawal Modes</a></li>
<li class="off" id="change" ><a id="myHeader2" href="javascript:showonlyone('newboxes3');" >Accounts</a></li>
<li class="off" id="change" ><a id="myHeader2" href="javascript:showonlyone('newboxes4');" >Regulation</a></li>
</ul>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

function CngClass(){
    var zxcevt=window.event||arguments.callee.caller.arguments[0];
    var zxcobj=window.event?zxcevt.srcElement:zxcevt.target;
    while (zxcobj.parentNode){
        if (zxcobj.nodeName=='LI') 
            break;
        zxcobj=zxcobj.parentNode;
    }
    if (zxcobj.nodeName!='LI') 
        return;
 
    var zxcul=zxcobj.parentNode;
    var lis=zxcul.getElementsByTagName('LI');
    for (var z0=0;z0<lis.length;z0++){
        lis[z0].className=lis[z0]!=zxcobj?'off':'on';
        if( lis[z0].className=='on')
          lis[z0].id='change';
        else
          lis[z0].id='';
    }
}


/*]]>*/
</script>
artvor 0 Light Poster

Nope: the <li class="blod"> become class="off" again..
See here: http://brokerhabitat.com/ava_fx/ (conditions is Class="bold" that don't have to change)

Have some others ideas?

(Thanks for helping me)

artvor 0 Light Poster

I just need To edit this on JS
var lis=zxcul.getElementsByTagName('LI'); + ByID
Don't know how to do it

artvor 0 Light Poster

Thanks for helping
Here is the website : http://brokerhabitat.com/ava_fx/
See: Conditions: Deposit , withdrawal.. (That is where i'm working)

artvor 0 Light Poster

I tryed but it still change all of <li> classes (also class="bold" that that must stay blod

artvor 0 Light Poster

I need to change this code here:

<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
 
function CngClass(){
 var zxcevt=window.event||arguments.callee.caller.arguments[0];
 var zxcobj=window.event?zxcevt.srcElement:zxcevt.target;
 while (zxcobj.parentNode){
  if (zxcobj.nodeName=='LI') break;
  zxcobj=zxcobj.parentNode;
 }
 if (zxcobj.nodeName!='LI') return;
 var zxcul=zxcobj.parentNode;
 var lis=zxcul.getElementsByTagName('LI');
 for (var z0=0;z0<lis.length;z0++){
  lis[z0].className=lis[z0]!=zxcobj?'off':'on';
 }
}
 
 
 
/*]]>*/
</script>

it's must be like this:

<ul class="titleNav" onclick="CngClass();">

<li class="bold">Conditions</li> // This don't change
<li class="on" id="change" >Deposit Modes</li> // This change
<li class="off" id="change" >Withdrawal Modes</li> // This change
<li class="off" id="change">Accounts</li> // This change
<li class="off" id="change">Regulation</li> // This change
</ul>

So when i click on <li> it have to become class="on" and when i click on other <li> the last <li> become class="off" and new <li> become class="on" ( But fine this works great)
The only problem that i have that: <li class="bold">Conditions</li> becoume also class="off" when i click on others <li>

So i was thinking to put ID on <li> so only that with id will change.

Owh.. gush .. i hope i explained my self

Thanks to all who try to help me!

artvor 0 Light Poster

Are you still here..?

artvor 0 Light Poster

Sorry i'm so newby in JS

artvor 0 Light Poster

How do i incorporate your code into all ready existing?

<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

function CngClass(){
var zxcevt=window.event||arguments.callee.caller.arguments[0];
var zxcobj=window.event?zxcevt.srcElement:zxcevt.target;
while (zxcobj.parentNode){
if (zxcobj.nodeName=='LI') break;
zxcobj=zxcobj.parentNode;
}
if (zxcobj.nodeName!='LI') return;
var zxcul=zxcobj.parentNode;
var lis=zxcul.getElementsByTagName('LI');
for (var z0=0;z0<lis.length;z0++){
lis[z0].className=lis[z0]!=zxcobj?'off':'on';
}
}



/*]]>*/
</script>
artvor 0 Light Poster

Please stay here... i gonna check it.. :)))
Just a second..
Thanks..

artvor 0 Light Poster

Sorry did not understand your code.

I need to change this code here:

<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
 
function CngClass(){
 var zxcevt=window.event||arguments.callee.caller.arguments[0];
 var zxcobj=window.event?zxcevt.srcElement:zxcevt.target;
 while (zxcobj.parentNode){
  if (zxcobj.nodeName=='LI') break;
  zxcobj=zxcobj.parentNode;
 }
 if (zxcobj.nodeName!='LI') return;
 var zxcul=zxcobj.parentNode;
 var lis=zxcul.getElementsByTagName('LI');
 for (var z0=0;z0<lis.length;z0++){
  lis[z0].className=lis[z0]!=zxcobj?'off':'on';
 }
}
 
 
 
/*]]>*/
</script>

it's must be like this:

<ul class="titleNav" onclick="CngClass();">

<li class="bold">Conditions</li> // This don't change
<li class="on" id="change" >Deposit Modes</li> // This change
<li class="off" id="change" >Withdrawal Modes</li> // This change
<li class="off" id="change">Accounts</li> // This change
<li class="off" id="change">Regulation</li> // This change
</ul>

So when i click on <li> it have to become class="on" and when i click on other <li> the last <li> become class="off" and new <li> become class="on" ( But fine this works great)
The only problem that i have that: <li class="bold">Conditions</li> becoume also class="off" when i click on others <li>

So i was thinking to put ID on <li> so only that with id will change.

Owh.. gush .. i hope i explained my self :)

Thanks to all who try to help me!

artvor 0 Light Poster

Hello Web Developers!

I need a simple help out here:

This is my JS code:

<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
 
function CngClass(){
 var zxcevt=window.event||arguments.callee.caller.arguments[0];
 var zxcobj=window.event?zxcevt.srcElement:zxcevt.target;
 while (zxcobj.parentNode){
  if (zxcobj.nodeName=='LI') break;
  zxcobj=zxcobj.parentNode;
 }
 if (zxcobj.nodeName!='LI') return;
 var zxcul=zxcobj.parentNode;
 var lis=zxcul.getElementsByTagName('LI');
 for (var z0=0;z0<lis.length;z0++){
  lis[z0].className=lis[z0]!=zxcobj?'off':'on';
 }
}
 
 
 
/*]]>*/
</script>

This is my HTML code:

<ul class="titleNav" onclick="CngClass();">
 
<li class="bold">Conditions</li>
<li class="on" >Deposit Modes</li>
<li class="off" >Withdrawal Modes</li>
<li class="off">Accounts</li>
<li class="off">Regulation</li>
</ul>

This script is to change class on click.

MY QUESTION: How can I change class only <li> that have this ID=change
(I don't know how to edit JS script, I'm not so expert)

Like:
<li class="bold">Conditions</li> <this on don't change
<li class="on" id="change" >Deposit Modes</li> and this one Yes.

If some one have skills to resolve this little problem please post it here.
Thanks for help!

artvor 0 Light Poster

Hello Web Developers!

I need a simple help out here:

This is my JS code:

<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

function CngClass(){
 var zxcevt=window.event||arguments.callee.caller.arguments[0];
 var zxcobj=window.event?zxcevt.srcElement:zxcevt.target;
 while (zxcobj.parentNode){
  if (zxcobj.nodeName=='LI') break;
  zxcobj=zxcobj.parentNode;
 }
 if (zxcobj.nodeName!='LI') return;
 var zxcul=zxcobj.parentNode;
 var lis=zxcul.getElementsByTagName('LI');
 for (var z0=0;z0<lis.length;z0++){
  lis[z0].className=lis[z0]!=zxcobj?'off':'on';
 }
}



/*]]>*/
</script>

This is my HTML code:

<ul class="titleNav" onclick="CngClass();">

<li class="bold">Conditions</li>
<li class="on" >Deposit Modes</li>
<li class="off" >Withdrawal Modes</li>
<li class="off">Accounts</li>
<li class="off">Regulation</li>
</ul>

This script is to change class on click.

MY QUESTION: How can I change class only <li> that have this ID=change
(I don't know how to edit JS script, I'm not so expert)

Like:
<li class="bold">Conditions</li> <this on don't change
<li class="on" id="change" >Deposit Modes</li> and this one Yes.

If some one have skills to resolve this little problem please post it here.
Thanks for help!

artvor 0 Light Poster

Like this:

<tr> <td> DATA </td></tr>
<tr class='bg1'> <td> DATA2 </td></tr>
<tr> <td> DATA3 </td></tr>
<tr class='bg1'> <td> DATA4 </td></tr>
.....
artvor 0 Light Poster

Hello,

I have this code till now:

<?php include '../include/db_viewer.php'; ?>
<?php
$c=$_GET["c"];

$sql="SELECT * FROM regulations AS b LEFT JOIN global AS ab ON b.id=ab.id WHERE checked = '".$c."' ";

$result = mysql_query($sql);

echo "<table class='maxWidth' cellspacing='0'>
<tr><td>
<table cellspacing='0' class='advanced'>
<tr >
<td>Broker</td>
</tr>";
while($row = mysql_fetch_array($result))
  {
echo "<tr>\n";
echo "<td><a href=\"";
echo $row['directory'];
echo  "\" title=\"";
echo $row['short_name'];
echo " Profile \" >";
echo $row['short_name'];
echo "</a></td>";
echo "</tr>\n";

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

mysql_close($con);
?>

It should look like this:
<tr> <td> DATA </td></tr>
And i need to add a class: <tr class='bg1'> <td> DATA2 </td></tr>


So when i add the class it display duble data ..

echo "<table class='maxWidth' cellspacing='0'>
<tr><td>
<table cellspacing='0' class='advanced'>
<tr >
<td>Broker</td>
</tr>";
while($row = mysql_fetch_array($result))
  {
echo "<tr>\n";
echo "<td><a href=\"";
echo $row['directory'];
echo  "\" title=\"";
echo $row['short_name'];
echo " Profile \" >";
echo $row['short_name'];
echo "</a></td>";
echo "</tr>\n";

echo "<tr>\n";
echo "<td><a href=\"";
echo $row['directory'];
echo  "\" title=\"";
echo $row['short_name'];
echo " Profile \" >";
echo $row['short_name'];
echo "</a></td>";
echo "</tr>\n";
  }
echo "</table>
</td></tr>
</table>";

It's look like this =

<tr> <td> DATA </td></tr>
<tr class='bg1'> <td> DATA2 </td></tr>
<tr> <td> DATA </td></tr>
<tr class='bg1'> <td> DATA2 </td></tr>

So ho can i display this :

<tr> <td> DATA </td></tr>
<tr class='bg1'> <td> DATA2 </td></tr>

I know that is simple but it's make me crazy...

artvor 0 Light Poster

Any help?

artvor 0 Light Poster

Hi all,

I'm going crazy...

I need make this simple function:

I need to have 2 inputs checkboxes Bank wire and visa.

How can i update them?


Here is my VISA table (the bank_wire is almost equel to visa table)

CREATE TABLE IF NOT EXISTS `visa` (
  `id` smallint(6) NOT NULL AUTO_INCREMENT,
  `method_name` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Visa',
  `checked` smallint(1) unsigned NOT NULL DEFAULT '1',
  `commision` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No commisions',
  `proccess_time` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Instant',
  `min_deposit` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '100 USD',
  `max_deposit` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No limits',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dump dei dati per la tabella `visa`
--

INSERT INTO `visa` (`id`, `method_name`, `checked`, `commision`, `proccess_time`, `min_deposit`, `max_deposit`) VALUES
(1, 'Visa', 1, '2%', 'Instant', '100 USD', '7000 USD every 7 days');

So when user click on checkbox the value "checked" in the table have to becoum =1 and if it's not checked it's must be =0


I need a html code + mysql code ( mysql_query("UPDATE ....))

Thanks to all..

artvor 0 Light Poster

Thanks pritaeas !

I'm your debtor, if some day you will need help my facebook is : www.facebook.com/artvor

artvor 0 Light Poster

Hello,
So here is the story:

I'm trying to select from two diferend tables ( bank_wire and visa)

CREATE TABLE IF NOT EXISTS `bank_wire` (
  `id` smallint(6) NOT NULL AUTO_INCREMENT,
  `method_name` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Bank wire',
  `checked` smallint(1) unsigned NOT NULL DEFAULT '1',
  `commision` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No commisions',
  `proccess_time` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Instant',
  `min_deposit` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '100 USD',
  `max_deposit` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No limits',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dump dei dati per la tabella `bank_wire`
--

INSERT INTO `bank_wire` (`id`, `method_name`, `checked`, `commision`, `proccess_time`, `min_deposit`, `max_deposit`) VALUES
(1, 'Bank wire', 1, 'No commisions', 'Instant', '100 USD', 'No limits'),
(2, 'Bank wire 2', 1, 'No commisions', 'Instant', '100 USD', 'No limits');

AND visa TABLE is this equal to bank_wire

CREATE TABLE IF NOT EXISTS `bank_wire` (
  `id` smallint(6) NOT NULL AUTO_INCREMENT,
  `method_name` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Bank wire',
  `checked` smallint(1) unsigned NOT NULL DEFAULT '1',
  `commision` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No commisions',
  `proccess_time` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Instant',
  `min_deposit` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '100 USD',
  `max_deposit` char(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No limits',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dump dei dati per la tabella `bank_wire`
--

INSERT INTO `bank_wire` (`id`, `method_name`, `checked`, `commision`, `proccess_time`, `min_deposit`, `max_deposit`) VALUES
(1, 'Bank wire', 1, 'No commisions', 'Instant', '100 USD', …
artvor 0 Light Poster

Ok, forgot my previous code.

How can i do this:

Insert into my db that checkbox is checked?

If it's checked it will display data also =commisions, proccess time, min deposit and max deposit.

And if it's not checked it will not display nothing.

Thanks for helping me.

artvor 0 Light Poster

I never work befor with <input type="radio" />

I have change values to yes/no

What is the MYSQL and PHP code to:

If yes = display = Accept all citizenships
If no = display = We do not accept citizenships from: (textare $description)

Thanks for helping me!

artvor 0 Light Poster

This data is collected from my DB Table= conditions.

Checked = Bank Wire
Commisions = 1%
Proccess Time = 1 day
Min Deposit = 50 $
Max Deposit = No limits

****
How can i insert into my db(table=conditions) that checkbox is checked?

If it's checked it will display data also =commisions, proccess time, min deposit and max deposit.

And if it's not checked it will be blank (do not display)

***

I hope i explane it well

Any way thanks for trying to help me..

artvor 0 Light Poster

Hello to all Web Developers!

I need a simple help here:

<table class="maxWidth" cellspacing="0">
<form action="update_conditions.php" method="post" >
<tr>
<td ><input type="radio" name="sex" value="citizenship" checked="checked" /> 
Accept all citizenships <br />
<div class="paddT5 borderT"></div>
<input type="radio" name="sex" value="citizenship" /> We do not accept citizenships from: <textarea name="ud_not_citizenship" class="textarea"  rows="5"    > <? echo "$description" ?> </textarea>
</td></tr>
<tr><td>
<input type="Submit" value="Update conditions"></td></tr></table></form>

I need something like this:
If it's checked "Accept all citizenships " Show = Accept all citizenships
If it's checked "We do not accept citizenships from:" Show= textarea(details)


How can i add radio to a MYSQL db and then show data to PHP page.

Thanks to all :S

artvor 0 Light Poster

Hello,
I'm new in PHP and MYSQL..
I need a small help...

Here is what i got:
CONDITIONS

<form action="update_conditions.php" method="post" >
<table class="maxWidth" cellspacing="0">

<tr><td >Method</td><td>Commisions</td><td>Proccess Time</td><td>Min Deposit</td><td>Max deposit</td></tr>

<tr>
<td>  <input type="checkbox" name="ud_bank_wire" value="<? echo "$bank_wire"?>"   /> Bank Wire</td>

<td><input name="ud_b_w_com" class="update_by" type="text"  value="<? echo "$b_w_com"?>"></td>

<td><input name="b_w_proc" class="update_by" type="text"  value="<? echo "$b_w_proc"?>"></td>

<td><input name="b_w_mim_d" class="update_by" type="text"  value="<? echo "$b_w_mim_d"?>"></td>

<td><input name="b_w_max_d" class="update_by" type="text"  value="<? echo "$b_w_max_d"?>"></td>
</tr>

</table>

UPDATE_CONDITIONS

<?php

include 'db.php';
/*ID and NAME*/
$ud_id=$_POST['ud_id'];

/*UPDATE*/

/*CONDITIONS*/
$ud_bank_wire=$_POST['ud_bank_wire'];
$ud_b_w_com=$_POST['ud_b_w_com'];
$ud_b_w_d=$_POST['ud_b_w_d'];




mysql_query("UPDATE presentation SET bank_wire='$ud_bank_wire', b_w_com='$ud_b_w_com', b_w_d='$ud_b_w_d' WHERE id='$ud_id'") or exit(mysql_error());

require('../Forex_Brokers/updated.php');
mysql_close();

?>

I need to make it somthing like that:

If (Method) Bank Wire is checcked = Show (on other page) details: commissions, proccess time, min deposit and max deposit.

So if this box is checcked it will show details and if not dont show any thing.

I hope i explane it well :-/

Thanks to all!