VM暫存
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Cario_seat_report_day.php 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. class Cario_seat_report_day extends CI_Controller {
  4. public function __construct() {
  5. parent::__construct();
  6. $this->load->library('session');
  7. $this->load->model('reports/Cario_seat_model','cario_seat');
  8. }
  9. public function index()
  10. {
  11. $post_data= $this->input->post(NULL, TRUE);
  12. $get_data= $this->input->get(NULL, TRUE);
  13. $sin_time="";
  14. $ein_time="";
  15. $sin_time0="";
  16. $ein_time0="";
  17. $sin_time1="";
  18. $ein_time1="";
  19. $sin_tim2e="";
  20. $in_lane_seat_tot=0;
  21. $in_lane_seat_avg=array();
  22. if(isset($post_data['sin_time'])){
  23. $sin_time0= isset($post_data['sin_time']) ? $post_data['sin_time']:'0000-00-00';
  24. $ein_time0= isset($post_data['ein_time']) ? $post_data['ein_time']:'0000-00-00';
  25. }elseif(isset($get_data['sin_time'])){
  26. $sin_time0= isset($get_data['sin_time']) ? $get_data['sin_time']:'0000-00-00';
  27. $ein_time0= isset($get_data['ein_time']) ? $get_data['ein_time']:'0000-00-00';
  28. }
  29. $sin_time1= strtotime($sin_time0);
  30. $ein_time1= strtotime($ein_time0);
  31. for($i=0; $i<=(($ein_time1-$sin_time1)/86400); $i++){
  32. $sin_time= date('Y-m-d H:i:s',$sin_time1+(86400*$i));
  33. $sin_tim2e= date('Y-m-d',$sin_time1+(86400*$i));
  34. $ein_time= date('Y-m-d H:i:s',$sin_time1+(86400*$i)+86400);
  35. $sel_cario_seat=$this->cario_seat->sel_cario_seat($sin_time,$ein_time);
  36. $in_lane_seat_tot=0;
  37. foreach($sel_cario_seat as $key0 => $val0){
  38. $in_lane_datetime=strtotime($val0['in_lane_datetime']);
  39. $in_seat_datetime=strtotime($val0['in_seat_datetime']);
  40. $in_lane_seat=($in_seat_datetime-$in_lane_datetime)/60;
  41. $in_lane_seat_tot=$in_lane_seat_tot + $in_lane_seat;
  42. }
  43. if(count($sel_cario_seat) > 0 ){
  44. $in_lane_seat_avg[]=array(
  45. "in_date" => $sin_tim2e,
  46. "countlpr" => count($sel_cario_seat),
  47. "tot" => floor($in_lane_seat_tot),
  48. "avg" => floor($in_lane_seat_tot/count($sel_cario_seat))
  49. );
  50. }
  51. }
  52. $this->front = new stdClass();
  53. $this->front->sin_time = $sin_time0;
  54. $this->front->ein_time = $ein_time0;
  55. $this->front->in_lane_seat_avg=$in_lane_seat_avg;
  56. $data=$this->front;
  57. $this->load->view('reports/cario_seat_report_day',$data);
  58. }
  59. }