public function getDocTimeSlot($hospitalId, $doctorUserId) { // echo $this->getDoctorSession(1); exit; $todayWeek = getDay(date("l")); $this->db->select('doctorAvailability_id id, doctorAvailability_day day')->from('qyura_doctorAvailability')->join('qyura_doctorAvailabilitySession', 'qyura_doctorAvailability.doctorAvailability_id=qyura_doctorAvailabilitySession.doctorAvailability_refferalId', 'left')->where(array('qyura_doctorAvailability.doctorAvailability_docUsersId' => $doctorUserId, 'doctorAvailability_deleted' => 0, 'doctorAvailability_refferalId' => $hospitalId))->order_by('day', 'ASC'); // $row = $this->db->get()->row(); $response = $this->db->get()->result(); // echo $this->db->last_query(); die(); $finalResult = array(); if (!empty($response)) { foreach ($response as $row) { $finalTemp = array(); $day = convertNumberToDay(date($row->id)); $finalResult[$day] = $this->getDoctorSession($row->id, $hospitalId); } return $finalResult; } else { return (object) $finalResult; } }
$result['icon'] = $simpleforecast[$DayNumber]->{'icon_url'}; // "icon_url": "http://icons-ak.wxug.com/i/c/k/partlycloudy.gif”, $result['forecast_high'] = "High: " . $simpleforecast[$DayNumber]->{'high'}->{'fahrenheit'} . "°F"; $result['forecast_low'] = "Low: " . $simpleforecast[$DayNumber]->{'low'}->{'fahrenheit'} . "°F"; //$result['forecast_humidity'] = "Humidity: ".$simpleforecast[$DayNumber]->{'title'}."%"; $result['forecast_wind'] = "" . $simpleforecast[$DayNumber]->{'avewind'}->{'mph'} . "mph"; $result['forecast_winddirection'] = $simpleforecast[$DayNumber]->{'avewind'}->{'dir'}; // Südwest $result['forecast_rainrisk'] = "Rain: " . $simpleforecast[$DayNumber]->{'pop'} . "%"; // probability of precipitation = regenwahrscheinlichkeit return $result; } function printDay($day, $title) { return "<p id='hr'>\n<div id='main'>\n<img src='" . $day['icon'] . "'/> \n</div>\n\n<b>" . $day['dayofweek'] . ":</b>\n\n{$title}\n" . $day['forecast_weather'] . "\n\n<br/>\n" . $day['forecast_high'] . "\n<br/>\n" . $day['forecast_low'] . "\n</br>\n" . $day['forecast_rainrisk'] . "\n</br>\nWind: " . $day['forecast_winddirection'] . "\n@\n" . $day['forecast_wind'] . "\n</p>"; } $day0 = printDay(getDay(0), ""); $day1 = printDay(getDay(1), ""); $day2 = printDay(getDay(2), ""); $day3 = printDay(getDay(3), ""); echo '<body>'; //echo "<h1>$location</h1>"; echo ' <div id="wrap">'; echo "<p><div id='main'><img src='{$icon_url}'/> </div><b>Current:</b> {$weather} <br /> Temperature: {$temp_f}\n °F <br/> Wind: {$wind_direction}\n @ " . $wind_speed . "</p>"; echo "<p>{$day0}</p>"; echo "<p>{$day1}</p>"; echo "<p>{$day2}</p>"; echo "<p>{$day3}</p>"; //echo '<br />test' . $alert_message; echo '</div>'; echo "</body></html>";
echo ", " . $restaurante->nombreColonia . " "; echo "Del. " . $restaurante->delegacion->nombre . ", " . $restaurante->delegacion->entidad; ?> </p> <p class="textoDireccion"> Llama si prefieres al <span class="telefono"><?php echo $restaurante->telefono; ?> </span> </p> <p class="textoDireccion"> <img src="layout/imagenes/resultadosBusqueda/reloj_20x20.png"/> <?php $inicio = ""; $fin = ""; switch (getDay()) { case "lu": $inicio = $restaurante->horario->luIni; $fin = $restaurante->horario->luFin; break; case "ma": $inicio = $restaurante->horario->maIni; $fin = $restaurante->horario->maFin; break; case "mi": $inicio = $restaurante->horario->miIni; $fin = $restaurante->horario->miFin; break; case "ju": $inicio = $restaurante->horario->juIni; $fin = $restaurante->horario->juFin;
function draw_page($persistent) { ?> <h1>ברוכים הבאים - אנא מלאו את הפרטים הבאים על מנת להצטרף למערכת</h1> <form name="registation" method="POST"> <table> <tr> <td>*שם פרטי:</td> <td> <input type="text" name="first_name" title="הכנס שם פרטי" value="<?php print_r($persistent["first_name"]); ?> "> </td> </tr> <tr> <td>*שם משפחה:</td> <td> <input type="text" name="last_name" title="הכנס שם משפחה"value="<?php print_r($persistent["last_name"]); ?> "> </td> </tr> <tr> <td>*שם משתמש:</td> <td> <input type="text" name="user_name" title="הכנס שם משתמש באותיות לועזיות" value="<?php print_r($persistent["user_name"]); ?> "> </td> </tr> <tr> <td>*סיסמא:</td> <td> <input type="password" name="pass1" title="הכנס סיסמה סודית" value=<?php print_r($persistent["pass1"]); ?> > </td> </tr> <tr> <td>*אימות סיסמא:</td> <td> <input type="password" name="pass2" title="הכנס סיסמה סודית" value=<?php print_r($persistent["pass1"]); ?> > </td> </tr> <tr> <td>בית ספר:</td> <td> <select name="memberOfGroup"> <?php getGroupsList(); ?> </select> </td> </tr> <tr> <td>מספר זהות:</td> <td> <input type="text" name="ID" title="הכנס מספר זהות בן 9 ספרות" value="<?php print_r($persistent["ID"]); ?> "> </td> </tr> <tr> <td>כתובת דוא"ל:</td> <td> <input type="text" name="email" title="הכנס כתובת דואר אלקטרוני" value=<?php print_r($persistent["email"]); ?> > </td> </tr> <tr> <td>תאריך לידה:</td> <td> <select name="year_of_birth" > <?php getYear(); ?> </select> <select name="month_of_birth" > <?php getMonth(); ?> </select> <select name="day_of_birth" > <?php getDay(); ?> </select> </td> </tr> <tr> <td>טלפון:</td> <td> <input type="text" name="phone" title="הכנס מספר טלפון "value=<?php print_r($persistent["phone"]); ?> > </td> </tr> <tr> <td>טלפון סלולרי:</td> <td> <input type="text" name="cell_phone" title="הכנס מספר טלפון סלולרי" value=<?php print_r($persistent["cell_phone"]); ?> > </td> </tr> <tr> <td>ישוב:</td> <td> <input type="text" name="city" title="הכנס את שם הישוב בו אתה גר" value=<?php print_r($persistent["city"]); ?> > </td> </tr> <tr> <td>רחוב:</td> <td> <input type="text" name="street" title="הכנס את שם הרחוב בו אתה גר" value=<?php print_r($persistent["street"]); ?> > </td> </tr> <tr> <td>מספר בית:</td> <td> <input type="text" name="house_number" title="הכנס את מספר הבית בו אתה גר" value=<?php print_r($persistent["house_number"]); ?> > </td> </tr> <tr> <td>שם האב:</td> <td> <input type="text" name="father_name" title="הכנס את שם האב" value="<?php print_r($persistent["father_name"]); ?> "> </td> </tr> <tr> <td> טלפון של האב:</td> <td> <input type="text" name="father_phone" title="הכנס מספר טלפון של האב" value=<?php print_r($persistent["father_phone"]); ?> > </td> </tr> <tr> <td>שם האם:</td> <td> <input type="text" name="mother_name" title="הכנס את שם האם" value="<?php print_r($persistent["mother_name"]); ?> "> </td> </tr> <tr> <td>טלפון של האם:</td> <td> <input type="text" name="mother_phone" title="הכנס מספר טלפון של האם" value=<?php print_r($persistent["mother_phone"]); ?> > </td> </tr> </table> <input type="submit" title="לחץ להרשמה" value="הירשם"></form> <?php }
}); Route::get('admin', function () { $appies = getApplies(); return view('admin', ['h1' => "휴가 관리", 'h1_small' => "전 직원의 휴가신청서를 조회합니다.", 'pagetype' => "admin", 'applies' => $appies]); }); Route::get('apply', function () { $users = getUsersSimple(); return view('apply', ['pagetype' => "admin", 'users' => $users]); }); Route::post('apply', function (\Illuminate\Http\Request $request) { // dd($request->all()); $name = $request->get('name'); $started_at = $request->get('started_at'); $ended_at = $request->get('ended_at'); $reason = $request->get('reason'); $day = getDay($started_at, $ended_at); DB::insert("insert into apply (user_id,started_at, ended_at, day, reason) values (?,?,?,?,?)", [$name, $started_at, $ended_at, $day, $reason]); return redirect()->to('/admin'); }); Route::get('user', function () { $users = getUsers(); return view('user', ['pagetype' => "admin", 'users' => $users]); }); Route::get('adduser', function () { return view('adduser', ['pagetype' => "admin"]); }); Route::post('adduser', function (\Illuminate\Http\Request $request) { $name = $request->get('name'); $dept = $request->get('dept'); $total = $request->get('total'); DB::insert("insert into user (name, dept, total) VALUES (?,?,?)", [$name, $dept, $total]);
function showClasses($course_name, $lec_name, $class_room, $class_start, $class_stop, $class_days) { global $count_1; global $count_2; global $count_3; global $count_4; global $count_5; global $day; if ($class_days == 1) { if ($count_1 == 1) { if ($day == "0") { echo '<p style="font-family:Arial;font-size: 18px;">' . getDay($class_days) . '</p><hr />'; } } $count_1++; } if ($class_days == 2) { if ($count_2 == 1) { if ($day == "0") { echo '<p style="font-family:Arial;font-size: 18px;">' . getDay($class_days) . '</p><hr />'; } } $count_2++; } if ($class_days == 3) { if ($count_3 == 1) { if ($day == "0") { echo '<p style="font-family:Arial;font-size: 18px;">' . getDay($class_days) . '</p><hr />'; } } $count_3++; } if ($class_days == 4) { if ($count_4 == 1) { if ($day == "0") { echo '<p style="font-family:Arial;font-size: 18px;">' . getDay($class_days) . '</p><hr />'; } } $count_4++; } if ($class_days == 5) { if ($count_5 == 1) { if ($day == "0") { echo '<p style="font-family:Arial;font-size: 18px;">' . getDay($class_days) . '</p><hr />'; } } $count_5++; } echo '<div style="height: 80px; box-shadow: rgb(200, 200, 200) 3px 4px; border-radius: 10px; width: 500px; margin: 5px; background-color: #eee; z-index: 10;"> <p style="font-family: verdana; padding: 10px;"> <label style="font-size: 16px; float: right;">' . $class_start . ' - ' . $class_stop . '</label><br /> <label style="font-size: 22px;">' . $course_name . '</label><br /> <label style="font-size: 16px; float: left;">' . $lec_name . '</label> <label style="font-size: 16px; float: right;">' . $class_room . '</label> </p> </div>'; }
?> </div> <div id="<?php echo $rs['ID']; ?> "<? if($postid && getDay($postid) != $thisday) echo' style="display: none"' ?>> <? } ?> <div class="content"> <div class="title"><? if($postid) echo'<a name="id'.$rs['ID'].'">' ?><b><?php echo returnHtml($rs['TITLE']); ?> </b></div> <? echo returnHtml($rs['MESSAGE']).'<br>'; echo drawSignature($rs); echo drawDivViewComment($rs); ?> </div> <? $lastDay = getDay($rs['ID']); } } ?> </div> <? include_once '../inc/footer.php'; include_once '../inc/closeHtml.php'; ?>
function horarioDisponibleAhorita($hora) { $habilitado = false; $diaIni = getDay() . 'Ini'; $diaFin = getDay() . 'Fin'; //Hay un caso que no se tomaba en cuenta, si el restaurante cierra de madrugada del siguiente día //Ejemplo. Abre a las 10am y cierra a las 2 de la madrugada, 2am //Entonces dia ini será mayor que día fin //Para que séa válido debemos pasar esto // //___________horaCierre___________________________horaApertura____________________ // Abierto Cerrado Abierto // //Tenemos dos casos en los que estas abierto: //-Ser menor a hora cierre //-Ser mayora hora apertura // if ($hora->{$diaIni} > $hora->{$diaFin}) { if (getTime24() < $hora->{$diaFin}) { $habilitado = true; } if (getTime24() > $hora->{$diaIni}) { $habilitado = true; } } //Otro caso, que la hora de inicio y fin sean las mismas, y no son 00:00 es abierto todo el día if ($hora->{$diaIni} == $hora->{$diaFin} && $hora->{$diaIni} != '00:00:00') { $habilitado = true; } //Si estamos dentro del rango, es válido if (getTime24() > $hora->{$diaIni} && getTime24() < $hora->{$diaFin}) { $habilitado = true; } //Si el inicio es 00:00:00 y el fin es 23:59:00, esta abierto todo el día if ($hora->{$diaIni} == '00:00:00' && $hora->{$diaFin} == '23:59:00') { $habilitado = true; } //cualquier otro caso, esta cerrado return $habilitado; }
if (!$userArray['ErrorReturn']['Success']) { echo json_encode(array('table' => $DBConnArray['ErrorReturn']['ErrorMessage'])); return; } $holdUserArray = array(); foreach ($userArray['DataSet'] as $data) { $holdUserArray[$data['id']] = array('street_address' => $data['street_address'], 'city_address' => $data['city_address']); } $collectionArray[$userID][0]['street_address'] = $holdUserArray[$userID]['street_address']; $collectionArray[$userID][0]['city_address'] = $holdUserArray[$userID]['city_address']; } $tableReturn = "<table class=table>"; $tableReturn .= "<tr><th class=titlecell>Day</th>\n\t\t\t\t\t\t<th class=titlecell>Street</th>\n\t\t\t\t\t\t<th class=titlecell>City</th>\n\t\t\t\t\t\t<th class=titlecell>Notes</th></tr>"; foreach ($collectionArray as $userID => $middleArray) { $dataArray = $middleArray[0]; $tableReturn .= "<tr><td class=tablecell>" . getDay($dataArray['collection_day']) . "</td><td class=tablecell>" . $dataArray['street_address'] . "</td><td class=tablecell>" . $dataArray['city_address'] . "</td><td class=tablecell>" . $dataArray['notes'] . "</td></tr>"; } #print_r($returnArray['DataSet']); $tableReturn .= "</table>"; } echo json_encode(array('table' => $tableReturn)); ##################################################### # functions ##################################################### function getDay($int) { switch ($int) { case 1: return "Sunday"; break; case 2:
?> <li class="pull-right"><a href="#" class="text-muted"><i class="fa fa-gear"></i></a></li> </ul> <div class="tab-content"> <?php for ($d = 2; $d < 7; ++$d) { if ($d == 2) { $class = "active"; } else { $class = ""; } echo ' <div class="tab-pane ' . $class . '" id="tab_' . $d . '"> <img src="img/chart/' . $year . '/resa-horaire-' . getDay($d) . '.png" > </div> '; } ?> </div></div> </div> <div class="row"><div class="col-md-6"><!-- row 2 --> <!-- Classement des réservations : les adhérents par CSP --> <!-- Classement des réservations : par poste --> <div class="box box-primary"> <div class="box-header"><i class="fa fa-bar-chart-o"></i><h3 class="box-title">Les réservations par machine, année <?php echo $year;
function getDay($day) { $days = array(1 => 'Chủ nhật', 2 => 'Thứ hai', 3 => 'Thứ ba', 4 => 'Thứ tư', 5 => 'Thứ năm', 6 => 'Thứ sáu', 7 => 'Thứ bảy'); return $days[$day]; } ?> <h2><?php echo GxHtml::encode($model->getRelationLabel('classCalendars')); ?> </h2> <?php echo GxHtml::openTag('ul'); foreach ($model->classCalendars as $relatedModel) { echo GxHtml::openTag('li'); echo GxHtml::encode(getDay(GxHtml::valueEx($relatedModel))) . " "; echo GxHtml::encode(date("H:i", $relatedModel->start_time)) . " - "; echo GxHtml::encode(date("H:i", $relatedModel->end_time)) . "<br/>"; echo GxHtml::closeTag('li'); } echo GxHtml::closeTag('ul'); ?> <h2><?php echo GxHtml::encode($model->getRelationLabel('userClasses')); ?> </h2> <?php echo GxHtml::openTag('ul'); foreach ($model->userClasses as $relatedModel) { echo GxHtml::openTag('li'); echo GxHtml::link(GxHtml::encode(GxHtml::valueEx($relatedModel)), array('userClass/view', 'id' => GxActiveRecord::extractPkValue($relatedModel, true)));
function getUserInfoHTML($edit = 0, $notAllowdToEdit = 0) { if ($edit) { $LineStart = "<input type=\"text\" name=\""; $LineMiddle = "\" value=\""; $LineEnd = "\""; } else { $LineStart = ""; $LineMiddle = ""; $LineEnd = ""; } if (isset($_POST[add_user])) { $addUser = true; ?> <input type="hidden" name="addUser" value="addUser"> <?php } ?> <input type="hidden" name="newUserApproval" value="<?php echo $this->uname; ?> "> <input type="hidden" name="getUserInfo" value="<?php echo $this->uname; ?> "> <input type="hidden" name="uname" value="<?php echo $this->uname; ?> "> <!-- --> <table> <tr> <td>שם פרטי </td> <td><?php //echo $this->firstName ?> <?php echo $LineStart; if ($edit) { echo "firstName"; } echo $LineMiddle . $this->firstName . $LineEnd; ?> </td> </tr> <tr> <td>שם משפחה</td> <td> <?php echo $LineStart; if ($edit) { echo "lastName"; } echo $LineMiddle . $this->lastName . $LineEnd; ?> </td> </tr> <tr> <td>שם משתמש</td> <td> <?php //echo $this->uname; ?> <?php echo $LineStart; if ($addUser) { echo "uname"; } echo $LineMiddle . $this->uname . $LineEnd; ?> </td> </tr> <tr> <td>תעודת זהות</td> <td> <?php echo $LineStart; if ($edit) { echo "id"; } echo $LineMiddle . $this->id . $LineEnd; ?> </td> </tr> <tr> <td>בית ספר</td> <td> <?php //From generalFunctions.php if ($edit && $edit != -1) { ?> <select name="memberOfGroup" > <?php getGroupsList($this->memberOfGroup); ?> </select> <?php } else { getUserGroup($this->uname, true); //Echo to screen } ?> </td> </tr> <tr> <td>טלפון</td> <td> <?php echo $LineStart; if ($edit) { echo "phone"; } echo $LineMiddle . $this->phone . $LineEnd; ?> </td> </tr> <tr> <td>טלפון נייד</td> <td> <?php echo $LineStart; if ($edit) { echo "cellPhone"; } echo $LineMiddle . $this->cellPhone . $LineEnd; ?> </td> </tr> <tr> <td>דוא"ל</td> <td> <?php echo $LineStart; if ($edit) { echo "email"; } echo $LineMiddle . $this->email . $LineEnd; ?> </td> </tr> <tr> <td> תאריך לידה</td> <td> <?php //echo $LineStart; if ($edit) { ?> <select name="year_of_birth" > <?php getYear($this->BirthYear); ?> </select> <select name="month_of_birth" > <?php getMonth($this->birthMonth); ?> </select> <select name="day_of_birth" > <?php getDay($this->birthDay); ?> </select> <?php } else { if (strcmp($this->BirthYear, "") != 0 && $this->BirthYear != 0) { echo $LineMiddle . $this->birthDay . "/" . $this->birthMonth . "/" . $this->BirthYear . $LineEnd; } } ?> </td> </tr> <tr> <td>ישוב</td> <td> <?php echo $LineStart; if ($edit) { echo "city"; } echo $LineMiddle . $this->city . $LineEnd; ?> </td> </tr> <tr> <td>רחוב</td> <td> <?php echo $LineStart; if ($edit) { echo "street"; } echo $LineMiddle . $this->Street . $LineEnd; ?> </td> </tr> <tr> <td>מס' בית</td> <td> <?php echo $LineStart; if ($edit) { echo "houseNumber"; } echo $LineMiddle . $this->houseNumber . $LineEnd; ?> </td> </tr> <tr> <td>שם האב</td> <td> <?php echo $LineStart; if ($edit) { echo "fatherName"; } echo $LineMiddle . $this->fatherName . $LineEnd; ?> </td> </tr> <tr> <td>מספר טלפון של האב</td> <td> <?php echo $LineStart; if ($edit) { echo "fatherPhoneNumber"; } echo $LineMiddle . $this->fatherPhoneNo . $LineEnd; ?> </td> </tr> <tr> <td>שם האם</td> <td> <?php echo $LineStart; if ($edit) { echo "motherName"; } echo $LineMiddle . $this->motherName . $LineEnd; ?> </td> </tr> <tr> <td>מספר טלפון של האם</td> <td> <?php echo $LineStart; if ($edit) { echo "motherPhoneNumber"; } echo $LineMiddle . $this->motherPhoneNo . $LineEnd; ?> </td> </tr> <tr> <td>הרשאות</td> <td> <?php //From generalFunctions.php if ($edit == 1) { ?> <select name="permissionGroup" > <?php getPermissionList($this->permission[PID]); ?> </select> <?php } else { if (isset($this->permission[PGroupName])) { echo $this->permission[PGroupName]; } else { echo "חניך"; } } ?> <input type="hidden" name="approved" value="<?php echo $this->approved(); ?> "> </td> </tr> <?php // $this->birthDay=""; // $this->birthMonth=""; // // $this->city=""; // $this->Street=""; // $this->houseNumber=""; // // $this->memberOfGroup=""; // $this->permissionGroup=""; // // $this->approvedUser=""; ?> </table> <table> <tr> <?php if ($edit) { ?> <td> <input type="submit" name="userUpdateSave" value="שמור שינויים"> </td> <td> <input type="submit" name="userUpdeateCancel" value="בטל שינויים"> </td> <td> <input type="submit" name="resetPassword" value="איפוס סיסמא" title="איפוס הסיסמא ל1234"> </td> <?php } else { if (!$notAllowdToEdit) { ?> <td><input type="submit" name="editUserData" value="ערוך"></td> <?php } } ?> </tr> </table> <?php }
public function generate() { $input = Request::all(); $goal = Request::get('goal'); switch ($goal) { case "strength": $sets = "5-8"; $reps = "1-6"; break; case "endurance": $sets = "3"; $reps = "15-25"; break; case "definition": $sets = "4"; $reps = "8-12"; break; default: $sets = "3"; $reps = "10"; } $preferences = ["free_weights", "dumbbells", "barbells", "selectorized", "cables", "calisthenics"]; # $preferences = [ # Request::get('free_weights'), # Request::get('dumbbells'), # Request::get('barbells'), # Request::get('selectorized'), # Request::get('cables'), # Request::get('calisthenics') # ]; if (isset($preferences)) { foreach (array_keys($preferences, '') as $key) { unset($preferences[$key]); } global $chestExercises; global $backExercises; global $legsExercises; global $lowerLegsExercises; global $bicepsExercises; global $tricepsExercises; global $shouldersExercises; global $forearmsExercises; global $absExercises; $chestExercises = []; $backExercises = []; $legsExercises = []; $lowerLegsExercises = []; $bicepsExercises = []; $tricepsExercises = []; $shouldersExercises = []; $forearmsExercises = []; $absExercises = []; function getExercises($muscle, $preference) { $exercises = DB::table('exercises')->where('exercise_type', $preference)->where('muscle_group', $muscle)->lists('exercise_name'); return $exercises; } foreach ($preferences as $preference) { $chestExercises = array_merge($chestExercises, getExercises('chest', $preference)); $backExercises = array_merge($backExercises, getExercises('back', $preference)); $legsExercises = array_merge($legsExercises, getExercises('legs', $preference)); $lowerLegsExercises = array_merge($lowerLegsExercises, getExercises('lowerLegs', $preference)); $bicepsExercises = array_merge($bicepsExercises, getExercises('biceps', $preference)); $tricepsExercises = array_merge($tricepsExercises, getExercises('triceps', $preference)); $shouldersExercises = array_merge($shouldersExercises, getExercises('shoulders', $preference)); $forearmsExercises = array_merge($forearmsExercises, getExercises('forearms', $preference)); $absExercises = array_merge($absExercises, getExercises('abs', $preference)); } } global $cardioExercises; $cardioExercises = DB::table('exercises')->where('exercise_type', 'cardio')->lists('exercise_name'); function getExerciseLists($muscle, $numberOfExercises) { global ${"{$muscle}" . "Exercises"}; $shuffled = ${"{$muscle}" . "Exercises"}; shuffle($shuffled); return array_slice($shuffled, 0, $numberOfExercises); } function getDay($title, $largeMuscles, $largeMuscleExercises, $smallMuscles = [], $smallMuscleExercises = 0) { $listOfExercises = []; foreach ($largeMuscles as $largeMuscle) { $listOfExercises = array_merge($listOfExercises, getExerciseLists($largeMuscle, $largeMuscleExercises)); } foreach ($smallMuscles as $smallMuscle) { $listOfExercises = array_merge($listOfExercises, getExerciseLists($smallMuscle, $smallMuscleExercises)); } return ['name' => $title . ' Day', 'exercises' => $listOfExercises]; } $years = intval(Request::get('years')); $months = intval(Request::get('months')); $frequency = intval(Request::get('frequency')); $total = $years * 12 + $months; switch ($total) { case $total >= 24: $experience = "Advanced"; global $days; $days = []; if ($frequency == 1) { $days[] = getDay("Full Body", ["chest", "back", "legs"], 1, ["biceps", "triceps", "shoulders", "forearms", "lowerLegs", "abs"], 1); } else { if ($frequency == 2) { $days[] = getDay("Upper Body", ["chest", "back"], 1, ["biceps", "triceps", "shoulders", "forearms"], 1); $days[] = getDay("Lower Body", ["legs"], 2, ["lowerLegs", "abs"], 1); } else { if ($frequency == 3) { $days[] = getDay("Chest", ["chest"], 3, ["triceps", "shoulders"], 2); $days[] = getDay("Back", ["back"], 3, ["biceps", "forearms"], 2); $days[] = getDay("Leg", ["legs"], 3, ["lowerLegs", "abs"], 2); } else { $days[] = getDay("Chest", ["chest"], 3, ["triceps"], 2); $days[] = getDay("Back", ["back"], 3, ["biceps"], 2); $days[] = getDay("Leg", ["legs"], 3, ["lowerLegs"], 2); $days[] = getDay("Arm", ["shoulders", "forearms", "abs"], 3); for ($i = 0; $i < $frequency - 4; $i++) { $days[] = getDay("Cardio", ["cardio"], 4); } } } } break; case $total > 6: $experience = "Intermediate"; global $days; $days = []; $workout = intval($frequency / 2); $cardio = $frequency % 2 * $workout; if ($frequency == 1) { $days[] = getDay("Cardio", ["cardio"], 4); } else { if ($frequency < 5) { for ($i = 0; $i < $workout; $i++) { $days[] = getDay("Upper Body", ["chest", "back"], 1, ["biceps", "triceps", "shoulders", "forearms"], 1); $days[] = getDay("Lower Body", ["legs"], 2, ["lowerLegs", "abs"], 1); } for ($i = 0; $i < $cardio; $i++) { $days[] = getDay("Cardio", ["cardio"], 4); } } else { for ($i = 0; $i < 2; $i++) { $days[] = getDay("Upper Body", ["chest", "back"], 1, ["biceps", "triceps", "shoulders", "forearms"], 1); $days[] = getDay("Lower Body", ["legs"], 2, ["lowerLegs", "abs"], 1); } for ($i = 0; $i < $frequency - 4; $i++) { $days[] = getDay("Cardio", ["cardio"], 4); } } } break; default: global $days; $days = []; $experience = "Beginner"; for ($i = 0; $i < $frequency; $i++) { if ($i % 2 == 0) { if (count($cardioExercises) > 0) { $days[] = getDay("Cardio", ["cardio"], 4); } else { $days[] = getDay("Full Body", ["chest", "back", "legs"], 1, ["biceps", "triceps", "shoulders", "forearms", "lowerLegs", "abs"], 1); } } else { $days[] = getDay("Full Body", ["chest", "back", "legs"], 1, ["biceps", "triceps", "shoulders", "forearms", "lowerLegs", "abs"], 1); } } } return view('generator/workout', ['goal' => ucfirst($goal), 'preferences' => implode(', ', $preferences), 'experience' => $experience, 'frequency' => $frequency, 'days' => $days, 'sets' => $sets, 'reps' => $reps]); }
require 'inc/func.inc.php'; require 'inc/globals.inc.php'; $response = array('status_code' => 400, 'success' => false); if (isset($_GET['day']) && isset($_GET['month']) && isset($_GET['year'])) { $date = intval($_GET['day']); $month = intval($_GET['month']); $year = intval($_GET['year']); $response_array = array(); if (checkdate($month, $date, $year) != 1) { $response['message'] = 'Invalid Date provided'; } else { $date_string = $year . '-' . $month . '-' . $date; $date_string_format = date('Ymd', strtotime($date_string)); $date_string_format_2 = date('Y-m-d', strtotime($date_string)); $date_display = $date . '-' . $MONTHS[$month] . '-' . $year; $day_index = getDay($date, $month, $year); $day = $DAY_OF_WEEK[$day_index]; if (date('Y') == $year && date('n') == $month && date('j') == $date) { $info = 'Today is ' . $day . ' (' . $date_display . ')'; array_push($response_array, $info); $time_flag = true; } else { if (strtotime(date('d-m-Y')) > strtotime($date_string)) { $time_flag = false; } else { $time_flag = true; } $info = 'The day on ' . $date_display . ($time_flag ? " is " : " was ") . $day; // array_push($response_array, $info); } $response_array = getVizgrEvents($date_string_format, $response_array);
function parseToSql($dir) { $row = array(); if (strpos($dir, 'index.html') > -1) { $dir = str_replace('index.html', '', $dir); } $list = file_get_contents($dir . 'lista.html'); $a = strpos($list, '<ul>'); $b = strpos($list, '</ul>'); $sub = substr($list, $a, $b - $a); $first_for_limit = substr_count($sub, 'target') + 1; for ($z = 0; $z < $first_for_limit; $z++) { $content = file_get_contents($dir . 'plany/o' . ($z + 1) . '.html'); $var = '<title>'; $a = strpos($content, $var); $b = strpos($content, '</title>', $a + strlen($var)); $klasa = substr($content, $a + strlen($var), $b - $a - strlen($var)); $klasa = $klasa[strlen($klasa) - 2] . $klasa[strlen($klasa) - 1]; $var = "tek</th>"; $a = strpos($content, $var, 0); $a = strpos($content, '</tr>', $a); //echo $content; //echo $a; $b = strpos($content, '</table>', $a); //echo $a.":".$b; $sub = substr($content, $a + 5, $b - $a); //echo $sub; $start = 0; for ($i = 0; $i < 10; $i++) { $a = strpos($sub, '</tr>', $start); $minisub = substr($sub, $start, $a + strlen('</tr>') - $start); $start = $a + strlen('</tr>'); // found a number $q = strpos($minisub, 'nr">'); $w = strpos($minisub, '<', $q); $nr = substr($minisub, $q + 4, $w - $q - 4); $start1 = 0; for ($j = 0; $j < 5; $j++) { $q = strpos($minisub, 'l">', $start1); // 6 $w = strpos($minisub, '</td', $q + 3); // $start1 = $w + 5; // Cały wiersz $v = substr($minisub, $q + 3, $w - $q - 3); if ($v == ' ') { continue; } // Wyciągnij przedmiot $q = strpos($v, 'p">'); $w = strpos($v, '<', $q + 3); $przedmiot = substr($v, $q + 3, $w - $q - 3); // Wyciągnij nauczyciela $q = strpos($v, 'n">'); $w = strpos($v, '<', $q + 3); $nauczyciel = substr($v, $q + 3, $w - $q - 3); // Wyciągnij salę $q = strpos($v, 's">'); $w = strpos($v, '<', $q + 3); $sala = substr($v, $q + 3, $w - $q - 3); $record = array(); $record['nr'] = $nr; $record['przedmiot'] = $przedmiot; $record['nauczyciel'] = $nauczyciel; $record['sala'] = $sala; $record['klasa'] = $klasa; $record['dzien'] = getDay($j); $row[] = $record; } } } return $row; }
function getLastModific($f) { $a = filemtime($f); return getDay(date("D")) . date(" j/m/Y H:i", $a); }
$db = new PDO('mysql:host=' . $mysql_hostname . ';dbname=' . $mysql_database, $mysql_username, $mysql_password); if (isset($_GET['id']) && is_numeric($_GET['id'])) { $sql_req = "SELECT * FROM `web_news` WHERE `id`=%d;"; $sql_req = sprintf($sql_req, $_GET['id']); } else { die("error"); } $req = $db->prepare($sql_req); $req->execute(); $req->setFetchMode(PDO::FETCH_ASSOC); if ($req->rowCount() > 0) { while ($row = $req->fetch()) { echo '<div id="news"> <div id="date"> <div id="month">' . getMonth($row["date"]) . '</div> <div id="day">' . getDay($row["date"]) . '</div> </div> <div id="header">' . stripslashes(utf8_encode($row["title"])) . '</div> <div id="content"> <div id="detail"> <div style="float:left;">Par <a id="link" href="/profiles/?id=' . $row["uuid_author"] . '">' . $dev->getName($row["uuid_author"]) . '</a></div>'; $db_2 = new PDO('mysql:host=' . $mysql_hostname . ';dbname=' . $mysql_database, $mysql_username, $mysql_password); $sql_2 = "SELECT * FROM web_news_comments WHERE `news_id`= " . $row['id'] . ";"; $req_res = $db_2->prepare($sql_2); $req_res->execute(); $req_res->setFetchMode(PDO::FETCH_ASSOC); echo '<div class="clearfix"></div> </div></br> ' . utf8_encode(getHTMLfromBB($row["content"])) . ' </div> </div>';