Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //buat variabel $intervals sebagai suatu array
- $intervals=array();
- foreach($product as $products) :
- $slangtype = explode ("-",$products['product_slangtype']);
- ?>
- <tr class="task Hoog" id="project-0">
- <td align="center" valign="middle">
- <input type="checkbox" name="projectslist[]" value="#project-0" checked="checked">
- </td>
- <td><?php echo $products['product_rn']; ?></td>
- <td class="title">
- <div class="task_title">
- <a href="http://mvdb-certificaten.ebbersmediaweb.nl/index.html#project-0"
- title="Bewerken" class="edit_slangtype"
- rel="projects/save.php">
- <?php echo $slangtype[1] ?>
- </a>
- <div class="quick_options fr">
- <a href="product_edit.php?idp=<?php echo $products['id_product'] ?>"
- title="Bewerken" class="do_edit"></a>
- <a href="" onclick="return confirm('Delete this data?')"
- title="Verwijderen" class="do_delete"></a>
- </div>
- </div>
- </td>
- <td>
- <?php echo date('d-m-Y',strtotime($products['product_created'])); ?>
- </td>
- <?php
- $res=strtotime(date('d-m-Y',strtotime($products['product_created'])).'+'.$products['product_k_freq'].' month');
- $interval=ceil(abs($res-strtotime(date('d-m-Y')))/86400);
- //check apakah $intervals utk account sesuai $products['id_user'] sudah ada?
- if(isset($interval[$products['id_user']]))
- {
- //jika sudah ada, tambahkan dengan nilai yg didapat
- $intervals[$products['id_user']]['product'][]=$products['product_rn'];
- $intervals[$products['id_user']]['interval']+=$interval;
- }
- else
- {
- //jika belum ada, buat baru dan isi dengan nilai yang didapat
- $intervals[$products['id_user']]=array();
- $intervals[$products['id_user']]['interval']=$interval;
- $intervals[$products['id_user']]['product']=array();
- $intervals[$products['id_user']]['product'][]=$products['product_rn'];
- }
- ?>
- <td><input type="text" value="<?php echo date('d-m-Y',$res); ?>"
- class="input_clean date-pick_table"></td>
- <td><?php echo $interval; ?> dagen</td>
- <td><?php echo $products['product_fabrikant'] ?></td>
- <td>
- <a class="open_accordion"
- href="keuring_add.php?idp=<?php echo $products['id_product']; ?>"
- title="">Keuren</a>
- </td>
- </tr>
- <?php
- endforeach;
- foreach($intervals as $id_user => $interval)
- {
- if($interval['interval']==60)
- {
- //kirim email ke account $id_user
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement