Bonjour à tous et merci d'avance pour votre aide.

Je me trouve face à un script qui permet d'afficher un décompte de produits commandés sur le site. Par exemple au départ il y a 100 produits disponibles affiché sur le site "100 disponibles". Après une commande il est censé affiché "99 / 100 disponibles". Hors le décompte ne se fait pas. Malgré les commandes effectuées il affiche toujours "100 disponibles". Pouvez vous m'aider à corriger le bug ? Je précise que ce n'est pas moi qui ais créé le script de mon site. Je ne suis pas programmeur, je veux juste corriger les différents bugs que je constate

Voici le code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
 
<?php if($project['project_type'] == 1) {
 
        if($all_reward)
        {
        ?>
            <tr>
            <td align="left" valign="top" colspan="2" style="color:#434343 !important; font-size:15px; padding:15px 0px; font-weight:bold; border-bottom:1px solid #cccccc;  text-transform:capitalize;"><input type="radio" name="selected_perk_id" id="selected_perk_id"  <?php if($project_perk_id==0) { ?> checked="checked"  <?php } ?> value="0" onclick="assignamount(this.value)" />&nbsp;<?php echo NO_REWARD; ?></td>
 
 
</tr><tr><td colspan="2" height="10"></td></tr>
 
            <?php
            foreach($all_reward as $reward)
            {
                $available = $reward['reward_total'] - ($reward['reward_get']*1);
    ?>
        <tr>
            <td align="left" valign="top" width="220" style="color:#434343 !important; font-size:15px; font-weight:bold;   text-transform:capitalize;"><input type="radio" name="selected_perk_id" id="selected_perk_id"  <?php if($project_perk_id==$reward['reward_id']) { ?> checked="checked"  <?php } ?> value="<?php echo $reward['reward_id']; ?>" onclick="assignamount(this.value)" />&nbsp;<?php echo CREATE_FOR;?> <?php echo $site_setting['currency_symbol']; ?> <?php echo $reward['reward_amount']; ?> <?php echo AND_MORE;?></td>
 
            <td align="left" valign="top" style="padding:10px 0px 5px 0px;">
            <?php
                                if($_SESSION['lang_code'] == 'fr') {
                                    echo $reward['reward_description_fr'];
                                }else{
                                    echo $reward['reward_description'];
                                }
 
                            ?>
            </td>
</tr>    
 
<tr><td >&nbsp;</td><td align="left" valign="top">
            <div style="color:#818181;margin:4px 0px 5px 0px;"><span style="font-weight:normal;color:#EC004B; font-size:13px; font-weight:bold;"> <?php echo $available; ?> <?php echo AVAILABLE; ?></span></div>
 
            </td>
            </tr>
            <tr><td colspan="2" height="10"></td></tr>
 
 
    <?php
            }
 
 
        } else {
    ?>
        <tr><td colspan="2" align="center" valign="middle" height="10"><span style="font-size:14px; color:#818181; font-weight:bold;"><?php echo NO_PERK_HAS_BEEN_CREATED;?></span></td></tr>
 
    <?php }
    } else {
 
        if($all_perks)
        {
        ?>
            <tr>
            <td align="left" valign="top" colspan="2" style="color:#434343 !important; font-size:15px; padding:15px 0px; font-weight:bold; border-bottom:1px solid #cccccc;  text-transform:capitalize;"><input type="radio" name="selected_perk_id" id="selected_perk_id"  <?php if($project_perk_id==0) { ?> checked="checked"  <?php } ?> value="0" onclick="assignamount(this.value)" />&nbsp;<?php echo NO_REWARD; ?></td>

Voici le code la page qui gère la validation de l'achat du produit. Le code qui nous concerne est à la ligne 665.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
<?php  $cur_url=base64_encode(current_url()); ?>
    <div class="section_top" style="margin:0px;">
        <div class="main">
 
                <div class="card_section2" style="background:none;">
                    <div class="card_section2_left" style="width:680px;"> 
        <!--====================left==============-->
 
    <style type="text/css">
    .normal_label,.form-label{width:170px;}
    .all_textbox{width:250px;margin-left:0px;}
    h3{margin-bottom:10px;}
    </style> 
    <script type="text/javascript">
 
    function assignamount(pid, value)
    {
        /* @TODO : meilleure méthode de passage */
        document.getElementById('amount').value = value;
        document.getElementById('project_id').value = "<?php echo $id; ?>";
        document.getElementById('perk_id').value = "<?php echo $project_perk_id; ?>";
        document.getElementById('donate_amt').innerHtml = value;
 
        var totw = '<?php echo $total_wallet_amount; ?>';
 
        var subt = parseFloat(totw) - parseFloat(value);
        if(subt < 0) {
            //alert('hggjh');
            document.getElementById('cannot_donate').innerHTML = "<?php  echo CANNOT_DONATE_MORE; ?>" ;
        }
        else {
            if(!isNaN(subt)){
                document.getElementById('remain_amt').innerHTML = subt.toFixed(2) ;
                document.getElementById('donate_amt').innerHTML = value ;
                document.getElementById('cannot_donate').innerHTML = '' ;
            }
            else{
                document.getElementById('donate_amt').innerHTML = '0' ;
            }  
        }  
        /*
      if(pid > 0){
        if (window.XMLHttpRequest) {
            xmlhttp = new XMLHttpRequest();
        } else if(window.ActiveXObject) {
            try {
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {
                    xmlhttp = false;
                }
            }
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                //alert(xmlhttp.responseText);
                var rt = xmlhttp.responseText;
 
                //alert(rt);
 
                document.getElementById('amount').value = rt ;
                document.getElementById('perk_id').value = pid ;
 
                var totw = '<?php echo $total_wallet_amount; ?>';
                //alert(totw);
                var subt = parseFloat(totw) - parseFloat(rt);
                if(parseFloat(rt) > parseFloat(totw)) {
                    //alert('hggjh');
                    document.getElementById('cannot_donate').innerHTML = "<?php  echo CANNOT_DONATE_MORE; ?>" ;
                }
                else {
                    if(!isNaN(subt)){
                        document.getElementById('remain_amt').innerHTML = subt.toFixed(2) ;
                        document.getElementById('donate_amt').innerHTML = rt ;
                        document.getElementById('cannot_donate').innerHTML = '' ;
                    }
                    else{
                        document.getElementById('donate_amt').innerHTML = '0' ;
                    }  
                }  
            }
        }
        var url = '<?php if($project['project_type'] == 1) { echo site_url('project/get_reward_amount'); } else { echo site_url('project/get_perk_amount'); } ?>/'+pid;
        xmlhttp.open("POST",url,true);
        xmlhttp.send(null);
 
      }else{
            document.getElementById('amount').value = '';
      }  */                     
    }
 
function set_wallet_details(val){
                var totw = '<?php echo $total_wallet_amount; ?>';
 
                var subt = parseFloat(totw) - parseFloat(val);
                var gateway = document.getElementById("gateway").value;
 
                        if(gateway=='wallet'){
 
                if(parseFloat(val) > parseFloat(totw)){
                    document.getElementById('cannot_donate').innerHTML = "<?php  echo CANNOT_DONATE_MORE; ?>" ;
 
                }
                else{
                    if(!isNaN(subt)){
                        document.getElementById('remain_amt').innerHTML = subt.toFixed(2) ;
                        document.getElementById('donate_amt').innerHTML = val ;
                        document.getElementById('cannot_donate').innerHTML = '' ;
                    }
                    else{
                        document.getElementById('donate_amt').innerHTML = '0' ;
                    }  
                }
 
            }
            else{
                if(!isNaN(subt)){
                        document.getElementById('remain_amt').innerHTML = subt.toFixed(2) ;
                        document.getElementById('donate_amt').innerHTML = val ;
                        document.getElementById('cannot_donate').innerHTML = '' ;
                    }
                    else{
                        document.getElementById('donate_amt').innerHTML = '0' ;
                    }  
            }  
 
}
 
 
            function return_set_wallet_details(){
                var val = document.getElementById('amount').value;
 
                var gateway = document.getElementById("gateway").value;//alert(gateway);
 
                        if(gateway=='wallet'){
                            var totw = '<?php echo $total_wallet_amount; ?>';
 
                            var subt = parseFloat(totw) - parseFloat(val);
                            if(val=='0' || val==0 || val==''){
                                document.getElementById('cannot_donate').innerHTML = "<?php  echo ENTER_AMOUNT_GREATOR_THAN_ZERO; ?>" ;
                                return false;
                            }
                            else if(parseFloat(val)<parseFloat(<?php echo $admin_amount->donation_amount; ?>)){
                                    document.getElementById('cannot_donate').innerHTML = "<?php echo YOU_CANNOT_DONATE_AMOUNT_LESS_THAN." ".$admin_amount->donation_amount.$site_setting['currency_symbol']; ?>";
                                    return false;
                            }
                            else if(parseFloat(val) > parseFloat(totw)){
                                document.getElementById('cannot_donate').innerHTML = "<?php  echo CANNOT_DONATE_MORE; ?>" ;
                                document.getElementById('add_donate_amount').innerHTML = '<?php  echo anchor("wallet/add_wallet/".$cur_url,CLICK_HERE_TO_ADD_AMOUNT_TO_YOUR_WALLET); ?>' ;
                                return false;
                            }
                            else{
                                if(!isNaN(subt)){
                                    document.getElementById('cannot_donate').innerHTML = '' ;
                                    //return true;
                                   // var ans=  confirm('Are you sure you want to make donation to <?php //echo $project['project_title'];?>');
 
                                       var url = document.getElementById("various1").href;//alert(url);
                                        var amount = document.getElementById("amount").value;//alert(amount);
                                        var perk = document.getElementById("perk_id").value;//alert(perk);
                                        if(perk=='' || perk=='0'){
                                            perk=0;
                                        }//alert(perk);
                                        var gateway = document.getElementById("gateway").value;//alert(gateway);
                                        var anonymous = document.getElementById("anonymous").value;//alert(anonymous);
                                        var email = document.getElementById("email").value;//alert(email);
 
                                    var newurl="<?php echo site_url('project/add_fund_confirm/'.$project['project_id']); ?>/"+amount+"/"+perk+"/"+gateway+"/"+anonymous+"/"+email;   
 
 
                                        document.getElementById("various1").href=newurl;
                                        $('#various1').trigger('click');
                                        return false;
                                }  
                            }
 
                }else{
 
                            if(val=='0' || val==0 || val==''){
 
                                document.getElementById('cannot_donate').style.display='block';
                                document.getElementById('cannot_donate').innerHTML = '<?php  echo ENTER_AMOUNT_GREATOR_THAN_ZERO; ?>' ;
                                return false;
                            }
                            else if(parseFloat(val)<parseFloat(<?php echo $admin_amount->donation_amount; ?>)){
                                    document.getElementById('cannot_donate').style.display='block';
                                    document.getElementById('cannot_donate').innerHTML = "<?php echo YOU_CANNOT_DONATE_AMOUNT_LESS_THAN." ".$admin_amount->donation_amount.$site_setting['currency_symbol']; ?>";
                                    return false;
                            }
                            else if(gateway==''){
                                    document.getElementById('select_gateway').innerHTML = "<?php echo PLEASE_SELECT_PAYMENT_GATEWAY; ?>";
                                    return false;
                            }
                            else{
                                        document.getElementById('cannot_donate').style.display='none';
                                        var url = document.getElementById("various1").href;//alert(url);
                                        var amount = document.getElementById("amount").value;//alert(amount);
                                        var perk = document.getElementById("perk_id").value;//alert(perk);
                                        if(perk=='' || perk=='0'){
                                            perk=0;
                                        }//alert(perk);
                                        var gateway = document.getElementById("gateway").value;//alert(gateway);
                                        var anonymous = document.getElementById("anonymous").value;//alert(anonymous);
                                        var email = document.getElementById("email").value;//alert(email);
 
 
                                    var newurl="<?php echo site_url('project/add_fund_confirm/'.$project['project_id']); ?>/"+amount+"/"+perk+"/"+gateway+"/"+anonymous+"/"+email;
 
                                        document.getElementById("various1").href=newurl;
                                        $('#various1').trigger('click');
                                        return false;
                         }         
                }  
 
 
            }
 
 
function show_wallet_details(){
        var val = document.getElementById('amount').value;
        set_wallet_details(val);
        document.getElementById('select_gateway').innerHTML='';
 
        var gat = document.getElementById('gateway3').checked;
        if(gat==true){
            document.getElementById('wallet_detail').style.display='block';
            document.getElementById('cannot_donate').style.display='block';
 
        }
        document.getElementById('gateway').value='wallet';
}
 
function hide_wallet_details(){
    document.getElementById('wallet_detail').style.display='none';
    document.getElementById('cannot_donate').style.display='none';
    document.getElementById('select_gateway').innerHTML='';
 
    if(document.getElementById('gateway1').checked){
        document.getElementById('gateway').value='amazon';
    }
    else if(document.getElementById('gateway2')){
        document.getElementById('gateway').value='paypal';
    }
    else if(document.getElementById('gateway3')){
        document.getElementById('gateway').value='paypal';
    }
    else{
        document.getElementById('gateway').value='';
    }
}
 
function set_anonymous_value(val){
 
    document.getElementById('anonymous').value=val;
}          
    </script>
 
<h2 class="project_title" style="font-size:22px; margin:10px 0px;"><?php echo JUST_FEW_STEPS_AWAY_BACKING_THIS_PROJECT; ?></h2>
        <br />
    <?php if($error!='') { ?><div align="center" class="error"> <?php echo $error; ?></div><?php } ?>
 
 
 
 
 
 
        <script type="text/javascript" language="javascript">
    function set_color(ele, color)
    {
        var all_ele = document.getElementById('colors').getElementsByTagName('span');//[0].style.border = "none";
        for(i=0;i<all_ele.length;i++)
        {
            all_ele[i].style.border = "none";
        }
        ele.style.border = "2px solid #000000";
        document.getElementById('color').value = color;
    }
 
    function show_div()
    {
        if(document.getElementById('radio1').checked == true)
        {
            document.getElementById('first').style.display = "block";
            document.getElementById('second').style.display = "none";
            document.getElementById('action').value = "upload";
        }
        else{
            document.getElementById('first').style.display = "none";
            document.getElementById('second').style.display = "block";
            document.getElementById('action').value = "video";
        }
    }
</script>
 
<?php if($this->session->userdata('user_id')=='') { ?>
 
 
 
    <?php
 
 
    $data = array(
        'facebook'      => $this->fb_connect->fb,
        'fbSession'     => $this->fb_connect->fbSession,
        'user'          => $this->fb_connect->user,
        'uid'           => $this->fb_connect->user_id,
        'fbLogoutURL'   => $this->fb_connect->fbLogoutURL,
        'fbLoginURL'    => $this->fb_connect->fbLoginURL, 
        'base_url'      => site_url('home/facebook'),
        'appkey'        => $this->fb_connect->appkey,
    );
?>      
 
<div  id="fb-root"></div>
 <script type="text/javascript">
window.fbAsyncInit = function() {
    FB.init({appId: '<?php echo $data['appkey']?>', status: true, cookie: true, xfbml: true});
 
    /* All the events registered */
    FB.Event.subscribe('auth.login', function(response) {
        // do something with response
       // login();
    });
 
    FB.Event.subscribe('auth.logout', function(response) {
    // do something with response
        //logout();
    });
};
 
(function() {
    var e = document.createElement('script');
    e.type = 'text/javascript';
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
}());
 
function login(){
    document.location.href = "<?php echo $data['base_url']; ?>";
}
 
function logout(){
    document.location.href = "<?php echo $data['base_url']; ?>";
}
</script>
<!-- END OF FB CODE -->  
 
 
 
 
 
 
 
   <div class="common_li2">
 
 
 
 
   <!--signup-->
   <div style="border-right:1px solid #494E51; width:313px; float:left;  padding:0px 8px 0px 8px;">
 
 
    <div style="color: #494E51; font-size:15px; font-weight:bold; padding:0px 0px 14px 8px;"><?php echo SIGNUP_TO_DONATE; ?></div>
 
 
    <div style="color: #494E51; font-size:12px; font-weight:normal; padding:0px 0px 14px 8px;"><?php echo NEED_FEW_DETAILS; ?></div>
 
    <div style="padding:5px 0px 0px 8px;">
    <?php
    $attributes = array('name'=>'frmsignup','autocomplete'=>'off');
    echo form_open_multipart('home/signup',$attributes);
?>
 
 
<h3><?php echo FIRST_NAME; ?> : *</h3>
<div class="txtbox_small"><input type="text" name="user_name" id="user_name" value="" class="all_textbox"  /></div>
<div class="clear"></div>
 
 
<h3><?php echo LAST_NAME; ?> : *</h3>
<div class="txtbox_small"><input type="text" name="last_name" id="last_name" value=""  class="all_textbox" /></div>
<div class="clear"></div>
 
 
<h3><?php echo YOUR_EMAIL; ?> : *</h3>
<div class="txtbox_small"><input type="text" name="email" id="email" value=""  class="all_textbox" /></div>
 
<div style="clear:both;"></div>
<div style="font-size:10px; "><?php echo USE_FOR_PROJECT_ACCOUNT_AND_NOTIFICATION; ?><br /></div><br />
 
 
 
<h3><?php echo PASSWORD; ?> : *</h3>
<div class="txtbox_small"><input type="password" name="password" id="password" value=""   class="all_textbox" /></div>
 
<div style="clear:both;"></div>
<div style="font-size:10px; ">(<?php echo MUST_BE_8_CHAR; ?>)</div><br />
 
 
<h3><?php echo CONFIRM_PASSWORD; ?> : *</h3>
<div class="txtbox_small"><input type="password" name="cpassword" id="cpassword" value=""   class="all_textbox" /></div>
 
<div style="clear:both;"></div>
<div style="font-size:10px; ">(<?php echo MUST_BE_8_CHAR; ?>)</div>
 
 
 
 
 
<input type="hidden" name="file1" id="file1" value=""    />
 
 
 
 
<div>
<?php
$p = array('src'=>'image/securimage','style'=>'padding-bottom:0px;');
echo img($p, TRUE);
?><br /><br />
</div>
 
 
<div class="txtbox_small"><input type="text" name="imagecode" id="imagecode"  class="all_textbox"   /></div>
<div class="clear"></div>
 
<input name="agree" id="agree" type="checkbox" value="yes" />
<label id="chklb"> <a href="javascript:void()" style="font-size:13px; font-weight:bold;" onclick="terms();"><?php echo AGREE_TERM_AND_CONDITION; ?></a></label>
 
<br /><br />
 
 
 
 
<input type="hidden" name="prev_image" id="prev_image" value="" />
<input type="submit" class="back_this" name="login" id="login" value="<?php echo SIGN_UP; ?> !!"  />
<input type="hidden" name="cur_url" id="cur_url" value="<?php echo $cur_url; ?>" />
 
 
 
 
 
   </form>
 
 
<script type="text/javascript">
function terms()
{
window.open('<?php echo site_url('home/terms_and_conditions');?>','Terms and Conditions','height=800,width=800,top=10,left=300,scrollbars=yes,overflow:auto');
}
</script>
 
 
 
</div>
 
 
 
   </div>
   <!--signup-->
 
 
 
   <!--login-->
 
   <div style="float:right; text-align:left;  width:318px; padding:0px 5px 0px 5px;">
 
   <div style="color: #494E51; font-size:15px; font-weight:bold; padding:0px 0px 14px 5px;"><?php echo ALREADY_ACCOUNT;?></div>
 
 
   <?php 
        $f_query = $this->db->getwhere('facebook_setting');
        $f_setting = $f_query->row_array();
 
        $t_query = $this->db->getwhere('twitter_setting');
        $t_setting = $t_query->row_array();
 
if($f_setting['facebook_login_enable'] == '1' || $t_setting['twitter_enable'] == '1'){
?>
  <table border="0" cellpadding="3" cellspacing="3">
 
 <?php if($f_setting['facebook_login_enable'] == '1'){ ?>
  <tr>
  <td align="left" valign="top">
  <!-- <a href="https://www.facebook.com/login.php?api_key=<?php //echo $data['appkey']; ?>&cancel_url=<?php //echo base_url();?>home&display=page&fbconnect=1&next=<?php //echo base_url();?>home/facebook&return_session=1&session_version=3&v=1.0&req_scope=email,read_stream,offline_access,user_birthday,status_update,publish_stream"></a>-->
 
    <a href="<?php echo $data['fbLoginURL']; ?>"><img src="<?php echo base_url(); ?>images2/fb_big.png" name="fbs"  onmouseover="document.fbs.src='<?php echo base_url();?>images2/fb_big_hover.png'" onmouseout="document.fbs.src='<?php echo base_url();?>images2/fb_big.png'" width="169" height="29" border="0"  alt="<?php echo SIGN_WITH_FACEBOOK; ?>" /></a>
    </td>
    </tr>
    <?php   }
                if($t_setting['twitter_enable'] == '1'){
            ?>
    <tr>
    <td align="left" valign="top">   
   <a  href="<?php echo site_url('home/twitter_auth'); ?>" >
<img src="<?php echo base_url(); ?>images2/tw_big.png" name="tws"  width="169" height="29" onmouseover="document.tws.src='<?php echo base_url();?>images2/tw_big_hover.png'" onmouseout="document.tws.src='<?php echo base_url();?>images2/tw_big.png'"   alt="<?php echo SIGN_WITH_TWITTER; ?>" border="0" /></a>
    </td>
    </tr>
    <?php } ?>
    <tr>
    <td align="left" valign="top"><br />
 
    <h5><?php echo TIPS; ?></h5>
    <p style="font-size:12px;"><?php echo DONT_WORRY_NEVER_SPAM_FACEBOOK_WALL_TEXT; ?></p>
    </td>
    </tr>
    </table>
 
    <?php } ?>
 
 
 
 
 
   <div style="padding:20px 0px 0px 6px;">
<script type="text/javascript">
function show_form(id1,id2)
{  
    document.getElementById(id1).style.display = "block";
    document.getElementById(id2).style.display = "none";
}
</script>
 
 
<?php
 
$attributes = array('name'=>'frm_login','id'=>'frm_login');
 
echo form_open_multipart('home/check_login/',$attributes);
?>
 
 
<h3><?php echo YOUR_EMAIL; ?></h3>
<div class="txtbox_small"><input type="text" name="email" id="email" value="" class="all_textbox" /></div>
<div class="clear"></div>
<h3><?php echo PASSWORD; ?></h3>
<div class="txtbox_small"><input type="password" id="password" name="password" value="" class="all_textbox" /></div><br/>
<div class="clear"></div>
<label id="chklb"><a href="javascript:" style="font-size:13px;font-weight:bold;" onclick="show_form('frm_forget_password','frm_login')" ><?php echo FORGOT_PASSWORD; ?></a></label><p>&nbsp;</p>
 
<input type="submit" value="<?php echo LOGIN; ?>" class="back_this" />
 <input type="hidden" name="cur_url" id="cur_url" value="<?php echo $cur_url; ?>" />
 
 
</form>
 
 
 
 <?php
 
$attributes = array('name'=>'frm_forget_password','id'=>'frm_forget_password','style'=>'display:none;');
 
echo form_open_multipart('home/forget_password/',$attributes);
?>
 
 
<h3><?php  echo YOUR_EMAIL;?></h3>
<div class="txtbox_small"><input type="text" name="email2" id="email2" value="" class="all_textbox" /></div>
<div class="clear"></div>
 
<label id="chklb"><a href="javascript:" style="font-size:13px;font-weight:bold;" onclick="show_form('frm_login','frm_forget_password')" ><?php echo BACK_TO_LOGIN; ?></a></label><p>&nbsp;</p>
 
<input type="submit" value="<?php echo SEND; ?>" class="back_this" />
 <input type="hidden" name="cur_url" id="cur_url" value="<?php echo $cur_url; ?>" />
 
 
</form>
 
 
 
  </div>                                
 
 
 
 
   </div>
   <!--login-->
 
   <div class="clear"></div>
 
   </div>
   <div class="clear"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
<?php }  else { ?>
 
 
                    <?php
                        $attributes = array('name'=>'frm_fund');
                        echo form_open_multipart('reward/'.$id.'/'.$project_perk_id,$attributes);
 
                    ?>
 
 
    <script type="text/javascript">
$(document).ready(function() {
$("#various1").fancybox({
                'width'             : 555,
                'height'            : 157,
                'border-width'      : '0%',
                'autoScale'         : false,
                'transitionIn'      : 'none',
                'transitionOut'     : 'none',
                'type'              : 'iframe'
            });
});        
    </script>
<h2 style="color:#EC004B!important;font-size:21px;"><?php echo STEP1_PICK_AWARD; ?></h2>
 
<div class="common_li2">
 
 
 
 
 
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
 
<?php if($project['project_type'] == 1) {
        /* @TODO : migrer vers model */
 
        $link = mysql_connect("localhost"") or die('Connexion impossible : ' . mysql_error());
        $db = mysql_select_db("admin_database", $link) or die('Sélection database impossible : ' . mysql_error());
        $query = mysql_query("select * from database") or die('Query impossible : ' . mysql_error());
 
        $tab = array();
 
        while ($row = mysql_fetch_assoc($query)) {
 
            //$row['description'] = html_entity_decode($row['description']);
            array_push($tab, $row);
        }
 
        mysql_free_result($query);
        $all_reward = $tab;
 
        if($all_reward)
        {
        ?>
 
            <tr>
            <td align="left" valign="top" colspan="2" style="color:#434343 !important; font-size:15px; padding:15px 0px; font-weight:bold; border-bottom:1px solid #cccccc;"><input type="radio" name="selected_perk_id" id="selected_perk_id"  <?php if($project_perk_id==0) { echo ' checked="checked"  '; $amount =0; } ?> value="0" onclick="assignamount(this.value, this.value)" />&nbsp;<?php echo NO_REWARD; ?></td>
 
 
</tr><tr><td colspan="2" height="10"></td></tr>
 
            <?php
            foreach($all_reward as $reward)
            {
                $available = $reward['reward_total'] - ($reward['reward_get']*1);
    ?>
        <tr>
            <td align="left" valign="top" width="220" style="color:#434343 !important; font-size:15px; font-weight:bold;   text-transform:capitalize;"><input type="radio" name="selected_perk_id" id="selected_perk_id"  <?php if($project_perk_id==$reward['reward_id']) { echo ' checked="checked"  '; $amount = $reward['reward_amount']; } ?> value="<?php echo $reward['reward_id']; ?>" onclick="assignamount(this.value, <?php echo $reward['reward_amount']; ?>)" />&nbsp;<?php echo CREATE_FOR;?> <?php echo $site_setting['currency_symbol']; ?> <?php echo $reward['reward_amount']; ?></td>
 
            <td align="left" valign="top" style="padding:2px 0px 5px 0px;">
            <?php
                                if($_SESSION['lang_code'] == 'fr') {
                                    echo $reward['reward_description_fr'];
                                }else{
                                    echo $reward['reward_description'];
                                }
 
                            ?>
            </td>
</tr>    
 
<tr><td >&nbsp;</td><td align="left" valign="top">
            <div style="color:#818181;margin:4px 0px 5px 0px;"><span style="font-weight:normal;color:#EC004B; font-size:13px; font-weight:bold;"> <?php echo ("" == $reward['reward_total']) ? AVAILABLE : $available." ".AVAILABLE; ?></span></div>
 
            </td>
            </tr>
            <tr><td colspan="2" height="10"></td></tr>
 
 
    <?php
            }
 
 
        } else {
    ?>
        <tr><td colspan="2" align="center" valign="middle" height="10"><span style="font-size:14px; color:#818181; font-weight:bold;"><?php echo NO_PERK_HAS_BEEN_CREATED;?></span></td></tr>
 
    <?php }
    } else {
 
        if($all_perks)
        {
        ?>
            <tr>
            <td align="left" valign="top" colspan="2" style="color:#434343 !important; font-size:15px; padding:15px 0px; font-weight:bold; border-bottom:1px solid #cccccc;"><input type="radio" name="selected_perk_id" id="selected_perk_id"  <?php if($project_perk_id==0) { echo ' checked="checked"  '; $amount =0; } ?> value="0" onclick="assignamount(this.value, this.value)" />&nbsp;<?php echo NO_REWARD; ?></td>
 
 
</tr><tr><td colspan="2" height="10"></td></tr>
 
            <?php
            foreach($all_perks as $perk)
            {
                $available = $perk['perk_total'] - ($perk['perk_get']*1);
    ?>
        <tr>
            <td align="left" valign="top" width="220" style="color:#434343 !important; font-size:15px; font-weight:bold;   text-transform:capitalize;"><input type="radio" name="selected_perk_id" id="selected_perk_id"  <?php if($project_perk_id==$perk['perk_id']) { echo ' checked="checked"  '; $amount = $perk['perk_amount']; } ?> value="<?php echo $perk['perk_id']; ?>" onclick="assignamount(this.value, <?php echo $perk['perk_amount']; ?>)" />&nbsp;<?php echo CREATE_FOR;?> <?php echo $site_setting['currency_symbol']; ?> <?php echo $perk['perk_amount']; ?></td>
 
            <td align="left" valign="top" style="padding:2px 0px 5px 0px;"><?php echo $perk['perk_description']; ?></td>
</tr>    
 
<tr><td >&nbsp;</td><td align="left" valign="top">
            <div style="color:#818181;margin:4px 0px 5px 0px;"><span style="font-weight:normal;color:#EC004B; font-size:13px; font-weight:bold;"><?php echo $available; ?> <?php echo AVAILABLE; ?></span></div>
 
            </td>
            </tr>
            <tr><td colspan="2" height="10"></td></tr>
 
 
    <?php
            }
 
 
        } else {
    ?>
        <tr><td colspan="2" align="center" valign="middle" height="10"><span style="font-size:14px; color:#818181; font-weight:bold;"><?php echo NO_PERK_HAS_BEEN_CREATED;?></span></td></tr>
 
    <?php }
 
    }
 
    ?>  
</table>
 
 
</div>
 
 
 
<div style="clear:both;"></div>
<div style="height:20px;"></div>
 
<h2 style="color:#EC004B!important;font-size:21px;"><?php echo STEP2_ADJUST_BACKING_AMMOUNT; ?></h2>
 
<div class="common_li2">
 
 
 
 
 
<table border="0" cellpadding="0" cellspacing="0" width="100%" >
 
 
<tr>
<td align="left" valign="top" style="padding:5px 0px 0px 20px; font-size:14px;"><?php echo $site_setting['currency_symbol']; ?></td><td align="left" valign="top"><input type="text" class="all_textbox" name="amount" id="amount" value="<?php echo $amount ;?>" onkeyup="set_wallet_details(this.value)" onchange="set_wallet_details(this.value)" />
 
 
</td>
 
<td align="left" valign="top" width="300" style="  font-size:14px; color:#999999; font-style:italic;"><?php echo DONT_STICK_PRICE_OF_AWARD; ?>.</td>
 
</tr>
<?php  if($amazons->gateway_status!='1' &&  $paypal->gateway_status!='1' && $wallet_setting->wallet_enable==1) {
                                $dis = 'block';
                            }
                            else{
                                $dis = 'block';
                            }
                            ?>
<tr><td colspan="3" height="50"><p id="cannot_donate" style="color:#f00; font-size:14px; padding-bottom:0px; line-height:16px; display:<?php echo $dis; ?>">&nbsp;</p><p id="add_donate_amount" style="color:#7DBF0F; padding-bottom:0px; line-height:14px;">&nbsp;</p></td></tr>
 
</table>
 
 
</div>


La page se présente visuellement comme cela: