0

私は、電子メールで 2 つのアラートを送信する必要があるプロジェクトに取り組んでいます。私は1つの電子メールアラートを実装し、正常に機能し、電子メールの配信が成功した後に完了としてステータスメッセージを取得していますが、2番目のアラートについては、service_statusとしてもう1つの列を追加しました. 電子メール機能は正常に動作していますが、null または空の値を表示する代わりに完了を表示していませんが、データベースの値は「完了」しています...これは、完了した結果を表示する必要がある私のコードです。

  <?php 
if(count($det)){
?>

<?php for($i=0;$i<count($det);$i++)
{?>
 <tr class="rowvalues">
<td rowspan="2" class="bottomcolor">
        <input  type="checkbox"  name="list[]"  value="<?php echo $det[$i]['customer_id']; ?>" /></td>
<td rowspan="2" class="bottomcolor"><?php echo $det[$i]['customer_title'].".".$det[$i]['customer_surname']; ?></td>
<td rowspan="2" class="bottomcolor"><?php echo $det[$i]['vehicle_regno']; ?></td>
<td>Reminder1</td>
<td><?php
        if ($det[$i]['reminder1_duedate'] != '0000-00-00'){
         echo date('d/m/Y',strtotime($det[$i]['reminder1_duedate']));}else{echo '00/00/0000';} ?></td>
<td><?php if ($det[$i]['reminder1_duedate'] != '0000-00-00'){ echo  date('d/m/Y',strtotime($det[$i]['reminder1_duedate'].'- 28 days'));}else{echo '00/00/0000';} ?></td>
<td><?php if ($det[$i]['reminder1_duedate'] != '0000-00-00'){ echo  date('d/m/Y',strtotime($det[$i]['reminder1_duedate'].'- 14 days'));}else{echo '00/00/0000';} ?></td>
<td><?php if ($det[$i]['reminder1_duedate'] != '0000-00-00'){ echo  date('d/m/Y',strtotime($det[$i]['reminder1_duedate'].'- 2 days'));}else{echo '00/00/0000';} ?></td>
<td><?php echo isset($det[$i]['reminder1_status'])?($det[$i]['status']=='c')?'Completed':'Pending':'';?>           </td>
<td rowspan="2" class="bottomcolor"><a href="<?php echo base_url();?>preview/view_vehicle.php?vid=<?php echo $det[$i]['customer_id'];?>" rel="facebox"><img src="<?php echo base_url();?>images/view.gif" alt="View"/></a>
       <a style="text-decoration:none;" href="<?php echo base_url();?>index.php/vehicles/edit_mot/<?php echo $det[$i]['customer_id'];?>" title="Edit"> <img src="<?php echo base_url();?>images/edit.gif" alt="search"/></a> <a style="text-decoration:none;" href="<?php echo base_url();?>index.php/vehicles/view/delete/<?php echo $det[$i]['customer_id'];?>" onclick="return confirm('Are you sure you want to delete this Vehicle Details?');" title="Delete">
        <img src="<?php echo base_url();?>images/delete.gif" alt="delete"/></a></td>
    </tr>
    <tr>
    <td class="bottomcolor">Reminder 2</td>
     <td class="bottomcolor"><?php
        if ($det[$i]['reminder2_duedate'] != '0000-00-00'){
         echo date('d/m/Y',strtotime($det[$i]['reminder2_duedate'])); }else{echo '00/00/0000';}?></td>
    <td class="bottomcolor"><?php if ($det[$i]['reminder2_duedate'] != '0000-00-00'){ echo  date('d/m/Y',strtotime($det[$i]['reminder2_duedate'].'- 28 days'));}else{echo '00/00/0000';}?></td>
    <td class="bottomcolor"><?php if ($det[$i]['reminder2_duedate'] != '0000-00-00'){ echo  date('d/m/Y',strtotime($det[$i]['reminder2_duedate'].'- 14 days'));}else{echo '00/00/0000';}?> </td>
    <td class="bottomcolor"><?php if ($det[$i]['reminder2_duedate'] != '0000-00-00'){ echo  date('d/m/Y',strtotime($det[$i]['reminder2_duedate'].'- 2 days'));}else{echo '00/00/0000';}?> </td>
    <td class="bottomcolor"><?php echo isset($det[$i]['reminder2_status'])?($det[$i]['service_status']=='c')?'Completed':'Pending':'';?>          </td>
    </tr>

             <?php } 
          }
     else{ echo '<div class="row"><p  style="text-align:center;"><strong>No records found</strong></p></div>'; 
    } ?>

  </table>      

問題はこのコード行にあります

        <td class="bottomcolor"><?php echo isset($det[$i]['reminder2_status'])?($det[$i]['service_status']=='c')?'Completed':'Pending':'';?>          </td>

これは空またはnull値を返しています

4

2 に答える 2

1

おそらく $det[$i]['reminder_status'] 変数が定義されていないためです。mysql クエリを呼び出す $det 変数を確認します。Reminder_status 列が mysql を介して返されることを確認してください。

于 2013-05-22T04:16:04.827 に答える