Ссылка для скачивания материалов урока 2.
Видео урока.
 

Архив файлов урока можно скачать по ссылке ниже.
engine.com
Видео с урока.
<?
//1. Задаем переменные
$items=430;
$items_per_page=25;
$pages_in_paginator=11;
$paginator_offset=floor($pages_in_paginator/2);
//2. Рассчитываем количество страниц.
$page_count=ceil($items/$items_per_page);
//3. Если не задана страница в гет параметре то мы ее приравниваем к нулю.
if(!isset($_GET['page']))
  $_GET['page']=0;
$cur_page=intval($_GET['page']);
if($cur_page>=$page_count)$cur_page=$page_count-1;
//4. Рассчет первой страницы для вывода в пагинаторе
$start_page_pagination=$cur_page-$paginator_offset;
if($start_page_pagination<0)$start_page_pagination=0;
//5. Рассчет последней страницы для вывода в пагинаторе
$end_page_pagination=$start_page_pagination+$pages_in_paginator;
if($end_page_pagination>=$page_count)$end_page_pagination=$page_count-1;
if($end_page_pagination-$start_page_pagination<$pages_in_paginator && $page_count>$pages_in_paginator)
{
  $end_page_pagination=$page_count-1;
  $start_page_pagination=$end_page_pagination-$pages_in_paginator;
}
?>
<a href='?page=0'><<</a> | 
<?if($cur_page-1>=0){?>
<a href='?page=<?=$cur_page-1?>'><</a> | 
<?
}
for($i=$start_page_pagination;$i<=$end_page_pagination;$i++)
{
  $style="";
  $i1=$i+1;
  if($i==$cur_page)
    $style="style='color:red;'";
  
  echo "<a href='?page=$i' $style> $i1</a> | ";
}
if($cur_page+1<$page_count-1)
  {
  ?>
  <a href='?page=<?=$cur_page+1?>'>></a> | 
<?}?>
<a href='?page=<?=$page_count-1?>'>>></a> 
<Feed monitoring1.ffm> ACL allow localhost ACL allow 192.168.0.0 192.168.255.255 File /tmp/monitoring1.ffm FileMaxSize 50M ACL allow 127.0.0.1 </Feed> <Stream monitoring1.mjpg> Feed monitoring1.ffm Format mpjpeg VideoCodec mjpeg VideoFrameRate 22 VideoBufferSize 80 VideoSize 720x264 NoAudio </Stream>
Решение к задаче 1.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "1. Выводим в строку значения от 0 до 10 \n";
  for (int i = 0; i <= 10; i++)
  {
    cout << i;
    cout << ";";
  }
  system("pause");
  return 0;
}
Решение к задаче 2.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n2. Выводим в строку значения от 10 до 0 \n";
  for (int i = 10; i >= 0; i--)
  {
    cout << i;
    cout << ";";
  }
  system("pause");
  return 0;
}
Решение к задаче 3.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n3. Выводим в строку значения от 60 до 100 \n";
  for (int i = 60; i <= 100; i++)
  {
    cout << i;
    cout << ";";
  }
  system("pause");
  return 0;
}
Решение к задаче 4.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n4. Выводим в строку значения от -39 до 100 \n";
  for (int i = -39; i <= 100; i++)
  {
    cout << i;
    cout << ";";
  }
  system("pause");
  return 0;
}
Решение к задаче 5.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n5. Выводим в строку четные числа от 2 до 50\n";
  for (int i = 2; i <= 50; i += 2)
  {
    cout << i;
    cout << ";";
  }
  system("pause");
  return 0;
}
Решение к задаче 6.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n6. Выводим в строку нечетные числа от 1 до 49\n";
  for (int i = 1; i <= 49; i += 2)
  {
    cout << i;
    cout << ";";
  }
  system("pause");
  return 0;
}
Решение к задаче 7.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n7. Выводим таблицу  нулей 10x10\n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1; x <= 10; x++)
    {
      cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 8.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n8. Выводим таблицу  нулей с диагональю из единиц 10x10\n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(x==y)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 9.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n9. Выводим таблицу  с рамочкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(x==1 || x==10 ||y==1 || y==10 )
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решения к задаче 10.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n10. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(y<=5)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 11.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n11. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(y<=5)
        cout << 0;
      else
        cout << 1;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 12.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n12. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(x<=5)
        cout << 0;
      else
        cout << 1;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 13.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n13. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(x<=5)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 14.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n14. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(x>y)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 15.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n15. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(x>=10-y+1)
        cout << 0;
      else
        cout << 1;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 16.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n16. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if(x>=10-y+1)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 17.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n17. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if ( (x >= 10 - y + 1 && x<=y) || (x <= 10 - y + 1 && x>=y))
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 18.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n18. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if ( y >= 10 - x + 1 && y<=x)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 19.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n19. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if ( x >= 10 - y + 1 && x<=y)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 20.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n20. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if ( y <= 10 - x + 1 && y>=x)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 21.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n21. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if (x <= 10 - y + 1 && x>=y)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 22.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n22. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if ((x <10 - y + 1 && x>y) || (x > 10 - y + 1 && x < y))
        cout << 0;
      else
        cout << 1;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Решение к задаче 23.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
  SetConsoleCP(1251);
  SetConsoleOutputCP(1251);
  cout << "\n23. Выводим таблицу  с заливкой \n";
  for (int y = 1; y <= 10; y++)
  {
    for (int x = 1;x <= 10;x++)
    {
      if ( (x ==3 && y>2 && y<9)  || (x == 8 && y>2 && y<9) || (y == 3 && x>2 && x<9) || (y == 8 && x>2 && x<9) || x==1 || y==1 || x==10 || y==10)
        cout << 1;
      else
        cout << 0;
      cout << " ";
    }
    cout << "\n";
  }
  system("pause");
  return 0;
}
Задание:
9. Вывести таблицу из нулей
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10. Вывести таблицу c диагональю из 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1
11. Вывести таблицу c рамочкой из 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
12. Вывести таблицу c заливкой верхней части 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
13. Вывести таблицу c заливкой нижней части 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
14. Вывести таблицу c заливкой по образцу 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1
15. Вывести таблицу c заливкой по образцу 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0
15. Вывести таблицу c заливкой по образцу 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
16. Вывести таблицу c заливкой по образцу 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
17. Вывести таблицу c заливкой по образцу 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1
18. Вывести таблицу c заливкой по образцу 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1
19. Вывести таблицу c заливкой по образцу 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1
20. Вывести таблицу c заливкой по образцу 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0
21. Вывести таблицу c заливкой по образцу 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
22. Вывести таблицу c заливкой по образцу 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
23. Вывести таблицу c заливкой по образцу 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1
24. Вывести таблицу c заливкой по образцу 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 0 1 1 0 1 0 0 0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
25. Вывести таблицу c заливкой по образцу 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
index.php
<link rel=»stylesheet» href=»https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css»><link rel=»stylesheet» href=»https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css»>  <script src=»https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js»></script>  <script src=»https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js»></script>  <script type=»text/javascript»>function loadXMLDoc(q) {     var xmlhttp = new XMLHttpRequest();    xmlhttp.onreadystatechange = function() {        if (xmlhttp.readyState == XMLHttpRequest.DONE) {   //            if (xmlhttp.status == 200 && xmlhttp.readyState==4) {               document.getElementById(«mydiv»).innerHTML = xmlhttp.responseText;           }        }    };    xmlhttp.open(«GET», «ajax/getfruit.php?q=»+q, true);    xmlhttp.send();}
function save_fruit(id,text) {     var xmlhttp = new XMLHttpRequest();    xmlhttp.onreadystatechange = function() {        if (xmlhttp.readyState == XMLHttpRequest.DONE) {   //            if (xmlhttp.status == 200 && xmlhttp.readyState==4) {                         }        }    };    xmlhttp.open(«GET», «ajax/savefruit.php?id=»+id+»&text=»+text, true);    xmlhttp.send();}</script><input onkeyup=»loadXMLDoc(this.value)»>
<?
mysql_connect(«localhost»,»root»,»»);mysql_select_db(«ajax»);$_GET[‘q’]=urldecode($_GET[‘q’]);$data=mysql_query(«select * from `fruits`»);while($res=mysql_fetch_array($data)) { echo «<div id=’id_{$res[‘id’]}’ data-toggle=’modal’ onclick=’setdata(\»{$res[‘fruit’]}\»,\»{$res[‘id’]}\»)’ data-target=’#myModal’ class=’btn btn-success’>».$res[‘fruit’].»</div>»; }?>
<div class=»container»>
<!— Trigger the modal with a button —>
<!— Modal —>  <div class=»modal fade» id=»myModal» role=»dialog»>    <div class=»modal-dialog»>          <!— Modal content—>      <div class=»modal-content»>        <div class=»modal-header»>          <button type=»button» class=»close» data-dismiss=»modal»>×</button>          <h4 class=»modal-title»>Введите имя нового фрукта</h4>        </div>        <div class=»modal-body»> <p> <input id=’fruit’ placeholder=»Введите имя фрукта»> <input id=’fruitid’ type=’hidden’> </p>        </div>        <div class=»modal-footer»>          <button type=»button» class=»btn btn-success» onclick=»save()»>Сохранить</button>   <button type=»button» class=»btn btn-default» data-dismiss=»modal»>Закрыть</button>        </div>      </div>          </div>  </div>  </div><script>function save(){ text=document.getElementById(«fruit»).value; id=document.getElementById(«fruitid»).value; document.getElementById(«id_»+id).innerHTML=text; save_fruit(id,text); $(‘#myModal’).modal(‘hide’); }function setdata(text,id){ document.getElementById(«fruit»).value=text; document.getElementById(«fruitid»).value=id;}</script>
savefruit.php
<?
mysql_connect(«localhost»,»root»,»»);
mysql_select_db(«ajax»);
mysql_query(«update `fruits` set `fruit`='{$_GET[‘text’]}’ where `id`='{$_GET[‘id’]}’»);
?>

Задания на одномерные массивы.
1. Заполнить массив числами от 1 до 100 и вывести его в консоль.
2. Заполнить массив числами от 100 до 1 и вывести его в консоль.
3. Заполнить массив числами от -50 до 50 и вывести его в консоль.
4. Заполнить массив случайными числами и вывести его в консоль.
5. Заполнить массив случайными числами и найти максимальное значение.
6. Заполнить массив случайными числами и найти минимальное значение.
7. Заполнить массив случайными числами и удалить из него все элементы в которых записано число 2.
8. Заполнить массив случайными числами и выполнить его сортировку.
9. Заполнить массив случайными числами и найти в нем все значения которые повторяются более одного раза.
10. Заполнить два массива случайными числами и найти значения которые не повторяются в обоих массивах. Если число находится в обоих массивах то его не нужно выводить. Вывести нужно только те значения которые есть только в одном массиве.
Задания на двумерные массивы.

Задание:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 0 1 1 0 1 0 0 0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1

Большинство операторов сравнения применимы к числовым значениям. Всё это бинарные операторы, имеющие два числовых аргумента, но возвращающие логическое значение.