3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?PHP include 'connection.php'; require_once("./include/membersite_config.php"); if(!$fgmembersite->CheckLogin()) { $fgmembersite->RedirectToURL("index.php"); exit; } $post_res = ""; $reg_new = ""; $space =""; $status = $fgmembersite->UserFullName(); $query = "SELECT user_level FROM login_verify where name = '$status'" ; $result = mysql_query($query); while($row = mysql_fetch_assoc( $result )) { $status_1 = $row['user_level']; if ($status_1 == "1") { $reg_new = "<li class='dropdown'> <a href='#' class='dropdown-toggle' data-toggle='dropdown'>Register <b class='caret'></b></a> <ul class='dropdown-menu'> <li><a href='register.php'>Register New User</a> </li> <li><a href='device_reg.php'>Register New Device</a> </li> </ul> </li>"; $post_res = "<li class='dropdown'> <a href='#' class='dropdown-toggle' data-toggle='dropdown'>Reporting<b class='caret'></b></a> <ul class='dropdown-menu'> <li><a href='log/file_handle.php'>Post Stats</a> </li> <li><a href='log/cdr.php'>Post CDR</a> </li> <li><a href='#'>CDR Statistics</a> </li> </ul> </li>"; } elseif($status_1 == "0") {$reg_new = "";} } /////////////////////// $month=$dt=$year=$emonth=$edt=$eyear=$startdat=$enddat=$dc=$da= $Avg= ''; $todo = @$_POST['todo']; if(isset($todo) and $todo=="submit"){ $month=$_POST['month']; $dt=$_POST['dt']; $year=$_POST['year']; $emonth=$_POST['emonth']; $edt=$_POST['edt']; $eyear=$_POST['eyear']; $startdat=$enddat= ''; $startdat= "$year-$month-$dt"; $enddat= "$eyear-$emonth-$edt"; $ct = mysql_query("SELECT COUNT(*) as total FROM cdr WHERE end_date BETWEEN '$startdat' AND '$enddat'"); $data=mysql_fetch_assoc($ct); $data = $data['total']; $sm = mysql_query("SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(duration))) as sum FROM cdr WHERE end_date BETWEEN '$startdat' AND '$enddat'"); $data2=mysql_fetch_assoc($sm); $da = $data2['sum']; $daseconds = $da; function seconds_from_time($daseconds) { list($h, $m, $s) = explode(':', $daseconds); return ($h * 3600) + ($m * 60) + $s; } $daseconds = seconds_from_time($daseconds); $seconds = @($daseconds / $data); function time_from_seconds($seconds) { $h = floor($seconds / 3600); $m = floor(($seconds % 3600) / 60); $s = $seconds - ($h * 3600) - ($m * 60); return sprintf('%02d:%02d:%02d', $h, $m, $s); } $Avg = time_from_seconds($seconds); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <title>Home - Total VC Automation</title> <!-- Bootstrap core CSS --> <link href="css/bootstrap.css" rel="stylesheet"> <!-- Add custom CSS here --> <link href="css/modern-business.css" rel="stylesheet"> <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet"> <link rel="STYLESHEET" type="text/css" href="style/fg_membersite.css" /> <script type='text/javascript' src='scripts/gen_validatorv31.js'></script> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar">home</span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">TOTAL VC AUTOMATION </a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav navbar-right"> <li><a href="home.php">Home</a> </li> <li><a href='test_call.php'>Place Test Calls</a> </li> <li><a href='point.php'>Make P2P calls</a> </li> <li><a href="#">Automate all calls</a> </li> <li><?php echo $post_res;?> </li> <li><?php echo $reg_new;?></li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </nav> <div class="container"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"><img src="images/logo_total.png" alt="total_logo" width="400" height="131"></h1> <ol class="breadcrumb"> <li><a href="index.php">Home</a></li> <li class="active">Logged in as: <?=$fgmembersite->UserFullName() ?></li> <li><a href='logoff.php'>Logout</a></li> </ol> </div> </div> <div class="col-md-6 portfolio-item" id='fg_membersite'> <form method=post name=f1 action='<?php echo ($_SERVER['PHP_SELF'])?>'><input type=hidden name=todo value=submit> <fieldset > <table width="281" border="0" cellpadding="0" cellspacing="0"> <td width="156">Start Date</td> <tr><td>Year</td><td width="222">Month</td><td width="86">Day</td></tr> <tr> <td><?php echo'<select name="year">'; for ($x = 2012; $x <= 2014; $x++) { echo '<option value="'.$x.'">' . $x . '</option>'; } echo '</select>';?></td> <td><select name=month value=''>Select Month</option> <option value='01'>January</option> <option value='02'>February</option> <option value='03'>March</option> <option value='04'>April</option> <option value='05'>May</option> <option value='06'>June</option> <option value='07'>July</option> <option value='08'>August</option> <option value='09'>September</option> <option value='10'>October</option> <option value='11'>November</option> <option value='12'>December</option> </select></td> <td><select name=dt > <option value='01'>01</option> <option value='02'>02</option> <option value='03'>03</option> <option value='04'>04</option> <option value='05'>05</option> <option value='06'>06</option> <option value='07'>07</option> <option value='08'>08</option> <option value='09'>09</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14'>14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> <option value='24'>24</option> <option value='25'>25</option> <option value='26'>26</option> <option value='27'>27</option> <option value='28'>28</option> <option value='29'>29</option> <option value='30'>30</option> <option value='31'>31</option> </select></td> </tr> <td>End Date</td> <tr><td>Year</td><td>Month</td><td>Day</td></tr> <tr> <td><?php echo'<select name="eyear">'; for ($x = 2012; $x <= 2014; $x++) { echo '<option value="'.$x.'">' . $x . '</option>'; } echo '</select>';?></td> <td><select name=emonth value=''>Select Month</option> <option value='01'>January</option> <option value='02'>February</option> <option value='03'>March</option> <option value='04'>April</option> <option value='05'>May</option> <option value='06'>June</option> <option value='07'>July</option> <option value='08'>August</option> <option value='09'>September</option> <option value='10'>October</option> <option value='11'>November</option> <option value='12'>December</option> </select></td> <td><select name=edt > <option value='01'>01</option> <option value='02'>02</option> <option value='03'>03</option> <option value='04'>04</option> <option value='05'>05</option> <option value='06'>06</option> <option value='07'>07</option> <option value='08'>08</option> <option value='09'>09</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14'>14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> <option value='24'>24</option> <option value='25'>25</option> <option value='26'>26</option> <option value='27'>27</option> <option value='28'>28</option> <option value='29'>29</option> <option value='30'>30</option> <option value='31'>31</option> </select></td> </tr> <tr><td></td><td></td><td><input type='submit' name='GenReport' value='Enter' /></td></tr> </table> </fieldset> </form> </div> <div class="col-md-6 portfolio-item"> <?php include 'connection.php'; $fail = @mysql_query("SELECT COUNT(*) as total_fail FROM cdr WHERE call_flag = '0' AND end_date BETWEEN '$startdat' AND '$enddat' "); $tf = @mysql_fetch_assoc($fail); $total_fail = $tf['total_fail']; $success = @mysql_query("SELECT COUNT(*) as total_success FROM cdr WHERE call_flag = '1' AND end_date BETWEEN '$startdat' AND '$enddat' "); $ts = @mysql_fetch_assoc($success); $total_success = $ts['total_success']; echo " <style> table,th,td { border:1px solid black; border-collapse:collapse; text-align:center; } th,td { padding:5px; } </style> <table border='0'> <h3><a href='#'>Successful Calls / Failed Calls</a> </h3><h4>From: $startdat To: $enddat </br></h4> <tr> <th>Total NO.Call Made</th> <th>Total Successful</th> <th>Total Failed</th> </tr>"; { $totalMade = $total_success + $total_fail; $percentSuccess = @round($total_success/$totalMade*(100),2); $percentFail= @round($total_fail/$totalMade*(100),2); echo "<tr>"; echo "<td>" . $totalMade. "</td>"; echo "<td>" . $total_success . "</td>"; echo "<td>" . $total_fail . "</td>"; echo "</tr>"; } echo "<tr>"; echo "<th>% Successful:</th><th>$percentSuccess</th>"; echo "</tr>";echo "<tr>"; echo "<th>% Failed :</th><th>$percentFail</th>"; echo "</tr>"; echo "</table>"; ?> <h3><a href="portfolio-item.html">Table One</a> </h3> <p>Table two shows in percantage the call success and failure rate with the chosen date range</p> </div> <div class="col-md-6 portfolio-item"> <?php echo " <style> table,th,td { border:1px solid black; border-collapse:collapse; } th,td { padding:5px; } </style> <table border='1'> <h3><a href='#'>Call/Number of Placed Calls</a> </h3><h4>From: $startdat To: $enddat </br></h4> <tr> <th>Start Date</th> <th>Duration</th> <th>Start Time</th> <th>End Time</th> <th>Transport Type</th> <th>Call Direction</th> <th>Call Success(1) / Fail(0)</th> </tr>"; include 'connection.php'; $dc = mysql_query("SELECT * FROM cdr WHERE end_date BETWEEN '$startdat' AND '$enddat'"); while ($dc2=mysql_fetch_assoc($dc)) { $start_date =$dc2['start_date']; $duration =$dc2['duration']; $transport_type =$dc2['transport_type']; $start_time =$dc2['start_time']; $end_time =$dc2['end_time']; $call_direction =$dc2['call_direction']; $call_flag =$dc2['call_flag']; echo "<tr>"; echo "<td>" . $start_date . "</td>"; echo "<td>" . $duration . "</td>"; echo "<td>" . $start_time . "</td>"; echo "<td>" . $end_time. "</td>"; echo "<td>" . $transport_type. "</td>"; echo "<td>" . $call_direction. "</td>"; echo "<td>" . $call_flag. "</td>"; echo "</tr>"; } echo "<th>Total:</th><th> $da</th>"; echo "<tr>"; echo "<th>Average:</th><th>$Avg</th>"; echo "</tr>"; echo "</table>"; ?> <h3><a href="">Table Two </a> </h3> <p>Table one shows the number of incoming and outgoing calls,duration,call sucesss and failure rate within the chosen range.Total is the total number of hours spent on the device and Average is the average time spent on the particular device per call session during the chosen range. </p> </div> </div> <div class="row"> </div> <div class="row"> </div> <hr> <div class="row text-center"> <div class="col-lg-12"> <ul class="pagination"> <li><a href="#">&laquo;</a> </li> <li class="active"><a href="#">1</a> </li> <li><a href="#">2</a> </li> <li><a href="#">3</a> </li> <li><a href="#">4</a> </li> <li><a href="#">5</a> </li> <li><a href="#">&raquo;</a> </li> </ul> </div> </div> </div> <!-- /.container --> <div class="container"> <hr> <footer> <div class="row"> <div class="col-lg-12"> <p>Copyright &copy; Company 2013</p> </div> </div> </footer> </div> <!-- /.container --> <!-- JavaScript --> <script src="js/jquery-1.10.2.js"></script> <script src="js/bootstrap.js"></script> <script src="js/modern-business.js"></script> </body> </html>
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: include(connection.php): failed to open stream: No such file or directory in /in/1LnbM on line 2 Warning: include(): Failed opening 'connection.php' for inclusion (include_path='.:') in /in/1LnbM on line 2 Warning: require_once(./include/membersite_config.php): failed to open stream: No such file or directory in /in/1LnbM on line 3 Fatal error: require_once(): Failed opening required './include/membersite_config.php' (include_path='.:') in /in/1LnbM on line 3
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: File not found: connection.php in /in/1LnbM on line 2 Fatal error: File not found: ./include/membersite_config.php in /in/1LnbM on line 3
Process exited with code 255.