Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <? $site_name="Course Registration" ?>
- <? include "header.php" ?>
- <? include "admin/__settings.php" ?>
- <?
- if(frmp("reg-submit")) {
- $id=frmp("course-id");
- $coursett_id=frmp("CalenderID");
- $group=frmp("group");
- set("cid", $id);
- set("group", $group);
- }
- if($id=='') { $id=get('cid'); }
- if($group=='') { $group=get('group'); }
- if($id!='') {
- $course=mfa(mq("SELECT * FROM course WHERE id=".$id." AND publish=1 AND post=1"));
- $location=mfa(mq("SELECT * FROM location WHERE id=".$course['loc_id']));
- $lo = mfa(mq("SELECT * FROM location l join course_timetable c WHERE c.cid =".$course['id']."
- AND l.id = c.lid AND c.id =".$coursett_id));
- if($lo['start_hour']){
- $str = pad($lo['start_hour'], 0, 4);
- $chunks = str_split($str, 2);
- $result = implode(':', $chunks);
- $st = $result." ". $lklist['time'][$lo["set1"]];
- }
- if($lo['end_hour']){
- $str = pad($lo['end_hour'], 0, 4);
- $chunks = str_split($str, 2);
- $r = implode(':', $chunks);
- $t = $r. " ".$lklist['time'][$lo["set2"]];
- }
- $zone = mfa(mq("SELECT t.offset FROM timezone t JOIN course_timetable c WHERE c.id =".$coursett_id."
- AND t.id = c.timeid" ));
- $nfiles = (frmp("itemCount")!='' ? frmp("itemCount") : $course['min3']);
- if($group!=0) {
- for ($i=1; $i < $nfiles; $i++) {
- $addPart.='
- <tr>
- <td><input type="text" size="20" name="pname[]" maxlength="50" value="'.$i.'"></td>
- <td><input type="text" size="20" name="pprofession[]" maxlength="50" value="'.$i.'"></td>
- <td><input type="text" size="20" name="pphone[]" maxlength="50" value="'.$i.'"></td>
- <td><input type="phone" size="30" name="pemail[]" maxlength="50" value="'.$i.'@mail.com"></td>
- </tr>
- ';
- }
- }
- ?>
- <div class="inner-head" style="background-image: url(<?=$refer_url?>/images/user/content/524201694023AMiTrainingExpert.com_Logo_New-2016.png);"><!-- CONTENT -->
- <div class="container">
- <h1 class="entry-title">Course Registration</h1>
- </div><!-- End container -->
- </div><!-- End Inner Page Head -->
- <section class="full-section contact contact-3 fadeInDown-animation"><!-- Start Content -->
- <div class="container">
- <div class="row">
- <div class="col-md-12"><!-- CONTENT -->
- <div class="contact-left">
- <br>
- <?
- require_once "notification.php";
- ?>
- <br>
- <div class="contact-form">
- <form name="register-form" action="register.php" method="post" id="register-form">
- <p>Required fields are marked <span class="color2">*</span></p>
- <div class="row">
- <div class="col-md-12">
- <label for="contact_name">Course Name<span class="color2">*</span></label>
- <div class="input">
- <input type="text" name="CourseName" id="CourseName" value="<?=$course['name']?>" size="50" tabindex="3" class="" disabled />
- </div>
- </div>
- <div class="col-md-12">
- <label for="contact_name">Training Programme Date: <span class="color2">*</span></label>
- <div class="input">
- <input type="text" name="TrainingDate" id="TrainingDate" value="<?=$lo['start_date']?> - <?=$lo['end_date']?>" size="50" tabindex="3" class="" disabled/>
- </div>
- </div>
- <div class="col-md-12">
- <label for="contact_name">Training Time: <span class="color2">*</span></label>
- <div class="input">
- <input type="text" name="TrainingTime" id="TrainingTime" value="<?=$st?> - <?=$t?> <?=$zone['offset']?>" size="50" tabindex="3" class="" disabled/>
- </div>
- </div>
- <div class="col-md-12">
- <label for="contact_name">Venue: <span class="color2">*</span></label>
- <div class="input">
- <input type="text" name="TrainingVenue" id="TrainingVenue" value="<?=$lo['name']?>" size="50" tabindex="3" class="" disabled/>
- </div>
- </div>
- <div class="col-md-12">
- <label for="contact_name">Country: </label>
- <div class="input">
- <input type="text" name="TrainingCountry" id="TrainingCountry" value="<?=$lklist['country'][$lo['country']]?>" size="50" tabindex="3" class="" disabled/>
- </div>
- </div>
- <div class="col-md-12">
- <label for="contact_email">Fee per pax (RM): <span class="color2">*</span></label>
- <div class="input">
- <input type="text" name="CourseFee" id="CourseFee" value="<?=$course['price1a']?>" size="50" tabindex="4" class="" disabled/>
- </div>
- </div>
- <div class="col-md-12">
- <label for="contact_url">Registration</label>
- <div class="input">
- <table border="0" width="100%" id="files" cellspacing="0" cellpadding="0" bordercolor="#CCCCCC">
- <tr>
- <td class="content"><strong>Participants Name<span class="color2">*</span></strong></td>
- <td class="content"><strong>Profession</strong></td>
- <td class="content"><strong>Contact No (Mobile)</strong><span class="color2">*</span></td>
- <td class="content"><strong>Email</strong><span class="color2">*</span></td>
- <td width="20%"> </td>
- </tr>
- <tr>
- <td><input type="text" size="20" name="pname[]" maxlength="50" value="<?=$name?>"></td>
- <td><input type="text" size="20" name="pprofession[]" maxlength="50" value="<?=$profession?>"></td>
- <td><input type="text" size="20" name="pphone[]" maxlength="50" value="<?=$phone?>"></td>
- <td><input type="email" size="30" name="pemail[]" maxlength="50" value="<?=$email?>"></td>
- </tr>
- <?=$addPart?>
- </table>
- <? if($group!=0) { ?>
- <!-- add more participants -->
- <input Type=Button Value="Add Participants" OnClick=return(Expand()) class="button">
- <!-- end add participant -->
- <? } ?>
- </div>
- </div>
- <div class="col-md-12">
- <label for="contact_subject">Company Name </label>
- <div class="input">
- <input type="text" name="cname" id="cname" value="<?=$cname?>" size="50" tabindex="6" />
- </div>
- </div>
- <div class="col-md-12">
- <label for="contact_subject">Company No. </label>
- <div class="input">
- <input type="text" name="cno" id="cno" value="<?=$cno?>" size="50" tabindex="6" />
- </div>
- </div>
- <div class="col-md-12">
- <label for="Address">Address </label>
- <div class="input">
- <input type="text" name="addr" id="addr" value="<?=$addr?>" size="50" tabindex="6" />
- </div>
- </div>
- <div class="col-md-12">
- <label for="City">City </label>
- <div class="input">
- <input type="text" name="city" id="city" value="<?=$city?>" size="50" tabindex="6" />
- </div>
- </div>
- <div class="col-md-12">
- <label for="State">State </label>
- <div class="input">
- <input type="text" name="state" id="state" value="<?=$state?>" size="50" tabindex="6" />
- </div>
- </div>
- <div class="col-md-12">
- <label for="State">Postcode</label>
- <div class="input">
- <input type="text" name="postcode" id="postcode" value="<?=$postcode?>" size="50" tabindex="6" />
- </div>
- </div>
- <div class="col-md-12">
- <label for="Country">Country <span class="color2">*</span></label>
- <div class="input">
- <select name="country" class="form_textfield">
- <?
- foreach ($lklist['country'] as $key => $value) {
- if ($country == $key){
- // define('PULL_DOWN_DEFAULT', 'Malaysia');
- // define('PULL_DOWN_DEFAULT_VALUE', '42');
- $selected = "selected";
- }
- else {
- $selected = "";
- }
- ?>
- <option value="<?=$key?>" <?=$selected?>><?=$value?></option>
- <? } ?>
- </select>
- </div>
- </div>
- <div class="cl"></div>
- <div class="col-md-12">
- <label for="Contact">Company Telephone. </label>
- <div class="input">
- <input type="text" name="cphone" id="cphone" value="<?=$cphone?>" size="50" tabindex="6" />
- </div>
- </div>
- <div class="cl"></div>
- <div class="col-md-12">
- <label for="Fax">Company Fax No. </label>
- <div class="input">
- <input type="text" name="fax" id="fax" value="<?=$fax?>" size="50" tabindex="6" />
- </div>
- </div>
- <div class="cl"></div>
- <div class="col-md-12">
- <label for="remark">Message </label>
- <div class="input">
- <textarea name="comment" id="comment" cols="106" rows="7" tabindex="7" ><?=$comment?></textarea>
- </div>
- </div>
- <div class="col-md-12">
- <label for="tnc">
- <input type="checkbox" name="check" id="tnc" value="Y"/> I confirm I have read and accepted the
- <a href="<?=$refer_url?>/Payment-Terms-and-Conditions/" target="_blank">Terms and Conditions</a> of this registration
- </label>
- <br>
- <br>
- <div class="input">
- <input type="submit" name="submit" id="register-submit" class="submit-input grad-btn ln-tr" value="NEXT">
- </div>
- </div>
- <input type="hidden" name="fn" value="register">
- <input type="hidden" name="itemCount">
- <input type="hidden" name="course_id" value="<?=$id?>">
- <input type="hidden" name="coursett_id" value="<?=$coursett_id?>">
- <div class="cl"></div>
- <div class="col-md-12">
- <div class="input">
- <div class="loading"></div>
- </div>
- </div>
- </div>
- </form><!-- end form tag -->
- </div><!-- end contact form -->
- </div><!-- End contact left -->
- </div><!-- end col-md-8 -->
- </div><!-- /CONTENT -->
- </div>
- </section><!-- end content -->
- <? } else { ?>
- <h3 class="h3-title text-center py-4"><a href="<?=$site_url?>course.php">No course selected.<br> Click here to go back.</a></h3>
- <? } ?>
- <? include "footer.php" ?>
- <script>
- //Expand form with a new File fields if needed.
- <? if($group==0) { ?>
- var nfiles = 1;
- <? } else { ?>
- var nfiles = <?= frmp("itemCount")!='' ? frmp("itemCount") : $course['min3']; ?>;
- <? } ?>
- function Expand(){
- nfiles++
- var adh = '<tr id="Participants[]">';
- adh = adh + '<td><input type="Text" size="20" name="pname[]" maxlength="50" value=""></td>';
- adh = adh + '<td><input type="Text" size="20" name="pprofession[]" maxlength="50" value=""></td>';
- adh = adh + '<td><input type="Text" size="20" name="pphone[]" maxlength="50" value=""></td>';
- adh = adh + '<td><input type="Text" size="30" name="pemail[]" maxlength="50" value=""></td><td><input type="button" onclick="removeitem('+nfiles+')" value="Delete"></td></tr>';
- files.insertAdjacentHTML('BeforeEnd',adh);
- return false;
- }
- function removeitem(value) {
- var filesNode = document.getElementById("files");
- var fileChild = document.getElementById("Participants" + value);
- var throwawayNode = filesNode.removeChild(fileChild );
- }
- </script>
- <script>
- // form on submit ============================================
- $(document).ready(function() {
- // if form submit event
- // get data from fields
- // call ajax
- var form = $("#register-form");
- var submit = $("input[name=submit]");
- form.on('submit', function(e) {
- e.preventDefault();
- $("input[name=itemCount]").val(nfiles);
- var data=form.serializeArray();
- custom_ajax(data);
- // debug ============================================
- // console.log(data);
- // end debug ========================================
- });
- });
- // end form on submit ========================================
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement