Find Jobs
Hire Freelancers

Build MySQL Query in PHP

$10-30 USD

Terminado
Publicado hace más de 7 años

$10-30 USD

Pagado a la entrega
I have a table which lists Business Working Days & Business Working Hours Columns are as below: ------------------------------------------------------------- id srvc_day_M - (1 = working, 0 = holiday) srvc_day_T - (1 = working, 0 = holiday) srvc_day_W - (1 = working, 0 = holiday) srvc_day_H - (1 = working, 0 = holiday) srvc_day_F - (1 = working, 0 = holiday) srvc_day_A - (1 = working, 0 = holiday) srvc_day_S - (1 = working, 0 = holiday) srvc_day_M_St - (office start time) srvc_day_M_En - (office end time) srvc_day_T_St - (office start time) srvc_day_T_En - (office end time) srvc_day_W_St - (office start time) srvc_day_W_En - (office end time) srvc_day_H_St - (office start time) srvc_day_H_En - (office end time) srvc_day_F_St - (office start time) srvc_day_F_En - (office end time) srvc_day_A_St - (office start time) srvc_day_A_En - (office end time) srvc_day_S_St - (office start time) srvc_day_S_En - (office end time) A sample DB is attached in XLS format. I need a PHP script which will do the following: (a) It will receive JSON input with dummy variable {"ping":"hello"} (a) PHP Script should check if today (Dow & Time of Day) is the office open. If yes, return {"online":"NOW") (b) If NOT, then return the next day & time when office will be open. {"online":"yyyy-mm-dd hh:mm:ss") The 2nd part is a bit tricky as you'll have to loop through all days of week to find the next avaialble day. Some scenarios: (1) Now Offline, DoW=ON but TIME is BEFORE office starts (2) Now Offline, DoW=ON but TIME is AFTER office starts (3) Now Offline, DoW=OFF, Iterate through each DoW starting from the next DoW & check when DOW="1" and then find the start time. Pls limit your MySQL queries to the minimum. Pls thoroughly test the PHP script before submitting. Budget: $20 IMP: Proposals sent without reading the project will be rejected.
ID del proyecto: 11221391

Información sobre el proyecto

16 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hi, i've already made the script but not using the json data, i can customize it toreceive the data, i'll send you some screenshots of today's result and another one chaging the date to saturday if you want.
$20 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
16 freelancers están ofertando un promedio de $24 USD por este trabajo
Avatar del usuario
Hello, I have read through your project and I am incredibly interested in taking on your project. I am an experienced developer with a diploma in the field of web development. i have recently also earned my preferred freelancer badge. I have been working in the field of web development for roughly 7 years. I take great pride in my work and deliver only the best quality. My skill-set includes... -PHP -HTML5 -CSS -AJAX -Responsive Design -Joomla -Wordpress -Magento -Drupal -Photoshop -Illustrator -Video Editing -Data entry -Iphone -Android I look forward to hearing from you and hopefully we will have the opportunity to work together. Thank you, Coasif
$45 USD en 1 día
4,8 (189 comentarios)
7,0
7,0
Avatar del usuario
Hello, I have a question. I notice there are multiple rows to search. How do you know which one is the current week? (Lowest available ID?) and is next ID the next week?
$20 USD en 1 día
4,9 (74 comentarios)
5,8
5,8
Avatar del usuario
I am muhammad waqas,I have more than 6 years of experience in php development,frameworks like laravel, Codeiginiter,YII and CMS like wordpress,Drupal.I am new on freelancer two projects 5 stars but I am the top ranked developer in upwork more than 35 projects all with five stars ratings.I have also team of professionals experience .Net technologies , IOS app devlopment , phonegap development and graphic designers any work regarding these technologies welcome.I assure you 100% quality and on time delivery as my profile shows all projects with five stars rating. Thanks M Waqas NovatureSol
$25 USD en 1 día
5,0 (6 comentarios)
4,7
4,7
Avatar del usuario
Hi I have 3+ experience in web development. I did many job like this. I have strong knowledge of Mysql, Oracle, Database Design and I have also strong knowledge in languages like Java, JSP, PHP, Javascript, Bootstrap CSS, Ajgular JS, HTML, CSS, JQuery etc .
$30 USD en 1 día
5,0 (11 comentarios)
3,6
3,6
Avatar del usuario
> Proposals sent without reading the project will be rejected. I've read your project :) ..........
$25 USD en 1 día
5,0 (4 comentarios)
3,3
3,3
Avatar del usuario
Hello there my name is Eth main I have been a php/MYSQL developer for 5 years, I have worked with MySQL a lot and it is considered my main data storage in a lot of usages. I believe I can finish this task today so we can get over it. please contact me for more info as I have limited characters in the proposal, thank you.
$20 USD en 1 día
5,0 (1 comentario)
2,3
2,3
Avatar del usuario
Hi, I Just had a look at your project, it seems that you need a developer who can write well optimized sql query, which can fetch data from database according to the input came in json format. Here is my small introduction, My name is Sudhakar Kumar and i have experienced in web designing using latest technology, like HTML5, Css3, JavaScript, jQuery, Bootstrap, PHP and Mysql. it would be great if we could have a little discussion about your project before awarding it to anyone, and i am pretty sure that i can complete this job in $20. your decision will be appreciated under any circumstances. Regards Sudhakar Kumar
$20 USD en 1 día
5,0 (2 comentarios)
1,6
1,6
Avatar del usuario
A proposal has not yet been provided
$25 USD en 2 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I read your proposal and I can do it in a day. I understand that you want the script to check if today is the day of work... not only just the day.. but I have to check if the time is within the working hours. If the office is not open - it can be open today or tomorrow. I also understood the 3 corner cases told by you. And also thank you for that, it saves me some time :) I hope the time on your server is always correct, if not, I can integrate API for that too...
$19 USD en 1 día
0,0 (0 comentarios)
1,1
1,1
Avatar del usuario
/////here's the code //code is not complete, but shows the logic //lacks features select another date if (isset($_GET['id'])) { $id = $_GET['id']; } else echo 'no id'; ///id=11; if ($id) { $q = "SELECT `id`, `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`, `Mon-Time-St`, `Mon-Time-En`, `Tue-Time-St`, `Tue-Time-En`, `Wed-Time-St`, `Wed-Time-En`, `Thu-Time-St`, `Thu-Time-En`, `Fri-Time-St`, `Fri-Time-En`, `Sat-Time-St`, `Sat-Time-En`, `Sun-Time-St`, `Sun-Time-En` FROM `data` where id = ".$id." LIMIT 1" ; $result = mysqli_query($connect,$q); if (mysqli_num_rows($result)) { $data = mysqli_fetch_array($result); $day_week = date('D',time()); $cur_day_result = $data[$day_week]; $result_array['Now'] = $cur_day_result; if ($cur_day_result==1)///online { ///work time $work_time_st = $data[$day_week.'-Time-St']; $work_time_en = $data[$day_week.'-Time-En']; ///to absolute time $atime_start = strtotime($work_time_st); $atime_end = strtotime($work_time_en); if (time()<$atime_start) { $result_array['DoW'] = 'office will be open at '.$atime_start; } else if (time()>$atime_start && time()<$atime_end) { $result_array['DoW'] = 'office is open '; } else if ( time()>$atime_end) { $result_array['DoW'] = 'office is closed '; ////find next day // //////////////here I shall add if you take my request } } } $res = json_encode($result_array); echo $res; ///{"Now":"1","DoW":"office will be open at 1470967200"} }
$13 USD en 10 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
$20, award it now and will get it done within a day. If you want to keep queries to a minimum, the best way is to just grab the entire table or alternatively you can probably run one long compound query.
$20 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
The code is pretty simple and actually needs only one query, however you need to explain about how to find the current week in the table, i see that there is an id is this the week number ?
$20 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de INDIA
Bangalore, India
5,0
27
Forma de pago verificada
Miembro desde nov 10, 2010

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.