Skip to main content
Added SQL Server tag
Link
Phrancis
  • 20.5k
  • 6
  • 70
  • 155
edited tags
Link
200_success
  • 145.6k
  • 22
  • 191
  • 481
deleted 28 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Hi iI have been making a web page in PHP and JavascriptJavaScript to take employees clock times and do some things with them so iI can display them everything. Everything is currently working quite well, but the code looks like rough.

'; $Arr = @array('Op' => $Data['Op'], 'Name' => $Data['Name'], 'WorkHours' => $Data['WorkHours'], 'Start' => $Data['Start'], 'End' => $Data['End'], 'Clock' => substr($data[0], 11, 8), 'OFF' => substr($data[1], 11, 8), 'ON' => substr($data[2], 11, 8), 'OUT' => substr($data[3], 11, 8), 'Late' => $lated, 'Home' => $homed); return $Arr; } } $People = (object) array( 'People' => array( array( 'Person1' => $person1->GetTimes(), ), array( 'Person2' => $person2->GetTimes(), ), array( 'Person3' => $person3->GetTimes(), ), array( 'Person4' => $person4->GetTimes(), ), array( 'Person5' => $person5->GetTimes(), ), array( 'Person6' => $person6->GetTimes(), ), array( 'Person7' => $person7->GetTimes(), ), array( 'Person8' => $person8->GetTimes(), ), array( 'Person9' => $person9->GetTimes(), ), array( 'Person10' => $person10->GetTimes(), ), array( 'Person11' => $person11->GetTimes(), ), array( 'Person12' => $person12->GetTimes(), ), array( 'Person13' => $person13->GetTimes(), ), array( 'Person14' => $person14->GetTimes(), ), array( 'Person15' => $person15->GetTimes(), ), array( 'Person16' => $person16->GetTimes(), ), array( 'Person17' => $person17->GetTimes(), ), array( 'Person18' => $person18->GetTimes(), ), array( 'Person19' => $person19->GetTimes(), ), array( 'Person20' => $person20->GetTimes(), ), array( 'Person21' => $person21->GetTimes(), ), array( 'Person22' => $person22->GetTimes(), ), array( 'Person23' => $person23->GetTimes(), ), array( 'Person24' => $person24->GetTimes(), ), array( 'Person25' => $person25->GetTimes(), ), array( 'Person26' => $person26->GetTimes(), ), array( 'Person27' => $person27->GetTimes(), ), array( 'Person28' => $person28->GetTimes(), ), array( 'Person29' => $person29->GetTimes(), ), array( 'Person30' => $person30->GetTimes(), ), array( 'Person31' => $person31->GetTimes(), ), array( 'Person32' => $person32->GetTimes(), ), array( 'Person33' => $person33->GetTimes(), ), array( 'Person34' => $person34->GetTimes(), ), array( 'Person35' => $person35->GetTimes(), ), array( 'Person36' => $person36->GetTimes(), ), array( 'Person37' => $person37->GetTimes(), ), array( 'Person38' => $person38->GetTimes(), ), array( 'Person38' => $person39->GetTimes(), ), array( 'Person38' => $person40->GetTimes(), ), array( 'Person38' => $person41->GetTimes(), ), ) ); $time_end = microtime(true); file_put_contents('People.json', json_encode($People)); $execution_time = round((($time_end - $time_start) / 60), 3); echo 'Total Execution Time: ' . $execution_time . ' Mins '; So this This code takes people that iI have initatedimitated in the included People`People` select file and then, runs some query'squeries and joins the data and then, puts it all in tointo an array and then in to a JSON file. However, however thethere must be a better way of doing what iI have done here  . Here is how iI am picking the people in the PeopleSelect.php file  : "); break; case 6: print("Today is Saturday"); break; }

Hi i have been making a web page in PHP and Javascript to take employees clock times and do some things with them so i can display them everything is currently working quite well but the code looks like rough.

'; $Arr = @array('Op' => $Data['Op'], 'Name' => $Data['Name'], 'WorkHours' => $Data['WorkHours'], 'Start' => $Data['Start'], 'End' => $Data['End'], 'Clock' => substr($data[0], 11, 8), 'OFF' => substr($data[1], 11, 8), 'ON' => substr($data[2], 11, 8), 'OUT' => substr($data[3], 11, 8), 'Late' => $lated, 'Home' => $homed); return $Arr; } } $People = (object) array( 'People' => array( array( 'Person1' => $person1->GetTimes(), ), array( 'Person2' => $person2->GetTimes(), ), array( 'Person3' => $person3->GetTimes(), ), array( 'Person4' => $person4->GetTimes(), ), array( 'Person5' => $person5->GetTimes(), ), array( 'Person6' => $person6->GetTimes(), ), array( 'Person7' => $person7->GetTimes(), ), array( 'Person8' => $person8->GetTimes(), ), array( 'Person9' => $person9->GetTimes(), ), array( 'Person10' => $person10->GetTimes(), ), array( 'Person11' => $person11->GetTimes(), ), array( 'Person12' => $person12->GetTimes(), ), array( 'Person13' => $person13->GetTimes(), ), array( 'Person14' => $person14->GetTimes(), ), array( 'Person15' => $person15->GetTimes(), ), array( 'Person16' => $person16->GetTimes(), ), array( 'Person17' => $person17->GetTimes(), ), array( 'Person18' => $person18->GetTimes(), ), array( 'Person19' => $person19->GetTimes(), ), array( 'Person20' => $person20->GetTimes(), ), array( 'Person21' => $person21->GetTimes(), ), array( 'Person22' => $person22->GetTimes(), ), array( 'Person23' => $person23->GetTimes(), ), array( 'Person24' => $person24->GetTimes(), ), array( 'Person25' => $person25->GetTimes(), ), array( 'Person26' => $person26->GetTimes(), ), array( 'Person27' => $person27->GetTimes(), ), array( 'Person28' => $person28->GetTimes(), ), array( 'Person29' => $person29->GetTimes(), ), array( 'Person30' => $person30->GetTimes(), ), array( 'Person31' => $person31->GetTimes(), ), array( 'Person32' => $person32->GetTimes(), ), array( 'Person33' => $person33->GetTimes(), ), array( 'Person34' => $person34->GetTimes(), ), array( 'Person35' => $person35->GetTimes(), ), array( 'Person36' => $person36->GetTimes(), ), array( 'Person37' => $person37->GetTimes(), ), array( 'Person38' => $person38->GetTimes(), ), array( 'Person38' => $person39->GetTimes(), ), array( 'Person38' => $person40->GetTimes(), ), array( 'Person38' => $person41->GetTimes(), ), ) ); $time_end = microtime(true); file_put_contents('People.json', json_encode($People)); $execution_time = round((($time_end - $time_start) / 60), 3); echo 'Total Execution Time: ' . $execution_time . ' Mins '; So this code takes people that i have initated in the included People select file and then runs some query's and joins the data and then puts it all in to an array and then in to a JSON file, however the must be a better way of doing what i have done here  Here is how i am picking the people in the PeopleSelect.php file  "); break; case 6: print("Today is Saturday"); break; }

I have been making a web page in PHP and JavaScript to take employees clock times and do some things with them so I can display them. Everything is currently working quite well, but the code looks rough.

'; $Arr = @array('Op' => $Data['Op'], 'Name' => $Data['Name'], 'WorkHours' => $Data['WorkHours'], 'Start' => $Data['Start'], 'End' => $Data['End'], 'Clock' => substr($data[0], 11, 8), 'OFF' => substr($data[1], 11, 8), 'ON' => substr($data[2], 11, 8), 'OUT' => substr($data[3], 11, 8), 'Late' => $lated, 'Home' => $homed); return $Arr; } } $People = (object) array( 'People' => array( array( 'Person1' => $person1->GetTimes(), ), array( 'Person2' => $person2->GetTimes(), ), array( 'Person3' => $person3->GetTimes(), ), array( 'Person4' => $person4->GetTimes(), ), array( 'Person5' => $person5->GetTimes(), ), array( 'Person6' => $person6->GetTimes(), ), array( 'Person7' => $person7->GetTimes(), ), array( 'Person8' => $person8->GetTimes(), ), array( 'Person9' => $person9->GetTimes(), ), array( 'Person10' => $person10->GetTimes(), ), array( 'Person11' => $person11->GetTimes(), ), array( 'Person12' => $person12->GetTimes(), ), array( 'Person13' => $person13->GetTimes(), ), array( 'Person14' => $person14->GetTimes(), ), array( 'Person15' => $person15->GetTimes(), ), array( 'Person16' => $person16->GetTimes(), ), array( 'Person17' => $person17->GetTimes(), ), array( 'Person18' => $person18->GetTimes(), ), array( 'Person19' => $person19->GetTimes(), ), array( 'Person20' => $person20->GetTimes(), ), array( 'Person21' => $person21->GetTimes(), ), array( 'Person22' => $person22->GetTimes(), ), array( 'Person23' => $person23->GetTimes(), ), array( 'Person24' => $person24->GetTimes(), ), array( 'Person25' => $person25->GetTimes(), ), array( 'Person26' => $person26->GetTimes(), ), array( 'Person27' => $person27->GetTimes(), ), array( 'Person28' => $person28->GetTimes(), ), array( 'Person29' => $person29->GetTimes(), ), array( 'Person30' => $person30->GetTimes(), ), array( 'Person31' => $person31->GetTimes(), ), array( 'Person32' => $person32->GetTimes(), ), array( 'Person33' => $person33->GetTimes(), ), array( 'Person34' => $person34->GetTimes(), ), array( 'Person35' => $person35->GetTimes(), ), array( 'Person36' => $person36->GetTimes(), ), array( 'Person37' => $person37->GetTimes(), ), array( 'Person38' => $person38->GetTimes(), ), array( 'Person38' => $person39->GetTimes(), ), array( 'Person38' => $person40->GetTimes(), ), array( 'Person38' => $person41->GetTimes(), ), ) ); $time_end = microtime(true); file_put_contents('People.json', json_encode($People)); $execution_time = round((($time_end - $time_start) / 60), 3); echo 'Total Execution Time: ' . $execution_time . ' Mins '; This code takes people that I have imitated in the included `People` select file, runs some queries and joins the data, puts it all into an array and then in to a JSON file. However, there must be a better way of doing what I have done here. Here is how I am picking the people in the PeopleSelect.php file: "); break; case 6: print("Today is Saturday"); break; }

Removed "colorful" language
Source Link
RubberDuck
  • 31.2k
  • 6
  • 74
  • 177
Loading
added 8416 characters in body
Source Link
Josh Kirkpatrick
  • 1.1k
  • 1
  • 10
  • 23
Loading
Source Link
Josh Kirkpatrick
  • 1.1k
  • 1
  • 10
  • 23
Loading