diff --git a/app/db_connector.php b/app/db_connector.php index 46c288d..30d541b 100755 --- a/app/db_connector.php +++ b/app/db_connector.php @@ -26,9 +26,37 @@ function get_images($pdo, $search='%', $sort='img_date', $sdir='DESC') { $img_list .= '
  • '; $img_list .= '
    '; $img_list .= '

    '.$block['img_title']."

    "; - $img_list .= '

    '.$block['img_desc']."

    "; + $img_list .= '

    '.$block['img_desc']."

    "; $img_list .= '
  • '; } $img_list .= ''; echo $img_list; } + +function get_audio($pdo, $search='%', $sort='aud_date', $sdir='DESC') { + if ($sort != 'aud_date' && $sdir != 'ASC') { + if ($sort != 'aud_title' && $sdir != 'DESC') { + echo('Ey boss, database request is kinda f*cked up. Maybe you want to try that again, hey...
    '.$sort.' '.$sdir); + die(); + } + } + $params = array('search' => $search); + $stmt = $pdo->prepare("SELECT * FROM audio WHERE aud_title LIKE CONCAT('%', :search ,'%') ORDER BY $sort $sdir;"); + $stmt->execute($params); + // $stmt->debugDumpParams(); + $data = $stmt->fetchAll(); + + $aud_list = ''; + echo $aud_list; +} diff --git a/app/db_utilities.php b/app/db_utilities.php new file mode 100644 index 0000000..c828f77 --- /dev/null +++ b/app/db_utilities.php @@ -0,0 +1,22 @@ + + + + + + + + +TOOLBAR; + +function showToolbar() { + global $toolbar; + echo $toolbar; +} diff --git a/project_files/cursor_blinking.ase b/project_files/cursor_blinking.ase new file mode 100644 index 0000000..671e769 Binary files /dev/null and b/project_files/cursor_blinking.ase differ diff --git a/public/about.php b/public/about.php index ed4176f..ffd205d 100755 --- a/public/about.php +++ b/public/about.php @@ -1,4 +1,4 @@ -

    > chosen file type: person
      getting to know me is futile...
      listing files...

    +

    > chosen file type: person
      getting to know me is futile...
      listing files...
    $

    I am a human. Treat me as such. I will reciprocate.

    diff --git a/public/audio.php b/public/audio.php index 46e1987..3414e44 100755 --- a/public/audio.php +++ b/public/audio.php @@ -1,2 +1,35 @@ +

    > chosen file type: audio
      listing files...

    + bong'); \ No newline at end of file + include_once('../app/db_connector.php'); + include_once('../app/db_utilities.php'); + + showToolbar(); + + if( isset($_POST['sel_order']) && isset($_POST['inp_search']) ) { + $sort = 'aud_date'; + $sdir = 'DESC'; + + switch($_POST['sel_order']) { + case 'new': + break; + case 'old': + $sdir = 'ASC'; + break; + case 'az': + $sort = 'aud_title'; + $sdir = 'ASC'; + break; + case 'za': + $sort = 'aud_title'; + break; + default: + break; + } + + get_audio($pdo, $_POST['inp_search'], $sort, $sdir); + } + else { + get_audio($pdo); + } +?> diff --git a/public/image.php b/public/image.php index 3f8abda..ab0059b 100755 --- a/public/image.php +++ b/public/image.php @@ -1,21 +1,10 @@

    > chosen file type: image
      listing files...

    -
    - - - - - - -
    - privacy policy contact

    - +