Jump to content

gmc1103

Members
  • Content Count

    246
  • Joined

  • Last visited

Community Reputation

0 Neutral

About gmc1103

  • Rank
    Advanced Member
  1. Hi Kicken Thank's for helping me. You are right about your explanation. I have followed your explaination and tried your code but there is an error, the var_export of the code provided gives me this array array ( 'idPlan' => '718', 'idCpModulos' => '318', 'dataAula' => '2020-09-22', 'tempos' => '4', 'tempos2' => '0', 'dataCriado' => '2020-10-27 17:52:00', )array ( 'idPlan' => '718', 'idCpModulos' => '318', 'dataAula' => '2020-09-23', 'tempos' => '4', 'tempos2' => '0', 'dataCriado' => '2020-10-27 17:52:
  2. Hello I have an array where i want the join values (not sum) where the date are the same This my array(var_export) array ( 0 => array ( 0 => array ( 0 => array ( 'dataAula' => '2020-09-21', 'tempos' => '4', 'tempos2' => 'Segunda', 'total' => 4, ), ), 1 => array ( 1 => array ( 'dataAula' => '2020-09-22', 'tempos' => '4', 'tempos2' => 'Terça', 'total' => 8, ), ), 2 => array ( 2 => arra
  3. No, no limit But usually a class don't have more than 7/8 hours week in specific subject(for instance, multimedia have in one subject with 8 hours per week, 3 hours with all student class + 5 hours each group(class divided in 2) Sending my form to get full picture Regards
  4. Hi Barand Thanks for helping Let me explain all the process Here, in Portugal, we have professional school for students who don't want to go to unervisity. The student have 3 years to finish this. All subjects ( math , english, etc) have more than one module. I mean, Math have 10 modules, each one must have a grade to have a final classification, Portuguese have 12 modules, English 6...and so on. Every teacher must do a scheduler for all modules (The teacher choose the subject, then, the year (10,11,12),. After choosing the year the system print out wich modules he mu
  5. Hi Iv'e create 5 differents arrays for each week day. Usually there is only 2 students groups, but in some cases, i can have all the student class in one day or more + 2 others days for groups (class divided in 2) $cronograma = array(); $shift1 = array(); $shift2 = array(); $shift3 = array(); $shift4 = array(); $shift5 = array(); So my main array is called cronograma, and the others are (by days week, monday,etc) at the end i'm using array_merge jo merge non empty arrays In the following example i have 2 week days with all class (Monday an
  6. Hello Ok iv'e changed my code and now i have arrays for each group. Now i must check wich array are not empty and compare with hours arrays, right? Regards
  7. Ok I will change the main code and let u know tomorrow...now here is 1 AM. Thanks mate, see u tomorrow.
  8. What i have so far is this $newAr = array(); //array $id = explode(',',$idPlan); //string to array (subjects id) foreach ($id as $idPlan) { foreach ($tot as $t){ //array with hours $tempos = (int)$t['tempos']; } foreach($cronograma as $c){ //where i have all dates and hours per day if($c[3]<= $tempos){ $newAr[] = $idPlan; $newAr[] = $c[0]; } } print "<br>"; echo "data: ".$idPlan; print "
  9. Exactly I'm trying to figure out how to do it...i'm lost 😄
  10. 2 groups, 2 subjects So i must have 4 in my array
  11. Yes, this chart belongs to a case with class with only 14 students and only one subject with 4 hours each time. For instance, the school have classes with only 14 students so no need more than one group. In this case or other similar there is 2 groups, and each group can have classes in different days (this case), that's why you see 2,2, 4,4, etc The most important is to separate subject by id getting the start date and the end date because i can store into database the start and the end of each subject
  12. I understand your questions and they are really important to avoid any problem. In this case the most important is last dates because is when the subjetcs end. If they are rescheduled a note must be writen by the teacher, Rigth now, the most important is to separate subject by id getting the start date and the end date. See the image with only one subject, now they ask me to have only one example like this with more than one subject
  13. Because this array is organized in 2 class groups, each group must have 68 hours Since covid 19, a class can't have more than 15 students In this case i must have 2 groups, thats why i have 2 different dates for 34 and 68 hours
  14. Hi Thanks for your reply To explain you i must tell you what a want to achieve The first array ($cronograma) has information about dates,hours and total hours(last is incermented) My full array have this data 2020-09-21 - 2 - 0 - 2 2020-09-22 - 2 - 0 - 2 2020-09-28 - 2 - 0 - 4 2020-09-29 - 2 - 0 - 4 2020-10-06 - 2 - 0 - 6 2020-10-12 - 2 - 0 - 6 2020-10-13 - 2 - 0 - 8 2020-10-19 - 2 - 0 - 8 2020-10-20 - 2 - 0 - 10 2020-10-26 - 2 - 0 - 10 2020-10-27 - 2 - 0 - 12 2020-11-02 - 2 - 0 - 12 2020-11-03 - 2 - 0 - 14 2020-11-09 - 2 - 0 - 14 2020-11-10 - 2 - 0 - 16 2
  15. Let me explain my problem. I have an array with dates and numbers in format ($cronograma) Ex: Array ( [2020-09-21] => Array ( [0] => 2020-09-21 [1] => 2 [2] => 2 [3] => 2 ) [2020-09-28] => Array ( [0] => 2020-09-28 [1] => 2 [2] => 2 [3] => 4 ) Then i have another array with 2 ids (in this case 58,60) ($id) Finally i have a third array with numbers only (in this case 34,34) $tot So what i want is cross information beween them, for example for id 58 I must get dates (first element and last element when $tot = 34) for id 60 I must get dates (fir
×
×
  • 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.