Advertisement
Guest User

unzend.com_ioncube_decoder92

a guest
May 25th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.23 KB | None | 0 0
  1. <?php
  2.  
  3. ioncube decoder https://www.unzend.com
  4. define("ADMINAREA", true);
  5. require("../init.php");
  6. $aInt = new WHMCS\Admin("Support Center Overview");
  7. $aInt->title = AdminLang::trans("support.supportoverview");
  8. $aInt->sidebar = "support";
  9. $aInt->icon = "support";
  10. $aInt->helplink = "Support Center";
  11. $aInt->requiredFiles(array( "ticketfunctions", "reportfunctions" ));
  12. ob_start();
  13. echo "\n<form method=\"post\" action=\"" . $_SERVER["PHP_SELF"] . "\">\n<div style=\"background-color:#f6f6f6;padding:5px 15px;\">" . AdminLang::trans("support.displayOverview") . "<select name=\"period\" class=\"form-control select-inline\" onchange=\"submit()\"><option>" . AdminLang::trans("calendar.today") . "</option><option" . (($period == "Yesterday" ? " selected" : "")) . ">" . AdminLang::trans("calendar.yest") . "</option><option" . (($period == "This Week" ? " selected" : "")) . ">" . AdminLang::trans("calendar.thisWeek") . "</option><option" . (($period == "This Month" ? " selected" : "")) . ">" . AdminLang::trans("calendar.thisMonth") . "</option><option" . (($period == "Last Month" ? " selected" : "")) . ">" . AdminLang::trans("calendar.lastMonth") . "</option></select></div>\n</form>\n\n<div style=\"border:2px solid #f6f6f6;border-top:0;\">";
  14. $chart = new WHMCSChart();
  15. if( $period == "Yesterday" )
  16. {
  17.     $date = "date LIKE '" . date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 1, date("Y"))) . "%'";
  18. }
  19. else
  20. {
  21.     if( $period == "This Week" )
  22.     {
  23.         $last_monday = strtotime("last monday");
  24.         $next_sunday = strtotime("next sunday");
  25.         $date = "date>='" . date("Y-m-d", $last_monday) . "' AND date<='" . date("Y-m-d", $next_sunday) . " 23:59:59'";
  26.     }
  27.     else
  28.     {
  29.         if( $period == "This Month" )
  30.         {
  31.             $date = "date LIKE '" . date("Y-m-") . "%'";
  32.         }
  33.         else
  34.         {
  35.             if( $period == "Last Month" )
  36.             {
  37.                 $date = "date LIKE '" . date("Y-m-", mktime(0, 0, 0, date("m") - 1, date("d"), date("Y"))) . "%'";
  38.             }
  39.             else
  40.             {
  41.                 $date = "date LIKE '" . date("Y-m-d") . "%'";
  42.             }
  43.  
  44.         }
  45.  
  46.     }
  47.  
  48. }
  49.  
  50. $newtickets = get_query_val("tbltickets", "COUNT(id)", (string) $date);
  51. $clientreplies = get_query_val("tblticketreplies", "COUNT(id)", (string) $date . " AND admin=''");
  52. $staffreplies = get_query_val("tblticketreplies", "COUNT(id)", (string) $date . " AND admin!=''");
  53. $hours = array(  );
  54. $maxHour = (!$period || $period == "Today" ? date("H") : 23);
  55. for( $hour = 0; $hour <= $maxHour; $hour++ )
  56. {
  57.     $hours[str_pad($hour, 2, 0, STR_PAD_LEFT)] = 0;
  58. }
  59. $replytimes = array( 1 => "0", 2 => 0, 4 => "0", 8 => "0", 16 => "0", 24 => "0" );
  60. $avefirstresponse = "0";
  61. $avefirstresponsecount = "0";
  62. $opennoreply = "0";
  63. $result = full_query("SELECT id,date,(SELECT date FROM tblticketreplies WHERE tblticketreplies.tid=tbltickets.id AND admin!='' LIMIT 1) FROM tbltickets WHERE " . $date . " ORDER BY id ASC");
  64. while( $data = mysql_fetch_array($result) )
  65. {
  66.     list($ticketid, $dateopened, $datefirstreply) = $data;
  67.     $datehour = substr($dateopened, 11, 2);
  68.     $hours[$datehour]++;
  69.     if( !$datefirstreply )
  70.     {
  71.         $opennoreply++;
  72.     }
  73.     else
  74.     {
  75.         $timetofirstreply = strtotime($datefirstreply) - strtotime($dateopened);
  76.         $timetofirstreply = round($timetofirstreply / (60 * 60), 2);
  77.         $avefirstresponse += $timetofirstreply;
  78.         $avefirstresponsecount++;
  79.         if( $timetofirstreply <= 1 )
  80.         {
  81.             $replytimes[1]++;
  82.         }
  83.         else
  84.         {
  85.             if( 1 < $timetofirstreply && $timetofirstreply <= 4 )
  86.             {
  87.                 $replytimes[2]++;
  88.             }
  89.             else
  90.             {
  91.                 if( 4 < $timetofirstreply && $timetofirstreply <= 8 )
  92.                 {
  93.                     $replytimes[4]++;
  94.                 }
  95.                 else
  96.                 {
  97.                     if( 8 < $timetofirstreply && $timetofirstreply <= 16 )
  98.                     {
  99.                         $replytimes[8]++;
  100.                     }
  101.                     else
  102.                     {
  103.                         if( 16 < $timetofirstreply && $timetofirstreply <= 24 )
  104.                         {
  105.                             $replytimes[16]++;
  106.                         }
  107.                         else
  108.                         {
  109.                             $replytimes[24]++;
  110.                         }
  111.  
  112.                     }
  113.  
  114.                 }
  115.  
  116.             }
  117.  
  118.         }
  119.  
  120.     }
  121.  
  122. }
  123. $avefirstresponse = (0 < $avefirstresponsecount ? round($avefirstresponse / $avefirstresponsecount, 2) : "-");
  124. $avereplieschartdata = array(  );
  125. $avereplieschartdata["cols"][] = array( "label" => AdminLang::trans("support.timeframe"), "type" => "string" );
  126. $avereplieschartdata["cols"][] = array( "label" => AdminLang::trans("support.numberOfTickets"), "type" => "number" );
  127. if( 0 < $replytimes[1] )
  128. {
  129.     $avereplieschartdata["rows"][] = array( "c" => array( array( "v" => "0-1 Hours" ), array( "v" => $replytimes[1], "f" => $replytimes[1] ) ) );
  130. }
  131.  
  132. if( 0 < $replytimes[2] )
  133. {
  134.     $avereplieschartdata["rows"][] = array( "c" => array( array( "v" => "1-4 Hours" ), array( "v" => $replytimes[2], "f" => $replytimes[2] ) ) );
  135. }
  136.  
  137. if( 0 < $replytimes[4] )
  138. {
  139.     $avereplieschartdata["rows"][] = array( "c" => array( array( "v" => "4-8 Hours" ), array( "v" => $replytimes[4], "f" => $replytimes[2] ) ) );
  140. }
  141.  
  142. if( 0 < $replytimes[8] )
  143. {
  144.     $avereplieschartdata["rows"][] = array( "c" => array( array( "v" => "8-16 Hours" ), array( "v" => $replytimes[8], "f" => $replytimes[8] ) ) );
  145. }
  146.  
  147. if( 0 < $replytimes[16] )
  148. {
  149.     $avereplieschartdata["rows"][] = array( "c" => array( array( "v" => "16-24 Hours" ), array( "v" => $replytimes[16], "f" => $replytimes[16] ) ) );
  150. }
  151.  
  152. if( 0 < $replytimes[24] )
  153. {
  154.     $avereplieschartdata["rows"][] = array( "c" => array( array( "v" => "24+ Hours" ), array( "v" => $replytimes[24], "f" => $replytimes[24] ) ) );
  155. }
  156.  
  157. $averepliesargs = array(  );
  158. $averepliesargs["title"] = AdminLang::trans("support.averageFirstReplyTime");
  159. $averepliesargs["legendpos"] = "right";
  160. $hourschartdata = array(  );
  161. $hourschartdata["cols"][] = array( "label" => AdminLang::trans("support.timeframe"), "type" => "string" );
  162. $hourschartdata["cols"][] = array( "label" => AdminLang::trans("support.numberOfTickets"), "type" => "number" );
  163. foreach( $hours as $hour => $count )
  164. {
  165.     $hourschartdata["rows"][] = array( "c" => array( array( "v" => $hour ), array( "v" => $count, "f" => $count ) ) );
  166. }
  167. $hoursargs = array(  );
  168. $hoursargs["title"] = AdminLang::trans("support.submitByHour");
  169. $hoursargs["xlabel"] = AdminLang::trans("support.ticketsSubmitted");
  170. $hoursargs["ylabel"] = AdminLang::trans("support.hour");
  171. $hoursargs["legendpos"] = "none";
  172. echo "<style>\n.ticketstatbox {\n    margin: 20px 10px 0;\n    width: 150px;\n    padding: 20px;\n    font-size: 14px;\n    text-align: center;\n    background-color: #FEFAEB;\n    -moz-border-radius: 10px;\n    -webkit-border-radius: 10px;\n    -o-border-radius: 10px;\n    border-radius: 10px;\n}\n.ticketstatbox .stat {\n    font-size: 24px;\n    color: #000066;\n}\n</style>\n<table align=\"center\">\n<tr>\n<td>\n<div class=\"ticketstatbox\">\n" . AdminLang::trans("support.newTickets") . "\n<div class=\"stat\">" . $newtickets . "</div>\n</div>\n</td>\n<td>\n<div class=\"ticketstatbox\">\n" . AdminLang::trans("support.clientReplies") . "\n<div class=\"stat\">" . $clientreplies . "</div>\n</div>\n</td>\n<td>\n<div class=\"ticketstatbox\">\n" . AdminLang::trans("support.staffReplies") . "\n<div class=\"stat\">" . $staffreplies . "</div>\n</div>\n</td>\n<td>\n<div class=\"ticketstatbox\">\n" . AdminLang::trans("support.withoutReply") . "\n<div class=\"stat\">" . $opennoreply . "</div>\n</div>\n</td><td>\n<div class=\"ticketstatbox\">\n" . AdminLang::trans("support.firstResponse") . "\n<div class=\"stat\">" . ((is_numeric($avefirstresponse) ? $avefirstresponse . "" . AdminLang::trans("fields.hours") . "" : "" . AdminLang::trans("global.na") . "")) . "</div>\n</div>\n</td>\n</tr>\n</table>";
  173. echo "<table width=\"100%\"><tr><td width=\"40%\">";
  174. echo $chart->drawChart("Pie", $avereplieschartdata, $averepliesargs, "500px", "100%");
  175. echo "</td><td width=\"60%\">";
  176. echo $chart->drawChart("Bar", $hourschartdata, $hoursargs, "600px", "100%");
  177. echo "</td></tr></table></div>";
  178. $content = ob_get_contents();
  179. ob_end_clean();
  180. $aInt->content = $content;
  181. $aInt->display();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement