0

I have some break times available in my module. In one for loop i need to remove break times. I have three break times 11:30 am to 11:45 am and lunch break 01:30 pm to 02:30 pm and tea break 04:30 pm to 04:45 pm

<?php
$start = new DateTime("09:30 am");
$end = new DateTime("06:30 pm");
$current = clone $start;
while ($current <= $end) {
    echo $current->format("h:i a"), "\n";
    $current->modify("+15 minutes");
}

?>

Please help me to solve this problem

1
Contributor
1
Reply
13
Views
2 Years
Discussion Span
Last Post by ramsiva
0

Below is my code to insert times.

I need only working times.any body help me

  <?php for ($i = 0; $i < $con_count; $i++) { 

   $con_id=$counselor_id1[$i];
   $ab=mysql_query("select * from  tb1_consellor_add where consellors_id='$con_id'")or die(mysql_error());
   $rowab=mysql_fetch_array($ab);
   $conname=$rowab['consellors_name'];  
 ?>

    <div id="fragment-<?php echo $i; ?>">
<h3> <span class="label label-default">Counselor :<?php echo $conname; ?></span></h3>

<?php 
static $ii=0;
static $iii=1;
$a=mysql_query("SELECT c.father_name as father_name,c.application_no as application_no FROM contact c, tb1_consellor_add t where t.consellors_id='$con_id' and c.status='0' and c.con_status='1' ORDER BY c.id ASC LIMIT $ii,$concount ") or die(mysql_error());  ?>

<table class="table table-bordered">
               <thead>
            <tr>,
              <th>Sno</th>
              <th>Name</th>
              <th>Form Number</th>
              <th>Time</th>
              </tr>
              </thead><tbody>
<?php while($rowa=mysql_fetch_array($a)){
$name=$rowa['father_name'];
$application_no=$rowa['application_no']; 
/*SELECT productCode,
       productName,
       buyPrice
FROM products
WHERE buyPrice BETWEEN 90 AND 100*/


?>

               <tr>  
              <td><?php echo $iii; ?></td>
              <td><?php echo $name; ?></td>
              <td><?php echo $application_no; ?></td>
              <td><?php echo "H-m-am/pm"; ?></td></tr>



<?php

$iii++;  }
?>
              </tbody>
              </table>
     </div>  <?php  $ii=$ii+$concount; 
                    }  ?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.