config->user_statics = json_decode($sh->config->user_statics); // foreach ($sh->config->user_statics as $key => $value) { // $ar[] = $value->new_users; // } // $ar = json_encode($ar); // $orders = $db->orderBy('id','DESC')->get(T_ORDERS,10); $rang_link = ''; $code = 'm'; $main_range = 'This Year'; $title = "Yearly"; $array = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0); $pt->users_array = implode(', ', $array); $pt->posts_array = implode(', ', $array); $pt->videos_array = implode(', ', $array); $pt->comments_array = implode(', ', $array); $pt->likes_array = implode(', ', $array); $pt->dislikes_array = implode(', ', $array); if (empty($_GET['range'])) { $_GET['range'] = 'This Year'; } if (!empty($_GET['range']) && in_array($_GET['range'], array('Today','Yesterday','This Week','This Month','Last Month','This Year'))) { if ($_GET['range'] == 'Today' || $_GET['range'] == 'Yesterday') { $main_range = 'Today'; $title = "Daily"; } elseif ($_GET['range'] == 'This Week') { $main_range = 'This Week'; $title = "Weekly"; } elseif ($_GET['range'] == 'This Month' ||$_GET['range'] == 'Last Month') { $main_range = 'This Month'; $title = "Monthly"; $month_days = cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y')); if ($_GET['range'] == 'Last Month') { $month_days = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime("-1 month")), date('Y')); } } $info = $db->where('name',$_GET['range'])->getOne(T_DASHBOARD_REPORTS); $infoData = json_decode($info->value); $pt->users_array = $infoData->users_array; $pt->posts_array = $infoData->posts_array; $pt->videos_array = $infoData->videos_array; $pt->comments_array = $infoData->comments_array; $pt->likes_array = $infoData->likes_array; $pt->dislikes_array = $infoData->dislikes_array; } $start = ''; $end = ''; $first_code = ''; $second_code = ''; if (!empty($_GET['range']) && !in_array($_GET['range'], array('Today','Yesterday','This Week','This Month','Last Month','This Year'))) { $arr = explode('-', $_GET['range']); if (preg_match('~(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d~m', $arr[0]) && preg_match('~(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d~m', $arr[1])) { $start = PT_Secure($arr[0]); $end = PT_Secure($arr[1]); $this_start = strtotime($start); $this_end = strtotime($end); $month_days = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime($start)), date('Y',strtotime($start))); $diff = abs(strtotime($end) - strtotime($start)); $years = floor($diff / (365*60*60*24)); $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); if ($years >= 1) { $array = array(); for ($i=date('Y',strtotime($start)); $i <= date('Y',strtotime($end)); $i++) { $array["'".$i."'"] = 0; } $main_range = 'Custom'; $code = 'Y'; $title = "Yearly"; } elseif ($months >= 1) { $array = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0); $code = 'm'; $main_range = 'This Year'; $title = "Monthly"; if (date('Y',strtotime($start)) == date('Y',strtotime($end))) { $array = array(); for ($i=date('m',strtotime($start)); $i <= date('m',strtotime($end)); $i++) { $array["'".(int)$i."'"] = 0; } $code = 'm'; $main_range = 'Custom'; } else{ $month = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime($start)), date('Y',strtotime($start))); $array = array(); for ($i=(int)date('m',strtotime($start)); $i <= 12; $i++) { $array["'".(int)$i.'-'.date('Y',strtotime($start))."'"] = 0; } for ($i=1; $i <= (int)date('m',strtotime($end)); $i++) { $array["'".(int)$i.'-'.date('Y',strtotime($end))."'"] = 0; } $first_code = 'm'; $second_code = 'Y'; $main_range = 'Custom'; } } elseif ($days > 7) { if (date('m',strtotime($start)) == date('m',strtotime($end))) { $array = array(); for ($i=date('d',strtotime($start)); $i <= date('d',strtotime($end)); $i++) { $array["'".(int)$i."'"] = 0; } $code = 'd'; $main_range = 'Custom'; } else{ $month = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime($start)), date('Y',strtotime($start))); $array = array(); for ($i=(int)date('d',strtotime($start)); $i <= $month; $i++) { $array["'".(int)$i.'-'.date('m',strtotime($start))."'"] = 0; } for ($i=1; $i <= (int)date('d',strtotime($end)); $i++) { $array["'".(int)$i.'-'.date('m',strtotime($end))."'"] = 0; } $first_code = 'd'; $second_code = 'm'; $main_range = 'Custom'; } $title = "Daily"; } elseif ($days >= 1 && $days < 8) { $title = "Daily"; $code = 'l'; $array = array('Saturday' => 0 , 'Sunday' => 0 , 'Monday' => 0 , 'Tuesday' => 0 , 'Wednesday' => 0 , 'Thursday' => 0 , 'Friday' => 0); if (date('m',strtotime($start)) == date('m',strtotime($end))) { $array = array(); for ($i=date('d',strtotime($start)); $i <= date('d',strtotime($end)); $i++) { $array["'".(int)$i."'"] = 0; } $code = 'd'; $main_range = 'Custom'; } else{ $month = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime($start)), date('Y',strtotime($start))); $array = array(); for ($i=(int)date('d',strtotime($start)); $i <= $month; $i++) { $array["'".(int)$i.'-'.date('m',strtotime($start))."'"] = 0; } for ($i=1; $i <= (int)date('d',strtotime($end)); $i++) { $array["'".(int)$i.'-'.date('m',strtotime($end))."'"] = 0; } $first_code = 'd'; $second_code = 'm'; $main_range = 'Custom'; } } $users_array = $array; $posts_array = $array; $videos_array = $array; $comments_array = $array; $likes_array = $array; $dislikes_array = $array; //$year_sub = $db->where('status','Received')->where('time',$this_start,'>=')->where('time',$this_end,'<=')->get(T_ORDERS); $users = $db->where('time',$this_start,'>=')->where('time',$this_end,'<=')->get(T_USERS); $posts = $db->where('time',$this_start,'>=')->where('time',$this_end,'<=')->get(T_POSTS); $videos = $db->where('time',$this_start,'>=')->where('time',$this_end,'<=')->get(T_VIDEOS); $comments = $db->where('time',$this_start,'>=')->where('time',$this_end,'<=')->get(T_COMMENTS); $likes = $db->where('time',$this_start,'>=')->where('time',$this_end,'<=')->where('type',1)->get(T_DIS_LIKES); $dislikes = $db->where('time',$this_start,'>=')->where('time',$this_end,'<=')->where('type',2)->get(T_DIS_LIKES); foreach ($users as $key => $value) { $day = date($code,$value->time); if ($main_range == 'Custom' && !empty($first_code) && !empty($second_code)) { $day = "'".(int)date($first_code,$value->time).'-'.(int)date($second_code,$value->time)."'"; } elseif ($main_range == 'Custom') { $day = "'".(int)date($code,$value->time)."'"; } if (in_array($day, array_keys($users_array))) { $users_array[$day] += 1; } } foreach ($posts as $key => $value) { $day = date($code,$value->time); if ($main_range == 'Custom' && !empty($first_code) && !empty($second_code)) { $day = "'".(int)date($first_code,$value->time).'-'.(int)date($second_code,$value->time)."'"; } elseif ($main_range == 'Custom') { $day = "'".(int)date($code,$value->time)."'"; } if (in_array($day, array_keys($users_array))) { $posts_array[$day] += 1; } } foreach ($videos as $key => $value) { $day = date($code,$value->time); if ($main_range == 'Custom' && !empty($first_code) && !empty($second_code)) { $day = "'".(int)date($first_code,$value->time).'-'.(int)date($second_code,$value->time)."'"; } elseif ($main_range == 'Custom') { $day = "'".(int)date($code,$value->time)."'"; } if (in_array($day, array_keys($users_array))) { $videos_array[$day] += 1; } } foreach ($comments as $key => $value) { $day = date($code,$value->time); if ($main_range == 'Custom' && !empty($first_code) && !empty($second_code)) { $day = "'".(int)date($first_code,$value->time).'-'.(int)date($second_code,$value->time)."'"; } elseif ($main_range == 'Custom') { $day = "'".(int)date($code,$value->time)."'"; } if (in_array($day, array_keys($users_array))) { $comments_array[$day] += 1; } } foreach ($likes as $key => $value) { $day = date($code,$value->time); if ($main_range == 'Custom' && !empty($first_code) && !empty($second_code)) { $day = "'".(int)date($first_code,$value->time).'-'.(int)date($second_code,$value->time)."'"; } elseif ($main_range == 'Custom') { $day = "'".(int)date($code,$value->time)."'"; } if (in_array($day, array_keys($users_array))) { $likes_array[$day] += 1; } } foreach ($dislikes as $key => $value) { $day = date($code,$value->time); if ($main_range == 'Custom' && !empty($first_code) && !empty($second_code)) { $day = "'".(int)date($first_code,$value->time).'-'.(int)date($second_code,$value->time)."'"; } elseif ($main_range == 'Custom') { $day = "'".(int)date($code,$value->time)."'"; } if (in_array($day, array_keys($users_array))) { $dislikes_array[$day] += 1; } } $pt->users_array = implode(', ', $users_array); $pt->posts_array = implode(', ', $posts_array); $pt->videos_array = implode(', ', $videos_array); $pt->comments_array = implode(', ', $comments_array); $pt->likes_array = implode(', ', $likes_array); $pt->dislikes_array = implode(', ', $dislikes_array); } } ?>
Important! There are some errors found on your system, please review System Status.
Dashboard

Users Chart

Videos , Posts Chart

TOTAL VIDEOS
video_library
{{CONFIG total_videos}}
TOTAL VIDEOS VIEWS
remove_red_eye
{{CONFIG total_views}}
TOTAL USERS
people
{{CONFIG total_users}}
TOTAL SUBSCRIPTIONS
person_add
{{CONFIG total_subs}}
TOTAL VIDEOS COMMENTS
comment
{{CONFIG total_comments}}
TOTAL VIDEOS LIKES
thumb_up
{{CONFIG total_likes}}
TOTAL VIDEOS DISLIKES
thumb_down
{{CONFIG total_dislikes}}
TOTAL SAVED VIDEOS
save
{{CONFIG total_saved}}

Comments , Likes , Dislikes Chart