<td><?php echo get_status($value['status']); ?> </td> <td><?php echo get_qty($cart); ?> </td> <td><?php echo get_sum($cart) . ' ' . get_currency($cart); ?> </td> <td><?php if ($value['status'] == 1) { //echo "<a href='".base_url()."template/pay/robokassa/demo2.php'>Оплатить</a>"; echo pay($value['id'], get_sum($cart)); } ?> </td> </tr> <?php } ?> </table> <style> .preview_img{ width: 40px; } table{ background: #F8F8F8;
<?php function get_sum($num1, $num2) { return $num1 + $num2; } $go = "y"; while ($go == "y") { print "Enter number 1: "; $num1 = read(); print "Enter number 2: "; $num2 = read(); print "The sum of your two numbers is: " + get_sum($num1, $num2); print "Do you want to run again? (y/n)"; $go = read(); }
</div> <!-- /table-responsive --> <table class="table invoice-total"> <tbody> <tr> <td><strong>Total Accepted :</strong></td> <td><?php echo get_sum($funds_accepted); ?> </td> </tr> <tr> <td><strong>Total Transferred :</strong></td> <td><?php echo get_sum($funds_transferred); ?> </td> </tr> </tbody> </table> <?php $this->load->view('partial/report_footer'); ?> <div class="pull-right">Created at: <?php echo $now; ?> </div> </div>
# make the years more ... json friendly $y = array(); foreach ($t as $k2 => $v2) { $point = array("year" => $years[$k2], "count" => intval(trim($t[$k2]))); $y[] = $point; $all_values[] = $point["count"]; } # and add some aggregates $temp[$k] = array("country" => $c, "placement" => $y); } $data = $temp; function get_sum($placement) { $c = 0; foreach ($placement as $v) { $c += $v["count"]; } return $c; } usort($data, function ($a, $b) { $sum_a = get_sum($a["placement"]); $sum_b = get_sum($b["placement"]); if ($sum_a === $sum_b) { return 0; } if ($sum_a > $sum_b) { return 1; } return -1; }); #echo "<PRE>";print_r( $data ); die;
$new = employee_array_sort('data/report.txt'); function total_number($array) { $total_number_employees = count($array); return $total_number_employees; } $total_number_employees = total_number($new); function get_sum($array) { $total_units = 0; foreach ($array as $person) { $total_units = $total_units + $person['units']; } return $total_units; } $total_units_sold = get_sum($new); function average($total, $sum) { $average_units_sold = $total / $sum; return $average_units_sold; } $average_units_array = average($total_units_sold, $total_number_employees); // echo "Total number of employees is {$total_number_employees}\n"; // echo "Total units sold is {$total_units_sold}\n"; // echo "Average units is {$average_units_array}\n"; // print_r($new); // echo "===================================================\n"; // echo "Employee Number, First Name, Last Name, Sales Units\n"; // echo "***************************************************\n"; foreach ($array as $person) { echo $person['units'];
//-------------------------------------------------------- echo "<h3> Выдача электронных ресурсов</h3>"; //--------------------------------------------------- echo "<table class='table'>"; echo "<tr>"; echo "<th>Дата</th><th>Выдача электронных копий(Искандэр)</th>"; echo "</tr>"; get_sum($iscander_sql, $mysqli); echo "</table>"; //------------------------------------------------------- echo "<table class='table'>"; echo "<tr>"; echo "<th>Дата</th><th>Выдача электронных копий(Кипарис)</th>"; echo "</tr>"; get_sum($kiparis_sql, $mysqli); echo "</table>"; /* -- - ------- - - - - - - --- - - */ echo "<table class='table'>"; echo "<tr>"; echo "<th>Дата</th><th>Выдача электронных копий(Правовые)</th>"; echo "</tr>"; get_sum($pravovye_sql, $mysqli); echo "</table>"; ?> </table> </div> </body> </html>