fork download
  1. <?php
  2. require('my_class.php');
  3.  
  4.  
  5. $obj=new handler;
  6.  
  7. $fields="*";
  8. $table="reg_data";
  9. $order="id DESC";
  10.  
  11. $data=$obj->db_select_short($fields,$table, $fieldname=null, $id=null, $order);
  12.  
  13. // ПОЛУЧИЛИ ДАННЫЕ ИЗ БД
  14.  
  15. // ЗАМЕНЯЕМ И ДОПОЛНЯЕМ ДАННЫЕ
  16.  
  17. $labels=array(
  18. 'hidden'=>'<span class="label label-hidden">На рассмотрении</span>',
  19. 'active'=>'<span class="label label-active">Утвержден</span>',
  20. 'declined'=>'<span class="label label-declined">Отклонен</span>');
  21. $buttons='
  22. <button> 1 </button> <button> 2 </button> <button> 3 </button>';
  23.  
  24. function switch_display ($data, $labels) {
  25. switch ($data) {
  26. case "0":
  27. $data=$labels['hidden'];
  28. break;
  29. case "1":
  30. $data=$labels['active'];
  31. break;
  32. case "2":
  33. $data=$labels['declined'];
  34. break;
  35. }
  36. return $data;
  37. }
  38.  
  39. foreach ($data as $person) {
  40. $person->status=switch_display ($person->status,$labels);
  41. $person->controls=$buttons;
  42. }
  43. // получаем нужный output!!!!!!!!!!
  44.  
  45. $obj->data_print($data);
  46.  
  47.  
  48. // $data2=new person;
  49. // $data2->surname="Сид22222иииииров";
  50. // $data2->country="Уганда";
  51. // $data2->id="308";
  52.  
  53. // $id=$data2->id;
  54.  
  55. // $response=$obj->db_update($table, $data2, $id);
  56.  
  57.  
  58. // $data3=new person;
  59. // $data3->surname="ииииров";
  60. // $data3->country="Уганда";
  61.  
  62. //$last_id=$obj->db_insert($table, $data3);
  63.  
  64. // $fieldname="id";
  65. // $id="308";
  66.  
  67. //$response=$obj->db_delete($table, $fieldname, $id);
  68. //$obj->data_print($data);
  69. ?>
Runtime error #stdin #stdout #stderr 0.02s 52472KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  require(my_class.php): failed to open stream: No such file or directory in /home/pm1RCp/prog.php on line 2
PHP Fatal error:  require(): Failed opening required 'my_class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/pm1RCp/prog.php on line 2