Plugin Directory

Changeset 1079010


Ignore:
Timestamp:
01/30/2015 01:56:51 PM (11 years ago)
Author:
theArab
Message:

updates to handling of multiple appointments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skedmaker-online-scheduling/trunk/_include/_form_confirm.php

    r1077780 r1079010  
    1717    $view=$_GET['v'];
    1818    $showApt=SM_apt($ts);
     19
    1920    $multipleWeekday=strtolower(date('l', $ts));
     21    if($multipleWeekday=="monday"){
     22        $today_multiple=$mondaymultiple;
     23    }else if($multipleWeekday=="tuesday"){
     24        $today_multiple=$tuesdaymultiple;
     25    }else if($multipleWeekday=="wednesday"){
     26        $today_multiple=$wednesdaymultiple;
     27    }else if($multipleWeekday=="thursday"){
     28        $today_multiple=$thrusdaymultiple;
     29    }else if($multipleWeekday=="friday"){
     30        $today_multiple=$fridaymultiple;
     31    }else if($multipleWeekday=="saturday"){
     32        $today_multiple=$saturdaymultiple;
     33    }else if($multipleWeekday=="sunday"){
     34        $today_multiple=$sundaymultiple;
     35    }
     36   
     37    echo $today_multiple;
    2038
    2139    if ($_SERVER['REQUEST_METHOD']=='POST' && $_GET['op']=="confirm"){
     
    5876            $client_content=SM_e($client_content);
    5977
    60             if($numberinparty=="" || $numberinparty<1){$numberinparty=1;}
     78//          if($numberinparty=="" || $numberinparty<1){$numberinparty=1;}
     79            if($num_in_party==""){$num_in_party="1";}
    6180
    6281            $DBcode=SM_code();
     
    128147                }
    129148                if($client_phone==""){$client_phone="n/a";}
    130                 if($num_in_party==""){$num_in_party="1";}
     149//              if($num_in_party==""){$num_in_party="1";}
    131150                if($client_content==""){$client_content="n/a";}
    132151
     
    139158                <tr><td class='label150'>Appointment:</td><td class='pad7' style='width:650px;'>".$showApt."</td></tr>
    140159                <tr><td class='label150'>E-mail:</td><td class='pad7' style='width:650px;'><span style='font-weight:normal'>".SM_d($client_email)."</span></td></tr>
    141                 <tr><td class='label150'>Phone:</td><td class='pad7' style='width:650px;'><span style='font-weight:normal'>".SM_d($client_phone)."</span></td></tr>
    142                 <tr><td class='label150'># in Party:</td><td class='pad7' style='width:650px;'><span style='font-weight:normal'>".SM_d($num_in_party)."</span></td></tr>
    143                 <tr><td class='label150'>Message:</td><td class='pad7' style='width:650px;'><span style='font-weight:normal'>".SM_d($client_content)."</span></td></tr>
     160                <tr><td class='label150'>Phone:</td><td class='pad7' style='width:650px;'><span style='font-weight:normal'>".SM_d($client_phone)."</span></td></tr>";
     161                if($num_in_party>1){$bodyData.="<tr><td class='label150'># in Party:</td><td class='pad7' style='width:650px;'><span style='font-weight:normal'>".SM_d($num_in_party)."</span></td></tr>";}
     162                $bodyData.="<tr><td class='label150'>Message:</td><td class='pad7' style='width:650px;'><span style='font-weight:normal'>".SM_d($client_content)."</span></td></tr>
    144163                <tr><td class='pad7' colspan='2'><a href='".$SM_permalink."&amp;op=cancel&amp;aptc=".$DBcode."&amp;#skedtop'>Click here if you need to cancel this appointment</a></td></tr>
    145164                <tr><td class='pad7' colspan='2'><span class='redText'>".$cancelpolicy."</span></td></tr>
     
    238257    <select name='num_in_party' class='form_select'>
    239258    <?php
    240     $result=mysql_query("SELECT numberinparty FROM skedmaker_sked WHERE startdate='$dayTS'") or die(mysql_error());
     259    $result=mysql_query("SELECT numberinparty FROM skedmaker_sked WHERE startdate='$dayTS'") or die(mysql_error());
    241260    while($row=mysql_fetch_array($result)){
    242261        $this_total_taken=SM_d($row['numberinparty']);
     
    245264    }
    246265
    247     $remaining=$partymax-$total_taken;
    248     for($x=1; $x<=$remaining; $x++){ ?>
     266    //======= REMAINING
     267    $remaining=$today_multiple-$total_taken;
     268    for($x=1; $x<=$remaining; $x++){
     269    ?>
    249270    <option value="<?php echo $x;?>" <?php if($x==$num_in_party){ ?> selected="selected" <?php } ?> ><?php echo $x;?></option>
    250271    <?php } ?>
Note: See TracChangeset for help on using the changeset viewer.