[PHP-JS] Tableau php dans javascript
Bonjour,
Je suis d�soler je ne sais pas ou placer ma question, si vous d�sirer la d�placer pas de probl�me
Voila un bout de code de mon script
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| <?
for($ii=0; $ii<$ct; $ii++){
$id = $Factures_ary[$ii]["id"];
$order_id = $Factures_ary[$ii]['order_id'];
$clientid = $Factures_ary[$ii]["clientid"];
$clientcompanyname = $Factures->truncateLongName($Factures_ary[$ii]['company'], $max_num_char_company_name, true);
$date = $Factures_ary[$ii]["date"];
$due_date = $Factures_ary[$ii]['due_date'];
$dateshow = fixDate($date, DATE_FORMAT_SHORT);
$due_dateshow=fixDate($due_date, DATE_FORMAT_SHORT);
$total = $Factures_ary[$ii]["total"];
$status = $Factures_ary[$ii]["status"];
$notifycount = $Factures_ary[$ii]['notifycount'];
$notifydates = $Factures_ary[$ii]['notifydates'];
$comments = $Factures_ary[$ii]['comments'];
$moneyunit = $Factures_ary[$ii]['moneyunit'];
if(strlen($clienttitle) > $max_num_char_title){
$clienttitle = substr($clienttitle, 0, $max_num_char_title)."...";
}
$clientname = $Factures->truncateLongName($Factures_ary[$ii]['fullname'], $max_num_char_client_name, true);
$mouse_over_effect = '';
if ($alternate == "1") {
$rowclass = "class='row2'";
$alternate = "2";
if($enable_mouse_over_effect){
$mouse_over_effect =' onmouseover="changeOver(this,\''.$mouse_over_color.'\','.$ii.');" onmouseout="changeOver(this,\''.$row_default_color2.'\','.$ii.');" onmousedown="changeDown(this,\''.$row_mark_color.'\', \''.$row_default_color2.'\', '.$ii.');" ';
}
}else {
$rowclass = "class='row1'";
$alternate = "1";
if($enable_mouse_over_effect){
$mouse_over_effect =' onmouseover="changeOver(this,\''.$mouse_over_color.'\','.$ii.');" onmouseout="changeOver(this,\''.$row_default_color1.'\','.$ii.');" onmousedown="changeDown(this,\''.$row_mark_color.'\', \''.$row_default_color1.'\', '.$ii.');" ';
} } ?> |
Mon probl�me est que je n'arrive pas a r�cup�rer id dans une fonction javascript, Ca fonctionne mais il me donne toujours le dernier id cr�er par le code plus haut
Si par exemple j�appelle un produit avec l�ID 6 de cette fa�on �a fonctionne
<a href='Facture.php?id=<?=$id?>' style="text-decoration:none"><br>Editer<border=0></a>
Mais si je l�appelle de cette fa�on il me donne le dernier ID de la boucle php
Code:
1 2 3 4 5 6 7 8
| <a href="javascript:outsideWindow();">Editer</a>
<script>
function outsideWindow() {
var win = new Window("win2", {className: "alphacube", top:0, left:0, width:800, height:500,
url: 'Facture.php?id=<?=$id?>', showEffectOptions: {duration:1.5}})
win.show(); }
</script> |
Ca fonctionne aussi mais il me donne toujours le dernier id cr�er par la boucle plus
Pouvez vous m�aidez svp