EVOLUTION-NINJA
Edit File: course_registation.php
<?php // print_r($payment); // echo $payment['amount']; // die(); echo view('includes/flow-header'); ?> <script src="https://checkout.razorpay.com/v1/checkout.js"></script> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/online_prep.css'); ?>"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300;0,400;0,500;1,400&family=Montserrat&family=Ms+Madi&family=My+Soul&family=Open+Sans&family=Poppins:wght@200;400&family=Roboto:ital,wght@0,300;0,500;1,300&family=Updock&display=swap" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script> <section class="registration-flow"> <div class="row"> <div class="col-sm-3"> <div class="conference-left"> <ul> <li><a href="">Online Exam Edge</a></li> </ul> </div> </div> <div class="col-sm-9"> <div class="conference-right"> <div class="con-head"> <div class="row" id="conf-bt"> <div class="col-sm-5"> <div class="conf-left-text"> <h5>EDIAC II</h5> </div> </div> <div class="col-sm-7" id="go-back-new"> <a href="<?php echo base_url('/Course-Faculty-Details-gas?id='.$val['conference_id']); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i>Back</a> </div> </div><!-----> </div> <!-- <div class="next d-sm-none"> <a href="<?php echo base_url('/Attend-Conference-gas?id='.$val['conference_id']); ?>">Next</a> </div> --> <header class="cf pt-4"> <div class="navigation"> <nav> <a href="javascript:void(0)" class="smobitrigger ion-navicon-round"><span>Menu</span></a> <ul class="mobimenu"> <li ><a href="<?php echo base_url('/Course-Details-gas?id='.$val['conference_id']); ?>">About</a></li> <li><a href="<?php echo base_url('/Course-Programs-gas?id='.$val['conference_id']); ?>">Course Schedule</a></li> <li><a href="<?php echo base_url('/Course-Faculty-Details-gas?id='.$val['conference_id']); ?>">Faculty</a></li> <li class="conf-act"><a href="<?php echo base_url('/Course-Registration-Details-gas?id='.$val['conference_id']); ?>">Registration</a></li> <li ><a href="<?php echo base_url('/Attend-Course-gas?id='.$val['conference_id']); ?>">Attend</a></li> <li><a href="<?php echo base_url('/Course-Feedback-gas?id='.$val['conference_id']); ?>">Feedback</a></li> <li><a href="<?php echo base_url('/Course-Certificate-gas?id='.$val['conference_id']); ?>">Certificate</a></li> </ul> </nav> </div> </header> </div><!--conference-right---> <div class="container"> <div class="attend-conf"> <div class="row pt-5"> <div class="col-sm-2"> <h4>Title</h4> <h4>Date:</h4> </div> <div class="col-sm-10"> <h4><b><?php echo $val['title']; ?></b></h4> <?php if($val['date_from'] == $val['date_to']){ ?> <h4><b><?php echo date('F j, Y',strtotime($val['date_from'])); ?></b></h4> <?php } else{ ?> <h4><b><?php echo date('F j, Y',strtotime($val['date_from'])). ' To '.date('F j, Y',strtotime($val['date_to']));?></b></h4> <?php } ?> </div> </div><!--row--> <div class="link-tabs"> <div class="row pt-5"> <div class="col-sm-12"> <input type="hidden" name="" id="conf_next_id" value="<?php echo $ps_ids[0]['conference_id']; ?>"> <nav> <div class="nav nav-tabs nav-fill" id="nav-tab" role="tablist"> <a class="nav-item nav-link active" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Register For Individual Program</a> <a class="nav-item nav-link " id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Register For Full Course</a> </div> </nav> <div class="tab-content" id="nav-tabContent"> <div class="tab-pane fade " id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab"> <?php if($val['full_course']==0){ ?> <!-- 2nd --> <div class="row"> <div class="col-sm-12"> <p style="color: black;"><b>This course is full fees</b></p> </div> </div> <!-- 2nd row close --> <?php }else { ?> <!-- 1st row --> <div class="row" > <div class="col-sm-12 pt-5"> <p class="ft"><b>We appreciate your interest in attending this Training Module</b></p> <p class="ft"><b>Please find the Registration fee details given below. We request you to make the payment to activate the Attend, Feedback and Certificate Tabs.</b></p> <p class="ft"><b>Your Name and other credentials will be same as GAS Medusys Membership.</b></p> </div> </div> <div class="row pt-5"> <div class="col-sm-8"> <div class="table-responsive"> <input type = "hidden" value = "<?php echo $val['conference_id']; ?>" name = "conference_id"> <table class="table table-striped"> <tbody> <tr> <td>Name</td> <td><p><?php echo $val['title']; ?></p></td> </tr> <tr> <td>Registration Fee</td> <td><p><?php echo $val['reg_fee']; ?></p></td> </tr> <tr> <td>Registration Details</td> <td><p><?php echo $val['reg_details']; ?></p></td> </tr> </tbody> </table> </div> </div> <div class="col-sm-4"></div> </div><!-----------> <?php if($val['reg_fee'] > 0){ if($payment[0]['amount'] > 0){ ?> <div class="row pt-5"> <div class="col-sm-3"></div> <div class="col-sm-6" style="text-align: center;"> <button> <a href="<?php echo base_url('/Attend-Course-gas?id='.$val['conference_id']); ?>">Already Paid...Please Attend</a></button> </div> <div class="col-sm-3"></div> ``</div> <?php } else{ $full = 0; foreach($ps_ids as $value){ if($value['max_user'] > 0){ foreach ($payment_count as $p_count){ if($p_count['ps_id'] == $value['ps_id']){ if($p_count['paycount'] >= $value['max_user']){ $full = 1; } } } } } if($full == 0){ ?> <div class="row pt-5"> <div class="col-sm-3"></div> <div class="col-sm-6" style="text-align: center;"> <p>Pay securely via Card/Net Banking/UPI/Wallet via Razor pay.</p> <button id="rzp-button1">Pay from Cards/Banks or UPI</button> </div> <div class="col-sm-3"></div> </div><!------> <?php } else{ ?> <div class="row pt-5"> <div class="col-sm-3"></div> <div class="col-sm-6" style="text-align: center;"> <p>Full</p> <button>Full</button> </div> <div class="col-sm-3"></div> </div><!------> <?php } ?> <?php } } else{ ?> <div class="row pt-5"> <div class="col-sm-3"></div> <div class="col-sm-6" style="text-align: center;"> <button> <a href="<?php echo base_url('/Attend-Course-gas?id='.$val['conference_id']); ?>">Attend</a></button> </div> <div class="col-sm-3"></div> </div><!------> <?php } ?> <!-- 1st row close --> <?php } ?> </div> <!----------------------------> <div class="tab-pane fade show active" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab"> <!-- <div class="row"> <div class="col-sm-2"> <h4>Title:</h4> </div> <div class="col-sm-10"> <h4><?php echo $title_con[0]['title']; ?></h4> </div> </div> --> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th>Select Course</th> <th>Date</th> <th>Start Time </th> <th>End Time </th> <th>Topic</th> <th>Moderator</th> <th>Speaker / Faculty</th> <th>Amount</th> <!-- <th>Status</th> --> </tr> </thead> <tbody> <?php $i = 0; $j = 0; foreach($ps_ids as $value) { $i++; foreach ($payment as $paid){ if($value['ps_id'] == $paid['course_ps_id']){ $j = 1; ?> <tr> <!-- <td><input type="checkbox" onchange="select_course('<?php echo $value['ps_id'];?>','<?php echo $value['amount'];?>',<?php echo $i;?>)" name = "sel" id = "<?php echo 'select'.$i ;?>" value = "off" checked readonly> </td> --> <td>PAID </td> <td><?php echo $value['date']; ?></td> <td><?php echo $value['start_time']; ?></td> <td><?php echo $value['end_time']; ?></td> <td><?php echo $value['topic']; ?></td> <td><?php echo $value['moderator']; ?></td> <td><?php echo $value['speaker']; ?></td> <td><?php echo $value['amount']; ?></td> <!-- <td><button type="button" class="submit" id="attend_link">Attend link</button></td> --> </tr> <?php } } if($j == 0){ ?> <tr> <?php if($value['max_user'] > 0){ $full = 0; foreach ($payment_count as $p_count){ if($p_count['ps_id'] == $value['ps_id']){ if($p_count['paycount'] >= $value['max_user']){ $full = 1; } } } } if($full == 0){ if($val['reg_fee'] != 0 && $value['amount'] == 0){ ?> <td></td> <?php } else{ ?> <td> <input type="checkbox" onchange="select_course('<?php echo $value['ps_id'];?>','<?php echo $value['amount'];?>',<?php echo $i;?>)" name = "sel" id = "<?php echo 'select'.$i ;?>" value = "off"> </td> <?php } } else{ ?> <td>Full</td> <?php } ?> <td><?php echo $value['date']; ?></td> <td><?php echo $value['start_time']; ?></td> <td><?php echo $value['end_time']; ?></td> <td><?php echo $value['topic']; ?></td> <td><?php echo $value['moderator']; ?></td> <td><?php echo $value['speaker']; ?></td> <td><?php echo $value['amount']; ?></td> <!-- <td><button type="button" class="submit" id="attend_link">Attend link</button></td> --> </tr> <?php } $j = 0; } ?> <tr> <td><b>Total</b></td> <td><input type="text" id = "sel_amount" name="sel_amount" value="0" style="height:25px;" readonly> <input type="hidden" id = "course_id" name="course_id" value="" > </td> <td> <button id="rzp-button2">Pay from Cards/Banks or UPI</button></td> </tr> </tbody> </table> </div> </div> </div><!--tab--content--> </div> </div> <div class="row pt-5"> <div class="col-sm-2" style=""> <!-- <button type="submit" class="btn">Submit</button> --> </div> <!-- <button type="button" class="btn"> Submit</button></div> --> <div class="col-sm-10"></div> </div><!----> </div> </div> </div><!--col--9--> </div> </section> </section> <?php $merchant_order_id = "ABC-".date("YmdHis"); $amount = $val['reg_fee']; ?> <script> function goback(){ location.href = '<?php echo base_url("Registration-gas")?>'; } </script> <script> function select_course(id,amount,select_id) { var id_val = $('#select'+select_id).val(); if(id_val == 'off'){ $('#select'+select_id).val('on'); var total_amount = $('#sel_amount').val(); var new_total_amount = (parseFloat(total_amount) + parseFloat(amount)); $('#sel_amount').val(new_total_amount); if(new_total_amount > 0){ var x = document.getElementById("rzp-button2"); if (x.style.display === "none") { x.style.display = "block"; } } var course_id = $('#course_id').val(); var new_course_id; if(course_id == ''){ new_course_id = id; } else{ new_course_id = course_id +","+id; } $('#course_id').val(new_course_id); } else{ $('#select'+select_id).val('off'); var total_amount = $('#sel_amount').val(); var new_total_amount = (parseFloat(total_amount) - parseFloat(amount)); $('#sel_amount').val(new_total_amount); if(new_total_amount == 0){ var x = document.getElementById("rzp-button2"); if (x.style.display === "block") { x.style.display = "none"; } } var course_id = $('#course_id').val(); var replace_string = id; new_course_id = course_id.replace(replace_string,'*'); $('#course_id').val(new_course_id); } } </script> <script> var x = document.getElementById("rzp-button2"); x.style.display = "none"; var amt = '<?php echo $amount; ?>'; var amount_pay = '<?php echo ((int)$amount*(int)100); ?>'; var orderid = '<?php echo $val['conference_id']; ?>'; var options = { "key": "rzp_live_s5Af1lyKMeMzZP", // Enter the Key ID generated from the Dashboard "amount": amount_pay, // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise "currency": "INR", "name": "Medusys", "description": "Medusys - Course", "image": "<?php echo base_url('public/assets/images/medusys.jpg');?>", "handler": function (response){ $.ajax({ type : "POST", url : '<?php echo base_url("Course-pay-gas")?>', data : {pay_id:orderid, amount:amt, transaction_id:response.razorpay_payment_id}, success:function(response){ response = jQuery.parseJSON(response); console.log(response.result); if(response.result==1){ window.location = '<?php echo base_url('/Attend-Course-gas?id='.$val['conference_id']); ?>'; } else toastr["error"](response.message); } }); }, "prefill": { "name": "<?php echo $fname; ?>", "email": "<?php echo $Email; ?>", "contact": "<?php echo $mobile; ?>" }, "notes": { soolegal_order_id: "<?php echo $merchant_order_id; ?>", }, "theme": { "color": "#3399cc" } }; var rzp1 = new Razorpay(options); var condition="<?php echo $val['full_course'];?>" if(condition!=0){ document.getElementById('rzp-button1').onclick = function(e){ rzp1.open(); e.preventDefault(); var conf_id = '<?php echo $val['conference_id']; ?>'; // alert(conf_id); $.ajax({ type : "POST", url : '<?php echo base_url("courseAttendUser-gas")?>?id='+conf_id, // data : formData, }); } } document.getElementById('rzp-button2').onclick = function(e){ // alert('hello') var sel_amount = parseFloat($('#sel_amount').val()); var sel_amount_pay = (parseFloat(sel_amount)*100); var orderid = $('#course_id').val(); var options1 = { "key": "rzp_live_s5Af1lyKMeMzZP", // Enter the Key ID generated from the Dashboard "amount": sel_amount_pay, // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise "currency": "INR", "name": "Medusys", "description": "Medusys - Course", "image": "<?php echo base_url('public/assets/images/medusys.jpg');?>", "handler": function (response){ $.ajax({ type : "POST", url : '<?php echo base_url("Course-Progarm-pay-gas")?>', data : {pay_id:orderid, amount:sel_amount, transaction_id:response.razorpay_payment_id}, success:function(response){ response = jQuery.parseJSON(response); if(response.result==1){ window.location = '<?php echo base_url('/Attend-Course-gas?id='.$val['conference_id']); ?>'; } else toastr["error"](response.message); } }); }, "prefill": { "name": "<?php echo $fname; ?>", "email": "<?php echo $Email; ?>", "contact": "<?php echo $mobile; ?>" }, "notes": { soolegal_order_id: "<?php echo $merchant_order_id; ?>", }, "theme": { "color": "#3399cc" } }; var rzp2 = new Razorpay(options1); rzp2.open(); e.preventDefault(); var conf_id = '<?php echo $val['conference_id']; ?>'; // alert(conf_id); $.ajax({ type : "POST", url : '<?php echo base_url("courseAttendUser-gas")?>?id='+conf_id, // data : formData, }); } // $('#rzp-button1').click(function(){ // // alert('hi'); // }); </script> <style type="text/css"> .payment{ font-family: 'Montserrat', sans-serif!important; } #modal-inner{ width: 500px!important; } #rzp-button1{ width:500px!important; } .ft{ color: #000; } </style> <?php echo view('includes/flow-footer'); ?>