Find Jobs
Hire Freelancers

Convert PHP snippet to C# API

$10-30 AUD

Closed
Posted over 4 years ago

$10-30 AUD

Paid on delivery
Hi I need the following code converted from PHP to C#. I want the data to be returned in the following format: [{"name":"Booked","data":[2,3,2]},{"name":"Capacity","data":[10,15,15]},{"name":"Vacancies","data":[8,12,13]}] PHP code: private function getDailyVacancies() { if ($this->get_request_method() != "GET") { $this->response('', 406); } $today = date('Ymd'); $sqlbooking = "select COUNT([login to view URL]) as Total,classroom from Attendance INNER JOIN Classroom ON [login to view URL] = [login to view URL] where DropDate = '$today' AND [login to view URL] = 0 AND IsAbsent = 1 GROUP BY Classroom ORDER BY [login to view URL]"; //echo $sqlbooking; //die; $bookings = $this->db->rawQuery($sqlbooking, null); $capacities = $this->db->rawQuery("SELECT [login to view URL] AS Total FROM Attendance INNER JOIN Classroom ON [login to view URL] = [login to view URL] where DropDate = '$today' AND IsAbsent = 1 AND Active = 0 GROUP BY [login to view URL] ORDER BY [login to view URL]", null); $result = array(); $rowsBooked = array(); foreach ($bookings as $booking) { $rowsBooked['name'] = 'Booked'; $rowsBooked['data'][] = $booking['Total']; } $rowsCapacity = array(); foreach ($capacities as $capacity) { $rowsCapacity['name'] = 'Capacity'; $rowsCapacity['data'][] = $capacity['Total']; } array_push($result, $rowsBooked); array_push($result, $rowsCapacity); $arr1 = array(); foreach ($bookings as $booking) { $arr1[] = $booking['Total']; } $arr2 = array(); foreach ($capacities as $capacity) { $arr2[] = $capacity['Total']; } $subtracted = array_map(function ($x, $y) { return $y - $x; }, $arr1, $arr2); $vacancies = array_combine(array_keys($arr1), $subtracted); $rowsVacancies = array(); foreach ($vacancies as $vacancy) { $rowsVacancies['name'] = 'Vacancies'; $rowsVacancies['data'][] = $vacancy; } array_push($result, $rowsVacancies); if ($this->db->count > 0) { $this->response($this->json_numeric($result), 200); // send user details } $this->response('', 204); }
Project ID: 23518771

About the project

9 proposals
Remote project
Active 4 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
9 freelancers are bidding on average $29 AUD for this job
User Avatar
Hello I have 3 years of experience with PHP and 10 years of experience with C# and I have extensive experience with converting code from one programming language to another one
$22 AUD in 1 day
4.9 (1396 reviews)
7.9
7.9
User Avatar
dear Hiring Manager, Hello, sir. I hope you are in good health condition. I am experienced php developer and web designer with the depth knowledge related to MySQL,Codeigniter,Laravel,WordPress,MSSQL,JSON,JAVASCRIPT,AJAX,XML,jQuery,CSS,HTML5,Material Designing with the integration of web technologies. I have worked as Php & Web developer in industry and now i am full time freelancer and having the experience of huge and live projects. I can design the web pages with the backend of php and I have also experience of query optimization and performance management through php support. I am finding one startup like you so i can provide my skills to IT market and I can give you 100% surity for quality work in minimum time sir. I have also launched eCommerce Product for pharmacy industry and launched android app on play store as well , I have great control in android with backend of php webservices and api generation with JSON integration. I can work at anytime with the great satisfactions,quality output and result in your hand with the fulfilling your requirements for sure. Waiting for your positive response , so we can start the work soon ...
$50 AUD in 1 day
4.8 (24 reviews)
5.3
5.3
User Avatar
I am a full-stack developer with a career in the IT industry of over 4 years. I have rich experiences with many people and they always get the best result. It's a piece of cake for me! You'll not waste your GOLD TIME. I readed through the job details extremely carefully and It's very easy for me. Can we have quick chat right now so that we can discuss the project briefly? Please give me a chance to work as your on-going partner! I will do everything in my power to assist you Regards.
$55 AUD in 1 day
5.0 (29 reviews)
4.7
4.7
User Avatar
Hi, I can easily get this done for you. It will be converted to a C# and will produce same result. Do you have in plan to execute this code on a Web Server or on Desktop?
$18 AUD in 1 day
5.0 (30 reviews)
4.7
4.7
User Avatar
Hi, I've checked the PHP code, I'll convert this in C# which will return same response. I've the following questions. 1. Which c# project version you want to use? WEB API? 2. do you want to use direct SQL query or want to use Entity Framework? I can do this in 2 hours. Regards, Umer Nazeer
$20 AUD in 1 day
5.0 (1 review)
0.8
0.8
User Avatar
proposal consider code conversion, TDD, architecture concepts, quality. please let me know for details.
$30 AUD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi Sir/Mam, Greetings of the day....! hello my name is Swapnil Chougule. I'm new to freelancer. I am expert with 7+ years of experience in HTML, PHP & C#.net Technology. If you are willing to award the project to me, I will always be ready to complete it perfectly. Thank you!!
$18 AUD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
I am a 5+ years experienced software engineer with the asp.net , SQL Server and Azure technologies.
$30 AUD in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of AUSTRALIA
Sydney, Australia
5.0
147
Payment method verified
Member since May 24, 2001

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.