first commit

This commit is contained in:
LAPTOP-V9RRD1TL\Michelle's Computer
2025-07-21 21:38:17 +08:00
commit f8f8fcaf96
2529 changed files with 227800 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
<?php
$must_login = true ;
$require_path = '../../../' ;
$require_sub = '../../' ;
require( $require_sub.'header.php' ) ;
if ( $boolean_login ){
$status = '201' ;
$search_query = '' ;
$search_query .= " AND a.form_id = '".$array['id']."'" ;
$query = "SELECT a.form_id, a.file, a.file_type, a.created_at, b.title FROM form a
LEFT JOIN form_translation b ON ( a.form_id = b.form_id )
WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND ( ( a.receiver_type IN ( '0' ) ) OR ( a.receiver_type IN ( '1', '2' ) AND a.staff_id LIKE '%/".$staff_info['staff_id']."/%' ) ) " . $search_query ;
$mysqli_query = $mysqli->query( $query ) ;
if ( $mysqli_query->num_rows > 0 ){
$status = '200' ;
$row = $mysqli_query->fetch_assoc() ;
$file = '' ;
if ( $row['file'] != '' ){
if ( $row['file_type'] == 'pdf' || $row['file_type'] == 'xls' || $row['file_type'] == 'xlsx' || $row['file_type'] == 'doc' || $row['file_type'] == 'docx' ){
$file = PATH.'uploads/Form/'.$row['file'] ;
}else{
$file = PATH.'uploads/Form/b/'.$row['file'] ;
}
}
$row['id'] = dataFilter( $row['form_id'] ) ;
$row['title'] = dataFilter( $row['title'] ) ;
$row['file'] = $file ;
$row['created_at'] = dataFilter( $row['created_at'] ) ;
$data['list'] = $row ;
}
}
require( $require_sub.'footer.php' ) ;
?>
+41
View File
@@ -0,0 +1,41 @@
<?php
$must_login = true ;
$require_path = '../../../' ;
$require_sub = '../../' ;
require( $require_sub.'header.php' ) ;
if ( $boolean_login ){
$status = '201' ;
$search_query = '' ;
if ( $array['category_id'] != '' ){
$search_query .= " AND a.category_id = '".$array['category_id']."'" ;
}
if ( $array['search'] != '' ){
$search_query .= " AND b.title LIKE '%".$array['search']."%'" ;
}
$query = "SELECT a.form_id, a.created_at, b.title FROM form a
LEFT JOIN form_translation b ON ( a.form_id = b.form_id )
WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.branch LIKE '%/".$array['branch_id']."/%' AND ( ( a.receiver_type IN ( '0' ) ) OR ( a.receiver_type IN ( '1', '2' ) AND a.staff_id LIKE '%/".$staff_info['staff_id']."/%' ) ) " . $search_query ;
$mysqli_query = $mysqli->query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ;
if ( $mysqli_query->num_rows > 0 ){
$status = '200' ;
$list = [] ;
while ( $row = $mysqli_query->fetch_assoc() ){
$row['id'] = dataFilter( $row['form_id'] ) ;
$row['title'] = dataFilter( $row['title'] ) ;
$row['created_at'] = resetDateFormat( $row['created_at'] ) ;
$list[] = $row ;
}
$data['list'] = $list ;
}
}
require( $require_sub.'footer.php' ) ;
?>
+38
View File
@@ -0,0 +1,38 @@
<?php
$must_login = true ;
$require_path = '../../../' ;
$require_sub = '../../' ;
require( $require_sub.'header.php' ) ;
if ( $boolean_login ){
$status = '201' ;
$search_query = '' ;
if ( $array['search'] != '' ){
$search_query .= " AND b.title LIKE '%".$array['search']."%'" ;
}
$query = "SELECT a.category_id, a.file, a.created_at, b.title FROM form_category a
LEFT JOIN form_category_translation b ON ( a.category_id = b.category_id )
WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.category_type = 'main' " . $search_query ;
$mysqli_query = $mysqli->query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ;
if ( $mysqli_query->num_rows > 0 ){
$status = '200' ;
$list = [] ;
while ( $row = $mysqli_query->fetch_assoc() ){
$row['id'] = dataFilter( $row['category_id'] ) ;
$row['title'] = dataFilter( $row['title'] ) ;
$row['file'] = ( $row['file'] != '' ? PATH.'uploads/FormCategory/b/'.$row['file'] : '' ) ;
$list[] = $row ;
}
$data['list'] = $list ;
}
}
require( $require_sub.'footer.php' ) ;
?>
+38
View File
@@ -0,0 +1,38 @@
<?php
$must_login = true ;
$require_path = '../../../' ;
$require_sub = '../../' ;
require( $require_sub.'header.php' ) ;
if ( $boolean_login ){
$status = '201' ;
$search_query = '' ;
if ( $array['search'] != '' ){
$search_query .= " AND b.title LIKE '%".$array['search']."%'" ;
}
$query = "SELECT a.category_id, a.file, a.created_at, b.title FROM form_category a
LEFT JOIN form_category_translation b ON ( a.category_id = b.category_id )
WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.category_type = 'sub' AND a.category_parent = '".$array['category_id']."' " . $search_query ;
$mysqli_query = $mysqli->query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ;
if ( $mysqli_query->num_rows > 0 ){
$status = '200' ;
$list = [] ;
while ( $row = $mysqli_query->fetch_assoc() ){
$row['id'] = dataFilter( $row['category_id'] ) ;
$row['title'] = dataFilter( $row['title'] ) ;
$row['file'] = ( $row['file'] != '' ? PATH.'uploads/FormCategory/b/'.$row['file'] : '' ) ;
$list[] = $row ;
}
$data['list'] = $list ;
}
}
require( $require_sub.'footer.php' ) ;
?>