Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php include("site_config.php");include("../external-web/include/config.php");include($he..

Decoded Output download

<?php include("site_config.php");include("../external-web/include/config.php");include($header);?><?phpif(!empty($_SESSION['emsg'])){$msg = urldecode($_SESSION['emsg']);$_SESSION['emsg'] = "";}if(!empty($_GET['scid'])){$_SESSION['scid'] = $_GET['scid'];}if(!empty($_SESSION['scid'])){$scid = $_SESSION['scid'];$row_rsScheduledCourses = mysql_fetch_array(mysql_query("SELECT instructors.instructorname,   instructors.instructorlastname,  instructors.instructorphoto, locations.locationname,   locations.locationsid, locations.locationaddress,   locations.locationphone,   locations.locationaddress2,   locations.locationcity,   locations.locationstate,   locations.locationzip,  locations.lat, locations.corpid, locations.lng, coursetypes.coursetypename,   coursetypes.audience, coursetypes.comments, coursetypes.PaperBookName, coursetypes.PaperBookPrice, coursetypes.ElecBookName, coursetypes.ElecBookPrice, coursetypes.PaperBookDesc, coursetypes.ElecBookDesc,scheduledcourses.courseinstructor, scheduledcourses.parent_ts_id, training_sites.paypal_signature, scheduledcourses.coursetype,   scheduledcourses.coursedate,   scheduledcourses.coursetime,   scheduledcourses.onlinekey,   scheduledcourses.courseendtime,   scheduledcourses.coursenumberofseats, scheduledcourses.coursestatus,  scheduledcourses.coursecost,   scheduledcourses.notes,   scheduledcourses.scheduledcoursesid, scheduledcourses.OfferPaperBook, scheduledcourses.OfferElecBook,scheduledcourses.Papperbook_price,scheduledcourses.Elecbook_price,  certifications.certification_name, scheduledcourses.custom_products, scheduledcourses.agencyid, coursetypes.coursetypecert,instructors.instructor_profile,location_geolocations.lat,location_geolocations.lng,locations.locationphotos,locations.locationsid,scheduledcourses.sellkey,scheduledcourses.onlinekey,coursetypes.keyassoc FROM  scheduledcourses  INNER JOIN coursetypes ON (scheduledcourses.coursetype=coursetypes.coursetypesid)  INNER JOIN locations ON (scheduledcourses.courselocationid=locations.locationsid)  INNER JOIN instructors ON (scheduledcourses.courseinstructor=instructors.instructorsid) LEFT JOIN location_geolocations ON (location_geolocations.locationsid=locations.locationsid)  LEFT OUTER JOIN certifications ON (coursetypes.coursetypecert=certifications.id) LEFT JOIN training_sites ON (training_sites.tsid = scheduledcourses.parent_ts_id) WHERE scheduledcourses.scheduledcoursesid = $scid AND (scheduledcourses.coursestatus = 'scheduled' OR scheduledcourses.coursestatus = 'accepted' OR scheduledcourses.coursestatus = 'completed' OR scheduledcourses.coursestatus = 'closed')"));$_SESSION['cp'] = $row_rsScheduledCourses['coursecost'];$tt =  intval($row_rsScheduledCourses['coursecost']);}if(!empty($_SESSION['bk_id'])){$bk_id = $_SESSION['bk_id'];$bk_name = $_SESSION['bk_name'];$bk_amt = $_SESSION['bk_amt'];$tt = intval($_SESSION['cp']) + intval($_SESSION['bk_amt']);}if(!empty($_POST['bk_opt'])){$bk_chs = explode("-",$_POST['bk_opt']);$bk_id = $bk_chs[0];$bk_name = $bk_chs[2];$bk_amt = $bk_chs[1];$_SESSION['bk_id'] = $bk_chs[0];$_SESSION['bk_name'] = $bk_chs[2];$_SESSION['bk_amt'] = $bk_chs[1];$tt = intval($_SESSION['cp']) + intval($bk_amt);}if(!empty($_POST['on_key'])){$on_key = explode("-",$_POST['on_key']);$on_key_id = $on_key[0];$on_key_name = $on_key[2];$on_key_amt = $on_key[1];$_SESSION['on_key_id'] = $on_key[0];$_SESSION['on_key_name'] = $on_key[2];$_SESSION['on_key_amt'] = $on_key[1];$tt =  intval($_SESSION['cp']) + intval($on_key[1]);}if(!empty($_SESSION['on_key_amt'])){$on_key_id = $_SESSION['on_key_id'];$on_key_name = $_SESSION['on_key_name'];$on_key_amt = $_SESSION['on_key_amt'];$tt =  intval($_SESSION['cp']) + intval($on_key_amt);}if(!empty($_POST['ufname_edt'])){$sadd1 = $_POST['sadd1'];$sadd2 = $_POST['sadd2'];$scity = $_POST['scity'];$sstate = $_POST['sstate'];$szip = $_POST['szip'];$sphone = $_POST['sphone'];$smob = $_POST['smob'];$fn = $_POST['ufname_edt'];$ln = $_POST['ulname_edt'];$pwd = $_POST['pwd'];$se = $_POST['semail'];mysql_query("insert into students (studentsname,studentlastname,studentaddress,studentaddress2,studentcity,studentstate,studentzip,studentphone,studentmobilephone,studentpassword,studentemddress) values('$fn','$ln','$sadd1','$sadd2','$scity','$sstate','$szip','$sphone','$smob','$pwd','$se')");$stu_id = mysql_insert_id();}?><!-- BLOG HEADER --><section id="blog-header" data-stellar-background-ratio="0.5">  <div class="overlay"></div>  <div class="container">      <div class="row">                    <div class="col-md-offset-1 col-md-5 col-sm-12">                              <h2><?= $row_rsScheduledCourses['coursetypename'] ?></h2>                               <?= date("l, F d, Y",strtotime(  $row_rsScheduledCourses['coursedate'])).' '.date("g:i a",strtotime($row_rsScheduledCourses['coursetime'])).' - '.date("g:i a",strtotime($row_rsScheduledCourses['courseendtime'])); ?>                     </div>                                  </div>  </div></section><!-- BLOG DETAIL --><section id="blog-detail" data-stellar-background-ratio="0.5">  <div class="container">     <div class="row"><div class="col-md-offset-1 col-md-10 col-sm-12"><!-- Wrapper -->    <div class="wrapper">              <div class="container">            <?php if(!empty($msg)){ ?>            <div class="row">                    <div class="col-sm-12">                         <!-- Info Board Red -->                         <div class="info-board info-board-red" style="padding: 5px 30px 5px 15px;">                            <h6 style="font-weight:bold;"><?= $msg ?></h6>                                                                </div>                    </div>            </div>                   <?php } ?>        <?php $sid = $stu_id;$_SESSION['user_id'] = $sid;if(empty($_SESSION['user_id'])) {?><div class="row">          <div class="col-sm-12">            <h4>Student Information</h4><form method="post" action="course-registration.php" >               <table class="table">                           <tr>                            <td>Student First Name</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="ufname_edt" value="<?= $res_stu['studentsname'] ?>"  required="required"/></td>                                                                   </tr>                                                                            <tr>                        <td>Student Last Name</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="ulname_edt" value="<?= $res_stu['studentlastname'] ?>"  required="required"/></td>                                                                   </tr>                              <?php if($res_stu['studentemddress'] == ""){ ?>             <tr>                                             <td>Email Address</td>                                          <td>:</td>                                              <td><input type="text" class="form-control" value="" id="semail" name="semail"  onblur="chk_email(this);" required/>                                         <span id="chk-email-info" style="color:#FF0000"></span>                                              </td>                                   </tr>                           <?php } ?>                                                          <tr>                                             <td>Password</td>                                               <td>:</td>                                              <td><input type="text" class="form-control" value="" id="pwd" name="pwd"   required/>                                                                                                </td>                       </tr>                                                                                    <tr>                                            <td>Address 1</td>                                  <td>:</td>                                               <td><input type="text" class="form-control" value="" name="sadd1" required/></td>                                       </tr>       <tr>                                             <td>Address 2</td>                                              <td>:</td>                                              <td><input type="text" class="form-control" value="" name="sadd2" /></td>                                    </tr>                                                                           <tr>                <td>City</td>                                            <td>:</td>                                              <td><input type="text" class="form-control" value="" name="scity" required/></td>                                    </tr>                                                                           <tr>                                            <td>State</td>      <td>:</td>                                               <td><select name="sstate" class="form-control" required>                                          <option value="" disabled selected>State</option>                                          <option value="AK">Alaska</option>                                              <option value="AL">Alabama</option>                 <option value="AR">Arkansas</option>                                             <option value="AZ">Arizona</option>                                             <option value="CA">California</option>                                               <option value="CO">Colorado</option>                                            <option value="CT">Connecticut</option>             <option value="DC">District of Columbia</option>                                         <option value="DE">Delaware</option>                                            <option value="FL">Florida</option>                                          <option value="GA">Georgia</option>                                             <option value="HI">Hawaii</option>                  <option value="IA">Iowa</option>                                         <option value="ID">Idaho</option>                                               <option value="IL">Illinois</option><option value="IN">Indiana</option>                                              <option value="KS">Kansas</option>                                              <option value="KY">Kentucky</option>                                         <option value="LA">Louisiana</option>                                           <option value="MA">Massachusetts</option>                   <option value="MD">Maryland</option>                                             <option value="ME">Maine</option>                                               <option value="MI">Michigan</option>                                         <option value="MN">Minnesota</option>                                           <option value="MO">Missouri</option>                        <option value="MS">Mississippi</option>                                          <option value="MT">Montana</option>                                             <option value="NC">North Carolina</option>                                           <option value="ND">North Dakota</option>                                                <option value="NE">Nebraska</option>        <option value="NH">New Hampshire</option>                                                <option value="NJ">New Jersey</option>                                          <option value="NM">New Mexico</option>                                               <option value="NV">Nevada</option>                                              <option value="NY">New York</option>        <option value="OH">Ohio</option>                                         <option value="OK">Oklahoma</option>                                            <option value="OR">Oregon</option>  <option value="PA">Pennsylvania</option>                                         <option value="PR">Puerto Rico</option>                                         <option value="RI">Rhode Island</option>                                             <option value="SC">South Carolina</option>                                              <option value="SD">South Dakota</option>    <option value="TN">Tennessee</option>                                            <option value="TX">Texas</option>                                               <option value="UT">Utah</option>                                             <option value="VA">Virginia</option>                                            <option value="VT">Vermont</option>                         <option value="WA">Washington</option>                                           <option value="WI">Wisconsin</option>                                           <option value="WV">West Virginia</option>                                            <option value="WY">Wyoming</option>                                       </select></td>                                        </tr><tr>                                            <td>ZIP</td>                                            <td>:</td>                                              <td><input type="text" class="form-control" value="" name="szip" required/></td>                                     </tr>                                                                                   <tr>        <td>Phone</td>                                           <td>:</td>                                              <td><input type="text" class="form-control" value="" name="sphone" id="sphone" /></td>                                       </tr>                                                                           <tr>                                            <td>Mobile</td>                                              <td>:</td>                                              <td><input type="text" class="form-control" value="" name="smob" id="smob" /></td>  </tr>                                                                            <tr>                                            <td colspan="3" align="right"><input type="submit" class="btn btn-red" value="Continue" /></td>                                      </tr>                   </table>                </form>          </div>        </div><?php } else {  $get_stu_sql = "select * from students where studentsid='$sid'";$res_stu = mysql_fetch_assoc(mysql_query($get_stu_sql));$_SESSION['ufname'] = $res_stu['studentsname'];$_SESSION['ulname'] = $res_stu['studentlastname'];$_SESSION['sfname'] = $res_stu['studentsname'];$_SESSION['slname'] = $res_stu['studentlastname'];$_SESSION['semail'] = $res_stu['studentemddress'];$_SESSION['sadd1'] = $res_stu['studentaddress'];$_SESSION['sadd2'] = $res_stu['studentaddress2'];$_SESSION['scity'] = $res_stu['studentcity'];$_SESSION['sstate'] = $res_stu['studentstate'];$_SESSION['szip'] = $res_stu['studentzip'];$uemail = $res_stu['studentemddress'];$uname = $res_stu['studentsname'];$ufullname = $res_stu['studentsname']." ".$res_stu['studentlastname'];$uphone = $res_stu['studentphone'];$uaddr = $res_stu['studentcity']." ".$res_stu['studentstate']." ".$res_stu['studentzip'];                      if(!empty($_POST['creg_ids'])){                                 $c_ids = $_POST['creg_ids'];                 $upm_stu_sql = "update courseregistrations set registrationstatus= 'registered' where courseregistrationsid in($c_ids)";                        mysql_query($upm_stu_sql);                   echo"<script>window.location = 'thank-you.php';</script>";              }                       else if(!empty($_SESSION['scid'])){                     $cid = $_SESSION['scid'];                    $sid = $_SESSION['user_id'];                                            $chk_reg = mysql_fetch_assoc(mysql_query("select scheduledid,courseregistrationsid from courseregistrations where scheduledid = '$cid' and studentid = '$sid' and paymentstatus ='paid'"));                  if(!empty($chk_reg['scheduledid'])){                        $_SESSION['scid'] ='';                           echo"<script>window.location = 'dashboard.php?msg=areg';</script>";                             exit;                   }                   $chk_reg = mysql_fetch_assoc(mysql_query("select scheduledid,courseregistrationsid from courseregistrations where scheduledid = '$cid' and studentid = '$sid' and paymentstatus =''"));      if(empty($chk_reg['scheduledid'])){                              if($_SESSION['bk_id'] == 2){                                    $pbk = 1;                                       }           else if($_SESSION['bk_id'] == 3){                                        $ebk = 1;                               }                                                               if(!empty($_SESSION['scid'])){                               if($_SESSION['cp'] > 0)                         $st_reg = 'registered';                         else                            $st_reg = 'registered';                                                              $cus_products = "";                                                             if(!empty($_POST['cus_products'])){ $cus_products = implode(",",$_POST['cus_products']);                             }                                                               $_SESSION['cus_products'] = $cus_products;  $ins_stu_sql = "insert into courseregistrations (scheduledid,studentid,registrationstatus,paymentstatus,registeredby,PaidBook,PaidElecBook,custom_products) values('$cid','$sid','$st_reg','','selfregister','$pbk','$ebk','$cus_products')";                         mysql_query($ins_stu_sql);                                                                                          $_SESSION['rcid'] = mysql_insert_id();                                                           }                       }                       else{                           $_SESSION['rcid'] = $chk_reg['courseregistrationsid'];                       }                                       }                                ?><?php  $sc_id = $_SESSION['scid'];$query_rsScheduledCourses = "SELECT instructors.instructorname,   instructors.instructorlastname,  instructors.instructorphoto, locations.locationname,   locations.locationsid, locations.locationaddress,   locations.locationphone,   locations.locationaddress2,   locations.locationcity,   locations.locationstate,   locations.locationzip,  locations.lat, locations.lng, coursetypes.coursetypename,   coursetypes.audience, coursetypes.comments, coursetypes.PaperBookName, coursetypes.PaperBookPrice, coursetypes.ElecBookName, coursetypes.ElecBookPrice, coursetypes.PaperBookDesc, coursetypes.ElecBookDesc,scheduledcourses.courseinstructor,scheduledcourses.coursetype,   scheduledcourses.coursedate,   scheduledcourses.coursetime,   scheduledcourses.onlinekey,   scheduledcourses.courseendtime,   scheduledcourses.coursenumberofseats, scheduledcourses.coursestatus,  scheduledcourses.coursecost,   scheduledcourses.notes,   scheduledcourses.scheduledcoursesid, scheduledcourses.OfferPaperBook, scheduledcourses.OfferElecBook,scheduledcourses.Papperbook_price,scheduledcourses.Elecbook_price,  certifications.certification_name,   coursetypes.coursetypecert,instructors.instructor_profile,location_geolocations.lat,location_geolocations.lng,locations.locationphotos,locations.locationsid,scheduledcourses.sellkey,scheduledcourses.onlinekey,coursetypes.keyassoc FROM  scheduledcourses  INNER JOIN coursetypes ON (scheduledcourses.coursetype=coursetypes.coursetypesid)  INNER JOIN locations ON (scheduledcourses.courselocationid=locations.locationsid)  INNER JOIN instructors ON (scheduledcourses.courseinstructor=instructors.instructorsid) LEFT JOIN location_geolocations ON (location_geolocations.locationsid=locations.locationsid)  LEFT OUTER JOIN certifications ON (coursetypes.coursetypecert=certifications.id) WHERE scheduledcourses.scheduledcoursesid = $sc_id AND (scheduledcourses.coursestatus = 'scheduled' OR scheduledcourses.coursestatus = 'accepted' OR scheduledcourses.coursestatus = 'completed' OR scheduledcourses.coursestatus = 'closed')";$rsScheduledCourses = mysql_query($query_rsScheduledCourses, $db) or die(mysql_error());$row_rsScheduledCourses = mysql_fetch_assoc($rsScheduledCourses);$custate = $row_rsScheduledCourses['locationstate'];?><div class="row"><?php if($_SESSION['cp'] == 0){ ?>                                <div class="col-sm-12">                                                         <table class="table" id="stu_info" style="white-space:nowrap">                                       <tr>                                    <th>Student:</th><th>Class#</th><th>Location Name</th><th>Date</th><th>City</th><th>State</th>      </tr>                                    <tr>                                            <td><?= $res_stu['studentsname']." ".$res_stu['studentlastname'] ?></td>                            <td><?= $_SESSION['scid'] ?></td>                                                                                                <td><?= $row_rsScheduledCourses['locationname'] ?></td>     <td><?= $_SESSION['stime'] ?></td>                                                                                                                               <td><?= $row_rsScheduledCourses['locationcity'] ?></td>                                                                                              <td><?= $row_rsScheduledCourses['locationstate'] ?></td>            </tr>                            </table>                                        <!--<a href="#add-student" class="fancybox btn btn-red">Add Student</a> <span id="load-info"></span>-->     <div class="row" style="display:none">                           <div class="col-sm-12"><p align="right" style="font-weight:bold"> Total : <span id="tt">$<?= $tt ?></span></p></div>        </div>                   </div><?php } else { ?>         <div class="col-sm-12">                                                         <table class="table" id="stu_info" style="white-space:nowrap">                                       <tr><?php if(empty($row_rsScheduledCourses['onlinekey']) ||  $row_rsScheduledCourses['onlinekey'] == "No" || $row_rsScheduledCourses['onlinekey'] == 0 ){ $adt =  "Book";} else { $adt =  "Online Key";} ?>                                  <!--<th>Student</th><th>Class#</th><th>Date</th><th>Class Fee</th><th>Purchase <?= $adt ?></th><th>Products</th><th>Total</th>-->                                                                            <th>Student</th><th>Class#</th><th>Date</th><th>Class Fee</th><th>Total</th></tr>                                    <tr>                                            <td><?= $res_stu['studentsname']." ".$res_stu['studentlastname'] ?></td>                            <td><?= $_SESSION['scid'] ?><input type="hidden" id="<?= $_SESSION['rcid']?>_sid" value="<?= $sid ?>" /></td>                                            <td><?= $_SESSION['stime'] ?></td>  <td id="<?= $_SESSION['rcid'] ?>_cp">$<?= $_SESSION['cp'] ?> </td>                                                                                               <?php /*?><td id="<?= $_SESSION['rcid']?>_bp"><?php if(!empty($_SESSION['bk_amt'])){ echo "$"+$_SESSION['bk_amt']; }  else if(!empty($_SESSION['on_key_amt'])){ echo "$"+$_SESSION['on_key_amt']; } else { echo "<a href='#add-key-bk' onclick='return add_id(".$_SESSION['rcid'].")' class='fancybox btn btn-red' style='padding:2px !important'>Add ".$adt."</a>"; } ?></td>                                        <td id="<?= $_SESSION['rcid']?>_pro">                                            <?php                                           if(!empty($_POST['cus_products'])){                         $cus_pros = implode(",",$_POST['cus_products']);                                         $_SESSION['cus_pros'] = $cus_pros;                                                                  $getproductsqry = mysql_query("select * from training_sites_products where product_id in($cus_pros)");                                           while($get_product = mysql_fetch_array($getproductsqry)){                                                    $tt = intval($tt) + intval($get_product['product_fee']);                                                        echo $get_product['product_name'].' - <b>$'.$get_product['product_fee'].'</b><br/>';                                         }                                               }                           else{                                                    echo '<a style="padding:2px !important" class="fancybox btn btn-red" onclick="return add_id('.$_SESSION['rcid'].')" href="#add-product">Add Product</a>';                                            }                                               ?>                                              </td><?php */?>             <td><span id="<?= $_SESSION['rcid']?>_tt">$<?= $tt ?></span></td>                                        </tr>                                                           </table>            <!--<a href="#add-student" class="fancybox btn btn-red">Add Student</a> <span id="load-info"></span>-->                                                          <div class="row">           <div class="col-sm-12">                                                          <?php                           $sc_id2 = $_SESSION['scid'];                            $get_codes = mysql_fetch_array(mysql_query("select discount_codes from scheduledcourses where scheduledcoursesid='$sc_id2'"));                               if(!empty($get_codes['discount_codes'])){           ?>                               <div style="width:320px; float:right"><span style="float:left; padding-top:8px; font-weight:bold">Coupon Code :&nbsp;&nbsp;</span><span style="float:left" id="coupon_add_opt"><input class="form-control" style="width:200px;border-radius:20px" type="text" value="" name="ccode" id="ccode" onBlur="chk_ccode(this);"/></span><br/><span id="chk-ccode-info" style="color:#FF0000; float:left"></span></div>                           <?php } ?>                              <div style="clear:both; font-weight:bold; font-size:14px" align="right"> Total : <span id="tt">$<?= $tt ?></span></div></div>                                </div>                  </div><?php } ?>                </div>                  <div class="row">             <div class="col-sm-12">                <?php if($_SESSION['cp'] == 0){ ?><form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">                             <input type="hidden" value="<?= $sid ?>" name="stu_ids" id="stu_ids" />                              <input type="hidden" value="<?= $_SESSION['rcid'] ?>" name="creg_ids" id="creg_ids" />                      <input type="hidden" value="<?= $tt ?>" id="h_tt" name="h_tt" />                                                                                 <div align="right"><input class="btn btn-red" type="submit" value="Continue" /></div>                                </form><?php } else { ?><?php   $dis_code = $_POST['ccode'];    $dic_desc = ""; $getpcodes = mysql_fetch_array(mysql_query("select discountamount,amounttype,discountdescription from discountcodes where discountcode ='$dis_code'"));      if(!empty($getpcodes['discountamount'])){               if($getpcodes['amounttype'] == 'dollars'){                   $tt = floatval($tt) - floatval($getpcodes['discountamount']);           }               else{                                           $percentage = $getpcodes['discountamount'];                                                                  $disamt = ($percentage / 100) * $tt;                    $tt = floatval($tt) - floatval($disamt);             }       $dic_desc = $getpcodes['discountdescription'];          }       ?><form method="post" action="paypal_new/paypal_pro_custom_new.php" id="paypost" onSubmit="sh();" >                          <input type="hidden" value="<?= $sid ?>" name="stu_ids" id="stu_ids" />                         <input type="hidden" value="<?= $_SESSION['rcid'] ?>" name="creg_ids" id="creg_ids" />                               <input type="hidden" value="<?= $tt ?>" id="h_tt" name="h_tt" />                                <input type="hidden" value="<?= $_SESSION['cp'] ?>" id="class_fee" />                                <input type="hidden" id="dis_code_cart" name="dis_code_cart"/>                          <input type="hidden" id="dis_code_amt" name="dis_code_amt" />                <table class="table">                                                                                                           <tr>                         <td>Name on Card</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="uname_edt" value="<?= $res_stu['studentsname']." ".$res_stu['studentlastname'] ?>"  required="required"/></td>                                                                   </tr>                    <tr>                      <td>Credit Card Type</td>                        <td>:</td>                        <td>                                              <table>                                         <tr>                <td width="50%">                                 <select name="customer_credit_card_type" class="form-control">                                  <option value="visa">Visa</option>                                <option value="mastercard">Master Card</option>                                <option value="discocer">Discover</option>                                <option value="amex">American Express</option>                            </select>                                                                                                    </td>               <td width="50%">                                         </td>                                           </tr>                                           </table>                        </td>                                                                    </tr>                                                                                                   <tr>                     <td>Credit Card #</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="customer_credit_card_number" value="" id="customer_credit_card_number"  required="required"/></td>                                                                   </tr>                 <tr>                            <td>Expiration Month</td>                        <td>:</td>                        <td>                              <select name="cc_expiration_month" style="width: 95px;" class="form-control">                                                                        <option value="1">1</option>                                                                    <option value="2">2</option>                                                                 <option value="3">3</option>                                                                    <option value="4">4</option>                                                                 <option value="5">5</option>                                                                    <option value="6">6</option>                                                                 <option value="7">7</option>                                                                    <option value="8">8</option>                                                                 <option value="9">9</option>                                                                    <option value="10">10</option>                                                                       <option value="11">11</option>                                                                  <option value="12">12</option>                                                            </select>                        </td>                                           </tr>                                         <tr>                     <td>Expiration Year</td>                        <td>:</td>                        <td>                            <select class="form-control" name="cc_expiration_year" style="width: 95px;">                                                                                                                                                                   <?php    $starting_year  =date('Y');                                                                                                                      $ending_year = date('Y', strtotime('+10 year'));                                                                                                                     for($starting_year; $starting_year <= $ending_year; $starting_year++) {                                                                                                                              echo '<option value="'.$starting_year.'"';          echo ' >'.$starting_year.'</option>';                                                                                                                    }                                    ?>                                                                                                                                                                                                                                                              </select>                        </td>                                           </tr>                                  <tr>                     <td>Billing Zip Code</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="zip_edt" value="<?= $res_stu['studentzip'] ?>"  required="required" style="width: 95px;"/></td>                                            </tr>                        <tr>                            <td>Card Verification #</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="cc_cvv2_number" value=""  required="required" style="width: 95px;"/></td>                                            </tr>                                                                                <tr style="display:none">                                   <td>Price </td>                        <td>:</td>                        <td>                                                                            <label id="chk_tt">$<?= $tt ?></label>                        </td>                                  </tr>                    <tr>                        <td align="center" colspan="3">                                        Terms & Conditions<br/><br/>                             <div class="tarea">                             <h5 align="center" style="font:font-size: 15px;"><b>PLEASE NOTE ALL ONLINE KEY SALES ARE FINAL </b></h5><p><h6><b>Schedule / Reschedule/Cancellation Policy:</b></h6></p><p>When a student schedules a class and the class is confirmed at a particular date, and time, the seat is fully reserved for that student and is not available to others.</p> <p>The following reschedule / cancelation policies are for classes held at all our Training Facilities:</p><p style="padding-left:20px;">A. Classes that are scheduled and confirmed must be rescheduled at least 48-hours prior to the scheduled start time of the class to allow us time to try to rebook the class seat for another student. The class registration fee is due in full to hold a seat in the requested class.We ONLY accept Visa, MasterCard, American Express, Discover and PayPal payments.<b>Once Payment is made NO Refunds are allowed.</b></p><p style="padding-left:20px;">B. If the student wishes to reschedule he may do so with no additional fees. Note student can only reschedule one time based on one payment. </p><p style="padding-left:20px;">C. <b>If we cancel the class due to sickness, error or Act of God, full refund will be given to student and given the chance to come take the class for free at our expense.</b></p><h6><b>Hold Harmless:</b></h6><p style="padding-left:20px;">A.Due to the physical nature of the training classes that we provide, all participants that take part in a class offered by Always CPR Training Center LLC must agree &sign a Release and Hold Harmless Agreement before they will be allowed to participate in the class.</p><p style="padding-left:20px;">B.If the participant is under the age of 18 a parent or guardian must also sign the release before the participant will be allowed to participate in the class.</p><h6><b>Certification Cards:</b></h6><p>1.      American Heart Association course completion cards are delivered to the student at the end of the class. AHA Digital certification cards are normally processed and delivered via email the same day as the completion of the class.</p><p>2.        If a print certification card is shipped to the student via US Postal Service First Class Mail it will be mailed at no cost to the student. Always CPR Training Center LLC shall not be responsible for the certification card(s) once it has been delivered to the Post Office for mailing.</p><p>3.     If you happen to lose your printed certification card, replacement print cards for classes taught by Always CPR Training Center LLC can be ordered for a <b>Lost Certification Card Replacement Fee</b> of $10.00.Replacement print cards will take approximately one business day for us to process once the replacement fee invoice has been paid.</p></div><!--<label style="color:#FFFFFF">hid<input class="form-control" type="checkbox" id="acpt" required="required" name="acpt"/></label>                         <p> I have read and accept all terms & conditions</p>-->                   <p>I have read and accept all terms & conditions</p>                                      <input class="btn btn-success" id="pay_btn" type="submit" name="submit" value="Pay Now"  required="required"/>                        </td>                    </tr>                                                         </table>                </form><?php } ?>          </div>        </div> <!-- / .row -->                              <?php } ?>      </div> <!-- / .container -->    </div> <!-- / .wrapper --><?php include("includes_new/footer.php"); ?>   <style type="text/css">div.tarea {  border: 1px inset #ccc;  background-color: #f4f4f4;  font: small courier, monospace black;  height:150px;  overflow:auto;  padding-left:10px;    text-align:left;}</style><script>function sh(){   $('#pay_btn').removeClass("btn btn-blue");        $('#pay_btn').addClass("btn btn-red");  $('#pay_btn').val("Processing, One Moment Please");  $('#pay_btn').attr("disabled", true);           $('#pay_btn').submit();}function chk_email(v){  $('#chk-email-info').html("");  $.ajax({                      url: 'checkEmail.php',                   type: 'post',                   cache: false,                   data: {"email":v.value},                        success: function (data) {          if(data == "false"){                                   $('#semail').val('');                                   $('#chk-email-info').html("Email Address Already Exists <a style='font-weight:bold' href='login-new.php'>Click Here to Sign In</a>");                                 }                        }               });}function get_email(v){    $('#mul_add_stu_btn').prop("disabled", true);                $('#get-email-info').html("");  $('#sfname').val('');   $('#slname').val('');   $('#smob').val('');     $('#sphone').val('');   if(v.value !=""){       $.ajax({                       url: 'getEmail.php',                    type: 'post',                   cache: false,                   data: {"email":v.value},                        success: function (data) {                          if(data != "false"){                                   data = data.split("###");                                       //$('#get-email-info').html("Email already exists, would you like to add "+data[0]+" "+data[1]+" to class?&nbsp;&nbsp; <a style='font-weight:bold' href='javascript:void(0);' onclick='add_info(\""+data[0]+"\",\""+data[1]+"\",\""+data[2]+"\",\""+data[3]+"\");'>CLICK TO ADD</a><br>");                                        $('#get-email-info').html("Email already exists,<br/>Please use a different email id or Leave empty.<br/>");                                 $("#semail").val("");                                                                    }                              $('#mul_add_stu_btn').prop("disabled", false);                         }               });   }}function add_info(f,l,m,p){   $('#sfname').val(f);    $('#slname').val(l);    $('#smob').val(m);      $('#sphone').val(p);}</script><script src="js_new/jquery.mask.js"></script><script>$("#sphone").mask("999-999-9999");$("#sphone").on("blur", function() {    var last = $(this).val().substr( $(this).val().indexOf("-") + 1 );    if( last.length == 3 ) {        var move = $(this).val().substr( $(this).val().indexOf("-") - 1, 1 );        var lastfour = move + last;        var first = $(this).val().substr( 0, 9 );        $(this).val( first + '-' + lastfour );    }});$("#smob").mask("999-999-9999");$("#smob").on("blur", function() {    var last = $(this).val().substr( $(this).val().indexOf("-") + 1 );    if( last.length == 3 ) {        var move = $(this).val().substr( $(this).val().indexOf("-") - 1, 1 );        var lastfour = move + last;        var first = $(this).val().substr( 0, 9 );        $(this).val( first + '-' + lastfour );    }});</script><!-- Add fancyBox main JS and CSS files --><script type="text/javascript" src="js_new/jquery.fancybox.js?v=2.1.5"></script><link rel="stylesheet" type="text/css" href="css_new/jquery.fancybox.css?v=2.1.5" media="screen" /><script type="text/javascript">$(document).ready(function() { $(".fancybox").fancybox({        'beforeLoad': function(){                       $.ajax({                                          url: 'chk-registration.php',                                type: 'post',                                    cache: false,                                   data: {"scid":"<?= $_SESSION['scid']; ?>"},                                     success: function (data) {                                 $('#show-reg-form').hide();                                     $('#no_class').hide();                                  if(data == 0)       $('#no_class').show();                                   else                                            $('#show-reg-form').show();                                                           }                                });   },      'afterClose': function() {              $('#stu_add_form')[0].reset();          $('#get-email-info').html("");  }});    });</script>    <script type="text/javascript">function add_student(){var isValid = true;$('#sfname,#slname,#sphone').each(function() {      if ($.trim($(this).val()) == '') {              isValid = false;    $(this).css({                    "border": "1px solid red",                      "background": "#FFCECE"         });     }       else {          $(this).css({                   "border": "","background": ""                });     }});if (isValid == true){       $('#load-info').html('<img src="img_new/ajax-loader.gif"> Please wait...');     var a_amt = "$0";               var bn = "";         var t_tot = "";                 semail = $('#semail').val();    scid = "<?= $_SESSION['scid'] ?>";      fname = $('#sfname').val();     lname = $('#slname').val();     smob  = $('#smob').val();                    sphone = $('#sphone').val();                    sstate = $('#sstate').val();            t_tot = parseInt($('#p_tot').val());            c_fee = parseInt($("#class_fee").val()) + parseInt("<?= $_SESSION['cp'] ?>");                        data = {"semail":semail,"scid":scid,"fname":fname,"lname":lname,"smob":smob,"sphone":sphone,"sstate":sstate};                c_tot = parseInt($('#h_tt').val()) + parseInt(t_tot);                           $('#h_tt').val(c_tot);  $('#tt').html("$"+c_tot);       $('#chk_tt').html("$"+c_tot);parent.jQuery.fancybox.close();                 $.ajax({                          url: 'send_reg_email.php',                      type: 'post',                   cache: false,               data: data,                      success: function (data) {                            data = data.trim();                             data = data.split("-");                         tmp_creg_ids = $('#creg_ids').val() + "," + data[1];                                 $('#creg_ids').val(tmp_creg_ids);                                                               tmp_stu_ids = $('#stu_ids').val() + "," + data[0];                           $('#stu_ids').val(tmp_stu_ids);                                                         $('#stu_info').append('<tr><td>'+fname+' ' +lname+'</td><td><?= $_SESSION['scid'] ?><input type="hidden" id="'+data[1]+'_sid" value="'+data[0]+'" /></td><td><?= $_SESSION['stime'] ?></td><td>$<?= $_SESSION['cp'] ?></td><td id="'+data[1]+'_bp"><a style="padding:2px !important" class="fancybox btn btn-red" onclick="return add_id('+data[1]+')" href="#add-key-bk">Add <?= $adt ?></a></td><td id="'+data[1]+'_pro"><a style="padding:2px !important" class="fancybox btn btn-red" onclick="return add_id('+data[1]+')" href="#add-product">Add Product</a></td><td><span id="'+data[1]+'_tt">$'+t_tot+'</span>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="delrow(this,\''+t_tot+'\',\''+data[0]+'\',\''+data[1]+'\');">Remove</a></td></tr>');                                                           $("#class_fee").val(c_fee);                                                        }               });                                   $('#stu_add_form')[0].reset();  $('#load-info').html('');            }}function add_student_free(){var isValid = true;$('#sfname,#slname,#sphone').each(function() { if ($.trim($(this).val()) == '') {              isValid = false;            $(this).css({                    "border": "1px solid red",                      "background": "#FFCECE"         });     }       else {          $(this).css({                   "border": "","background": ""                });     }});if (isValid == true){       $('#load-info').html('<img src="img_new/ajax-loader.gif"> Please wait...');     var ln = '<?= $row_rsScheduledCourses['locationname'] ?>';           var st = '<?= $row_rsScheduledCourses['locationstate'] ?>';             var ct = '<?= $row_rsScheduledCourses['locationcity'] ?>';              var bn = "";var t_tot = "";                  semail = $('#semail').val();    scid = "<?= $_SESSION['scid'] ?>";      fname = $('#sfname').val();     lname = $('#slname').val();     smob  = $('#smob').val();                    sphone = $('#sphone').val();            sstate = $('#sstate').val();                    t_tot = parseInt($('#p_tot').val());            data = {"semail":semail,"scid":scid,"fname":fname,"lname":lname,"smob":smob,"sphone":sphone,"sstate":sstate};        c_tot = parseInt($('#h_tt').val()) + parseInt(t_tot);                                           $('#h_tt').val(c_tot);       $('#tt').html("$"+c_tot);       $('#chk_tt').html("$"+c_tot);   parent.jQuery.fancybox.close();                 $.ajax({                          url: 'send_reg_email.php',                   type: 'post',                   cache: false,                   data: data,                     success: function (data) {                            data = data.trim();                          data = data.split("-");                         tmp_creg_ids = $('#creg_ids').val() + "," + data[1];                            $('#creg_ids').val(tmp_creg_ids);                                                            tmp_stu_ids = $('#stu_ids').val() + "," + data[0];                              $('#stu_ids').val(tmp_stu_ids);             $('#stu_info').append('<tr><td>'+fname+' ' +lname+'</td><td><?= $_SESSION['scid'] ?></td><td>'+ln+'</td><td><?= $_SESSION['stime'] ?></td><td>'+ct+'</td><td>'+st+'&nbsp;&nbsp;<a href="javascript:void(0);" onclick="delrow(this,\''+t_tot+'\',\''+data[0]+'\',\''+data[1]+'\');">Remove</a></td></tr>');                                                              }               });                        $('#stu_add_form')[0].reset();  $('#load-info').html('');}      }function isInt(value) {  var x = parseFloat(value);  return !isNaN(value) && (x | 0) === x;}function delrow(t,a,i,c) {      c_tot = parseInt($('#h_tt').val()) - parseInt(a);               fld2 = "#"+c+"_bp";     bp = parseInt($(fld2).html().substring(1));     if(isInt(bp)){  c_tot = parseInt(c_tot) - bp;        }               $(t).parent().closest('tr').remove();           tmp_stu_ids  = $('#stu_ids').val();             tmp_stu_ids = tmp_stu_ids.replace(","+i,"");        $('#stu_ids').val(tmp_stu_ids);          tmp_creg_ids  = $('#creg_ids').val();           tmp_creg_ids  = tmp_creg_ids.replace(","+c,"");                 $('#creg_ids').val(tmp_creg_ids);   $('#h_tt').val(c_tot);   $('#tt').html("$"+c_tot);       $('#chk_tt').html("$"+c_tot);           $.ajax({                          url: 'del-registration.php',                    type: 'post',                        cache: false,                   data: {"creg_id":c},                    success: function (data) {                      }               });}function add_id(i){$('#tmp_cregid').val(i);}function add_product_cart(){       cid = $('#tmp_cregid').val();   sfld = "#"+$('#tmp_cregid').val()+"_sid";       sid = $(sfld).val();            fld = "#"+$('#tmp_cregid').val()+"_tt";      fld2 = "#"+$('#tmp_cregid').val()+"_pro";               cus_pro = $('.cusproducts:checked').map(function() {return this.value;}).get().join(',');       data = {"cregid":cid,"sid":sid,"cus_pro":cus_pro};           $.ajax({                                  url: 'purchase_product.php',                    type: 'post',                   cache: false,       data:data,                       success: function (data) {                            if(data == false){                                      alert("Unable to add");                     }else{                                   var ret = data.split("####");                                                                           c_tot = parseInt($('#h_tt').val()) + parseInt(ret[0]);                                       $('#h_tt').val(c_tot);                                                                  $('#tt').html("$"+c_tot);                           $('#chk_tt').html("$"+c_tot);                                                                                    t_tot = parseInt($(fld).html().substring(1)) + parseInt(ret[0]);            $(fld).html("$"+t_tot);                                  $(fld2).html(ret[1]);                           }                                                                                   }                  });   parent.jQuery.fancybox.close();   }function add_bk_key(){cid = $('#tmp_cregid').val();sfld = "#"+$('#tmp_cregid').val()+"_sid";sid = $(sfld).val();if($("#bk_opt").length){                  var bp = $('#bk_opt').val();                            bp_ar = bp.split("-");                          fld = "#"+$('#tmp_cregid').val()+"_tt";         fld2 = "#"+$('#tmp_cregid').val()+"_bp";                             t_tot = parseInt($(fld).html().substring(1)) + parseInt(bp_ar[1]);                      a_amt = parseInt(bp_ar[1]);                 pr = bp_ar[1];                           bn = bp_ar[2];                          $(fld).html("$"+t_tot);         $(fld2).html("$"+a_amt);                                data = {"cregid":cid,"sid":sid,"bk_id":bp_ar[0],"bamt":a_amt,"bn":bn};                       }else if($("#on_key").length){                          var okey = $('#on_key').val();                          okey = okey.split("-");                              fld = "#"+$('#tmp_cregid').val()+"_tt";         fld2 = "#"+$('#tmp_cregid').val()+"_bp";                                                t_tot = parseInt($(fld).html().substring(1)) + parseInt(okey[1]);                    a_amt = "$"+parseInt(okey[1]);                                  pr = okey[1];                           onk = okey[2];                               $(fld).html("$"+t_tot);         $(fld2).html(a_amt);                            data = {"cregid":cid,"sid":sid,"on_kid":okey[0],"on_kamt":okey[1],"on_kname":okey[2]};                       }                       c_tot = parseInt($('#h_tt').val()) + parseInt(pr);                                              $('#h_tt').val(c_tot);  $('#tt').html("$"+c_tot);    $('#chk_tt').html("$"+c_tot);   parent.jQuery.fancybox.close();         $.ajax({                          url: 'purchase_bk_key.php',                     type: 'post',                        cache: false,                   data: data,                     success: function (data) {                                                      }               });}</script><div id="add-student" style="display:none; width:400px; height:430px;"><div id="no_class" style="display:none"><h4 style="color:#FF0000">CLASS IS FULL CALL FOR WAIT LIST</h4></div><div id="show-reg-form" style="display:none">          <form id="stu_add_form">                <p>                     New Student?s Email Address:                    <input type="text" value="" id="semail"  class="form-control" onBlur="get_email(this);"/>                    <span id="get-email-info" style="color:#FF0000"></span>                         First Name :        <input type="text" value="" id="sfname"  class="form-control"  required="required"/>                     Last Name :                     <input type="text" value="" id="slname"  class="form-control"  required="required"/>                                                         Phone No :                      <input type="text" value="" id="sphone"  class="form-control"  required="required"/>                         Mobile No :                     <input type="text" value="" id="smob"  class="form-control"/>                                                   State :                      <select id="sstate" class="form-control">                       <?php                   $get_st_qry = mysql_query("select * from USStates");                        while($get_st = mysql_fetch_array($get_st_qry)){                         $add = '';                              if($custate == $get_st['stateabr'])                             $add = 'selected="selected"';                                echo '<option value="'.$get_st['stateabr'].'"'.$add.'>'.$get_st['statename'].'</option>';                       }                       ?>  </select>                                <p align="center">                      <input type="hidden" value="<?= $_SESSION['cp'] ?>" id="p_tot" />                       <input type="button" value="Add Student" onClick="<?php if($_SESSION['cp'] == 0){ echo"add_student_free()"; } else { echo "add_student()";} ?>" id="mul_add_stu_btn"  class="btn btn-red"/>                      </p>                     </p>                    </form></div>   </div> <div id="add-product" style="display:none; width:300px"><?php$scd_id = $_SESSION['scid'];$get_pro = mysql_fetch_array(mysql_query("select custom_products from scheduledcourses where scheduledcoursesid='$scd_id'"));$cus_pros = $get_pro['custom_products'];?><?php if(!empty($cus_pros)) { ?>                   <tr>                  <td>Products</td>                           <td>&nbsp;</td>                                 <td>                            <table class="table">                       <?php                                  $getproductsqry = mysql_query("select * from training_sites_products where product_id in($cus_pros)");                                  while($get_product = mysql_fetch_array($getproductsqry)){                                            echo '<tr><td  style="width:10px !important;"><input type="checkbox" class="cusproducts" name="cus_products[]" value="'.$get_product['product_id'].'"></td><td><b>'.$get_product['product_name'].'</b><br/>'.$get_product['product_description'].'</td><td><b>$'.$get_product['product_fee'].'</b></td></tr>';                                    }                               ?>                              </table>                                  </td>                           </tr>                                        <tr>                            <td><input type="button" value="Add" class="btn btn-red" onClick="add_product_cart()"/></td>                        </tr>                          <?php } ?>      </div><div id="add-key-bk" style="display:none"><input type="hidden" value="" id="tmp_cregid" /><?php if(empty($row_rsScheduledCourses['onlinekey']) ||  $row_rsScheduledCourses['onlinekey'] == "No" || $row_rsScheduledCourses['onlinekey'] == 0 ){                                if($row_rsScheduledCourses['OfferPaperBook'] == 1 || $row_rsScheduledCourses['OfferElecBook'] == 1){                         ?>               Book :                                   <?php                                   $bk_slt_add = "";                                          if($row_rsScheduledCourses['Papperbook_price'] == "" || $row_rsScheduledCourses['Papperbook_price'] == 0){                                      $pb_price = $row_rsScheduledCourses['PaperBookPrice'];                                       }                                       else{                                   $pb_price = $row_rsScheduledCourses['Papperbook_price'];                                     }                                                                                                                   if($row_rsScheduledCourses['Elecbook_price'] == "" || $row_rsScheduledCourses['Elecbook_price'] == 0){                                   $eb_price = $row_rsScheduledCourses['ElecBookPrice'];}                                       else{                                   $eb_price = $row_rsScheduledCourses['Elecbook_price'];                                  }                            if($row_rsScheduledCourses['OfferPaperBook'] == 1)                                              $bk_slt_add .='<option value="1-'.$pb_price.'-'.$row_rsScheduledCourses['PaperBookName'].'">+'.$pb_price.' USD Paper Book ('.$row_rsScheduledCourses['PaperBookName'].')</option>';                                                                                  if($row_rsScheduledCourses['OfferElecBook'] == 1)                                            $bk_slt_add .='<option value="2-'.$eb_price.'-'.$row_rsScheduledCourses['ElecBookName'].'">+'.$eb_price.' USD Electronic Book ('.$row_rsScheduledCourses['ElecBookName'].')</option>';                                                                                 ?>                                <select name="bk_opt" class="form-control" id="bk_opt">                                  <option value="0-0-">I have a Book or will Purchase Day of Class</option>                           <?= $bk_slt_add; ?>                                      </select>                                       <span id="bk_info" style="color: red; font-size:11px;"></span>                                                                                                               <?php } ?>                                      <?php } else { ?>                               Purchase Key :                                         <select name="on_key" id="on_key" class="form-control">                                 <option value="0-0-">I Already have a Key (No Purchase)</option>                             <?php                                   if(!empty($row_rsScheduledCourses['keyassoc'])){                                      $key_type_Ary = explode(",",$row_rsScheduledCourses['keyassoc']);                                    $cnt = count($key_type_Ary);                                    for($k=0; $k<$cnt; $k++){                   $kid = $key_type_Ary[$k];                                                $key_get = mysql_fetch_assoc(mysql_query("select * from keys_subcategories where keyssubcatid='$kid'"));            echo "<option value='".$key_get['keyssubcatid']."-".$key_get['keysprice']."-".$key_get['keynameshort']."'>+$".$key_get['keysprice']." ".$key_get['keynameshort']."</option>";                }  }                               ?>                              </select>                                                                                                             <?php }                                                              ?>                                              <p align="center">  <input type="button" value="ADD" class="btn btn-red" onClick="add_bk_key()" /></p>                                       </div><?php if(!empty($_SESSION['scid']) || !empty($get_cur_info['scheduledcoursesid'])){$to = $_SESSION['semail'];$sid = $_SESSION['scid'];if(!empty($bk_amt)){$tta = $paymentAmount + $bk_amt;$tinfo = $paymentAmount."+($".$bk_amt." ".$bk_name.")";}else if(!empty($on_key_amt)){$tta = $paymentAmount + $on_key_amt;$tinfo = $paymentAmount."+($".$on_key_amt." ".$on_key_name.")";}$query_rsScheduledCourses = "SELECT instructors.instructorname,   instructors.instructorlastname,  instructors.instructorphoto, locations.locationname,   locations.locationsid, locations.locationaddress,   locations.locationphone,   locations.locationaddress2,   locations.locationcity,   locations.locationstate,   locations.locationzip,  locations.lat, locations.lng, coursetypes.coursetypename,   coursetypes.comments, coursetypes.PaperBookName, coursetypes.PaperBookPrice, coursetypes.ElecBookName, coursetypes.ElecBookPrice, coursetypes.PaperBookDesc, coursetypes.ElecBookDesc,  scheduledcourses.coursetype,   scheduledcourses.coursedate,   scheduledcourses.coursetime,   scheduledcourses.onlinekey,   scheduledcourses.courseendtime,   scheduledcourses.coursenumberofseats, scheduledcourses.coursestatus,  scheduledcourses.coursecost,   scheduledcourses.notes, scheduledcourses.agent_id,  scheduledcourses.scheduledcoursesid,scheduledcourses. parent_ts_id,scheduledcourses.OfferPaperBook, scheduledcourses.OfferElecBook,  certifications.certification_name,   scheduledcourses.agencyid, coursetypes.coursetypecert,instructors.instructor_bio,location_geolocations.lat,location_geolocations.lng,locations.locationphotos,locations.locationsid,scheduledcourses.sellkey,scheduledcourses.onlinekey,coursetypes.keyassoc FROM  scheduledcourses  INNER JOIN coursetypes ON (scheduledcourses.coursetype=coursetypes.coursetypesid)  INNER JOIN locations ON (scheduledcourses.courselocationid=locations.locationsid)  INNER JOIN instructors ON (scheduledcourses.courseinstructor=instructors.instructorsid) LEFT JOIN location_geolocations ON (location_geolocations.locationsid=locations.locationsid)  LEFT OUTER JOIN certifications ON (coursetypes.coursetypecert=certifications.id) WHERE scheduledcourses.scheduledcoursesid = '$sid' AND (scheduledcourses.coursestatus = 'scheduled' OR scheduledcourses.coursestatus = 'accepted' OR scheduledcourses.coursestatus = 'completed' OR scheduledcourses.coursestatus = 'closed')";$get_cur_info = mysql_fetch_array(mysql_query($query_rsScheduledCourses));//get agency info$a_name = "";if(!empty($get_cur_info['agencyid'])){$agency_id = $get_cur_info['agencyid'];$get_agency = mysql_fetch_row(mysql_query("select agency_name from course_agency where agencyid='$agency_id' "));$a_info = '<tr><td>Provider</td><td>'.$get_agency[0].'</td></tr>';}$a_email = "";if(!empty($get_cur_info['agent_id'])){    $aid = $get_cur_info['agent_id'];       $get_agent_email = mysql_fetch_array(mysql_query("select agent_email from corporate_agents where client_id = '$aid'"));      $a_email = ','.$get_agent_email['agent_email'];}$tsid = $get_cur_info['parent_ts_id'];$get_email_template = mysql_fetch_array(mysql_query("select tmp.*, tc.stu_reg,tc.tcompany_name from training_sites_config tc, training_sites_email_template tmp where tc.tsid = tmp.tsid  and tmp.email_type = 'stu_reg' and tmp.tsid = '$tsid' "));$qry = mysql_query("select contact_email,company_name from training_sites where tsid = '$tsid'") or die(mysql_error());$res_em = mysql_fetch_array($qry);$get_temail = ','.$res_em['contact_email'];$tr_email = $res_em['contact_email'];$get_tcmpname = $res_em['company_name'];if(!empty($get_email_template['email_subject']) && $get_email_template['stu_reg'] == 1 ){   $subject = $get_email_template['email_subject'];    }else{$subject="Course Registration";}if(!empty($get_email_template['email_sender']) && $get_email_template['stu_reg'] == 1 ){   $from = $get_email_template['email_sender'];    }else{$from = '[email protected]';}$efile = "http://www.alwayscpr.com/events_new/".$get_cur_info['scheduledcoursesid'].".ics";$mlink = $get_cur_info['lat'].','.$get_cur_info['lng'];$body='        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />        <meta name="viewport" content="width=device-width"/><style>a {    color: #000000;}</style></head><body>';$tcmp_name = 'Always CPR Training Center';if(!empty($get_tcmpname)){$tcmp_name = $get_tcmpname;}if(!empty($get_email_template['tcompany_name'])){$tcmp_name = $get_email_template['tcompany_name'];}$body .= '<table class="twelve columns"><tr>   <td>          <h1 class="style2">Hi  '.$uname.',</h1>         <p class="lead style1">Thank you for Registering with '.$tcmp_name.'.</p></td>  </tr>  </table>';if(!empty($get_email_template['email_body']) && $get_email_template['stu_reg'] == 1 ){      $body .= '<br/><p>'.$get_email_template['email_body'].'</p><br/><br/>                           <table class="twelve columns" bgcolor="#3e91cf" style="color:#fff;">                        <tr>                          <td class="panel">';               }else{  $body .= '<table class="twelve columns" bgcolor="#3e91cf" style="color:#fff;">                        <tr>                          <td class="panel">                                                 <h3>Course Information:</h3>';}$body .= '<table>                            <tr>                                             <td>Course ID</td><td>'.$get_cur_info['scheduledcoursesid'].'</td></tr><tr>                 <td>Course Type</td><td>'.$get_cur_info['coursetypename'].' - '.$get_cur_info['coursetypecert'].'</td></tr>'.$a_info.'                                           <tr> <td>Course Date</td><td><a href="'.$efile.'">'.date("F d Y",strtotime( $get_cur_info['coursedate'])).'&nbsp;<img src="http://www.alwayscpr.com/img_new/callender-ico.png" width="20" height="20"/></a></td></tr><tr>                                                 <td>Course Time</td><td>'.date("g:i a",strtotime($get_cur_info['coursetime'])).' - '.date("g:i a",strtotime($get_cur_info['courseendtime'])).'</td></tr><tr>                                                 <td>Course Instructor</td><td>'.$get_cur_info['instructorname'].' '.$get_cur_info['instructorlastname'].'</td></tr><tr>     <td>Course Location</td><td><a href="http://maps.google.com/maps?daddr='.$mlink.'">'.$get_cur_info['locationname'].'<br>'.$get_cur_info['locationaddress'].'<br>'.$get_cur_info['locationaddress2'].'<br>'.$get_cur_info['locationcity'].' '.$get_cur_info['locationstate'].' '.$get_cur_info['locationzip'].'</a></td></tr><tr>                                              <td>Course Notes</td><td>'.$get_cur_info['notes'].'</td></tr>                                                                                                </table>                                     </td>                        </tr>                      </table>                                        <table class="twelve columns">                        <tr>                          <td align="center">                            <center>                              <p class="style1" style="text-align:center;">This email was automatically generated by: AlwaysCPR Course Management System<br />                                Do Not Reply to this address.<br />                              If you have any questions, please contact us at [email protected] or call us 1-855-277-4339</p>                            </center>                          </td>                          <td class="expander"></td>                        </tr>                      </table>';         if(!empty($get_email_template['email_signature']) && $get_email_template['stu_reg'] == 1 ){    $body .= '<br/><p>'.$get_email_template['email_signature'].'</p><br/><br/>'; }else{  $body .='<br/<br/><table>  <tbody>    <tr>      <td align="center"><center>        <p>This email was automatically generated by: AlwaysCPR Course Management System<br />          Do Not Reply to this address</p>      </center></td>      <td>&nbsp;</td>    </tr>  </tbody></table>';}   $body .='</body></html>';$headers = "From: " . strip_tags($from) . "
";$headers .= "Reply-To: ". strip_tags($from) . "
";$headers .= "MIME-Version: 1.0
";$headers .= "Content-Type: text/html; charset=ISO-8859-1
"."Bcc: [email protected],[email protected]".$get_temail.$a_email."
"."X-Mailer: PHP/" . phpversion();//mail($to,$subject,$body,$headers);//Admin Notification$to = $tr_email;$actual_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";$body = "<p><h5>A New Student has registered at ".$tcmp_name." </h5></p>";$body .="<b>Student Details:</b><br/>Name: ".$ufullname."<br/>Email: ".$uemail."<br/>Phone: ".$uphone."<br/>Address: ".$uaddr." <br/><bt/>Refer URL: ".$actual_link."<br/><br/> --------<br/>This email is automatically generated.<br/>Do not reply to this email address.";$subject="New Student Registration";$headers = "From: " . strip_tags($from) . "
";$headers .= "Reply-To: ". strip_tags($from) . "
";$headers .= "MIME-Version: 1.0
";$headers .= "Content-Type: text/html; charset=ISO-8859-1
"."Bcc: [email protected],[email protected]
"."X-Mailer: PHP/" . phpversion();//mail($to,$subject,$body,$headers);}function get_client_ip() {    $ipaddress = '';    if (getenv('HTTP_CLIENT_IP'))        $ipaddress = getenv('HTTP_CLIENT_IP');    else if(getenv('HTTP_X_FORWARDED_FOR'))        $ipaddress = getenv('HTTP_X_FORWARDED_FOR');    else if(getenv('HTTP_X_FORWARDED'))        $ipaddress = getenv('HTTP_X_FORWARDED');    else if(getenv('HTTP_FORWARDED_FOR'))        $ipaddress = getenv('HTTP_FORWARDED_FOR');    else if(getenv('HTTP_FORWARDED'))       $ipaddress = getenv('HTTP_FORWARDED');    else if(getenv('REMOTE_ADDR'))        $ipaddress = getenv('REMOTE_ADDR');    else        $ipaddress = 'UNKNOWN';    return $ipaddress;}?><script type="text/javascript">function chk_ccode(v){  $('#chk-ccode-info').html("Please wait...");    $("#reg_btn_info").hide();   top_p = $('#h_tt').val();       tot_c = $("#class_fee").val();  scid = "<?= $_SESSION['scid'] ?>";      $.ajax({                          url: 'checkccode.php',              type: 'post',                    cache: false,                   data: {"ccode":v.value,"tot":top_p,"cfee":tot_c,"scid":scid},                   success: function (data) {                  if(data == "false"){                                   $('#ccode').val('');                                    $('#chk-ccode-info').html("Invalid Coupon Code");                            }                                else{                           var ret = data.split("####");                           $('#chk-ccode-info').html(ret[0]+": - $"+ret[2]);                                                    $('#h_tt').val(ret[1]);                                         $("#dis_code_cart").val($('#ccode').val());                                     $("#dis_code_amt").val(ret[2]);                                              $('#tt').html("$"+ret[1]);                              $("#coupon_add_opt").hide();                            }           $("#reg_btn_info").show();                        }               });}</script>                 </div>                             </div>  </div></section>                             <?php include($footer); ?>

Did this file decode correctly?

Original Code

<?php include("site_config.php");include("../external-web/include/config.php");include($header);?><?phpif(!empty($_SESSION['emsg'])){$msg = urldecode($_SESSION['emsg']);$_SESSION['emsg'] = "";}if(!empty($_GET['scid'])){$_SESSION['scid'] = $_GET['scid'];}if(!empty($_SESSION['scid'])){$scid = $_SESSION['scid'];$row_rsScheduledCourses = mysql_fetch_array(mysql_query("SELECT instructors.instructorname,   instructors.instructorlastname,  instructors.instructorphoto, locations.locationname,   locations.locationsid, locations.locationaddress,   locations.locationphone,   locations.locationaddress2,   locations.locationcity,   locations.locationstate,   locations.locationzip,  locations.lat, locations.corpid, locations.lng, coursetypes.coursetypename,   coursetypes.audience, coursetypes.comments, coursetypes.PaperBookName, coursetypes.PaperBookPrice, coursetypes.ElecBookName, coursetypes.ElecBookPrice, coursetypes.PaperBookDesc, coursetypes.ElecBookDesc,scheduledcourses.courseinstructor, scheduledcourses.parent_ts_id, training_sites.paypal_signature, scheduledcourses.coursetype,   scheduledcourses.coursedate,   scheduledcourses.coursetime,   scheduledcourses.onlinekey,   scheduledcourses.courseendtime,   scheduledcourses.coursenumberofseats, scheduledcourses.coursestatus,  scheduledcourses.coursecost,   scheduledcourses.notes,   scheduledcourses.scheduledcoursesid, scheduledcourses.OfferPaperBook, scheduledcourses.OfferElecBook,scheduledcourses.Papperbook_price,scheduledcourses.Elecbook_price,  certifications.certification_name, scheduledcourses.custom_products, scheduledcourses.agencyid, coursetypes.coursetypecert,instructors.instructor_profile,location_geolocations.lat,location_geolocations.lng,locations.locationphotos,locations.locationsid,scheduledcourses.sellkey,scheduledcourses.onlinekey,coursetypes.keyassoc FROM  scheduledcourses  INNER JOIN coursetypes ON (scheduledcourses.coursetype=coursetypes.coursetypesid)  INNER JOIN locations ON (scheduledcourses.courselocationid=locations.locationsid)  INNER JOIN instructors ON (scheduledcourses.courseinstructor=instructors.instructorsid) LEFT JOIN location_geolocations ON (location_geolocations.locationsid=locations.locationsid)  LEFT OUTER JOIN certifications ON (coursetypes.coursetypecert=certifications.id) LEFT JOIN training_sites ON (training_sites.tsid = scheduledcourses.parent_ts_id) WHERE scheduledcourses.scheduledcoursesid = $scid AND (scheduledcourses.coursestatus = 'scheduled' OR scheduledcourses.coursestatus = 'accepted' OR scheduledcourses.coursestatus = 'completed' OR scheduledcourses.coursestatus = 'closed')"));$_SESSION['cp'] = $row_rsScheduledCourses['coursecost'];$tt =  intval($row_rsScheduledCourses['coursecost']);}if(!empty($_SESSION['bk_id'])){$bk_id = $_SESSION['bk_id'];$bk_name = $_SESSION['bk_name'];$bk_amt = $_SESSION['bk_amt'];$tt = intval($_SESSION['cp']) + intval($_SESSION['bk_amt']);}if(!empty($_POST['bk_opt'])){$bk_chs = explode("-",$_POST['bk_opt']);$bk_id = $bk_chs[0];$bk_name = $bk_chs[2];$bk_amt = $bk_chs[1];$_SESSION['bk_id'] = $bk_chs[0];$_SESSION['bk_name'] = $bk_chs[2];$_SESSION['bk_amt'] = $bk_chs[1];$tt = intval($_SESSION['cp']) + intval($bk_amt);}if(!empty($_POST['on_key'])){$on_key = explode("-",$_POST['on_key']);$on_key_id = $on_key[0];$on_key_name = $on_key[2];$on_key_amt = $on_key[1];$_SESSION['on_key_id'] = $on_key[0];$_SESSION['on_key_name'] = $on_key[2];$_SESSION['on_key_amt'] = $on_key[1];$tt =  intval($_SESSION['cp']) + intval($on_key[1]);}if(!empty($_SESSION['on_key_amt'])){$on_key_id = $_SESSION['on_key_id'];$on_key_name = $_SESSION['on_key_name'];$on_key_amt = $_SESSION['on_key_amt'];$tt =  intval($_SESSION['cp']) + intval($on_key_amt);}if(!empty($_POST['ufname_edt'])){$sadd1 = $_POST['sadd1'];$sadd2 = $_POST['sadd2'];$scity = $_POST['scity'];$sstate = $_POST['sstate'];$szip = $_POST['szip'];$sphone = $_POST['sphone'];$smob = $_POST['smob'];$fn = $_POST['ufname_edt'];$ln = $_POST['ulname_edt'];$pwd = $_POST['pwd'];$se = $_POST['semail'];mysql_query("insert into students (studentsname,studentlastname,studentaddress,studentaddress2,studentcity,studentstate,studentzip,studentphone,studentmobilephone,studentpassword,studentemddress) values('$fn','$ln','$sadd1','$sadd2','$scity','$sstate','$szip','$sphone','$smob','$pwd','$se')");$stu_id = mysql_insert_id();}?><!-- BLOG HEADER --><section id="blog-header" data-stellar-background-ratio="0.5">  <div class="overlay"></div>  <div class="container">      <div class="row">                    <div class="col-md-offset-1 col-md-5 col-sm-12">                              <h2><?= $row_rsScheduledCourses['coursetypename'] ?></h2>                               <?= date("l, F d, Y",strtotime(  $row_rsScheduledCourses['coursedate'])).' '.date("g:i a",strtotime($row_rsScheduledCourses['coursetime'])).' - '.date("g:i a",strtotime($row_rsScheduledCourses['courseendtime'])); ?>                     </div>                                  </div>  </div></section><!-- BLOG DETAIL --><section id="blog-detail" data-stellar-background-ratio="0.5">  <div class="container">     <div class="row"><div class="col-md-offset-1 col-md-10 col-sm-12"><!-- Wrapper -->    <div class="wrapper">              <div class="container">            <?php if(!empty($msg)){ ?>            <div class="row">                    <div class="col-sm-12">                         <!-- Info Board Red -->                         <div class="info-board info-board-red" style="padding: 5px 30px 5px 15px;">                            <h6 style="font-weight:bold;"><?= $msg ?></h6>                                                                </div>                    </div>            </div>                   <?php } ?>        <?php $sid = $stu_id;$_SESSION['user_id'] = $sid;if(empty($_SESSION['user_id'])) {?><div class="row">          <div class="col-sm-12">            <h4>Student Information</h4><form method="post" action="course-registration.php" >               <table class="table">                           <tr>                            <td>Student First Name</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="ufname_edt" value="<?= $res_stu['studentsname'] ?>"  required="required"/></td>                                                                   </tr>                                                                            <tr>                        <td>Student Last Name</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="ulname_edt" value="<?= $res_stu['studentlastname'] ?>"  required="required"/></td>                                                                   </tr>                              <?php if($res_stu['studentemddress'] == ""){ ?>             <tr>                                             <td>Email Address</td>                                          <td>:</td>                                              <td><input type="text" class="form-control" value="" id="semail" name="semail"  onblur="chk_email(this);" required/>                                         <span id="chk-email-info" style="color:#FF0000"></span>                                              </td>                                   </tr>                           <?php } ?>                                                          <tr>                                             <td>Password</td>                                               <td>:</td>                                              <td><input type="text" class="form-control" value="" id="pwd" name="pwd"   required/>                                                                                                </td>                       </tr>                                                                                    <tr>                                            <td>Address 1</td>                                  <td>:</td>                                               <td><input type="text" class="form-control" value="" name="sadd1" required/></td>                                       </tr>       <tr>                                             <td>Address 2</td>                                              <td>:</td>                                              <td><input type="text" class="form-control" value="" name="sadd2" /></td>                                    </tr>                                                                           <tr>                <td>City</td>                                            <td>:</td>                                              <td><input type="text" class="form-control" value="" name="scity" required/></td>                                    </tr>                                                                           <tr>                                            <td>State</td>      <td>:</td>                                               <td><select name="sstate" class="form-control" required>                                          <option value="" disabled selected>State</option>                                          <option value="AK">Alaska</option>                                              <option value="AL">Alabama</option>                 <option value="AR">Arkansas</option>                                             <option value="AZ">Arizona</option>                                             <option value="CA">California</option>                                               <option value="CO">Colorado</option>                                            <option value="CT">Connecticut</option>             <option value="DC">District of Columbia</option>                                         <option value="DE">Delaware</option>                                            <option value="FL">Florida</option>                                          <option value="GA">Georgia</option>                                             <option value="HI">Hawaii</option>                  <option value="IA">Iowa</option>                                         <option value="ID">Idaho</option>                                               <option value="IL">Illinois</option><option value="IN">Indiana</option>                                              <option value="KS">Kansas</option>                                              <option value="KY">Kentucky</option>                                         <option value="LA">Louisiana</option>                                           <option value="MA">Massachusetts</option>                   <option value="MD">Maryland</option>                                             <option value="ME">Maine</option>                                               <option value="MI">Michigan</option>                                         <option value="MN">Minnesota</option>                                           <option value="MO">Missouri</option>                        <option value="MS">Mississippi</option>                                          <option value="MT">Montana</option>                                             <option value="NC">North Carolina</option>                                           <option value="ND">North Dakota</option>                                                <option value="NE">Nebraska</option>        <option value="NH">New Hampshire</option>                                                <option value="NJ">New Jersey</option>                                          <option value="NM">New Mexico</option>                                               <option value="NV">Nevada</option>                                              <option value="NY">New York</option>        <option value="OH">Ohio</option>                                         <option value="OK">Oklahoma</option>                                            <option value="OR">Oregon</option>  <option value="PA">Pennsylvania</option>                                         <option value="PR">Puerto Rico</option>                                         <option value="RI">Rhode Island</option>                                             <option value="SC">South Carolina</option>                                              <option value="SD">South Dakota</option>    <option value="TN">Tennessee</option>                                            <option value="TX">Texas</option>                                               <option value="UT">Utah</option>                                             <option value="VA">Virginia</option>                                            <option value="VT">Vermont</option>                         <option value="WA">Washington</option>                                           <option value="WI">Wisconsin</option>                                           <option value="WV">West Virginia</option>                                            <option value="WY">Wyoming</option>                                       </select></td>                                        </tr><tr>                                            <td>ZIP</td>                                            <td>:</td>                                              <td><input type="text" class="form-control" value="" name="szip" required/></td>                                     </tr>                                                                                   <tr>        <td>Phone</td>                                           <td>:</td>                                              <td><input type="text" class="form-control" value="" name="sphone" id="sphone" /></td>                                       </tr>                                                                           <tr>                                            <td>Mobile</td>                                              <td>:</td>                                              <td><input type="text" class="form-control" value="" name="smob" id="smob" /></td>  </tr>                                                                            <tr>                                            <td colspan="3" align="right"><input type="submit" class="btn btn-red" value="Continue" /></td>                                      </tr>                   </table>                </form>          </div>        </div><?php } else {  $get_stu_sql = "select * from students where studentsid='$sid'";$res_stu = mysql_fetch_assoc(mysql_query($get_stu_sql));$_SESSION['ufname'] = $res_stu['studentsname'];$_SESSION['ulname'] = $res_stu['studentlastname'];$_SESSION['sfname'] = $res_stu['studentsname'];$_SESSION['slname'] = $res_stu['studentlastname'];$_SESSION['semail'] = $res_stu['studentemddress'];$_SESSION['sadd1'] = $res_stu['studentaddress'];$_SESSION['sadd2'] = $res_stu['studentaddress2'];$_SESSION['scity'] = $res_stu['studentcity'];$_SESSION['sstate'] = $res_stu['studentstate'];$_SESSION['szip'] = $res_stu['studentzip'];$uemail = $res_stu['studentemddress'];$uname = $res_stu['studentsname'];$ufullname = $res_stu['studentsname']." ".$res_stu['studentlastname'];$uphone = $res_stu['studentphone'];$uaddr = $res_stu['studentcity']." ".$res_stu['studentstate']." ".$res_stu['studentzip'];                      if(!empty($_POST['creg_ids'])){                                 $c_ids = $_POST['creg_ids'];                 $upm_stu_sql = "update courseregistrations set registrationstatus= 'registered' where courseregistrationsid in($c_ids)";                        mysql_query($upm_stu_sql);                   echo"<script>window.location = 'thank-you.php';</script>";              }                       else if(!empty($_SESSION['scid'])){                     $cid = $_SESSION['scid'];                    $sid = $_SESSION['user_id'];                                            $chk_reg = mysql_fetch_assoc(mysql_query("select scheduledid,courseregistrationsid from courseregistrations where scheduledid = '$cid' and studentid = '$sid' and paymentstatus ='paid'"));                  if(!empty($chk_reg['scheduledid'])){                        $_SESSION['scid'] ='';                           echo"<script>window.location = 'dashboard.php?msg=areg';</script>";                             exit;                   }                   $chk_reg = mysql_fetch_assoc(mysql_query("select scheduledid,courseregistrationsid from courseregistrations where scheduledid = '$cid' and studentid = '$sid' and paymentstatus =''"));      if(empty($chk_reg['scheduledid'])){                              if($_SESSION['bk_id'] == 2){                                    $pbk = 1;                                       }           else if($_SESSION['bk_id'] == 3){                                        $ebk = 1;                               }                                                               if(!empty($_SESSION['scid'])){                               if($_SESSION['cp'] > 0)                         $st_reg = 'registered';                         else                            $st_reg = 'registered';                                                              $cus_products = "";                                                             if(!empty($_POST['cus_products'])){ $cus_products = implode(",",$_POST['cus_products']);                             }                                                               $_SESSION['cus_products'] = $cus_products;  $ins_stu_sql = "insert into courseregistrations (scheduledid,studentid,registrationstatus,paymentstatus,registeredby,PaidBook,PaidElecBook,custom_products) values('$cid','$sid','$st_reg','','selfregister','$pbk','$ebk','$cus_products')";                         mysql_query($ins_stu_sql);                                                                                          $_SESSION['rcid'] = mysql_insert_id();                                                           }                       }                       else{                           $_SESSION['rcid'] = $chk_reg['courseregistrationsid'];                       }                                       }                                ?><?php  $sc_id = $_SESSION['scid'];$query_rsScheduledCourses = "SELECT instructors.instructorname,   instructors.instructorlastname,  instructors.instructorphoto, locations.locationname,   locations.locationsid, locations.locationaddress,   locations.locationphone,   locations.locationaddress2,   locations.locationcity,   locations.locationstate,   locations.locationzip,  locations.lat, locations.lng, coursetypes.coursetypename,   coursetypes.audience, coursetypes.comments, coursetypes.PaperBookName, coursetypes.PaperBookPrice, coursetypes.ElecBookName, coursetypes.ElecBookPrice, coursetypes.PaperBookDesc, coursetypes.ElecBookDesc,scheduledcourses.courseinstructor,scheduledcourses.coursetype,   scheduledcourses.coursedate,   scheduledcourses.coursetime,   scheduledcourses.onlinekey,   scheduledcourses.courseendtime,   scheduledcourses.coursenumberofseats, scheduledcourses.coursestatus,  scheduledcourses.coursecost,   scheduledcourses.notes,   scheduledcourses.scheduledcoursesid, scheduledcourses.OfferPaperBook, scheduledcourses.OfferElecBook,scheduledcourses.Papperbook_price,scheduledcourses.Elecbook_price,  certifications.certification_name,   coursetypes.coursetypecert,instructors.instructor_profile,location_geolocations.lat,location_geolocations.lng,locations.locationphotos,locations.locationsid,scheduledcourses.sellkey,scheduledcourses.onlinekey,coursetypes.keyassoc FROM  scheduledcourses  INNER JOIN coursetypes ON (scheduledcourses.coursetype=coursetypes.coursetypesid)  INNER JOIN locations ON (scheduledcourses.courselocationid=locations.locationsid)  INNER JOIN instructors ON (scheduledcourses.courseinstructor=instructors.instructorsid) LEFT JOIN location_geolocations ON (location_geolocations.locationsid=locations.locationsid)  LEFT OUTER JOIN certifications ON (coursetypes.coursetypecert=certifications.id) WHERE scheduledcourses.scheduledcoursesid = $sc_id AND (scheduledcourses.coursestatus = 'scheduled' OR scheduledcourses.coursestatus = 'accepted' OR scheduledcourses.coursestatus = 'completed' OR scheduledcourses.coursestatus = 'closed')";$rsScheduledCourses = mysql_query($query_rsScheduledCourses, $db) or die(mysql_error());$row_rsScheduledCourses = mysql_fetch_assoc($rsScheduledCourses);$custate = $row_rsScheduledCourses['locationstate'];?><div class="row"><?php if($_SESSION['cp'] == 0){ ?>                                <div class="col-sm-12">                                                         <table class="table" id="stu_info" style="white-space:nowrap">                                       <tr>                                    <th>Student:</th><th>Class#</th><th>Location Name</th><th>Date</th><th>City</th><th>State</th>      </tr>                                    <tr>                                            <td><?= $res_stu['studentsname']." ".$res_stu['studentlastname'] ?></td>                            <td><?= $_SESSION['scid'] ?></td>                                                                                                <td><?= $row_rsScheduledCourses['locationname'] ?></td>     <td><?= $_SESSION['stime'] ?></td>                                                                                                                               <td><?= $row_rsScheduledCourses['locationcity'] ?></td>                                                                                              <td><?= $row_rsScheduledCourses['locationstate'] ?></td>            </tr>                            </table>                                        <!--<a href="#add-student" class="fancybox btn btn-red">Add Student</a> <span id="load-info"></span>-->     <div class="row" style="display:none">                           <div class="col-sm-12"><p align="right" style="font-weight:bold"> Total : <span id="tt">$<?= $tt ?></span></p></div>        </div>                   </div><?php } else { ?>         <div class="col-sm-12">                                                         <table class="table" id="stu_info" style="white-space:nowrap">                                       <tr><?php if(empty($row_rsScheduledCourses['onlinekey']) ||  $row_rsScheduledCourses['onlinekey'] == "No" || $row_rsScheduledCourses['onlinekey'] == 0 ){ $adt =  "Book";} else { $adt =  "Online Key";} ?>                                  <!--<th>Student</th><th>Class#</th><th>Date</th><th>Class Fee</th><th>Purchase <?= $adt ?></th><th>Products</th><th>Total</th>-->                                                                            <th>Student</th><th>Class#</th><th>Date</th><th>Class Fee</th><th>Total</th></tr>                                    <tr>                                            <td><?= $res_stu['studentsname']." ".$res_stu['studentlastname'] ?></td>                            <td><?= $_SESSION['scid'] ?><input type="hidden" id="<?= $_SESSION['rcid']?>_sid" value="<?= $sid ?>" /></td>                                            <td><?= $_SESSION['stime'] ?></td>  <td id="<?= $_SESSION['rcid'] ?>_cp">$<?= $_SESSION['cp'] ?> </td>                                                                                               <?php /*?><td id="<?= $_SESSION['rcid']?>_bp"><?php if(!empty($_SESSION['bk_amt'])){ echo "$"+$_SESSION['bk_amt']; }  else if(!empty($_SESSION['on_key_amt'])){ echo "$"+$_SESSION['on_key_amt']; } else { echo "<a href='#add-key-bk' onclick='return add_id(".$_SESSION['rcid'].")' class='fancybox btn btn-red' style='padding:2px !important'>Add ".$adt."</a>"; } ?></td>                                        <td id="<?= $_SESSION['rcid']?>_pro">                                            <?php                                           if(!empty($_POST['cus_products'])){                         $cus_pros = implode(",",$_POST['cus_products']);                                         $_SESSION['cus_pros'] = $cus_pros;                                                                  $getproductsqry = mysql_query("select * from training_sites_products where product_id in($cus_pros)");                                           while($get_product = mysql_fetch_array($getproductsqry)){                                                    $tt = intval($tt) + intval($get_product['product_fee']);                                                        echo $get_product['product_name'].' - <b>$'.$get_product['product_fee'].'</b><br/>';                                         }                                               }                           else{                                                    echo '<a style="padding:2px !important" class="fancybox btn btn-red" onclick="return add_id('.$_SESSION['rcid'].')" href="#add-product">Add Product</a>';                                            }                                               ?>                                              </td><?php */?>             <td><span id="<?= $_SESSION['rcid']?>_tt">$<?= $tt ?></span></td>                                        </tr>                                                           </table>            <!--<a href="#add-student" class="fancybox btn btn-red">Add Student</a> <span id="load-info"></span>-->                                                          <div class="row">           <div class="col-sm-12">                                                          <?php                           $sc_id2 = $_SESSION['scid'];                            $get_codes = mysql_fetch_array(mysql_query("select discount_codes from scheduledcourses where scheduledcoursesid='$sc_id2'"));                               if(!empty($get_codes['discount_codes'])){           ?>                               <div style="width:320px; float:right"><span style="float:left; padding-top:8px; font-weight:bold">Coupon Code :&nbsp;&nbsp;</span><span style="float:left" id="coupon_add_opt"><input class="form-control" style="width:200px;border-radius:20px" type="text" value="" name="ccode" id="ccode" onBlur="chk_ccode(this);"/></span><br/><span id="chk-ccode-info" style="color:#FF0000; float:left"></span></div>                           <?php } ?>                              <div style="clear:both; font-weight:bold; font-size:14px" align="right"> Total : <span id="tt">$<?= $tt ?></span></div></div>                                </div>                  </div><?php } ?>                </div>                  <div class="row">             <div class="col-sm-12">                <?php if($_SESSION['cp'] == 0){ ?><form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">                             <input type="hidden" value="<?= $sid ?>" name="stu_ids" id="stu_ids" />                              <input type="hidden" value="<?= $_SESSION['rcid'] ?>" name="creg_ids" id="creg_ids" />                      <input type="hidden" value="<?= $tt ?>" id="h_tt" name="h_tt" />                                                                                 <div align="right"><input class="btn btn-red" type="submit" value="Continue" /></div>                                </form><?php } else { ?><?php   $dis_code = $_POST['ccode'];    $dic_desc = ""; $getpcodes = mysql_fetch_array(mysql_query("select discountamount,amounttype,discountdescription from discountcodes where discountcode ='$dis_code'"));      if(!empty($getpcodes['discountamount'])){               if($getpcodes['amounttype'] == 'dollars'){                   $tt = floatval($tt) - floatval($getpcodes['discountamount']);           }               else{                                           $percentage = $getpcodes['discountamount'];                                                                  $disamt = ($percentage / 100) * $tt;                    $tt = floatval($tt) - floatval($disamt);             }       $dic_desc = $getpcodes['discountdescription'];          }       ?><form method="post" action="paypal_new/paypal_pro_custom_new.php" id="paypost" onSubmit="sh();" >                          <input type="hidden" value="<?= $sid ?>" name="stu_ids" id="stu_ids" />                         <input type="hidden" value="<?= $_SESSION['rcid'] ?>" name="creg_ids" id="creg_ids" />                               <input type="hidden" value="<?= $tt ?>" id="h_tt" name="h_tt" />                                <input type="hidden" value="<?= $_SESSION['cp'] ?>" id="class_fee" />                                <input type="hidden" id="dis_code_cart" name="dis_code_cart"/>                          <input type="hidden" id="dis_code_amt" name="dis_code_amt" />                <table class="table">                                                                                                           <tr>                         <td>Name on Card</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="uname_edt" value="<?= $res_stu['studentsname']." ".$res_stu['studentlastname'] ?>"  required="required"/></td>                                                                   </tr>                    <tr>                      <td>Credit Card Type</td>                        <td>:</td>                        <td>                                              <table>                                         <tr>                <td width="50%">                                 <select name="customer_credit_card_type" class="form-control">                                  <option value="visa">Visa</option>                                <option value="mastercard">Master Card</option>                                <option value="discocer">Discover</option>                                <option value="amex">American Express</option>                            </select>                                                                                                    </td>               <td width="50%">                                         </td>                                           </tr>                                           </table>                        </td>                                                                    </tr>                                                                                                   <tr>                     <td>Credit Card #</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="customer_credit_card_number" value="" id="customer_credit_card_number"  required="required"/></td>                                                                   </tr>                 <tr>                            <td>Expiration Month</td>                        <td>:</td>                        <td>                              <select name="cc_expiration_month" style="width: 95px;" class="form-control">                                                                        <option value="1">1</option>                                                                    <option value="2">2</option>                                                                 <option value="3">3</option>                                                                    <option value="4">4</option>                                                                 <option value="5">5</option>                                                                    <option value="6">6</option>                                                                 <option value="7">7</option>                                                                    <option value="8">8</option>                                                                 <option value="9">9</option>                                                                    <option value="10">10</option>                                                                       <option value="11">11</option>                                                                  <option value="12">12</option>                                                            </select>                        </td>                                           </tr>                                         <tr>                     <td>Expiration Year</td>                        <td>:</td>                        <td>                            <select class="form-control" name="cc_expiration_year" style="width: 95px;">                                                                                                                                                                   <?php    $starting_year  =date('Y');                                                                                                                      $ending_year = date('Y', strtotime('+10 year'));                                                                                                                     for($starting_year; $starting_year <= $ending_year; $starting_year++) {                                                                                                                              echo '<option value="'.$starting_year.'"';          echo ' >'.$starting_year.'</option>';                                                                                                                    }                                    ?>                                                                                                                                                                                                                                                              </select>                        </td>                                           </tr>                                  <tr>                     <td>Billing Zip Code</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="zip_edt" value="<?= $res_stu['studentzip'] ?>"  required="required" style="width: 95px;"/></td>                                            </tr>                        <tr>                            <td>Card Verification #</td>                        <td>:</td>                        <td><input class="form-control" type="text" name="cc_cvv2_number" value=""  required="required" style="width: 95px;"/></td>                                            </tr>                                                                                <tr style="display:none">                                   <td>Price </td>                        <td>:</td>                        <td>                                                                            <label id="chk_tt">$<?= $tt ?></label>                        </td>                                  </tr>                    <tr>                        <td align="center" colspan="3">                                        Terms & Conditions<br/><br/>                             <div class="tarea">                             <h5 align="center" style="font:font-size: 15px;"><b>PLEASE NOTE ALL ONLINE KEY SALES ARE FINAL </b></h5><p><h6><b>Schedule / Reschedule/Cancellation Policy:</b></h6></p><p>When a student schedules a class and the class is confirmed at a particular date, and time, the seat is fully reserved for that student and is not available to others.</p> <p>The following reschedule / cancelation policies are for classes held at all our Training Facilities:</p><p style="padding-left:20px;">A. Classes that are scheduled and confirmed must be rescheduled at least 48-hours prior to the scheduled start time of the class to allow us time to try to rebook the class seat for another student. The class registration fee is due in full to hold a seat in the requested class.We ONLY accept Visa, MasterCard, American Express, Discover and PayPal payments.<b>Once Payment is made NO Refunds are allowed.</b></p><p style="padding-left:20px;">B. If the student wishes to reschedule he may do so with no additional fees. Note student can only reschedule one time based on one payment. </p><p style="padding-left:20px;">C. <b>If we cancel the class due to sickness, error or Act of God, full refund will be given to student and given the chance to come take the class for free at our expense.</b></p><h6><b>Hold Harmless:</b></h6><p style="padding-left:20px;">A.Due to the physical nature of the training classes that we provide, all participants that take part in a class offered by Always CPR Training Center LLC must agree &sign a Release and Hold Harmless Agreement before they will be allowed to participate in the class.</p><p style="padding-left:20px;">B.If the participant is under the age of 18 a parent or guardian must also sign the release before the participant will be allowed to participate in the class.</p><h6><b>Certification Cards:</b></h6><p>1.      American Heart Association course completion cards are delivered to the student at the end of the class. AHA Digital certification cards are normally processed and delivered via email the same day as the completion of the class.</p><p>2.        If a print certification card is shipped to the student via US Postal Service First Class Mail it will be mailed at no cost to the student. Always CPR Training Center LLC shall not be responsible for the certification card(s) once it has been delivered to the Post Office for mailing.</p><p>3.     If you happen to lose your printed certification card, replacement print cards for classes taught by Always CPR Training Center LLC can be ordered for a <b>Lost Certification Card Replacement Fee</b> of $10.00.Replacement print cards will take approximately one business day for us to process once the replacement fee invoice has been paid.</p></div><!--<label style="color:#FFFFFF">hid<input class="form-control" type="checkbox" id="acpt" required="required" name="acpt"/></label>                         <p> I have read and accept all terms & conditions</p>-->                   <p>I have read and accept all terms & conditions</p>                                      <input class="btn btn-success" id="pay_btn" type="submit" name="submit" value="Pay Now"  required="required"/>                        </td>                    </tr>                                                         </table>                </form><?php } ?>          </div>        </div> <!-- / .row -->                              <?php } ?>      </div> <!-- / .container -->    </div> <!-- / .wrapper --><?php include("includes_new/footer.php"); ?>   <style type="text/css">div.tarea {  border: 1px inset #ccc;  background-color: #f4f4f4;  font: small courier, monospace black;  height:150px;  overflow:auto;  padding-left:10px;    text-align:left;}</style><script>function sh(){   $('#pay_btn').removeClass("btn btn-blue");        $('#pay_btn').addClass("btn btn-red");  $('#pay_btn').val("Processing, One Moment Please");  $('#pay_btn').attr("disabled", true);           $('#pay_btn').submit();}function chk_email(v){  $('#chk-email-info').html("");  $.ajax({                      url: 'checkEmail.php',                   type: 'post',                   cache: false,                   data: {"email":v.value},                        success: function (data) {          if(data == "false"){                                   $('#semail').val('');                                   $('#chk-email-info').html("Email Address Already Exists <a style='font-weight:bold' href='login-new.php'>Click Here to Sign In</a>");                                 }                        }               });}function get_email(v){    $('#mul_add_stu_btn').prop("disabled", true);                $('#get-email-info').html("");  $('#sfname').val('');   $('#slname').val('');   $('#smob').val('');     $('#sphone').val('');   if(v.value !=""){       $.ajax({                       url: 'getEmail.php',                    type: 'post',                   cache: false,                   data: {"email":v.value},                        success: function (data) {                          if(data != "false"){                                   data = data.split("###");                                       //$('#get-email-info').html("Email already exists, would you like to add "+data[0]+" "+data[1]+" to class?&nbsp;&nbsp; <a style='font-weight:bold' href='javascript:void(0);' onclick='add_info(\""+data[0]+"\",\""+data[1]+"\",\""+data[2]+"\",\""+data[3]+"\");'>CLICK TO ADD</a><br>");                                        $('#get-email-info').html("Email already exists,<br/>Please use a different email id or Leave empty.<br/>");                                 $("#semail").val("");                                                                    }                              $('#mul_add_stu_btn').prop("disabled", false);                         }               });   }}function add_info(f,l,m,p){   $('#sfname').val(f);    $('#slname').val(l);    $('#smob').val(m);      $('#sphone').val(p);}</script><script src="js_new/jquery.mask.js"></script><script>$("#sphone").mask("999-999-9999");$("#sphone").on("blur", function() {    var last = $(this).val().substr( $(this).val().indexOf("-") + 1 );    if( last.length == 3 ) {        var move = $(this).val().substr( $(this).val().indexOf("-") - 1, 1 );        var lastfour = move + last;        var first = $(this).val().substr( 0, 9 );        $(this).val( first + '-' + lastfour );    }});$("#smob").mask("999-999-9999");$("#smob").on("blur", function() {    var last = $(this).val().substr( $(this).val().indexOf("-") + 1 );    if( last.length == 3 ) {        var move = $(this).val().substr( $(this).val().indexOf("-") - 1, 1 );        var lastfour = move + last;        var first = $(this).val().substr( 0, 9 );        $(this).val( first + '-' + lastfour );    }});</script><!-- Add fancyBox main JS and CSS files --><script type="text/javascript" src="js_new/jquery.fancybox.js?v=2.1.5"></script><link rel="stylesheet" type="text/css" href="css_new/jquery.fancybox.css?v=2.1.5" media="screen" /><script type="text/javascript">$(document).ready(function() { $(".fancybox").fancybox({        'beforeLoad': function(){                       $.ajax({                                          url: 'chk-registration.php',                                type: 'post',                                    cache: false,                                   data: {"scid":"<?= $_SESSION['scid']; ?>"},                                     success: function (data) {                                 $('#show-reg-form').hide();                                     $('#no_class').hide();                                  if(data == 0)       $('#no_class').show();                                   else                                            $('#show-reg-form').show();                                                           }                                });   },      'afterClose': function() {              $('#stu_add_form')[0].reset();          $('#get-email-info').html("");  }});    });</script>    <script type="text/javascript">function add_student(){var isValid = true;$('#sfname,#slname,#sphone').each(function() {      if ($.trim($(this).val()) == '') {              isValid = false;    $(this).css({                    "border": "1px solid red",                      "background": "#FFCECE"         });     }       else {          $(this).css({                   "border": "","background": ""                });     }});if (isValid == true){       $('#load-info').html('<img src="img_new/ajax-loader.gif"> Please wait...');     var a_amt = "$0";               var bn = "";         var t_tot = "";                 semail = $('#semail').val();    scid = "<?= $_SESSION['scid'] ?>";      fname = $('#sfname').val();     lname = $('#slname').val();     smob  = $('#smob').val();                    sphone = $('#sphone').val();                    sstate = $('#sstate').val();            t_tot = parseInt($('#p_tot').val());            c_fee = parseInt($("#class_fee").val()) + parseInt("<?= $_SESSION['cp'] ?>");                        data = {"semail":semail,"scid":scid,"fname":fname,"lname":lname,"smob":smob,"sphone":sphone,"sstate":sstate};                c_tot = parseInt($('#h_tt').val()) + parseInt(t_tot);                           $('#h_tt').val(c_tot);  $('#tt').html("$"+c_tot);       $('#chk_tt').html("$"+c_tot);parent.jQuery.fancybox.close();                 $.ajax({                          url: 'send_reg_email.php',                      type: 'post',                   cache: false,               data: data,                      success: function (data) {                            data = data.trim();                             data = data.split("-");                         tmp_creg_ids = $('#creg_ids').val() + "," + data[1];                                 $('#creg_ids').val(tmp_creg_ids);                                                               tmp_stu_ids = $('#stu_ids').val() + "," + data[0];                           $('#stu_ids').val(tmp_stu_ids);                                                         $('#stu_info').append('<tr><td>'+fname+' ' +lname+'</td><td><?= $_SESSION['scid'] ?><input type="hidden" id="'+data[1]+'_sid" value="'+data[0]+'" /></td><td><?= $_SESSION['stime'] ?></td><td>$<?= $_SESSION['cp'] ?></td><td id="'+data[1]+'_bp"><a style="padding:2px !important" class="fancybox btn btn-red" onclick="return add_id('+data[1]+')" href="#add-key-bk">Add <?= $adt ?></a></td><td id="'+data[1]+'_pro"><a style="padding:2px !important" class="fancybox btn btn-red" onclick="return add_id('+data[1]+')" href="#add-product">Add Product</a></td><td><span id="'+data[1]+'_tt">$'+t_tot+'</span>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="delrow(this,\''+t_tot+'\',\''+data[0]+'\',\''+data[1]+'\');">Remove</a></td></tr>');                                                           $("#class_fee").val(c_fee);                                                        }               });                                   $('#stu_add_form')[0].reset();  $('#load-info').html('');            }}function add_student_free(){var isValid = true;$('#sfname,#slname,#sphone').each(function() { if ($.trim($(this).val()) == '') {              isValid = false;            $(this).css({                    "border": "1px solid red",                      "background": "#FFCECE"         });     }       else {          $(this).css({                   "border": "","background": ""                });     }});if (isValid == true){       $('#load-info').html('<img src="img_new/ajax-loader.gif"> Please wait...');     var ln = '<?= $row_rsScheduledCourses['locationname'] ?>';           var st = '<?= $row_rsScheduledCourses['locationstate'] ?>';             var ct = '<?= $row_rsScheduledCourses['locationcity'] ?>';              var bn = "";var t_tot = "";                  semail = $('#semail').val();    scid = "<?= $_SESSION['scid'] ?>";      fname = $('#sfname').val();     lname = $('#slname').val();     smob  = $('#smob').val();                    sphone = $('#sphone').val();            sstate = $('#sstate').val();                    t_tot = parseInt($('#p_tot').val());            data = {"semail":semail,"scid":scid,"fname":fname,"lname":lname,"smob":smob,"sphone":sphone,"sstate":sstate};        c_tot = parseInt($('#h_tt').val()) + parseInt(t_tot);                                           $('#h_tt').val(c_tot);       $('#tt').html("$"+c_tot);       $('#chk_tt').html("$"+c_tot);   parent.jQuery.fancybox.close();                 $.ajax({                          url: 'send_reg_email.php',                   type: 'post',                   cache: false,                   data: data,                     success: function (data) {                            data = data.trim();                          data = data.split("-");                         tmp_creg_ids = $('#creg_ids').val() + "," + data[1];                            $('#creg_ids').val(tmp_creg_ids);                                                            tmp_stu_ids = $('#stu_ids').val() + "," + data[0];                              $('#stu_ids').val(tmp_stu_ids);             $('#stu_info').append('<tr><td>'+fname+' ' +lname+'</td><td><?= $_SESSION['scid'] ?></td><td>'+ln+'</td><td><?= $_SESSION['stime'] ?></td><td>'+ct+'</td><td>'+st+'&nbsp;&nbsp;<a href="javascript:void(0);" onclick="delrow(this,\''+t_tot+'\',\''+data[0]+'\',\''+data[1]+'\');">Remove</a></td></tr>');                                                              }               });                        $('#stu_add_form')[0].reset();  $('#load-info').html('');}      }function isInt(value) {  var x = parseFloat(value);  return !isNaN(value) && (x | 0) === x;}function delrow(t,a,i,c) {      c_tot = parseInt($('#h_tt').val()) - parseInt(a);               fld2 = "#"+c+"_bp";     bp = parseInt($(fld2).html().substring(1));     if(isInt(bp)){  c_tot = parseInt(c_tot) - bp;        }               $(t).parent().closest('tr').remove();           tmp_stu_ids  = $('#stu_ids').val();             tmp_stu_ids = tmp_stu_ids.replace(","+i,"");        $('#stu_ids').val(tmp_stu_ids);          tmp_creg_ids  = $('#creg_ids').val();           tmp_creg_ids  = tmp_creg_ids.replace(","+c,"");                 $('#creg_ids').val(tmp_creg_ids);   $('#h_tt').val(c_tot);   $('#tt').html("$"+c_tot);       $('#chk_tt').html("$"+c_tot);           $.ajax({                          url: 'del-registration.php',                    type: 'post',                        cache: false,                   data: {"creg_id":c},                    success: function (data) {                      }               });}function add_id(i){$('#tmp_cregid').val(i);}function add_product_cart(){       cid = $('#tmp_cregid').val();   sfld = "#"+$('#tmp_cregid').val()+"_sid";       sid = $(sfld).val();            fld = "#"+$('#tmp_cregid').val()+"_tt";      fld2 = "#"+$('#tmp_cregid').val()+"_pro";               cus_pro = $('.cusproducts:checked').map(function() {return this.value;}).get().join(',');       data = {"cregid":cid,"sid":sid,"cus_pro":cus_pro};           $.ajax({                                  url: 'purchase_product.php',                    type: 'post',                   cache: false,       data:data,                       success: function (data) {                            if(data == false){                                      alert("Unable to add");                     }else{                                   var ret = data.split("####");                                                                           c_tot = parseInt($('#h_tt').val()) + parseInt(ret[0]);                                       $('#h_tt').val(c_tot);                                                                  $('#tt').html("$"+c_tot);                           $('#chk_tt').html("$"+c_tot);                                                                                    t_tot = parseInt($(fld).html().substring(1)) + parseInt(ret[0]);            $(fld).html("$"+t_tot);                                  $(fld2).html(ret[1]);                           }                                                                                   }                  });   parent.jQuery.fancybox.close();   }function add_bk_key(){cid = $('#tmp_cregid').val();sfld = "#"+$('#tmp_cregid').val()+"_sid";sid = $(sfld).val();if($("#bk_opt").length){                  var bp = $('#bk_opt').val();                            bp_ar = bp.split("-");                          fld = "#"+$('#tmp_cregid').val()+"_tt";         fld2 = "#"+$('#tmp_cregid').val()+"_bp";                             t_tot = parseInt($(fld).html().substring(1)) + parseInt(bp_ar[1]);                      a_amt = parseInt(bp_ar[1]);                 pr = bp_ar[1];                           bn = bp_ar[2];                          $(fld).html("$"+t_tot);         $(fld2).html("$"+a_amt);                                data = {"cregid":cid,"sid":sid,"bk_id":bp_ar[0],"bamt":a_amt,"bn":bn};                       }else if($("#on_key").length){                          var okey = $('#on_key').val();                          okey = okey.split("-");                              fld = "#"+$('#tmp_cregid').val()+"_tt";         fld2 = "#"+$('#tmp_cregid').val()+"_bp";                                                t_tot = parseInt($(fld).html().substring(1)) + parseInt(okey[1]);                    a_amt = "$"+parseInt(okey[1]);                                  pr = okey[1];                           onk = okey[2];                               $(fld).html("$"+t_tot);         $(fld2).html(a_amt);                            data = {"cregid":cid,"sid":sid,"on_kid":okey[0],"on_kamt":okey[1],"on_kname":okey[2]};                       }                       c_tot = parseInt($('#h_tt').val()) + parseInt(pr);                                              $('#h_tt').val(c_tot);  $('#tt').html("$"+c_tot);    $('#chk_tt').html("$"+c_tot);   parent.jQuery.fancybox.close();         $.ajax({                          url: 'purchase_bk_key.php',                     type: 'post',                        cache: false,                   data: data,                     success: function (data) {                                                      }               });}</script><div id="add-student" style="display:none; width:400px; height:430px;"><div id="no_class" style="display:none"><h4 style="color:#FF0000">CLASS IS FULL CALL FOR WAIT LIST</h4></div><div id="show-reg-form" style="display:none">          <form id="stu_add_form">                <p>                     New Student?s Email Address:                    <input type="text" value="" id="semail"  class="form-control" onBlur="get_email(this);"/>                    <span id="get-email-info" style="color:#FF0000"></span>                         First Name :        <input type="text" value="" id="sfname"  class="form-control"  required="required"/>                     Last Name :                     <input type="text" value="" id="slname"  class="form-control"  required="required"/>                                                         Phone No :                      <input type="text" value="" id="sphone"  class="form-control"  required="required"/>                         Mobile No :                     <input type="text" value="" id="smob"  class="form-control"/>                                                   State :                      <select id="sstate" class="form-control">                       <?php                   $get_st_qry = mysql_query("select * from USStates");                        while($get_st = mysql_fetch_array($get_st_qry)){                         $add = '';                              if($custate == $get_st['stateabr'])                             $add = 'selected="selected"';                                echo '<option value="'.$get_st['stateabr'].'"'.$add.'>'.$get_st['statename'].'</option>';                       }                       ?>  </select>                                <p align="center">                      <input type="hidden" value="<?= $_SESSION['cp'] ?>" id="p_tot" />                       <input type="button" value="Add Student" onClick="<?php if($_SESSION['cp'] == 0){ echo"add_student_free()"; } else { echo "add_student()";} ?>" id="mul_add_stu_btn"  class="btn btn-red"/>                      </p>                     </p>                    </form></div>   </div> <div id="add-product" style="display:none; width:300px"><?php$scd_id = $_SESSION['scid'];$get_pro = mysql_fetch_array(mysql_query("select custom_products from scheduledcourses where scheduledcoursesid='$scd_id'"));$cus_pros = $get_pro['custom_products'];?><?php if(!empty($cus_pros)) { ?>                   <tr>                  <td>Products</td>                           <td>&nbsp;</td>                                 <td>                            <table class="table">                       <?php                                  $getproductsqry = mysql_query("select * from training_sites_products where product_id in($cus_pros)");                                  while($get_product = mysql_fetch_array($getproductsqry)){                                            echo '<tr><td  style="width:10px !important;"><input type="checkbox" class="cusproducts" name="cus_products[]" value="'.$get_product['product_id'].'"></td><td><b>'.$get_product['product_name'].'</b><br/>'.$get_product['product_description'].'</td><td><b>$'.$get_product['product_fee'].'</b></td></tr>';                                    }                               ?>                              </table>                                  </td>                           </tr>                                        <tr>                            <td><input type="button" value="Add" class="btn btn-red" onClick="add_product_cart()"/></td>                        </tr>                          <?php } ?>      </div><div id="add-key-bk" style="display:none"><input type="hidden" value="" id="tmp_cregid" /><?php if(empty($row_rsScheduledCourses['onlinekey']) ||  $row_rsScheduledCourses['onlinekey'] == "No" || $row_rsScheduledCourses['onlinekey'] == 0 ){                                if($row_rsScheduledCourses['OfferPaperBook'] == 1 || $row_rsScheduledCourses['OfferElecBook'] == 1){                         ?>               Book :                                   <?php                                   $bk_slt_add = "";                                          if($row_rsScheduledCourses['Papperbook_price'] == "" || $row_rsScheduledCourses['Papperbook_price'] == 0){                                      $pb_price = $row_rsScheduledCourses['PaperBookPrice'];                                       }                                       else{                                   $pb_price = $row_rsScheduledCourses['Papperbook_price'];                                     }                                                                                                                   if($row_rsScheduledCourses['Elecbook_price'] == "" || $row_rsScheduledCourses['Elecbook_price'] == 0){                                   $eb_price = $row_rsScheduledCourses['ElecBookPrice'];}                                       else{                                   $eb_price = $row_rsScheduledCourses['Elecbook_price'];                                  }                            if($row_rsScheduledCourses['OfferPaperBook'] == 1)                                              $bk_slt_add .='<option value="1-'.$pb_price.'-'.$row_rsScheduledCourses['PaperBookName'].'">+'.$pb_price.' USD Paper Book ('.$row_rsScheduledCourses['PaperBookName'].')</option>';                                                                                  if($row_rsScheduledCourses['OfferElecBook'] == 1)                                            $bk_slt_add .='<option value="2-'.$eb_price.'-'.$row_rsScheduledCourses['ElecBookName'].'">+'.$eb_price.' USD Electronic Book ('.$row_rsScheduledCourses['ElecBookName'].')</option>';                                                                                 ?>                                <select name="bk_opt" class="form-control" id="bk_opt">                                  <option value="0-0-">I have a Book or will Purchase Day of Class</option>                           <?= $bk_slt_add; ?>                                      </select>                                       <span id="bk_info" style="color: red; font-size:11px;"></span>                                                                                                               <?php } ?>                                      <?php } else { ?>                               Purchase Key :                                         <select name="on_key" id="on_key" class="form-control">                                 <option value="0-0-">I Already have a Key (No Purchase)</option>                             <?php                                   if(!empty($row_rsScheduledCourses['keyassoc'])){                                      $key_type_Ary = explode(",",$row_rsScheduledCourses['keyassoc']);                                    $cnt = count($key_type_Ary);                                    for($k=0; $k<$cnt; $k++){                   $kid = $key_type_Ary[$k];                                                $key_get = mysql_fetch_assoc(mysql_query("select * from keys_subcategories where keyssubcatid='$kid'"));            echo "<option value='".$key_get['keyssubcatid']."-".$key_get['keysprice']."-".$key_get['keynameshort']."'>+$".$key_get['keysprice']." ".$key_get['keynameshort']."</option>";                }  }                               ?>                              </select>                                                                                                             <?php }                                                              ?>                                              <p align="center">  <input type="button" value="ADD" class="btn btn-red" onClick="add_bk_key()" /></p>                                       </div><?php if(!empty($_SESSION['scid']) || !empty($get_cur_info['scheduledcoursesid'])){$to = $_SESSION['semail'];$sid = $_SESSION['scid'];if(!empty($bk_amt)){$tta = $paymentAmount + $bk_amt;$tinfo = $paymentAmount."+($".$bk_amt." ".$bk_name.")";}else if(!empty($on_key_amt)){$tta = $paymentAmount + $on_key_amt;$tinfo = $paymentAmount."+($".$on_key_amt." ".$on_key_name.")";}$query_rsScheduledCourses = "SELECT instructors.instructorname,   instructors.instructorlastname,  instructors.instructorphoto, locations.locationname,   locations.locationsid, locations.locationaddress,   locations.locationphone,   locations.locationaddress2,   locations.locationcity,   locations.locationstate,   locations.locationzip,  locations.lat, locations.lng, coursetypes.coursetypename,   coursetypes.comments, coursetypes.PaperBookName, coursetypes.PaperBookPrice, coursetypes.ElecBookName, coursetypes.ElecBookPrice, coursetypes.PaperBookDesc, coursetypes.ElecBookDesc,  scheduledcourses.coursetype,   scheduledcourses.coursedate,   scheduledcourses.coursetime,   scheduledcourses.onlinekey,   scheduledcourses.courseendtime,   scheduledcourses.coursenumberofseats, scheduledcourses.coursestatus,  scheduledcourses.coursecost,   scheduledcourses.notes, scheduledcourses.agent_id,  scheduledcourses.scheduledcoursesid,scheduledcourses. parent_ts_id,scheduledcourses.OfferPaperBook, scheduledcourses.OfferElecBook,  certifications.certification_name,   scheduledcourses.agencyid, coursetypes.coursetypecert,instructors.instructor_bio,location_geolocations.lat,location_geolocations.lng,locations.locationphotos,locations.locationsid,scheduledcourses.sellkey,scheduledcourses.onlinekey,coursetypes.keyassoc FROM  scheduledcourses  INNER JOIN coursetypes ON (scheduledcourses.coursetype=coursetypes.coursetypesid)  INNER JOIN locations ON (scheduledcourses.courselocationid=locations.locationsid)  INNER JOIN instructors ON (scheduledcourses.courseinstructor=instructors.instructorsid) LEFT JOIN location_geolocations ON (location_geolocations.locationsid=locations.locationsid)  LEFT OUTER JOIN certifications ON (coursetypes.coursetypecert=certifications.id) WHERE scheduledcourses.scheduledcoursesid = '$sid' AND (scheduledcourses.coursestatus = 'scheduled' OR scheduledcourses.coursestatus = 'accepted' OR scheduledcourses.coursestatus = 'completed' OR scheduledcourses.coursestatus = 'closed')";$get_cur_info = mysql_fetch_array(mysql_query($query_rsScheduledCourses));//get agency info$a_name = "";if(!empty($get_cur_info['agencyid'])){$agency_id = $get_cur_info['agencyid'];$get_agency = mysql_fetch_row(mysql_query("select agency_name from course_agency where agencyid='$agency_id' "));$a_info = '<tr><td>Provider</td><td>'.$get_agency[0].'</td></tr>';}$a_email = "";if(!empty($get_cur_info['agent_id'])){    $aid = $get_cur_info['agent_id'];       $get_agent_email = mysql_fetch_array(mysql_query("select agent_email from corporate_agents where client_id = '$aid'"));      $a_email = ','.$get_agent_email['agent_email'];}$tsid = $get_cur_info['parent_ts_id'];$get_email_template = mysql_fetch_array(mysql_query("select tmp.*, tc.stu_reg,tc.tcompany_name from training_sites_config tc, training_sites_email_template tmp where tc.tsid = tmp.tsid  and tmp.email_type = 'stu_reg' and tmp.tsid = '$tsid' "));$qry = mysql_query("select contact_email,company_name from training_sites where tsid = '$tsid'") or die(mysql_error());$res_em = mysql_fetch_array($qry);$get_temail = ','.$res_em['contact_email'];$tr_email = $res_em['contact_email'];$get_tcmpname = $res_em['company_name'];if(!empty($get_email_template['email_subject']) && $get_email_template['stu_reg'] == 1 ){   $subject = $get_email_template['email_subject'];    }else{$subject="Course Registration";}if(!empty($get_email_template['email_sender']) && $get_email_template['stu_reg'] == 1 ){   $from = $get_email_template['email_sender'];    }else{$from = '[email protected]';}$efile = "http://www.alwayscpr.com/events_new/".$get_cur_info['scheduledcoursesid'].".ics";$mlink = $get_cur_info['lat'].','.$get_cur_info['lng'];$body='        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />        <meta name="viewport" content="width=device-width"/><style>a {    color: #000000;}</style></head><body>';$tcmp_name = 'Always CPR Training Center';if(!empty($get_tcmpname)){$tcmp_name = $get_tcmpname;}if(!empty($get_email_template['tcompany_name'])){$tcmp_name = $get_email_template['tcompany_name'];}$body .= '<table class="twelve columns"><tr>   <td>          <h1 class="style2">Hi  '.$uname.',</h1>         <p class="lead style1">Thank you for Registering with '.$tcmp_name.'.</p></td>  </tr>  </table>';if(!empty($get_email_template['email_body']) && $get_email_template['stu_reg'] == 1 ){      $body .= '<br/><p>'.$get_email_template['email_body'].'</p><br/><br/>                           <table class="twelve columns" bgcolor="#3e91cf" style="color:#fff;">                        <tr>                          <td class="panel">';               }else{  $body .= '<table class="twelve columns" bgcolor="#3e91cf" style="color:#fff;">                        <tr>                          <td class="panel">                                                 <h3>Course Information:</h3>';}$body .= '<table>                            <tr>                                             <td>Course ID</td><td>'.$get_cur_info['scheduledcoursesid'].'</td></tr><tr>                 <td>Course Type</td><td>'.$get_cur_info['coursetypename'].' - '.$get_cur_info['coursetypecert'].'</td></tr>'.$a_info.'                                           <tr> <td>Course Date</td><td><a href="'.$efile.'">'.date("F d Y",strtotime( $get_cur_info['coursedate'])).'&nbsp;<img src="http://www.alwayscpr.com/img_new/callender-ico.png" width="20" height="20"/></a></td></tr><tr>                                                 <td>Course Time</td><td>'.date("g:i a",strtotime($get_cur_info['coursetime'])).' - '.date("g:i a",strtotime($get_cur_info['courseendtime'])).'</td></tr><tr>                                                 <td>Course Instructor</td><td>'.$get_cur_info['instructorname'].' '.$get_cur_info['instructorlastname'].'</td></tr><tr>     <td>Course Location</td><td><a href="http://maps.google.com/maps?daddr='.$mlink.'">'.$get_cur_info['locationname'].'<br>'.$get_cur_info['locationaddress'].'<br>'.$get_cur_info['locationaddress2'].'<br>'.$get_cur_info['locationcity'].' '.$get_cur_info['locationstate'].' '.$get_cur_info['locationzip'].'</a></td></tr><tr>                                              <td>Course Notes</td><td>'.$get_cur_info['notes'].'</td></tr>                                                                                                </table>                                     </td>                        </tr>                      </table>                                        <table class="twelve columns">                        <tr>                          <td align="center">                            <center>                              <p class="style1" style="text-align:center;">This email was automatically generated by: AlwaysCPR Course Management System<br />                                Do Not Reply to this address.<br />                              If you have any questions, please contact us at [email protected] or call us 1-855-277-4339</p>                            </center>                          </td>                          <td class="expander"></td>                        </tr>                      </table>';         if(!empty($get_email_template['email_signature']) && $get_email_template['stu_reg'] == 1 ){    $body .= '<br/><p>'.$get_email_template['email_signature'].'</p><br/><br/>'; }else{  $body .='<br/<br/><table>  <tbody>    <tr>      <td align="center"><center>        <p>This email was automatically generated by: AlwaysCPR Course Management System<br />          Do Not Reply to this address</p>      </center></td>      <td>&nbsp;</td>    </tr>  </tbody></table>';}   $body .='</body></html>';$headers = "From: " . strip_tags($from) . "\r\n";$headers .= "Reply-To: ". strip_tags($from) . "\r\n";$headers .= "MIME-Version: 1.0\r\n";$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"."Bcc: [email protected],[email protected]".$get_temail.$a_email."\r\n"."X-Mailer: PHP/" . phpversion();//mail($to,$subject,$body,$headers);//Admin Notification$to = $tr_email;$actual_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";$body = "<p><h5>A New Student has registered at ".$tcmp_name." </h5></p>";$body .="<b>Student Details:</b><br/>Name: ".$ufullname."<br/>Email: ".$uemail."<br/>Phone: ".$uphone."<br/>Address: ".$uaddr." <br/><bt/>Refer URL: ".$actual_link."<br/><br/> --------<br/>This email is automatically generated.<br/>Do not reply to this email address.";$subject="New Student Registration";$headers = "From: " . strip_tags($from) . "\r\n";$headers .= "Reply-To: ". strip_tags($from) . "\r\n";$headers .= "MIME-Version: 1.0\r\n";$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"."Bcc: [email protected],[email protected]\r\n"."X-Mailer: PHP/" . phpversion();//mail($to,$subject,$body,$headers);}function get_client_ip() {    $ipaddress = '';    if (getenv('HTTP_CLIENT_IP'))        $ipaddress = getenv('HTTP_CLIENT_IP');    else if(getenv('HTTP_X_FORWARDED_FOR'))        $ipaddress = getenv('HTTP_X_FORWARDED_FOR');    else if(getenv('HTTP_X_FORWARDED'))        $ipaddress = getenv('HTTP_X_FORWARDED');    else if(getenv('HTTP_FORWARDED_FOR'))        $ipaddress = getenv('HTTP_FORWARDED_FOR');    else if(getenv('HTTP_FORWARDED'))       $ipaddress = getenv('HTTP_FORWARDED');    else if(getenv('REMOTE_ADDR'))        $ipaddress = getenv('REMOTE_ADDR');    else        $ipaddress = 'UNKNOWN';    return $ipaddress;}?><script type="text/javascript">function chk_ccode(v){  $('#chk-ccode-info').html("Please wait...");    $("#reg_btn_info").hide();   top_p = $('#h_tt').val();       tot_c = $("#class_fee").val();  scid = "<?= $_SESSION['scid'] ?>";      $.ajax({                          url: 'checkccode.php',              type: 'post',                    cache: false,                   data: {"ccode":v.value,"tot":top_p,"cfee":tot_c,"scid":scid},                   success: function (data) {                  if(data == "false"){                                   $('#ccode').val('');                                    $('#chk-ccode-info').html("Invalid Coupon Code");                            }                                else{                           var ret = data.split("####");                           $('#chk-ccode-info').html(ret[0]+": - $"+ret[2]);                                                    $('#h_tt').val(ret[1]);                                         $("#dis_code_cart").val($('#ccode').val());                                     $("#dis_code_amt").val(ret[2]);                                              $('#tt').html("$"+ret[1]);                              $("#coupon_add_opt").hide();                            }           $("#reg_btn_info").show();                        }               });}</script>                 </div>                             </div>  </div></section>                             <?php include($footer); ?>

Function Calls

None

Variables

None

Stats

MD5 d246f451a63f22e4cc7ba2f088be61c3
Eval Count 0
Decode Time 133 ms