This topic is locked

Update Multiple Selected Record From Button & Lookup

1/16/2013 7:55:33 AM
PHPRunner General questions
S
sickacid author

Is possible add in the button bar a dropdown with a related button ?

I want to do this, check the field i want to associate from list page, choose an id in the dropdown (placed in the button bar) and at the end launch the association with botton.
I've done this button (it works as the similar i want to do) but i need to put the id manually
Client before:
var val=prompt("Prego inserire il prezzo al litro","*,***");

if(val == null || val == "" || val > 2)

{

alert("Prezzo non valido");

return false;

}

val = val.replace(",",".");

params["invoiceno"] = val;
Server
for ($i=0; $i<count($keys); $i++)

{
$sql = "Update tabellaspese set PrezzoAlLitro='".$params["invoiceno"]."' where ID=" . $keys[$i]["ID"];

CustomQuery($sql);

$sql1 = "Update tabellaspese set Prezzo=PrezzoAlLitro
litri where ID=" . $keys[$i]["ID"];

CustomQuery($sql1);

}

$result["txt"] = "Records aggiornati..";

C
cgphp 1/16/2013
S
sickacid author 1/16/2013

Is possible to display more value of tabellaconsegne like the function concat in mysql, i want to display Giro and IdConsegna in the same line..

The users shoud do this: check some fields in the list page, select a value from this dropdown and confirm with a button
global $conn , $select;

$str = "";

$str.= "<select onselect=\"window.location.href=this.options[this."."selectedIndex].value;\"><option value=\"\">Seleziona un viaggio</option>";
//select values from database
$strSQL = "select * from vista_tabellaconsegne";

$rs = db_query($strSQL,$conn);

while ($data = db_fetch_array($rs))

$str.="<option value=>".$data["IdConsegna"]."</option>";

$select = $data["IdConsegna"]

$str.="</select>";

echo $str;
This is the button code:
global $select;

$parametro = $select;

for ($i=0; $i<count($keys); $i++)

{

$sql = "Update tabellabolle set LastUser='".$parametro."' where IdConsegne=" . $keys[$i]["IdConsegne"];

CustomQuery($sql);

}

$result["txt"] = "Giro associato ai record selezionati";
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=69387&image=1&table=forumreplies' class='bbc_emoticon' alt=':blink:' />

S
sickacid author 1/17/2013

Can someone fix my code? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=69394&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />



Is possible to display more value of tabellaconsegne like the function concat in mysql, i want to display Giro and IdConsegna in the same line..

The users shoud do this: check some fields in the list page, select a value from this dropdown and confirm with a button
global $conn , $select;

$str = "";

$str.= "<select onselect=\"window.location.href=this.options[this."."selectedIndex].value;\"><option value=\"\">Seleziona un viaggio</option>";
//select values from database
$strSQL = "select * from vista_tabellaconsegne";

$rs = db_query($strSQL,$conn);

while ($data = db_fetch_array($rs))

$str.="<option value=>".$data["IdConsegna"]."</option>";

$select = $data["IdConsegna"]

$str.="</select>";

echo $str;
This is the button code:
global $select;

$parametro = $select;

for ($i=0; $i<count($keys); $i++)

{

$sql = "Update tabellabolle set LastUser='".$parametro."' where IdConsegne=" . $keys[$i]["IdConsegne"];

CustomQuery($sql);

}

$result["txt"] = "Giro associato ai record selezionati";
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=69394&image=2&table=forumreplies' class='bbc_emoticon' alt=':blink:' />