Jump to content

nitiphone2021

Members
  • Posts

    85
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

nitiphone2021's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

1

Community Answers

  1. first I tried this code will show all rooms in system select `tb_rooms`.`id`, `tb_rooms`.`room_name` from `tb_reservation_room` right join `tb_rooms` on `tb_rooms`.`id` = `tb_reservation_room`.`room_id` I tried this code but no any output select `tb_rooms`.`id`, `tb_rooms`.`room_name` from `tb_reservation_room` right join `tb_rooms` on `tb_rooms`.`id` = `tb_reservation_room`.`room_id` where `checkin_date` < '2022-02-12'
  2. yes, both greater than and less than $checkin_date
  3. it's a good tutorial but how can I get the available room? I tried to follow your logic but it's not work This is my sql query from laravel $load_room = DB::table('tb_reservation_room') ->rightJoin('tb_rooms', 'tb_rooms.id', '=', 'tb_reservation_room.room_id') ->select('tb_rooms.id', 'tb_rooms.room_name') ->whereDate('checkin_date','<',$checkin_date) ->whereDate('checkin_date','>',$checkin_date) ->get();
  4. Dear all, I am design hotel management system as below schema. Do you have any idea to improve it? to verify room status
  5. hi all, as I reinstall old project for my customer and the service is working fine but I found sometimes it can't query some information. from checking it's because @@Global.sql_mode and @@SESSION.sql_mode set to "ONLY_FULL_GROUP_BY" the step to solve it need to run command SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); So any way can I make it not change the mode?
  6. Dear All, I uploaded my Laravel Project to Server by remove "vendor" directory and then run command "composer install --no-dev" then I got error message Do not run Composer as root/super user! See https://getcomposer.org/root for details Continue as root/super user [yes]? yes Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Your lock file does not contain a compatible set of packages. Please run composer update. Problem 1 - league/commonmark is locked to version 2.0.2 and an update of this package was not requested. - league/commonmark 2.0.2 requires php ^7.4 || ^8.0 -> your php version (7.3.33) does not satisfy that requirement. Problem 2 - league/config is locked to version v1.1.1 and an update of this package was not requested. - league/config v1.1.1 requires php ^7.4 || ^8.0 -> your php version (7.3.33) does not satisfy that requirement. Problem 3 - psr/container is locked to version 1.1.2 and an update of this package was not requested. - psr/container 1.1.2 requires php >=7.4.0 -> your php version (7.3.33) does not satisfy that requirement. Problem 4 - league/commonmark 2.0.2 requires php ^7.4 || ^8.0 -> your php version (7.3.33) does not satisfy that requirement. - laravel/framework v8.74.0 requires league/commonmark ^1.3|^2.0.2 -> satisfiable by league/commonmark[2.0.2]. - laravel/framework is locked to version v8.74.0 and an update of this package was not requested.
  7. Dear friends. As I create a website and javascript to record voice and send it to server side(PHP). it's work on small file size but if it's large the sending will be fail. Could you please kindly help me check my code? why I can't see the file on the server? Existing code Javscript var fd = new FormData(); fd.append('to_user_id', to_user_id); fd.append('audio_data', blob, filename); $.ajax({ url: "../func/upload.php", method: "POST", processData: false, contentType: false, data: fd, enctype: 'multipart/form-data', success: function(data) {}, error: function(err) {} }); PHP /* Check If the guest send file to admin */ if (isset($_FILES)) { //this will print out the received name, temp name, type, size, etc. $input = $_FILES['audio_data']['tmp_name']; //get the temporary name that PHP gave to the uploaded file $output = $originalsFolder . $FileName; //letting the client control the filename is a rather bad idea //move the file from temp name to local folder using $output name $result = move_uploaded_file($input, $output); $txt_msg = '<audio controls controlsList="nodownload"> <source src="' . $originalsFolderDB . $FileName . '" type="audio/wav"> Audio. </audio>'; } MY NEW CODE FOR SLICE BLOB FILE Javascript var chunks = chunksAmount(blob.size); var blobChunksArray = sliceFile(blob,chunks,blob.type); var slice_chunk = blobChunksArray.shift(); var fd = new FormData(); fd.append('to_user_id', to_user_id); fd.append('chunksupload',true); fd.append('filename', filename); fd.append('data', slice_chunk); if(chunksArray.length){ fd.append('chunksend',false); }else{ fd.append('chunksend',true); } $.ajax({ url: "../func/upload.php", method: "POST", processData: false, contentType: false, data: fd, enctype: 'multipart/form-data', success: function(data) {}, error: function(err) {} }).done(function(data) { if(chunksArray.length){ sendChunkFile2(chunksArray,filename) }else{ console.log(JSON.stringify(data)); } }); function slice(file, start, end) { var slice = file.mozSlice ? file.mozSlice : file.webkitSlice ? file.webkitSlice : file.slice; return slice.bind(file)(start, end); } function sliceFile(file, chunksAmount, mimetype) { var byteIndex = 0; var chunks = []; for (var i = 0; i < chunksAmount; i += 1) { var byteEnd = Math.ceil((file.size / chunksAmount) * (i + 1)); chunks.push( new Blob([slice(file, byteIndex, byteEnd)], { type: mimetype })); byteIndex += (byteEnd - byteIndex); } return chunks; } function chunksAmount(size){ const BYTES_PER_CHUNK = ((1024 * 1024)*5); //5MB chunk sizes. return Math.ceil(size / BYTES_PER_CHUNK); } FOR PHP if (isset($_POST['chunksupload'])) { file_put_contents($_POST['filename'], file_get_contents($_FILES['data']['tmp_name']), FILE_APPEND | LOCK_EX); if($_POST['chunksend']){ echo json_encode(["url"=>$originalsFolderDB . $_POST['filename'],"size"=>filesize($_POST['filename']) . " bytes"]); } //this will print out the received name, temp name, type, size, etc. // $input = $_FILES['audio_data']['tmp_name']; //get the temporary name that PHP gave to the uploaded file // $output = $originalsFolder . $FileName; //letting the client control the filename is a rather bad idea //move the file from temp name to local folder using $output name // $result = move_uploaded_file($input, $output); $txt_msg = '<audio controls controlsList="nodownload"> <source src="' . $originalsFolderDB . $FileName . '" type="audio/wav"> Audio. </audio>';
  8. According to I created a API authen by sanctum and it's work when I send logout by php artisan serve but when i close it and use xampp http://localhost/Laravel/laravel2/api/logout it's said "Unauthenticated" Why it work only on artisan serve?
  9. I have a table include column name license_plate(String),car_bike(1 or 2),price,create_date I would like to create a report about income for system I try as below command SELECT DATE(create_date) as Park_Date,car_bike,price,COUNT(car_bike) * price as income from 1_tb_parking group by Park_Date,car_bike I would like to get result like this date, car_bike = 1, count(car_bike=1),sum(price for car_bike = 1) as sum1, car_bike = 2, count(car_bike=2),sum(price for car_bike = 2) as sum2, Total = sum1 + sum2 Do you have any idea?
  10. I am planing to develop a Delivery App like foodpanda, from starting I think the customer not too much but I want to know the technology for it that we can upgrade it after the customer increase
  11. Oh, Seem my question is not clear, I mean I make a POS online software and sell it to many shop, so how can I saperate shop information, shop name, stock, login info....
  12. Dear friends. As I would like to create a software like POS on web application. my question is: 1. Should I create only one Database for all customers? 2. in case I have only one Database, How can I saperate the customer information? by field or table name? 3. if I have new customer. I need to create new table or information for them?
  13. According to I would like to try to use JWT for my PHP and these are my step on domain/app/ composer require firebase/php-jwt so I have domain/app/login.php domain/app/vendor/firebase/... and on the login.php try{ echo "1"; require_once('vendor/autoload.php'); use firebase\JWT\JWT; echo "2"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } It's not show any thing and error "HTTP ERROR 500" I think the code is really find the autoload.php but I don't know why it's internet error on line use firebase\JWT\JWT; If I add this command, the PHP will be error 500
  14. But I want to send them some notify when the user is not open the browser. How can i send to it?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.