�����JFIF��XX����������    $.' ",#(7),01444'9=82<.342  2!!22222222222222222222222222222222222222222222222222�����"����4���������������������������� ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������,�PG"Z_�4�˷����kjز�Z�,F+��_z�,�© �����zh6�٨�ic�fu������������������������������������#ډb���_�N��?�����������wQ���5-�~�I���8���������������������������������TK<5o�Iv-������������������k�_U_������������������������������~b�M��d��������Ӝ�U�Hh��?]��E�w��Q���k�{��_}qFW7HTՑ��Y��F�����?_�'ϔ��_�Ջt������������������������=||I �����6�έ"�����D���/[�k�9����Y�8������ds|\���Ҿp6�Ҵ���]��.����6���z<�v��@]�i%������������������������$j��~����g��J>��no����pM[me�i$[�����������s�o�ᘨ�˸ nɜG-�ĨU�ycP���3.DB�li�;���������������������hj���x����7Z^�N�h��������N3u{�:j�����x�힞��#M��&��jL P@��_���� P�������������������&��o8��������9������@Sz���6�t7#O�ߋ �����s}Yf�T������lmr����Z)'N��k�۞p�����w\�T���������������ȯ?�8`���O��i{wﭹW�[�r�� ��Q4F�׊������3m&L�=��h3�������z~��#����\�l :�F,j@�� ʱ�wQT����8�"kJO����6�֚l������������������}����R�>ډK���]��y����&����p�}b������;N�1�m�r$����|��7�>e�@���B�TM*-i�H��g�D�)� E�m�|�ؘbҗ�a���Ҿ����������������t4�����o���G��*oCN�rP���Q��@z,|?W[0���������:�n,j���WiE��W������$~/�hp\��?��{(�0���+�Y8rΟ�+����>S-S���������������VN;���}�s?.����� w��9��˟<���Mq4�Wv'������{)0�1mB����V����W[��������8�/<� �%���wT^�5���b��)iM� p�g�N�&ݝ������������VO~��q���u���9��� ����!��J27�����$����O-���! �:���%H��� ـ�������y�ΠM=t{!S�� �oK8�������t<����è��������:a��������[������ա�H���~��w��Qz`�p����o�^ ������Q��n����� �,uu�C��$ ^���,�������8�#��:�6��e�|~�����������!�3��3.�\0�����q��o�4`.|� ����y�Q�`~;�d�ׯ,��O�Zw�������`73�v�܋�<�����Ȏ�� ـ4k��5�K�a�u�=9Yd��$>x�A�&�� j0� ���vF��� Y���|�y��� ~�6�@c��1vOp��������Ig�����4��l�OD�����L����� R���c���j�_�uX�6��3?nk��Wy�f;^*B� ��@���~a�`��Eu�������+�����6�L��.ü>��}y���}_�O�6�͐�:�Yr���G�X��kG������l^w����������~㒶sy���Iu�!���� W ��X��N�7BV��O��!X�2����wvG�R�f�T#�����t�/?���%8�^�W�aT����G�cL�M���I��(J����1~�8�?aT ���]����AS�E��(��*E}� 2������#I/�׍qz��^t�̔���������b�Yz4x����t�){ OH�����+(E��A&�N�������XT��o��"�XC����'���)}�J�z�p� ����~5�}�^����+�6����w��c��Q�|�Lp�d�H��}�(�.|����k��c4^�����"�����Z?ȕ ��a<�������L�!0�39C� �Eu�����C�F�Ew�ç ;�n?�*o���B�8�bʝ���'#Rqf����M}7����]�������s2tcS{�\icTx;�\��7K���P������ʇ Z O-��~�������c>"��?��������P�����E��O�8��@�8��G��Q�g�a�Վ���󁶠��䧘��_%#r�>�����1�z�a���eb��qcP��ѵ��n���#L��� =��׀t� L�7�`�����V����A{�C:�g���e@�����w1 Xp�3�c3�ġ�������p��M"'-�@n4���fG���B3�DJ�8[Jo�ߐ���gK)ƛ��$���� �������8�3�����+���� �����6�ʻ���� ���S�kI�*KZlT _`�������?��K�����QK�d���������B`�s}�>���`������*�>��,*@J�d�oF*�����弝��O}�k��s��]��y�ߘ�������c1G�V���<=�7��7����6��q�PT��tXԀ�!9*4�4Tހ���3XΛex�46�������Y��D ����� ����BdemDa����\�_l,����G�/���֌7���Y�](�xTt^%�GE�����4�}bT����ڹ�����;��Y)���B�Q��u��>J/J ���⮶.�XԄ��j�ݳ������+E��d ���r�5�_D�����1 ���o�� �B�x�΢�#����<��W�����8���R6�@���g�M�.��� dr�D��>(otU��@�x=��~v���2� ӣ�d�oBd�����3�eO�6�㣷����������ݜ�6��6Y��Qz`����S��{���\P��~z m5{J/L��1������<�e�ͅPu���b�]�ϔ��������'�������f�b� Zpw��c`"��i���BD@:)ִ�:�]��h���v�E��w���T�l�������P����"Ju�}��وV ��J��G6��. J/�Qgl߭�e�����@�z�Zev2u����)]կ���������7x�������s�M�-<ɯ�c��r��v�����@��$�ޮ}lk���a����'����>x��O\�Z������Fu>������ck#��&:��`�$��ai�>2Δ����l���oF[h�������lE�ܺ�Π���k:)���`������� $[6�����9�����kOw�\|�����8}������ބ:��񶐕��������I�A1/���=�2[�,�!��.}gN#�u����b���� ~���������݊��}34q�����d�E��L��������c��$���"�[q�U�硬g^��%B ��z���r�p�������J�ru%v\h�����1Y�ne`������ǥ:g����pQM~�^��Xi� ��`S�:V2������9.�P���V������?B�k�� ��������AEvw%�_�9C�Q����wKekP�ؠ�\������;Io d�{ ߞo�c1eP�����\� `����E=���@K<�Y��������eڼ�J����w����{av�F�'�M�@��������������/J��+9p����|]���������Iw &`���8���&�M�hg���[�{�������Xj���%��Ӓ�������������������$��(�����ʹN�������<>�I���RY�����K2�NPlL�ɀ�)��&e��������B+ь����(������������������� � �JTx����_?EZ� }@���� 6�U���뙢ط�z��dWI��n` D����噥�[��uV��"�G&�����Ú����2�g�}&m���������������������?ċ���"����Om#�������������������������� ��{���������������������ON��"S�X���Ne��ysQ���@�������������Fn��Vg�����dX�~nj����������������������]J�<�K]:����FW���b�������62����������=��5f����JKw����bf�X������������������������55��~J �%^�������:�-�QIE��P��v�nZum� z � ~ə ���� ���ة����;�f��\v�������g�8�1��f2�������������������������4;�V���ǔ�)�������������������9���1\������������������������������c��v�/'Ƞ�w������������������$�4�R-��t����������������������������������� e�6�/�ġ �̕Ecy�J���u�B���<�W�ַ~�w[B1L۲�-JS΂�{���΃�������������������������������������������A��20�c#���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@���� 0!1@AP"#2Q`$3V�%45a6�FRUq����� ������^7ׅ,$n��������+��F�`��2X'��0vM��p�L=�������5��8������u�p~���.�`r�����\����O��,ư�0oS ��_�M�����l���4�kv\JSd���x���SW�<��Ae�IX����������$I���w�:S���y���›R��9�Q[���,�5�;�@]�%���u�@ *ro�lbI �� ��+���%m:�͇ZV�����u�̉����θau<�fc�.����{�4Ա� �Q����*�Sm��8\ujqs]{kN���)qO�y�_*dJ�b�7���yQqI&9�ԌK!�M}�R�;�������S�T���1���i[U�ɵz�]��U)V�S6���3$K{��ߊ<�(� E]Զ[ǼENg�����'�\?#)Dkf��J���o��v���'�%ƞ�&K�u��!��b�35LX�Ϸ��63$K�a�;�9>,R��W��3�3� d�JeTYE.Mϧ��-�o�j3+y��y^�c�������VO�9NV\nd�1 ��!͕_)a�v;����թ�M�lWR1��)El��P;��yوÏ�u 3�k�5Pr6<�⒲l�!˞*��u־�n�!�l:����UNW ��%��Chx8vL'��X�@��*��)���̮��ˍ��� ����D-M�+J�U�kvK����+�x8��cY������?�Ԡ��~3mo��|�u@[XeY�C�\Kp�x8�oC�C�&����N�~3-H���� ��MX�s�u<`���~"WL��$8ξ��3���a�)|:@�m�\���^�`�@ҷ)�5p+��6���p�%i)P M���ngc�����#0Aruz���RL+xSS?���ʮ}()#�t��mˇ!��0}}y����<�e� �-ή�Ԩ��X������ MF���ԙ~l L.3���}�V뽺�v������멬��Nl�)�2����^�Iq��a��M��qG��T�����c3#������3U�Ǎ���}��לS�|qa��ڃ�+���-��2�f����/��bz��ڐ�� �ݼ[2�ç����k�X�2�* �Z�d���J�G����M*9W���s{��w���T��x��y,�in�O�v��]���n����P�$��JB@=4�OTI�n��e�22a\����q�d���%�$��(���:���: /*�K[PR�fr\nڙdN���F�n�$�4��[�� U�zƶ����� �mʋ���,�ao�u 3�z� �x��Kn����\[��VFmbE;�_U��&V�Gg�]L�۪&#n%�$ɯ��dG���D�TI=�%+AB�Ru#��b4�1�»x�cs�YzڙJG��f��Il���d�eF'T� iA��T���uC�$����Y��H?����[!G`}���ͪ� �纤Hv\������j�Ex�K���!���OiƸ�Yj�+u-<���'q����uN�*�r\��+�]���<�wOZ.fp�ێ��,-*)V?j-kÊ#�`�r��dV����(�ݽBk�����G�ƛk�QmUڗe��Z���f}|����8�8��a���i��3'J�����~G_�^���d�8w������ R�`(�~�.��u���l�s+g�bv���W���lGc}��u���afE~1�Ue������Z�0�8�=e�� f@/�jqEKQQ�J���oN��J���W5~M>$6�Lt�;$ʳ{���^��6�{����v6���ķܰg�V�cnn �~z�x�«�,2�u�?cE+Ș�H؎�%�Za�)���X>uW�Tz�Nyo����s���FQƤ��$��*�&�LLXL)�1�" L��eO��ɟ�9=���:t��Z���c��Ž���Y?�ӭV�wv�~,Y��r�ۗ�|�y��GaF�����C�����.�+� ���v1���fήJ�����]�S��T��B��n5sW}y�$��~z�'�c ��8 ��� ,! �p��VN�S��N�N�q��y8z˱�A��4��*��'������2n<�s���^ǧ˭P�Jޮɏ�U�G�L�J�*#��<�V��t7�8����TĜ>��i}K%,���)[��z�21z ?�N�i�n1?T�I�R#��m-�����������������1����lA�`��fT5+��ܐ�c�q՝��ʐ��,���3�f2U�եmab��#ŠdQ�y>\��)�SLY����w#��.���ʑ�f��� ,"+�w�~�N�'�c�O�3F�������N<���)j��&��,-� �љ���֊�_�zS���TǦ����w�>��?�������n��U仆�V���e�����0���$�C�d���rP �m�׈e�Xm�Vu� �L��.�bֹ��� �[Դaզ���*��\y�8�Է:�Ez\�0�Kq�C b��̘��cө���Q��=0Y��s�N��S.����3.���O�o:���#���v7�[#߫ ��5�܎�L���Er4���9n��COWlG�^��0k�%<���ZB���aB_���������'=��{i�v�l�$�uC���mƎҝ{�c㱼�y]���W�i ��ߧc��m�H� m�"�"�����;Y�ߝ�Z�Ǔ�����:S#��|}�y�,/k�Ld� TA�(�AI$+I3��;Y*���Z��}|��ӧO��d�v��..#:n��f>�>���ȶI�TX��� 8��y����"d�R�|�)0���=���n4��6ⲑ�+��r<�O�܂~zh�z����7ܓ�HH�Ga롏���nCo�>������a ���~]���R���̲c?�6(�q�;5%� |�uj�~z8R�=X��I�V=�|{v�Gj\gc��q����z�؋%M�ߍ����1y��#��@f^���^�>N������#x#۹��6�Y~�?�dfPO��{��P�4��V��u1E1J �*|���%����JN��`eWu�zk M6���q t[�� ��g�G���v��WIG��u_ft����5�j�"�Y�:T��ɐ���*�;� e5���4����q$C��2d�}���� _S�L#m�Yp��O�.�C�;��c����Hi#֩%+) �Ӎ��ƲV���SYź��g |���tj��3�8���r|���V��1#;.SQ�A[���S������#���`n�+���$��$�I �P\[�@�s��(�ED�z���P��])8�G#��0B��[ى��X�II�q<��9�~[Z멜�Z�⊔IWU&A>�P~�#��dp<�?����7���c��'~���5 ��+$���lx@�M�dm��n<=e�dyX��?{�|Aef ,|n3�<~z�ƃ�uۧ�����P��Y,�ӥQ�*g�#먙R�\���;T��i,��[9Qi歉����c>]9�� ��"�c��P�� �Md?٥��If�ت�u��k��/����F��9�c*9��Ǎ:�ØF���z�n*�@|I�ށ9����N3{'��[�'ͬ�Ҳ4��#}��!�V� Fu��,�,mTIk���v C�7v���B�6k�T9��1�*l� '~��ƞF��lU��'�M ����][ΩũJ_�{�i�I�n��$����L�� j��O�dx�����kza۪��#�E��Cl����x˘�o�����V���ɞ�ljr��)�/,�߬h�L��#��^��L�ф�,íMƁe�̩�NB�L�����iL����q�}��(��q��6IçJ$�W�E$��:������=#����(�K�B����zђ <��K(�N�۫K�w��^O{!����)��H���>x�������lx�?>Պ�+�>�W���,Ly!_�D���Ō�l���Q�!�[ �S����J��1��Ɛ�Y}��b,+�Lo�x�ɓ)����=�y�oh�@�꥟/��I��ѭ=��P�y9��� �ۍYӘ�e+�p�Jnϱ?V\SO%�(�t� ���=?MR�[Ș�����d�/ ��n�l��B�7j� ��!�;ӥ�/�[-���A�>��dN�sLj ��,ɪv��=1c�.SQ�O3�U���ƀ�ܽ�E����������̻��9G�ϷD�7(�}��Ävӌ\��y�_0[w ���<΍>����a_��[0+�L��F.�޺��f�>oN�T����q;���y\��bՃ��y�jH�<|q-eɏ�_?_9+P���Hp$�����[ux�K w�Mw��N�ی'$Y2�=��q���KB��P��~�������Yul:�[<����F1�2�O���5=d����]Y�sw:���Ϯ���E��j,_Q��X��z`H1,#II ��d�wr��P˂@�ZJV����y$�\y�{}��^~���[:N����ߌ�U�������O��d�����ؾe��${p>G��3c���Ė�lʌ�� ת��[��`ϱ�-W����dg�I��ig2��� ��}s ��ؤ(%#sS@���~���3�X�nRG�~\jc3�v��ӍL��M[JB�T��s3}��j�Nʖ��W����;7���ç?=X�F=-�=����q�ߚ���#���='�c��7���ڑW�I(O+=:uxq�������������e2�zi+�kuG�R��������0�&e�n���iT^J����~\jy���p'dtG��s����O��3����9* �b#Ɋ�� p������[Bws�T�>d4�ۧs���nv�n���U���_�~,�v����ƜJ1��s�� �QIz���)�(lv8M���U=�;����56��G���s#�K���MP�=��LvyGd��}�VwWBF�'�à �?MH�U�g2�� ����!�p�7Q��j��ڴ����=��j�u��� Jn�A s���uM������e��Ɔ�Ҕ�!)�'��8Ϣ�ٔ���ޝ(��Vp���צ֖d=�IC�J�Ǡ{q������kԭ�߸���i��@K����u�|�p=..�*+����x�����z[Aqġ#s2a�Ɗ���RR�)*HRsi�~�a &f��M��P����-K�L@��Z��Xy�'x�{}��Zm+���:�)�) IJ�-i�u���� ���ܒH��'��L(7�y�GӜq���� j��� 6ߌg1�g�o���,kر���tY�?W,���p���e���f�OQS��!K�۟cҒA�|ս�j�>��=⬒��˧L[�� �߿2JaB~R��u�:��Q�] �0H~���]�7��Ƽ�I���(�}��cq '�ήET���q�?f�ab���ӥvr� �)o��-Q��_'����ᴎo��K������;��V���o��%���~OK ����*��b�f:���-ťIR��`B�5!RB@���ï�� �u �̯e\�_U�_������� g�ES��3��������QT��a�����x����U<~�c?�*�#]�MW,[8O�a�x��]�1bC|踤�P��lw5V%�)�{t�<��d��5���0i�XSU��m:��Z�┵�i�"��1�^B�-��P�hJ��&)O��*�D��c�W��vM��)����}���P��ܗ-q����\mmζZ-l@�}��a��E�6��F�@��&Sg@���ݚ�M����� ȹ 4����#p�\H����dYDo�H���"��\��..R�B�H�z_�/5˘����6��KhJR��P�mƶi�m���3��,#c�co��q�a)*P�t����R�m�k�7x�D�E�\Y�閣_X�<���~�)���c[[�BP����6�Yq���S��0����%_����;��Àv�~�| VS؇ ��'O0��F0��\���U�-�d@�����7�SJ*z��3n��y��P����O����������m�~�P�3|Y��ʉr#�C�<�G~�.,! ���bqx���h~0=��!ǫ�jy����l��O,�[B��~��|9��ٱ����Xly�#�i�B��g%�S��������tˋ���e���ې��\[d�t)��.+u�|1 ������#�~Oj����hS�%��i.�~X���I�H�m��0n���c�1uE�q��cF�RF�o���7� �O�ꮧ� ���ۛ{��ʛi5�rw?׌#Qn�TW��~?y$��m\�\o����%W� ?=>S�N@�� �Ʈ���R����N�)�r"C�:��:����� �����#��qb��Y�. �6[��2K����2u�Ǧ�HYR��Q�MV��� �G�$��Q+.>�����nNH��q�^��� ����q��mM��V��D�+�-�#*�U�̒ ���p욳��u:�������IB���m����PV@O���r[b= �� ��1U�E��_Nm�yKbN�O���U�}�the�`�|6֮P>�\2�P�V���I�D�i�P�O;�9�r�mAHG�W�S]��J*�_�G��+kP�2����Ka�Z���H�'K�x�W�MZ%�O�YD�Rc+o��?�q��Ghm��d�S�oh�\�D�|:W������UA�Qc yT�q��������~^�H��/��#p�CZ���T�I�1�ӏT����4��"�ČZ�����}��`w�#�*,ʹ�� ��0�i��課�Om�*�da��^gJ݅{���l�e9uF#T�ֲ��̲�ٞC"�q���ߍ ոޑ�o#�XZTp����@ o�8��(jd��xw�]�,f���`~��|,s��^����f�1���t��|��m�򸄭/ctr��5s��7�9Q�4�H1꠲BB@�l9@���C�����+�wp�xu�£Yc�9��?`@#�o�mH�s2��)�=��2�.�l����jg�9$�Y�S�%*L������R�Y������7Z���,*=�䷘$�������arm�o�ϰ���UW.|�r�uf����IGw�t����Zwo��~5 ��YյhO+=8fF�)�W�7�L9lM�̘·Y���֘YLf�큹�pRF���99.A �"wz��=E\Z���'a� 2��Ǚ�#;�'}�G���*��l��^"q��+2FQ� hj��kŦ��${���ޮ-�T�٭cf�|�3#~�RJ����t��$b�(R��(����r���dx� >U b�&9,>���%E\� Ά�e�$��'�q't��*�א���ެ�b��-|d���SB�O�O��$�R+�H�)�܎�K��1m`;�J�2�Y~9��O�g8=vqD`K[�F)k�[���1m޼c��n���]s�k�z$@��)!I �x՝"v��9=�ZA=`Ɠi �:�E��)`�7��vI��}d�YI�_ �o�:ob���o ���3Q��&D&�2=�� �Ά��;>�h����y.*ⅥS������Ӭ�+q&����j|UƧ�����}���J0��WW< ۋS�)jQR�j���Ư��rN)�Gű�4Ѷ(�S)Ǣ�8��i��W52���No˓� ۍ%�5brOn�L�;�n��\G����=�^U�dI���8$�&���h��'���+�(������cȁ߫k�l��S^���cƗjԌE�ꭔ��gF���Ȓ��@���}O���*;e�v�WV���YJ\�]X'5��ղ�k�F��b 6R�o՜m��i N�i�����>J����?��lPm�U��}>_Z&�KK��q�r��I�D�Չ~�q�3fL�:S�e>���E���-G���{L�6p�e,8��������QI��h��a�Xa��U�A'���ʂ���s�+טIjP�-��y�8ۈZ?J$��W�P� ��R�s�]��|�l(�ԓ��sƊi��o(��S0���Y� 8�T97.�����WiL��c�~�dxc�E|�2!�X�K�Ƙਫ਼�$((�6�~|d9u+�qd�^3�89��Y�6L�.I�����?���iI�q���9�)O/뚅����O���X��X�V��ZF[�یgQ�L��K1���RҖr@v�#��X�l��F���Нy�S�8�7�kF!A��sM���^rkp�jP�DyS$N���q���nxҍ!U�f�!eh�i�2�m����`�Y�I�9r�6� �TF���C}/�y�^���Η���5d�'��9A-��J��>{�_l+�`��A���[�'��յ�ϛ#w:݅�%��X�}�&�PSt�Q�"�-��\縵�/����$Ɨh�Xb�*�y��BS����;W�ջ_mc�����vt?2}1�;qS�d�d~u:2k5�2�R�~�z+|HE!)�Ǟl��7`��0�<�,�2*���Hl-��x�^����'_TV�gZA�'j� ^�2Ϊ��N7t�����?w�� �x1��f��Iz�C-Ȗ��K�^q�;���-W�DvT�7��8�Z�������� hK�(P:��Q- �8�n�Z���܃e貾�<�1�YT<�,�����"�6{�/ �?�͟��|1�:�#g��W�>$����d��J��d�B���=��jf[��%rE^��il:��B���x���Sּ�1հ��,�=��*�7 fcG��#q� �eh?��2�7�����,�!7x��6�n�LC�4x��},Geǝ�tC.��vS �F�43��zz\��;QYC,6����~;RYS/6���|2���5���v��T��i����������mlv��������&� �nRh^ejR�LG�f���? �ۉҬܦƩ��|��Ȱ����>3����!v��i�ʯ�>�v��オ�X3e���_1z�Kȗ\<������!�8���V��]��?b�k41�Re��T�q��mz��TiOʦ�Z��Xq���L������q"+���2ۨ��8}�&N7XU7Ap�d�X��~�׿��&4e�o�F��� �H�����O���č�c�� 懴�6���͉��+)��v;j��ݷ�� �UV�� i��� j���Y9GdÒJ1��詞�����V?h��l�����l�cGs�ځ�������y�Ac������\V3�? �� ܙg�>qH�S,�E�W�[�㺨�uch�⍸�O�}���a��>�q�6�n6�����N6�q��������N� ���! 1AQaq�0@����"2BRb�#Pr���3C`��Scst���$4D���%Td���� ?�����N����a��3��m���C���w��������xA�m�q�m����m������$����4n淿t'��C"w��zU=D�\R+w�p+Y�T�&�պ@��ƃ��3ޯ?�Aﶂ��aŘ���@-�����Q�=���9D��ռ�ѻ@��M�V��P��܅�G5�f�Y<�u=,EC)�<�Fy'�"�&�չ�X~f��l�KԆV��?�� �W�N����=(� �;���{�r����ٌ�Y���h{�١������jW����P���Tc�����X�K�r��}���w�R��%��?���E��m�� �Y�q|����\lEE4����r���}�lsI�Y������f�$�=�d�yO����p�����yBj8jU�o�/�S��?�U��*������ˍ�0�������u�q�m [�?f����a�� )Q�>����6#������� ?����0UQ����,IX���(6ڵ[�DI�MNލ�c&���υ�j\��X�R|,4��� j������T�hA�e��^���d���b<����n�� �즇�=!���3�^�`j�h�ȓr��jẕ�c�,ٞX����-����a�ﶔ���#�$��]w�O��Ӫ�1y%��L�Y<�wg#�ǝ�̗`�x�xa�t�w��»1���o7o5��>�m뭛C���Uƃߜ}�C���y1Xνm�F8�jI���]����H���ۺиE@I�i;r�8ӭ�����V�F�Շ| ��&?�3|x�B�MuS�Ge�=Ӕ�#BE5G������Y!z��_e��q�р/W>|-�Ci߇�t�1ޯќd�R3�u��g�=0 5��[?�#͏��q�cf���H��{ ?u�=?�?ǯ���}Z��z���hmΔ�BFTW�����<�q��(v� ��!��z���iW]*�J�V�z��gX֧A�q�&��/w���u�gYӘa���; �i=����g:��?2�dž6�ى�k�4�>�Pxs����}������G�9���3 ���)gG�R<>r h�$��'nc�h�P��Bj��J�ҧH� -��N1���N��?��~��}-q!=��_2hc�M��l�vY%UE�@|�v����M2�.Y[|y�"Eï��K�ZF,�ɯ?,q�?v�M 80jx�"�;�9vk�����+ ֧�� �ȺU��?�%�vcV��mA�6��Qg^M�����A}�3�nl� QRN�l8�kkn�'�����(��M�7m9و�q���%ޟ���*h$Zk"��$�9��: �?U8�Sl��,,|ɒ��xH(ѷ����Gn�/Q�4�P��G�%��Ա8�N��!� �&�7�;���eKM7�4��9R/%����l�c>�x;������>��C�:�����t��h?aKX�bhe�ᜋ^�$�Iհ �hr7%F$�E��Fd���t��5���+�(M6�t����Ü�UU|zW�=a�Ts�Tg������dqP�Q����b'�m���1{|Y����X�N��b �P~��F^F:����k6�"�j!�� �I�r�`��1&�-$�Bevk:y���#y�w��I0��x��=D�4��tU���P�ZH��ڠ底taP��6����b>�xa�����Q�#� WeF��ŮNj�p�J* mQ�N�����*I�-*�ȩ�F�g�3 �5��V�ʊ�ɮ�a��5F���O@{���NX��?����H�]3��1�Ri_u��������ѕ�� ����0��� F��~��:60�p�͈�S��qX#a�5>���`�o&+�<2�D����: �������ڝ�$�nP���*)�N�|y�Ej�F�5ټ�e���ihy�Z �>���k�bH�a�v��h�-#���!�Po=@k̆IEN��@��}Ll?j�O������߭�ʞ���Q|A07x���wt!xf���I2?Z��<ץ�T���cU�j��]���陎Ltl �}5�ϓ��$�,��O�mˊ�;�@O��jE��j(�ا,��LX���LO���Ц�90�O �.����a��nA���7������j4 ��W��_ٓ���zW�jcB������y՗+EM�)d���N�g6�y1_x��p�$Lv�:��9�"z��p���ʙ$��^��JԼ*�ϭ����o���=x�Lj�6�J��u82�A�H�3$�ٕ@�=Vv�]�'�qEz�;I˼��)��=��ɯ���x �/�W(V���p�����$ �m�������u�����񶤑Oqˎ�T����r��㠚x�sr�GC��byp�G��1ߠ�w e�8�$⿄����/�M{*}��W�]˷.�CK\�ުx���/$�WP�w���r� |i���&�}�{�X� �>��$-��l���?-z���g����lΆ���(F���h�vS*���b���߲ڡn,|)mrH[���a�3�ר�[1��3o_�U�3�TC�$��(�=�)0�kgP���� ��u�^=��4 �WYCҸ:��vQ�ר�X�à��tk�m,�t*��^�,�}D*�� �"(�I��9R����>`�`��[~Q]�#af��i6l��8���6�:,s�s�N6�j"�A4���IuQ��6E,�GnH��zS�HO�uk�5$�I�4��ؤ�Q9�@��C����wp��BGv[]�u�Ov����0I4���\��y�����Q�Ѹ��~>Z��8�T��a��q�ޣ;z��a���/��S��I:�ܫ_�|������>=Z����8:�S��U�I�J��"IY���8%b8���H��:�QO�6�;7�I�S��J��ҌAά3��>c���E+&jf$eC+�z�;��V����� �r���ʺ������my�e���aQ�f&��6�ND���.:��NT�vm�<- u���ǝ\MvZY�N�NT��-A�>jr!S��n�O 1�3�Ns�%�3D@���`������ܟ 1�^c<���� �a�ɽ�̲�Xë#�w�|y�cW�=�9I*H8�p�^(4���՗�k��arOcW�tO�\�ƍR��8����'�K���I�Q�����?5�>[�}��yU�ײ -h��=��% q�ThG�2�)���"ו3]�!kB��*p�FDl�A���,�eEi�H�f�Ps�����5�H:�Փ~�H�0Dت�D�I����h�F3�������c��2���E��9�H��5�zԑ�ʚ�i�X�=:m�xg�hd(�v����׊�9iS��O��d@0ڽ���:�p�5�h-��t�&���X�q�ӕ,��ie�|���7A�2���O%P��E��htj��Y1��w�Ѓ!����  ���� ࢽ��My�7�\�a�@�ţ�J ��4�Ȼ�F�@o�̒?4�wx��)��]�P��~�����u�����5�����7X ��9��^ܩ�U;Iꭆ 5 �������eK2�7(�{|��Y׎ �V��\"���Z�1� Z�����}��(�Ǝ"�1S���_�vE30>���p;� ΝD��%x�W�?W?v����o�^V�i�d��r[��/&>�~`�9Wh��y�;���R���� ;;ɮT��?����r$�g1�K����A��C��c��K��l:�'��3 c�ﳯ*"t8�~l��)���m��+U,z��`(��>yJ�?����h>��]��v��ЍG*�{`��;y]��I�T� ;c��NU�fo¾h���/$���|NS���1�S�"�H��V���T���4��uhǜ�]�v;���5�͠x��'C\�SBpl���h}�N����� A�Bx���%��ޭ�l��/����T��w�ʽ]D�=����K���ž�r㻠l4�S�O?=�k �M:� ��c�C�a�#ha���)�ѐxc�s���gP�iG���{+���x���Q���I= �� z��ԫ+ �8"�k�ñ�j=|����c ��y��CF��/���*9ж�h{ �?4�o� ��k�m�Q�N�x��;�Y��4膚�a�w?�6�>�e]�����Q�r�:����g�,i"�����ԩA��*M�<�G��b�if��l^M��5�� �Ҩ�{����6J��ZJ�����P�*�����Y���ݛu�_4�9�I8�7���������,^ToR���m4�H��?�N�S�ѕw��/S��甍�@�9H�S�T��t�ƻ���ʒU��*{Xs�@����f������֒Li�K{H�w^���������Ϥm�tq���s� ���ք��f:��o~s��g�r��ט� �S�ѱC�e]�x���a��) ���(b-$(�j>�7q�B?ӕ�F��hV25r[7 Y� }L�R��}����*sg+��x�r�2�U=�*'WS��ZDW]�WǞ�<��叓���{�$�9Ou4��y�90-�1�'*D`�c�^o?(�9��u���ݐ��'PI&� f�Jݮ�������:wS����jfP1F:X �H�9dԯ����˝[�_54 �}*;@�ܨ�� ð�yn�T���?�ןd�#���4rG�ͨ��H�1�|-#���Mr�S3��G�3�����)�.᧏3v�z֑��r����$G"�`j �1t��x0<Ɔ�Wh6�y�6��,œ�Ga��gA����y��b��)���h�D��ß�_�m��ü �gG;��e�v��ݝ�nQ� ��C����-�*��o���y�a��M��I�>�<���]obD��"�:���G�A��-\%LT�8���c�)��+y76���o�Q�#*{�(F�⽕�y����=���rW�\p���۩�c���A���^e6��K������ʐ�cVf5$�'->���ՉN"���F�"�UQ@�f��Gb~��#�&�M=��8�ט�JNu9��D��[̤�s�o�~������� G��9T�tW^g5y$b��Y'��س�Ǵ�=��U-2 #�MC�t(�i� �lj�@Q 5�̣i�*�O����s�x�K�f��}\��M{E�V�{�υ��Ƈ�����);�H����I��fe�Lȣr�2��>��W��I�Ȃ6������i��k�� �5�YOxȺ����>��Y�f5'��|��H+��98pj�n�.O�y�������jY��~��i�w'������l�;�s�2��Y��:'lg�ꥴ)o#'Sa�a�K��Z� �m��}�`169�n���"���x��I ��*+� }F<��cГ���F�P�������ֹ*�PqX�x۩��,� ��N�� �4<-����%����:��7����W���u�`����� $�?�I��&����o��o��`v�>��P��"��l���4��5'�Z�gE���8���?��[�X�7(��.Q�-��*���ތL@̲����v��.5���[��=�t\+�CNܛ��,g�SQnH����}*F�G16���&:�t��4ُ"A��̣��$�b �|����#rs��a�����T�� ]�<�j��B�S�('$�ɻ� �wP;�/�n��?�ݜ��x�F��yUn�~mL*-�������Xf�wd^�a�}��f�,=t�׵i�.2/wpN�Ep8�OР���•��R�FJ� 55TZ��T �ɭ�<��]��/�0�r�@�f��V��V����Nz�G��^���7hZi����k��3�,kN�e|�vg�1{9]_i��X5y7� 8e]�U����'�-2,���e"����]ot�I��Y_��n�(JҼ��1�O ]bXc���Nu�No��pS���Q_���_�?i�~�x h5d'�(qw52] ��'ޤ�q��o1�R!���`ywy�A4u���h<קy���\[~�4�\ X�Wt/� 6�����n�F�a8��f���z �3$�t(���q��q�x��^�XWeN'p<-v�!�{�(>ӽDP7��ո0�y)�e$ٕv�Ih'Q�EA�m*�H��RI��=:��� ���4牢) �%_iN�ݧ�l]� �Nt���G��H�L��� ɱ�g<���1V�,�J~�ٹ�"K��Q�� 9�HS�9�?@��k����r�;we݁�]I�!{ �@�G�[�"��`���J:�n]�{�cA�E����V��ʆ���#��U9�6����j�#Y�m\��q�e4h�B�7��C�������d<�?J����1g:ٳ���=Y���D�p�ц� ׈ǔ��1�]26؜oS�'��9�V�FVu�P�h�9�xc�oq�X��p�o�5��Ա5$�9W�V(�[Ak�aY錎qf;�'�[�|���b�6�Ck��)��#a#a˙��8���=äh�4��2��C��4tm^ �n'c����]GQ$[Wҿ��i���vN�{Fu ��1�gx��1┷���N�m��{j-,��x�� Ūm�ЧS�[�s���Gna���䑴�� x�p 8<������97�Q���ϴ�v�aϚG��Rt�Һ׈�f^\r��WH�JU�7Z���y)�vg=����n��4�_)y��D'y�6�]�c�5̪��\� �PF�k����&�c;��cq�$~T�7j ���nç]�<�g ":�to�t}�159�<�/�8������m�b�K#g'I'.W������6��I/��>v��\�MN��g���m�A�yQL�4u�Lj�j9��#44�t��l^�}L����n��R��!��t��±]��r��h6ٍ>�yҏ�N��fU�� ���� Fm@�8}�/u��jb9������he:A�y�ծw��GpΧh�5����l}�3p468��)U��d��c����;Us/�֔�YX�1�O2��uq�s��`hwg�r~�{ R��mhN��؎*q 42�*th��>�#���E����#��Hv�O����q�}������6�e��\�,Wk�#���X��b>��p}�դ��3���T5��†��6��[��@��P�y*n��|'f�֧>�lư΂�̺����SU�'*�q�p�_S�����M�� '��c�6������m�� ySʨ;M��r���Ƌ�m�Kxo,���Gm�P��A�G�:��i��w�9�}M(�^�V��$ǒ�ѽ�9���|���� �a����J�SQ�a���r�B;����}���ٻ֢�2�%U���c�#�g���N�a�ݕ�'�v�[�OY'��3L�3�;,p�]@�S��{ls��X�'���c�jw��k'a�.��}�}&�� �dP�*�bK=ɍ!����;3n�gΊU�ߴmt�'*{,=SzfD� A��ko~�G�aoq�_mi}#�m�������P�Xhύ�����mxǍ�΂���巿zf��Q���c���|kc�����?���W��Y�$���_Lv����l߶��c���`?����l�j�ݲˏ!V��6����U�Ђ(A���4y)H���p�Z_�x��>���e���R��$�/�`^'3qˏ�-&Q�=?��CFVR �D�fV�9��{�8g�������n�h�(P"��6�[�D���< E�����~0<@�`�G�6����Hг�cc�� �c�K.5��D��d�B���`?�XQ��2��ٿyqo&+�1^� DW�0�ꊩ���G�#��Q�nL3��c���������/��x ��1�1�[y�x�პCW��C�c�UĨ80�m�e�4.{�m��u���I=��f�����0QRls9���f���������9���~f�����Ǩ��a�"@�8���ȁ�Q����#c�ic������G��$���G���r/$W�(��W���V�"��m�7�[m�A�m����bo��D� j����۳� l���^�k�h׽����� ��#� iXn�v��eT�k�a�^Y�4�BN���ĕ���0������� !01@Q"2AaPq3BR�������?�����@4�Q�����T3,���㺠�W�[=JK�Ϟ���2�r^7��vc�:�9 �E�ߴ�w�S#d���Ix��u��:��Hp��9E!�� V 2;73|F��9Y���*ʬ�F��D����u&���y؟��^EA��A��(ɩ���^��GV:ݜDy�`��Jr29ܾ�㝉��[���E;Fzx��YG��U�e�Y�C���� ����v-tx����I�sם�Ę�q��Eb�+P\ :>�i�C'�;�����k|z�رn�y]�#ǿb��Q��������w�����(�r|ӹs��[�D��2v-%��@;�8<a���[\o[ϧw��I!��*0�krs)�[�J9^��ʜ��p1)� "��/_>��o��<1����A�E�y^�C��`�x1'ܣn�p��s`l���fQ��):�l����b>�Me�jH^?�kl3(�z:���1ŠK&?Q�~�{�ٺ�h�y���/�[��V�|6��}�KbX����mn[-��7�5q�94�������dm���c^���h� X��5��<�eޘ>G���-�}�دB�ޟ� ��|�rt�M��V+�]�c?�-#ڛ��^ǂ}���Lkr���O��u�>�-D�ry� D?:ޞ�U��ǜ�7�V��?瓮�"�#���r��չģVR;�n���/_� ؉v�ݶe5d�b9��/O��009�G���5n�W����JpA�*�r9�>�1��.[t���s�F���nQ� V 77R�]�ɫ8����_0<՜�IF�u(v��4��F�k�3��E)��N:��yڮe��P�`�1}�$WS��J�SQ�N�j��ٺ��޵�#l���ј(�5=��5�lǏmoW�v-�1����v,W�mn��߀$x�<����v�j(����c]��@#��1������Ǔ���o'��u+����;G�#�޸��v-lη��/(`i⣍Pm^����ԯ̾9Z��F��������n��1��� ��]�[��)�'�������:�֪�W��FC����� �B9،!?���]��V��A�Վ�M��b�w��G F>_DȬ0¤�#�QR�[V��kz���m�w�"��9ZG�7'[��=�Q����j8R?�zf�\a�=��O�U����*oB�A�|G���2�54 �p��.w7� �� ���&������ξxGHp� B%��$g�����t�Џ򤵍z���HN�u�Я�-�'4��0���;_���3������� !01"@AQa2Pq#3BR�������?����ʩca��en��^��8���<�u#��m*08r��y�N"�<�Ѳ0��@\�p��� �����Kv�D��J8�Fҽ� �f�Y��-m�ybX�NP����}�!*8t(�OqѢ��Q�wW�K��ZD��Δ^e��!� ��B�K��p~�����e*l}z#9ң�k���q#�Ft�o��S�R����-�w�!�S���Ӥß|M�l޶V��!eˈ�8Y���c�ЮM2��tk���� ������J�fS����Ö*i/2�����n]�k�\���|4yX�8��U�P.���Ы[���l��@"�t�<������5�lF���vU�����W��W��;�b�cД^6[#7@vU�xgZv��F�6��Q,K�v��� �+Ъ��n��Ǣ��Ft���8��0��c�@�!�Zq s�v�t�;#](B��-�nῃ~���3g������5�J�%���O������n�kB�ĺ�.r��+���#�N$?�q�/�s�6��p��a����a��J/��M�8��6�ܰ"�*������ɗud"\w���aT(����[��F��U՛����RT�b���n�*��6���O��SJ�.�ij<�v�MT��R\c��5l�sZB>F��<7�;EA��{��E���Ö��1U/�#��d1�a�n.1ě����0�ʾR�h��|�R��Ao�3�m3 ��%�� ���28Q�� ��y��φ���H�To�7�lW>����#i`�q���c����a��� �m,B�-j����݋�'mR1Ήt�>��V��p���s�0IbI�C.���1R�ea�����]H�6�����������4B>��o��](��$B���m�����a�!=���?�B� K�Ǿ+�Ծ"�n���K��*��+��[T#�{�E�J�S����Q�����s�5�:�U�\wĐ�f�3����܆&�)�����I���Ԇw��E T�lrTf6Q|R�h:��[K�� �z��c֧�G�C��%\��_�a��84��HcO�bi��ؖV��7H �)*ģK~Xhչ0��4?�0��� �E<���}3���#���u�?�� ��|g�S�6ꊤ�|�I#Hڛ� �ա��w�X��9��7���Ŀ%�SL��y6č��|�F�a 8���b���$�sק�h���b9RAu7�˨p�Č�_\*w��묦��F ����4D~�f����|(�"m���NK��i�S�>�$d7SlA��/�²����SL��|6N�}���S�˯���g��]6��; �#�.��<���q'Q�1|KQ$�����񛩶"�$r�b:���N8�w@��8$�� �AjfG|~�9F ���Y��ʺ��Bwؒ������M:I岎�G��`s�YV5����6��A �b:�W���G�q%l�����F��H���7�������Fsv7���k�� 403WebShell
403Webshell
Server IP : 172.67.166.40  /  Your IP : 104.23.197.203
Web Server : Apache
System : Linux tastesys.restaurant-online.biz 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64
User : restaura ( 1002)
PHP Version : 5.4.45
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/restaura/public_html/roo/difiores-pizzeria-an/cmsadmin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/restaura/public_html/roo/difiores-pizzeria-an/cmsadmin//menu_board_detail.php
<?php include("admin_globals.php"); ?>

<script type="text/javascript" src="js/jscolor/jscolor.js"></script>
<style type="text/css">
#full-width-wrapper {
	margin-left:15px;
}
#menu-board {
	width: 67%;
	display: inline-block;
	float: left;
	margin-top:15px;
	background: #2077a1;
	border: solid 1px #cccfd2;
	-webkit-border-radius: 6px;
	-moz-border-radius: 6px;
	border-radius: 6px;
	padding: 12px;
	clear:both;
}

#menu-board .dd-item {
	width:82%;
	line-height:1.1em;
}
.column-row {
	clear: both;
}
#available-items {
	float: right;
	width: 28%;
}
#available-categories,
#available-widgets,#available-slides {
	float: right;
	width:90%;
	display: inline-block;
	margin-right:0px;
	background:#2077a1;
	border: solid 1px #cccfd2;
	  -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
	padding:13px 18px 8px 13px;
	margin-top:15px;
	margin-bottom:15px;
	padding-top:0px;
}
#available-categories h2,
#available-widgets h2,
#menu-board h2,#available-slides h2 {
	font-family:Arial, Helvetica, sans-serif;
	font-size:1.2em; color:#fff; font-weight:bold;
	cursor: pointer;
}
.columns-1 .column {
	width: 100%;
}
.columns-2 .column {
	width: 50%;
}
.columns-3 .column {
	width: 33%;
}
.columns-4 .column {
	width: 25%;
}
.column {
	box-sizing: border-box;
	display: inline-block;
	float: left;
	padding-left: 10px;
	padding-right: 10px;
}
.column li, #available-categories li,
.column li, #available-widgets li,#available-slides li {
	margin:0;padding:0;
	width:97%;
	color:#000;
	background:#fff;
	border: solid 1px #cccfd2;
	  -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
	padding:1px 4px 1px 4px;
	margin-bottom:5px;
}
.columnnew li{
	margin:0;padding:0;
	width:97%;
	color:#000;
	background:#fff;
	border: solid 1px #cccfd2;
	  -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
	padding:1px 4px 1px 4px;
	margin-bottom:5px;
}
#menu-board {
}
.column h2 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 1.2em;
	color: #fff;
	font-weight: bold;
}
.dd-placeholder {
	display: inline-block;
	max-width: 100%;
	width: 100%;
}
#background-image-preview {
	max-width: 400px;
}
#background-image-preview img {
	max-width: 100%;
}
#errormsg {
	color: red;
}

#upload-btn, #delete-image {
	background:#48a3db;
	color:#fff;
	border: 1px solid #777777;
     -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
	padding:3px 6px;
	margin-top:4px;
	margin-bottom:4px;
}

#upload-btn:hover, #delete-image:hover {
	 background:#F00;
}

#upload-bg-image-wrapper {
	float:right;
	width:29%;
}

#num-columns-wrapper {
	float:left;
	width:48%;
	margin-top:2px;
	color:#000;
	clear:both;
}

#num-columns-wrapper h3 {
	font-size: 16px;
	font-weight:bold;
	margin:0;padding:0;
	margin-bottom:8px;
}

.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}
.progress .bar{width:0;height:100%;color:#fff;float:left;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}
.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}
.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}
.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}
.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}
.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}
.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}
.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}
.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}
.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}
.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}
.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}
.pic-save-frame{display:inline-block;vertical-align:middle;padding-left:0}
.pic-size-info{text-align:right;margin-left:5px !important;margin-right:0 !important;display:inline-block;height:18px;line-height:18px;vertical-align:middle}
.progress{width:210px;border:1px solid #999 !important;vertical-align:middle;margin-bottom:0}

/*.progress-wrap{float:left;clear:both}*/
.progress-wrap .prog{clear:both;margin:10px 0;}
.progress-wrap .prog .size{clear:both;height:21px;line-height:21px;vertical-align:middle;display:inline-block;padding-right:5px;text-overflow: ellipsis;white-space:nowrap;overflow:hidden;}
.progress-wrap .prog .progress{height:21px;display:inline-block}

#custom-category-form {
	margin-top:0;padding-top:0;
	float: left;
	width: 48%;
}
.choose-category-items {
	margin-top:0;padding-top:0;
	width: 48%;
	float: right;
}
.clearfix {
	clear: both;
}
.edit-custom-category {
	position: absolute;
	right: 5px;
	top: 6px;
}
.edit-custom-category img:hover {
	cursor: pointer;
}

/** Menu board schedule styles **/
.popup_background {
	z-index: 4005; /* any number */
}
.popup_wrapper {
	z-index: 4006; /* any number + 1 */
}
.modal_close_button {
	position: absolute;
	top: 5px;
	right: 5px;
}
.popup_modal {
	display:none;
	background:white;padding:20px;
		border: 1px solid #777777;
     -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
	max-width:800px;
}
.menu-boards-schedule {
	margin-top: 15px;
	margin-bottom: 15px;
}
.menu-board-schedule-settings {
	display: none;
	margin-top: 15px;
}

#manage-slides-button a {
	float:right;
	width:25%;
	margin-right:20px;
		background:#209FF0;
	background: -moz-linear-gradient(top, #1682b2 1%, #209FF0 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#1682b2), color-stop(100%,#209FF0));
	background: -webkit-linear-gradient(top, #1682b2 1%,#209FF0 100%);
	background: -o-linear-gradient(top, #1682b2 1%,#209FF0 100%);
	background: -ms-linear-gradient(top, #1682b2 1%,#209FF0 100%);
	background: linear-gradient(top, #1682b2 1%,#209FF0 100%);
	color:#fff;
     -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
	padding:10px;
	text-decoration:none;
	   border: solid 3px #D0D0D0;
	font-size:1.2em;
	text-align:center;
	max-height:80px;
	vertical-align:middle;
	margin-bottom:15px;
}

#manage-slides-button a:hover {
	    background:#1eac63;
	background: -moz-linear-gradient(top, #1eac63 1%, #19894f 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#1eac63), color-stop(100%,#19894f));
	background: -webkit-linear-gradient(top, #1eac63 1%,#19894f 100%);
	background: -o-linear-gradient(top, #1eac63 1%,#19894f 100%);
	background: -ms-linear-gradient(top, #1eac63 1%,#19894f 100%);
	background: linear-gradient(top, #1eac63 1%,#19894f 100%);
}

.mb-top-left {
	float:left;
	width:69%;
}

.mb-top-left h1 {
	display:block;
	float:left;width:66%;
}
.edit_popUp_slide {
    position: absolute;
    right: 50px;
    top: 6px;
    cursor: pointer;
}

/** END Menu board schedule styles **/

</style>

<div id="full-width-wrapper">
<?php
if ($_SESSION['FirstName'] == "") {
	echo 'You are not authorized to view this page. <br><br>You may <a href="index.php">log in here.</a>';
	exit;
	}

	//print_r($_SESSION);
	$admin_folder = $_SESSION['admin_folder'];
	if($_GET['admin-page']>""){
	$admin_page = "?admin-page=".$_GET['admin-page'];
	}
	if($_GET['board']>""){
		$selected_board = $_GET['board'];
		//echo "selected: $selected_board";
	}
	/* If get a parametr of monitor */
	if(isset($_GET['monitor'])){

		$selected_board = $_GET['monitor'];
		$is_monitor     = 1;
		$qry = "SELECT count('id') as total from menu_boards_live where board_number=".$selected_board;
		$res = mysql_query($qry);
		$row = mysql_fetch_assoc($res);

		if($row['total'] != 0 ){
			$published = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >Published - this monitor is live. Be sure to publish it again after making any changes</p>';
		} else {
			$published = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >Unpublished. This monitor is not yet live.</p>';
		}
		//echo "selected: $selected_board";
	}else{
		$is_monitor = 0;
	}
	/* if get a parametr of monitor */

	/* If get parametr is a slide */
	if($_GET['slide']>""){

		$selected_board = $_GET['slide'];
		$is_slide = 1;
		$qry      = "SELECT count('id') as total from menu_boards_live where board_number=".$selected_board;
		$res      = mysql_query($qry);
		$row      = mysql_fetch_assoc($res);

		if($row['total'] != 0 ){
			$slidePublished = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >Published - this slide is live. Be sure to publish it again after making any changes.</p>';
		} else {
			$slidePublished = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >Unpublished. This slide is not yet live.</p>';
		}

		$join = "SELECT menu_board_schedule.menu_board, menu_boards_live.board_name FROM menu_board_schedule INNER JOIN menu_boards_live ON menu_board_schedule.menu_board=menu_boards_live.board_number WHERE menu_board_schedule.display_board =".$selected_board; 
		
		$Jres  = mysql_query($join) or die(mysql_error());
		$slideusedMonitor = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >';
		$i=0;
		$arr = array();
		while ( $Jrow = mysql_fetch_array($Jres) ) {
			$arr[$i] = 'Monitor '.$Jrow["menu_board"].'('.$Jrow["board_name"].')';
			$i++;
		}
		//check for popup usage
		$join2 = "SELECT menu_board_ads.menu_board, menu_boards_live.board_name FROM menu_board_ads INNER JOIN menu_boards_live ON menu_board_ads.menu_board=menu_boards_live.board_number WHERE menu_board_ads.display_board =".$selected_board; 
		
		$Jres2  = mysql_query($join2) or die(mysql_error());
		$i=0;
		$arr2 = array();
		while ( $Jrow2 = mysql_fetch_array($Jres2) ) {
			$arr2[$i] = 'Monitor '.$Jrow2["menu_board"].'('.$Jrow2["board_name"].')';
			$i++;
		}
		
		if(!empty($arr)){
			$slideusedMonitor .= 'This slide is currently in use on the following monitors: ';
			$slideusedMonitor .= implode(',',$arr);
			$slideusedMonitor .= '<br><br>';
		}
		if(!empty($arr2)){
			$slideusedMonitor .= 'This slide is currently in use as a popup ad on the following monitors: ';
			$slideusedMonitor .= implode(',',$arr2);
			$slideusedMonitor .= '<br><br>';			
		}
		
		if(empty($arr) && empty($arr2)){
			$slideusedMonitor .= 'This slide is not currently in use.</p>';
		} else {
			$slideusedMonitor .= '.</p>';
		}

	} else {
		$is_slide = 0;
	}
	/* If get parametr is a slide */

	if($_GET['show_descriptions']>""){
		if($_GET['show_descriptions']=="yes"){
			$show_descriptions = 1;
		} else {
			$show_descriptions = 0;
		}

		$qry="update menu_boards set show_menu_descriptions = '".$show_descriptions."' where board_number='$selected_board'";
		mysql_query($qry);

	}

	if($_GET['show_item_descriptions']>""){
		if($_GET['show_item_descriptions']=="yes"){
			$show_item_descriptions = 1;
		} else {
			$show_item_descriptions = 0;
		}

		$qry="update menu_boards set show_item_descriptions = '".$show_item_descriptions."' where board_number='$selected_board'";
		mysql_query($qry);

	}


	if($_GET['action']=="publish"){
		//publish current menu board to live view
		//first clear existing records for this menu board
		
		$qry="delete from menu_boards_live where board_number='$selected_board'";
		mysql_query($qry);

		$qry="delete from menu_board_items_live where board_number='$selected_board'";
		mysql_query($qry);


		$qry="INSERT INTO menu_boards_live SELECT * FROM menu_boards where board_number='$selected_board'";
		mysql_query($qry);


		$qry="INSERT INTO menu_board_items_live SELECT * FROM menu_board_items where board_number='$selected_board'";
		mysql_query($qry);

		echo "<font color='red'>Menu board published successfully. </font><br>";

		if( isset($_GET['monitor']) ){

			$qry = "SELECT count('id') as total from menu_boards_live where board_number=".$selected_board;
			$res = mysql_query($qry);
			$row = mysql_fetch_assoc($res);

			if($row['total'] != 0 ){
				$published = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >Published - this monitor is live. Be sure to publish it again after making any changes</p>';
			} else {
				$published = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >Unpublished. This monitor is not yet live.</p>';
			}
		}

		if( isset($_GET['slide']) ) {

			$qry = "SELECT count('id') as total from menu_boards_live where board_number=".$selected_board;
			$res = mysql_query($qry);
			$row = mysql_fetch_assoc($res);

			if($row['total'] != 0 ){
				$slidePublished = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >Published - this slide is live. Be sure to publish it again after making any changes.</p>';
			} else {
				$slidePublished = '<p style="color:red;border-bottom:none;font-size:11px;margin-top:1px;margin-left: 5px;" >Unpublished. This slide is not yet live.</p>';
			}
		}
	}

if($_SESSION['menu_boards']==0){
	echo "You are not subscribed to this service.";
}

// if($selected_board > 0 && $selected_board <= $_SESSION['menu_boards']){
if(isset($selected_board)){
	$board = getMenuBoard($selected_board);

	// Get num columns
	if (isset($_GET['num_columns']) && !empty($_GET['num_columns']) && $_GET['num_columns'] > 0 && $_GET['num_columns'] < 5) {
		$numColumns = $_GET['num_columns'];
		updateMenuBoardNumColumns($board, $numColumns);
	} else {
		$numColumns = !empty($board['column_count']) ? $board['column_count'] : 1;
	}
	if(isset($_GET['monitor'])){
	echo "<div class='mb-top-left'><h1 style='text-align:left;'>You are managing monitor #$selected_board<br />
		$published
	</h1>";
	
	}elseif(isset($_GET['slide'])){
		echo "<div class='mb-top-left'><h1 style='text-align:left;'>You are managing slide #$selected_board <br> $slidePublished $slideusedMonitor </h1>";
		$url_variable = "slide";
	}

	if($is_monitor == 1){
		echo "<div id='manage-slides-button'><a style='margin-bottom:4px;' href='?admin-page=10'  
data-tooltip='Click to manage individual slides. You can have unlimited slides per each monitor.'>Manage Slides</a><div style='clear:both;'>
<a href='?admin-page=5'>Return to Monitor List</a></div></div>";
    	$url_variable = "monitor";
	}

	if($url_variable == "slide"){
	    echo "<div class='preview-menu-board'><a href='?admin-page=5'>Menu Board Home</a></div>";
	    echo '<br><br>';
		$deleteSlide = $_GET["slide"];
		echo "<div class='preview-menu-board'><a class='deleteSlide' data-id='$deleteSlide' href='javascript:void(0);'>Delete this slide </a></div>";
	}
	
	echo "</div>";

	//echo"<span class='description-text'>To create your menu board simply drag and drop menu categories into the column where you want them displayed (below). <br />
	//<strong>IMPORTANT:</strong> Preview your menu board before you publish it (make it live). You may need to adjust your menu categories and items to fit within the monitor columns.</span>";
	$display_url = "http://$_SERVER[SERVER_NAME]/menu-boards/live_display.php?$url_variable=$selected_board";
	$preview_url = "http://$_SERVER[SERVER_NAME]/menu-boards/display.php?$url_variable=$selected_board";

	echo "<div class='preview-menu-board'><a href='index.php'>Admin Home</a></div>";
	echo "<div class='preview-menu-board'><a href='?admin-page=".$_GET['admin-page']."&action=publish&$url_variable=$selected_board'>Publish</a></div>";
	if($is_slide==1){
		echo "<div class='preview-menu-board'><a href='$preview_url' target='blank'>Preview</a></div>";
	}
	if($is_slide==1){
		$label = "slide";
	} else {
		$label = "menu board";
	}
	if($label!="slide"){	
	echo "<div class='mb-top-right'>To display the live view of this $label ($label $selected_board), the web address is:<br /> <a href='$display_url' target='blank'><font color='blue'><u>$display_url</u></font></a></div>";
	}


		// Number of columns
	if($is_slide==1){
		echo '<div id="num-columns-wrapper">';
		echo "<div style='margin-bottom:14px;'>Slide name: <input name='monitor_name' id='monitor_name' type='text' size='40' value='".$board['board_name']."'></div>";
	if($is_slide==1){
		echo '<h3>Layout Options</h3><label>Number of Columns: </label>';
		echo '<br /><select id="num-columns" name="num_columns">';
		for ($i = 1; $i < 5; $i++) {
			echo '<option value="'.$i.'"';
			if ($i == $numColumns) {
				echo ' selected';
			}
			echo '>'.$i.'</option>';
		}
		echo '</select>';
	}
		echo '<input id="original-num-columns" type="hidden" name="original_num_columns" value="'.$numColumns.'">';

	if($is_slide==1){
		// Scroll text
		echo '<div class="scroll-ctl-box">';
		echo '<h3>Add Scrolling Text</h3><label for="scroll_text">Scroll Text</label><br />';
		echo '<textarea id="scroll_text" name="scroll_text" cols="35" >';
		if (!empty($board)) {
			echo $board['scroll_text'];
		}
		echo '</textarea><br />';
		echo '';

		// Scroll position
		echo '<div style="margin-top:8px;"><label>Scroll Position: </label></div>';
		echo '<select id="scroll_position" name="scroll_position">';
		echo '<option value="1"'. ((!empty($board) && $board['scroll_position'] == 1) ? ' selected' : '') .'>Top</option>';
		echo '<option value="2"'. ((!empty($board) && $board['scroll_position'] == 2) ? ' selected' : '') .'>Bottom</option>';
		echo '</select><br />';
		echo '</div>';
		

        // Text Size
		echo '<div>';
		echo '<br /><label>Text Size: </label><br />';
		echo '<select id="text_multiplier" name="text_multiplier">';
		$sizes = array(
			'1.5' => 'X-Large',
			'1.25' => 'Large',
			'1.0' => 'Normal',
			'0.75' => 'Small',
			'0.5' => 'X-Small'
		);
		foreach ($sizes as $size => $name) {
			echo '<option value="'.$size.'"'. ((!empty($board) && $board['text_multiplier'] == $size) ? ' selected' : '') .'>'.$name.'</option>';
		}
		echo '</select>';
		echo '</div>';
		$startTime=explode(' ', $board['start_time']);
		$endTime=explode(' ', $board['end_time']);
		
		echo '<div>';
		?>
		<input type="hidden" name="recKey" id="recKey" value="<?php echo $board['recordkey']; ?>">
		<label style="margin-top:10px">Select Day of Week</label>
		<select name="dayofweek" id="dayofweek" class="s-box-jumpTo">
		    <option value="All" <?php if("All"==$board['day_of_week']) { echo 'selected'; } ?> >Every day</option>
			<option value="Sunday" <?php if("Sunday"==$board['day_of_week']) { echo 'selected'; } ?> >Sunday</option>
		    <option value="Monday" <?php if("Monday"==$board['day_of_week']) { echo 'selected'; } ?> >Monday</option>
		 	<option value="Tuesday" <?php if("Tuesday"==$board['day_of_week']) { echo 'selected'; } ?> >Tuesday</option>
		 	<option value="Wednesday" <?php if("Wednesday"==$board['day_of_week']) { echo 'selected'; } ?>>Wednesday</option>
		 	<option value="Thursday" <?php if("Thursday"==$board['day_of_week']) { echo 'selected'; } ?>>Thursday</option>
		 	<option value="Friday" <?php if("Friday"==$board['day_of_week']) { echo 'selected'; } ?>>Friday</option>
		 	<option value="Saturday" <?php if("Saturday"==$board['day_of_week']) { echo 'selected'; } ?>>Saturday</option>
		</select>
	    </div>
		
		<div>
		<label>Display Starting</label>
		<select id="starttime" name="starttime" style="min-width: 80px !important; margin: 11px;">
		<?php
		for($i = 0; $i < 13; $i++) {
			$iDisplay = str_pad($i, 2, '0', STR_PAD_LEFT);
			?>	<option value="<?php echo $iDisplay; ?>"
			<?php
			if($startTime[0]==$iDisplay)
			{
				echo 'selected';
			}
			?>><?php echo $iDisplay; ?></option>
		<?php 
	    }
	    ?>
		</select>
		<select id="start-meridiem" style="min-width: 80px !important;">
		<option value="am" <?php
			if($startTime[1]=="am")
			{
				echo 'selected';
			}
			?>>am</option>
		<option value="pm" <?php if($startTime[1]=="pm")
			{
				echo 'selected';
			}
			?>>pm</option>
		</select>
		</div>

		<div>
		<label>Display Until</label>
		<select id="endtime" name="endtime" style="min-width: 80px !important; margin-top: 10px; margin-left: 27px;">
		<?php
		for($i = 0; $i < 13; $i++) {
			$iDisplay = str_pad($i, 2, '0', STR_PAD_LEFT);
			?>
			<option value="<?php echo $iDisplay; ?>"
			<?php
			if($endTime[0]==$iDisplay)
			{
				echo 'selected';
			}
			?>
			><?php echo $iDisplay; ?></option>
		<?php 
		}
		?>
		</select>
		<select id="end-meridiem" style="margin-left:15px;min-width: 80px !important">
		<option value="am"<?php 
		    if($endTime[1]=="am")
			{
				echo 'selected';
			}
			?>>am</option>
		<option value="pm" <?php 
		    if($endTime[1]=="pm")
			{
				echo 'selected';
			}
			?>>pm</option>
		</select>
		</div>
		
		<?php
        echo '<div class="show-label"><br />';
		if($board['show_menu_descriptions']==1){$checked = " checked='checked'";} else { $checked="";}
		echo "<input type='checkbox' name='show_descriptions' id='show_descriptions'  onclick='check(this);' $checked>";
		echo "<label> Show category descriptions: </label></div>";

		echo '<div class="show-label">';
		if($board['show_item_descriptions']==1){$checked = " checked='checked'";} else { $checked="";}
		echo "<input type='checkbox' name='show_item_descriptions' id='show_item_descriptions'  onclick='toggle(this);' $checked>";
		echo "<label> Show item descriptions: </label></div>"; //end show-label

		echo '<div class="show-label">';
		$recordkeyDesc = $board['recordkey'];
		if($board['show_menu_images']==1){$checked = " checked='checked'";} else { $checked="";}
		echo "<input type='checkbox' data-recordkey='$recordkeyDesc' class='changeItemDEscpStat' name='' id='' $checked>";
		echo "<label> Show item images: </label></div>"; //end show-label

		// Text Size
		echo '<div style="clear:both;">';
		echo '</div>';
	} //end if slide loop
	//***********************************

	// Menu Board Schedule
	echo '<div class="menu-boards-schedule">';
	echo '<h3>Schedule</h3>';

	echo '<div>';
	echo '<label><input class="schedule-checkbox" type="checkbox" name="schedule" value="use_schedule" '.($board['use_schedule'] ? 'checked' : '').'> Change on time schedule</label>';
	echo '</div>';

	echo '<div>';
	echo '<label><input class="schedule-checkbox" type="checkbox" name="schedule" value="toggle_boards" '.($board['toggle_boards'] ? 'checked' : '').'> Use constant rotation 1</label>';
	echo '</div>';

	
	echo '<div class="menu-board-schedule-settings" id="time-schedule-settings">';
	echo '<h4>Slides in rotation schedule for this monitor:</h4>';
	echo '<div id="menu-boards-in-schedule">';

	$boardSchedule = getMenuBoardSchedule($board['board_number']);

	foreach ($boardSchedule as $boardScheduleItem) {
		$time = strtotime($boardScheduleItem['switch_time']);
		$hour = date('h', $time);
		$minute = date('i', $time);
		$meridiem = date('a', $time);
		echo '<div class="menu-board-in-schedule">';
		echo '<input type="hidden" name="schedule_board" value="'.$boardScheduleItem['display_board'].'">';
		echo '<input type="hidden" name="schedule_hour" value="'.$hour.'">';
		echo '<input type="hidden" name="schedule_minute" value="'.$minute.'">';
		echo '<input type="hidden" name="schedule_meridiem" value="'.$meridiem.'">';
		$slideqry="Select board_name from menu_boards where add_on_slide='1' and board_number='".$boardScheduleItem['display_board']."'";
		$rt=mysql_query($slideqry);
		while($data = mysql_fetch_array($rt)){$slide_name = $data['board_name'];}
		echo '<span class="dd-handle">Slide '.$boardScheduleItem['display_board'].' ('.$slide_name.') '.$hour.':'.$minute.' '.$meridiem.'</span>';
		echo ' <button class="edit-menu-board-in-schedule" type="button">Edit</button>';
		echo ' <button class="remove-menu-board-in-schedule" type="button">Remove</button>';
		echo '</div>';
	}
	echo '</div>'; // /#menu-boards-in-schedule

	echo '<div>';
	echo '<button class="add_menu_board_to_schedule_modal_open" type="button">Add a board</button>';
	echo '</div>';
	echo '</div><!-- /#time-schedule-settings -->';

	echo '<div class="menu-board-schedule-settings" id="rotation-schedule-settings">';
	echo '<div>';
	echo '<h4>Slides in rotation</h4>';
	echo '<div id="menu-boards-in-rotation">';
	foreach ($boardSchedule as $boardScheduleItem) {
		echo '<div class="menu-board-in-rotation">';
		echo '<input type="hidden" name="boards_in_rotation[]" value="'.$boardScheduleItem['display_board'].'">';
		$slideqry="Select board_name from menu_boards where add_on_slide='1' and board_number='".$boardScheduleItem['display_board']."' ";
		$rt=mysql_query($slideqry);
		while($data = mysql_fetch_array($rt)){$slide_name = $data['board_name'];}
		echo 'Slide ' .$boardScheduleItem['display_board'] . "($slide_name)";
		echo ' <button class="remove-menu-board-in-rotation" type="button">Remove</button>';
		echo '</div>';
	}
	echo '</div>'; // /#menu-boards-in-rotation
	echo '</div>';
	echo '<select id="select-menu-board-rotation">';
	for ($i = 1; $i < 11; $i++) {
		echo '<option value="'.$i.'">Menu Board '.$i.'</option>';
	}
	echo '</select>';
	echo ' <button id="add-board-to-rotation" type="button">Add</button>';
	echo '</div><!-- /#rotation-schedule-settings -->';

	echo '</div><!-- /.menu-boards-schedule -->';

	echo '<div id="add_menu_board_to_schedule_modal" class="popup_modal">';
	echo '<a href="#" class="add_menu_board_to_schedule_modal_close modal_close_button"><img src="/images/x-15.png" width="15" height="15" /></a>';
	echo '<h3>Add Menu Board to Schedule</h3>';
	echo '<label>Menu Board: </label>';
	echo '<select id="add-to-schedule-board">';
	for ($i = 1; $i < 11; $i++) {
		echo '<option value="'.$i.'">Menu Board '.$i.'</option>';
	}
	echo '</select>';
	echo '<br>';
	echo '<br>';
	echo '<label>Switch Time: </label>';
	echo '<select id="add-to-schedule-hour">';
	for($i = 1; $i < 13; $i++) {
		$iDisplay = str_pad($i, 2, '0', STR_PAD_LEFT);
		echo '<option>'.$iDisplay.'</option>';
	}
	echo '</select>';
	echo ':';
	echo '<select id="add-to-schedule-minute">';
	echo '<option>00</option>';
	echo '<option>30</option>';
	echo '</select>';
	echo '<select id="add-to-schedule-meridiem">';
	echo '<option value="am">am</option>';
	echo '<option value="pm">pm</option>';
	echo '</select>';

	echo '<br>';
	echo '<br>';
	echo '<button id="save-button" class="add_menu_board_to_schedule_modal_close" type="button" onclick="addMenuBoardToSchedule()">Save</button>';
	echo '</div>'; // end modal

	echo '<div id="edit_menu_board_to_schedule_modal" class="popup_modal">';
	echo '<a href="#" class="edit_menu_board_to_schedule_modal_close modal_close_button"><img src="/images/x-15.png" width="15" height="15" /></a>';
	echo '<h3>Edit Menu Board in Schedule</h3>';
	echo '<label>Menu Board: </label>';
	echo '<select id="edit-schedule-board">';
	for ($i = 1; $i < 11; $i++) {
		echo '<option value="'.$i.'">Menu Board '.$i.'</option>';
	}
	echo '</select>';
	echo '<br>';
	echo '<br>';
	echo '<label>Switch Time: </label>';
	echo '<select id="edit-schedule-hour">';
	for($i = 1; $i < 13; $i++) {
		$iDisplay = str_pad($i, 2, '0', STR_PAD_LEFT);
		echo '<option>'.$iDisplay.'</option>';
	}
	echo '</select>';
	echo ':';
	echo '<select id="edit-schedule-minute">';
	echo '<option>00</option>';
	echo '<option>30</option>';
	echo '</select>';
	echo '<select id="edit-schedule-meridiem">';
	echo '<option value="am">am</option>';
	echo '<option value="pm">pm</option>';
	echo '</select>';

	echo '<br>';
	echo '<br>';
	echo '<button id="save-button" class="edit_menu_board_to_schedule_modal_close" type="button" onclick="updateMenuBoardToSchedule()">Save</button>';
	echo '</div>'; // end modal
	echo '<button id="trigger-edit-schedule-modal" class="edit_menu_board_to_schedule_modal_open" type="button" style="display:none;">&nbsp;</button>';

	// END Menu board schedule
//***********************************
	echo '</div> <!-- /#num-columns-wrapper -->';
}elseif($is_monitor){
	echo '<div id="add_menu_board_to_schedule_modal" class="popup_modal">';
	echo '<a href="#" class="add_menu_board_to_schedule_modal_close modal_close_button"><img src="/images/x-15.png" width="15" height="15" /></a>';
	echo '<h3>Add Menu Board to Schedule</h3>';
	echo '<label>Menu Board: </label>';
	echo '<select id="add-to-schedule-board">';
	for ($i = 1; $i < 11; $i++) {
		echo '<option value="'.$i.'">Menu Board '.$i.'</option>';
	}
	echo '</select>';
	echo '<br>';
	echo '<br>';
	echo '<label>Switch Time: </label>';
	echo '<select id="add-to-schedule-hour">';
	for($i = 1; $i < 13; $i++) {
		$iDisplay = str_pad($i, 2, '0', STR_PAD_LEFT);
		echo '<option>'.$iDisplay.'</option>';
	}
	echo '</select>';
	echo ':';
	echo '<select id="add-to-schedule-minute">';
	echo '<option>00</option>';
	echo '<option>30</option>';
	echo '</select>';
	echo '<select id="add-to-schedule-meridiem">';
	echo '<option value="am">am</option>';
	echo '<option value="pm">pm</option>';
	echo '</select>';

	echo '<br>';
	echo '<br>';
	echo '<button id="save-button" class="add_menu_board_to_schedule_modal_close" type="button" onclick="addMenuBoardToScheduleMonitor()">Save</button>';
	echo '</div>'; // end modal
	
	echo '<button id="trigger-edit-schedule-modal" class="edit_menu_board_to_schedule_modal_open" type="button" style="display:none;">&nbsp;</button>';
	
	echo '<button id="trigger-edit-popup-modal" class="edit_menu_board_modal_open" type="button" style="display:none;">&nbsp;</button>';
	
	// open edit_menu_board
	echo '<div id="edit_menu_board_modal" class="popup_modal">';
	
	
	echo '<a href="#" class="edit_menu_board_modal_close modal_close_button"><img src="/images/x-15.png" width="15" height="15" /></a>';
	echo '<h3>Popup-Ad Settings</h3>';
	?>
    <span style="width: 75px;display: inline-block;">Display time</span>
			<select name="ad_interval_new" id="ad_interval_new">
				<?php 
				for($i = 0; $i < 13; $i++) {
					$iDisplay = str_pad($i, 2, '0', STR_PAD_LEFT);
					?>
					<option value="<?php echo $iDisplay; ?>"><?php echo $iDisplay; ?></option>
			<?php } 
			?>
	        </select>
	        <?php echo ':'; ?>
			<select name="ad_duration_new" id="ad_duration_new">
				<?php 
				for($i = 0; $i < 60; $i++) {
					$iDisplay = str_pad($i, 2, '0', STR_PAD_LEFT);
					?>
					<option value="<?php echo $iDisplay; ?>"><?php echo $iDisplay; ?></option>
			<?php } 
			?>
			</select> 
	<select id="popup-meridiem">
	<option value="am">am</option>
	<option value="pm">pm</option>
	</select>
	<?php
	echo '<br>';
	echo '<br>';
	echo '<button id="save-button" class="edit_menu_board_to_schedule_modal_close" type="button" onclick="updateMenuBoardMonitor()">Save</button>';
	
	echo '</div>'; // end modal


	echo '<div id="edit_menu_board_to_schedule_modal" class="popup_modal">';
	echo '<a href="#" class="edit_menu_board_to_schedule_modal_close modal_close_button"><img src="/images/x-15.png" width="15" height="15" /></a>';
	echo '<h3>Edit Menu Board in Schedule</h3>';
	echo '<label>Menu Board: </label>';
	echo '<select id="edit-schedule-board">';
	for ($i = 1; $i < 11; $i++) {
		echo '<option value="'.$i.'">Menu Board '.$i.'</option>';
	}
	echo '</select>';
	echo '<br>';
	echo '<br>';
	echo '<label>Switch Time: </label>';
	echo '<select id="edit-schedule-hour">';
	for($i = 0; $i < 13; $i++) {
		$iDisplay = str_pad($i, 2, '0', STR_PAD_LEFT);
			echo '<option>'.$iDisplay.'</option>';
	}
	echo '</select>';
	echo ':';
	echo '<select id="edit-schedule-minute">';
	echo '<option>00</option>';
	echo '<option>30</option>';
	echo '</select>';
	echo '<select id="edit-schedule-meridiem">';
	echo '<option value="am">am</option>';
	echo '<option value="pm">pm</option>';
	echo '</select>';

	echo '<br>';
	echo '<br>';
	echo '<button id="save-button" class="edit_menu_board_to_schedule_modal_close" type="button" onclick="updateMenuBoardToScheduleMonitor()">Save</button>';
	echo '</div>'; // end modal



echo '<div id="num-columns-wrapper">';
		echo "<div>Monitor name: <input name='monitor_name' id='monitor_name' type='text' size='42' value='".$board['board_name']."'></div>";
?>

	<br>

	<div class="menu-board-settings">
		<h3>Schedule</h3>

		<?php
			$checktoggel="Select * from menu_boards where board_number='".$board['board_number']."'";
			$result=mysql_query($checktoggel);
			$boardSettings = mysql_fetch_assoc($result);
		?>
		<div style="margin-bottom:6px;"><label>
		    <input type="checkbox"  value="use_schedule" <?php echo $boardSettings['use_schedule'] == 1 ? 'checked' : ''; ?> name="schedule" class="schedule-checkbox_monitor"> Change on time schedule</label>
        </div>
		<div>
            <label><input type="checkbox" value="toggle_boards" name="schedule" <?php echo $boardSettings['toggle_boards'] == 1 ? 'checked' : ''; ?> class="schedule-checkbox_monitor"> Use constant rotation </label>
        </div>

        <div class="refresh-interval" style="<?php echo $boardSettings['toggle_boards'] != 1 ? 'display: none;' : ''; ?>">
            <br>
            <label>Refresh Interval: </label>
            <select name="refresh_interval">
                <option value="15" <?php if ($boardSettings['refresh_interval'] == 15) echo 'selected'; ?>>15 Seconds</option>
                <option value="30" <?php if ($boardSettings['refresh_interval'] == 30) echo 'selected'; ?>>30 Seconds</option>
                <option value="45" <?php if ($boardSettings['refresh_interval'] == 45) echo 'selected'; ?>>45 Seconds</option>
                <option value="60" <?php if ($boardSettings['refresh_interval'] == 60) echo 'selected'; ?>>1 Minute</option>
                <option value="120" <?php if ($boardSettings['refresh_interval'] == 120) echo 'selected'; ?>>2 Minutes</option>
                <option value="300" <?php if ($boardSettings['refresh_interval'] == 300) echo 'selected'; ?>>5 Minutes</option>
                <option value="600" <?php if ($boardSettings['refresh_interval'] == 600) echo 'selected'; ?>>10 Minutes</option>
                <option value="1800" <?php if ($boardSettings['refresh_interval'] == 1800) echo 'selected'; ?>>30 Minutes</option>
                <option value="3600" <?php if ($boardSettings['refresh_interval'] == 3600) echo 'selected'; ?>>1 Hour</option>
                <option value="7200" <?php if ($boardSettings['refresh_interval'] == 7200) echo 'selected'; ?>>2 Hours</option>
                <option value="43200" <?php if ($boardSettings['refresh_interval'] == 43200) echo 'selected'; ?>>12 Hours</option>
                <option value="86400" <?php if ($boardSettings['refresh_interval'] == 86400) echo 'selected'; ?>>24 Hours</option>
            </select>
        </div>

		<br>
		<div>
		<input type="hidden" name="recKey" id="recKey" value="<?php echo $boardSettings['recordkey']; ?>">
		<label>Select Transition</label>
		<select name="transSchedule" id="transSchedule" class="s-box-jumpTo">
		    <option value="0" <?php if(0==$boardSettings['transition_schedule']) { echo 'selected'; } ?> > None </option>
		    <option value="1" <?php if(1==$boardSettings['transition_schedule']) { echo 'selected'; } ?> >Slide Left</option>
		 	<option value="2" <?php if(2==$boardSettings['transition_schedule']) { echo 'selected'; } ?> >Slide Right</option>
		 	<option value="3" <?php if(3==$boardSettings['transition_schedule']) { echo 'selected'; } ?>>Fade</option>
		 	<option value="4" <?php if(4==$boardSettings['transition_schedule']) { echo 'selected'; } ?>>Spinning</option>
		  </select>
	    </div>
	    <br>
		<h3>Popup-Ad Settings</h3>

		<div>
			<span style="width: 75px;display: inline-block;">Show every:</span>
			<select name="ad_interval" id="ad_interval">
				<?php for($i = 1; $i < 16; $i++) : ?>
					<option value="<?php echo $i; ?>" <?php echo $i == $boardSettings['ad_interval'] ? 'selected' : '' ?>>
						<?php echo $i; ?> minute<?php echo $i > 1 ? 's' : ''; ?>
					</option>
				<?php endfor; ?>
			</select>
		</div>

		<div>
			<span style="width: 75px;display: inline-block;">Show for:</span>
			<select name="ad_duration" id="ad_duration">
				<?php for($i = 3; $i < 31; $i++) : ?>
					<option value="<?php echo $i; ?>" <?php echo $i == $boardSettings['ad_duration'] ? 'selected' : '' ?>>
						<?php echo $i; ?> seconds
					</option>
				<?php endfor; ?>
			</select>
		</div>

		<div>
		<input type="hidden" name="recKey" id="recKey" value="<?php echo $boardSettings['recordkey']; ?>">
		<label>Select Transition</label>
		<select name="transSchedulePop" id="transSchedulePop" class="s-box-jumpTo">
		    <option value="0" <?php if(0==$boardSettings['transition_popup']) { echo 'selected'; } ?> > None </option>
		    <option value="1" <?php if(1==$boardSettings['transition_popup']) { echo 'selected'; } ?> >Slide Left</option>
		 	<option value="2" <?php if(2==$boardSettings['transition_popup']) { echo 'selected'; } ?> >Slide Right</option>
		 	<option value="3" <?php if(3==$boardSettings['transition_popup']) { echo 'selected'; } ?>>Fade</option>
		 	<option value="4" <?php if(4==$boardSettings['transition_popup']) { echo 'selected'; } ?>>Spinning</option>
		  </select>
	    </div>
	    <br>
	</div>

	<br>

	<div class="monitor_schedule_wrapper">
		<div id="rotation-schedule-settings" class="menu-board-schedule-settings">
			<h4><font color='white'>Slides in rotation</font></h4>

			<div id="menu-boards-in-rotation">
				<div data-column-number="1" class="column dd" id="column-1" style="width:100%">
					<?php
					$boardSchedule = getMenuBoardSchedule($board['board_number']);
					$monitor_toggle_count = 1;

					if(!empty($boardSchedule)){
						echo '<ol class="dd-list">';
					foreach ($boardSchedule as $boardScheduleItem) {

						echo '<li class="dd-item" data-type="slides" data-item-id="'.$boardScheduleItem['display_board'].'" data-item-num="'.$monitor_toggle_count.'">';
						echo '<input type="hidden" name="boards_in_rotation[]" value="'.$boardScheduleItem['display_board'].'">';
						$slideqry="Select board_name from menu_boards where add_on_slide='1' and board_number='".$boardScheduleItem['display_board']."' ";
						$rt=mysql_query($slideqry);
						while($data = mysql_fetch_array($rt)){$slide_name = $data['board_name'];}
						echo '<span class="dd-handle">Slide ' .$boardScheduleItem['display_board'] . " ($slide_name)</span>";
						echo ' <span class="remove-icon">
							<a class="remove-menu-board-in-monitor" href="#"><img src="../images/remove-icon.png" title="Remove from menu board"></a></span>';
						echo '</li>';
						$monitor_toggle_count++;
					}
					echo '</ol>';
					}else{
						echo '<div class="dd-empty"></div>';
					}

					?>
				</div>
			</div>
		</div>

		<div id="time-schedule-settings" class="menu-board-schedule-settings">
			<h4><font color='white'>Slides in rotation schedule for this monitor:</font></h4>

			<?php
				if (count($boardSchedule) == 0){
					echo "<h4><font color='white'>Drag slides Here</font></h4>";
				}
			?>

			<div id="menu-boards-in-schedule">
				<div data-column-number="1" class="column dd" id="column-1" style="width:100%">
					<?php
						$monitor_count = 1;

						if(!empty($boardSchedule)){
							echo '<ol class="dd-list">';
							if(count($boardSchedule) == 0){
								echo '<li><b><font>Drag slides Here</font></b></li>';
							}


						foreach ($boardSchedule as $boardScheduleItem) {
							$time = strtotime($boardScheduleItem['switch_time']);
							$hour = date('h', $time);
							$minute = date('i', $time);
							$meridiem = date('a', $time);
							echo '<li class="dd-item" data-type="slides" data-item-id="'.$boardScheduleItem['display_board'].'" data-item-num="'.$monitor_count.'">';
							echo '<input type="hidden" name="schedule_board" value="'.$boardScheduleItem['display_board'].'">';
							echo '<input type="hidden" name="schedule_hour" value="'.$hour.'">';
							echo '<input type="hidden" name="schedule_minute" value="'.$minute.'">';
							echo '<input type="hidden" name="schedule_meridiem" value="'.$meridiem.'">';
							$slideqry="Select board_name from menu_boards where add_on_slide='1' and board_number='".$boardScheduleItem['display_board']."' ";
							$rt=mysql_query($slideqry);
							while($data = mysql_fetch_array($rt)){$slide_name = $data['board_name'];}
							echo '<span class="dd-handle">Slide '.$boardScheduleItem['display_board'].' ('.$slide_name.') '.$hour.':'.$minute.' '.$meridiem.'</span>';

							echo '<span class="edit_monitor_slide">
							<img src="images/gear-icon.png"></span><span class="remove-icon">
							<a class="remove-menu-board-in-monitor" href="#"><img src="../images/remove-icon.png" title="Remove from menu board"></a></span>';




							echo '</li>';
							$monitor_count++;


						}
						echo '	</ol>';
						} else {
							echo '<div class="dd-empty"></div>';
						}
					?>
				</div>
			</div>
		</div>
	</div>

	<?php
		$ads = [];
		$sql = "SELECT menu_board_ads.*, menu_boards.board_name 
				FROM menu_board_ads
			 	LEFT JOIN menu_boards on menu_board_ads.display_board = menu_boards.board_number
				WHERE menu_board = '".$board['board_number']."'";

		$result = mysql_query($sql) or die(mysql_error());
	
		while ($row = mysql_fetch_assoc($result)) {
			$ads[] = $row;
		}

	?>
	<div class="monitor_schedule_wrapper">
		<div id="menu-board-ads">
			<h4><font color='white'>Pop-up ads:</font></h4>

			<div id="menu-board-ads">
			<input type="hidden" name="boardNo" id="boardNo" value="<?php echo $board['board_number']; ?>">
		<input type="hidden" name="thisboardNo" id="thisboardNo" value="">
				<div data-column-number="1" id="column-1" style="width:100%" class="column ads dd">
					<?php if (empty($ads)) : ?>
						<div class="dd-empty"></div>
					<?php else: ?>
						<ol class="dd-list">
							<?php foreach ($ads as $ad) : ?>
								<li class="dd-item">
								<?php
								$ptime   = array();
								$ptime   = explode(':',$ad['display_time']);
								$phour   = $ptime[0];
								$pminute = $ptime[1];
								?>
									<span class="dd-handle">Slide <?php echo $ad['display_board']; ?> (<?php echo $ad['board_name']; ?>)
									<?php echo $phour.':',$pminute;
									echo '&nbsp'; 
									echo $ad['display_meridiem'];
									?>
									
									</span>
									<span class="edit_popUp_slide">
							        <img src="images/gear-icon.png"></span>
									<input type="hidden" name="ads[]" value="<?php echo $ad['display_board']; ?>" class="ads">
									<span class="remove-icon"><a class="remove-menu-board-in-monitor" href="#"><img src="../images/remove-icon.png" title="Remove from menu board"></a>
								</li>
							<?php endforeach; ?>
						</ol>
					<?php endif; ?>
				</div>
			</div>
		</div>
	</div>

</div>
<?php

}//End of is monitor condition
	if($is_slide==1){
		echo '<div id="upload-bg-image-wrapper"><div class="mb-bg-label"><label>Background Color:</label><input id="bkgd_color" type="text" name="bkgd_color" class="color" size="8" value="' . $board['bkgd_color'] . '" onchange="saveForm()"></div>';

			// Background image
		echo '';
		echo '<label>Background Image</label>';
		echo '<button id="upload-btn" type="button">Select Image</button>';
		echo '<div id="errormsg"></div>';
		echo '<div id="pic-progress-wrap" class="progress-wrap"></div>';
		echo '<div id="background-image-preview">';
		if (!empty($board) && !empty($board['image_name'])) {
			echo '<img src="/custom/images/menu-boards/' . $board['image_name'] . '">';
			$removeBtnStyles = '';
		} else {
			$removeBtnStyles = 'display:none;';
		}
		echo '</div>';

		echo '<div style="float:right;margin-left:12px;"><button type="button" id="delete-image" style="'.$removeBtnStyles.'">Remove Image</button></div>';
		echo '<input id="image_name" type="hidden" name="image_name" value="'.$board['image_name'].'" />';

		// Image as background
		echo '<div class="image-as-bkgd-fields" '.(!empty($board) && empty($board['image_name']) ? 'style="display:none;"' : '').'>';
		echo '<div style="margin-top:10px;">';
		echo '<label>';
		echo 'Image as Background: ';
		echo '<input id="image_as_bkgd" type="checkbox" name="image_as_bkgd" value="1"' . ((!empty($board) && ($board['image_as_bkgd'] == 1)) ? ' checked' : '') . ' />';
		echo '</label>';
		echo '</div>';
		echo '<div>';
		echo '<span class="image-note-enabled" '. ((!empty($board) && $board['image_as_bkgd'] == 0) ? 'style="display: none;"' : '') . '><span class="small-font">This image will be displayed as the background behind whatever content you select below.</span></span>';
		echo '<span class="image-note-disabled" '. ((!empty($board) && $board['image_as_bkgd'] == 1) ? 'style="display: none;"' : '') . '>This image will be displayed on your menu board, without any other content.</span>';
		echo '</div>';
		echo '</div>';
		echo '</div><!-- /.image-as-bkgd-fields -->';

}


	//show active Categories

	if($is_monitor == 1){

		echo '<div id="available-items">';

		// echo "<div class='preview-menu-board'><a href='slides.php' type='button'><p>Manage lnd slides</p></a></div>";
		echo '<div id="available-slides">';
		echo '<h2>Available Slides</h2>';
		echo '<div class="dd available monitor_slides available-slides expanded">';

		$items = '';
		$slides="Select * from menu_boards where add_on_slide='1' order by board_number";
		$rt=mysql_query($slides);
		$itemNum = 1;
		while($nt=mysql_fetch_array($rt)){
			$items .= "<li id='available-slide-".$itemNum."' class='dd-item available-slide' data-type='slides' data-item-id='".$nt['board_number']."' data-item-num='".$itemNum."'>";
			$items .= '<span class="dd-handle">';
			$items .= 'Slide '.$nt[board_number]. ' ('.$nt[board_name].')';
			$items .= '</span>';
			$items .= "</li>";
			$itemNum++;
		}



		if (!empty($items)) {
			echo "<ol id='ol-available-slides' class='dd-list'>";
			echo $items;
			echo '</ol>';
		} else {
			echo '<div class="dd-empty"></div>';
		}
		echo '</div> <!-- /.dd -->';

		echo '</div><!-- /#available-slides -->';
		echo '</div>';
	}


if($is_slide==1){
	echo '<div id="widgets-wrapper"'. ((!empty($board) && !empty($board['image_name']) && $board['image_as_bkgd'] == 0) ? 'style="display: none;"' : '') . '>';
	echo '<div id="menu-board" class="columns-'.$numColumns.'">';

	for ($columnNum = 1; $columnNum <= $numColumns; $columnNum++) {
		echo '<div id="column-'.$columnNum.'" class="column dd" data-column-number="'.$columnNum.'">';
		echo "<h2>Column $columnNum </h2>";

		// Get items for this column
		$sql = "SELECT *
				FROM menu_board_items
				WHERE board_number = '{$selected_board}' AND display_column = '$columnNum'
				ORDER BY position";
		$result = mysql_query($sql) or die(mysql_error());
		if (mysql_num_rows($result) < 1) {
			echo '<div class="dd-empty"></div>';
		} else {
			echo"<ol class='dd-list'>";
			while($boardItem = mysql_fetch_assoc($result)) {
				// Get category for this menu board
				$itemName = null;
				$customCategoryItems = '';
				if($boardItem['menu_category'] <> "0"){
					$itemType = 'category';
					$itemId = $boardItem['menu_category'];
					if ($boardItem['menu_category'] == 9999) {
						$itemName = $boardItem['custom_name'] . ' <span style="font-size:.8em;font-style:italic;color:red;">(Custom)</span>';

						// Get custom category items
						$customCategoryItems = array();
						foreach (getCustomCategoryItems($boardItem['recordkey']) as $customCategoryItem) {
							$customCategoryItems[] = $customCategoryItem['item_key'];
						}
						$customCategoryItems = implode(',', $customCategoryItems);
					} else {
						$itemName = getCategoryName($boardItem['menu_category']);
					}
				}
				if($boardItem['widget_id'] <> "0"){
					$itemType = 'widget';
					$itemId = $boardItem['widget_id'];
					$itemName = getWidgetName($boardItem['widget_id']);
				}

				if ($itemName != null) {
					echo '<li class="dd-item" data-recordkey="'.$boardItem['recordkey'].'" data-type="'.$itemType.'" data-item-id="'.$itemId.'" data-custom-name="'.$boardItem['custom_name'].'" data-custom-description="'.$boardItem['custom_description'].'" data-custom-category-items="'.$customCategoryItems.'" data-price-grid-format="'.$boardItem['price_grid_format'].'">';
					echo '<span class="dd-handle">';
					echo $itemName;
					echo '</span>';
					if ($boardItem['menu_category'] == 9999) {
						echo '<span class="edit-custom-category">';
						echo '<img src="images/gear-icon.png">';
						echo '</span>';
					} else {
						echo ' <span class="remove-icon"><a class="remove-category" href="#"><img src="../images/remove-icon.png" title="Remove from menu"></a></span>';
					}
					echo '</li>';
				}
			}
			echo "</ol>";
		}
		echo '</div><!-- /.column -->';

	} //end of column loop
//} //end of slide loop
	echo '</div> <!-- /#menu-board -->';


	//show active Categories

	if($is_monitor == 1){
		echo '<div id="available-items">';
		echo '<div id="available-slides">';
		echo '<h2>Available Slides</h2>';
		echo '<div class="dd available available-slides expanded">';

		$items = '';
		$slides="Select * from menu_boards where add_on_slide='1' order by board_number";
		$rt=mysql_query($slides);
		$itemNum = 1;
		while($nt=mysql_fetch_array($rt)){
			$items .= "<li id='available-slide-".$itemNum."' class='dd-item available-slide' data-type='slides' data-item-id='".$nt['recordkey']."' data-item-num='".$itemNum."'>";
			$items .= '<span class="dd-handle">';
			$items .= 'Menu Board '.$nt[board_number];
			$items .= '</span>';
			$items .= "</li>";
			$itemNum++;
		}



		if (!empty($items)) {
			echo "<ol id='ol-available-slides' class='dd-list'>";
			echo $items;
			echo '</ol>';
		} else {
			echo '<div class="dd-empty"></div>';
		}
		echo '</div> <!-- /.dd -->';

		echo '</div><!-- /#available-slides -->';
		echo '</div>';

	}else{
		echo '<div id="available-items">';
		echo '<div id="available-categories">';
		echo '<h2>Available Categories</h2>';
		echo '<div class="dd available available-categories expanded">';

		$items = '';
		$catqry="Select * from menuCategory where active='1' order by CategoryName";
		$rt=mysql_query($catqry);
		$itemNum = 1;
		while($nt=mysql_fetch_array($rt)){
			$items .= "<li id='available-category-".$itemNum."' class='dd-item available-category' data-type='category' data-item-id='".$nt['RecordKey']."' data-item-num='".$itemNum."'>";
			$items .= '<span class="dd-handle">';
			$items .= $nt[CategoryName];
			$items .= '</span>';
			$items .= "</li>";
			$itemNum++;
		}

		//add custom category option

		$items .= "<li id='available-category-9999' class='dd-item available-category' data-type='category' data-item-id='9999' data-item-num='".$itemNum."'>";
		$items .= '<span class="dd-handle">';
		$items .= "<b><font color='red'>Custom</font></b>";
		$items .= '</span>';
		$items .= "</li>";


		if (!empty($items)) {
			echo "<ol id='ol-available-categories' class='dd-list'>";
			echo $items;
			echo '</ol>';
		} else {
			echo '<div class="dd-empty"></div>';
		}
		echo '</div> <!-- /.dd -->';

		echo '</div><!-- /#available-categories -->';
	}

	// Show Available Widgets
	echo '<div id="available-widgets">';
	echo '<h2>Available Widgets</h2>';
	echo '<div class="dd available available-widgets" style="display: none;">';

	$items = '';
	$sql = "SELECT recordkey, title 
			FROM widgets 
			WHERE active = 1
			ORDER BY title";
	$result = mysql_query($sql) or die(mysql_error());

	$itemNum = 1;
	while($row = mysql_fetch_array($result)){
		$items .= "<li id='available-widget-".$itemNum."' class='dd-item available-widget' data-type='widget' data-item-id='".$row['recordkey']."' data-item-num='".$itemNum."'>";
		$items .= '<span class="dd-handle">';
		$items .= $row['title'];
		$items .= '</span>';
		$items .= "</li>";
		$itemNum++;
	}

	if (!empty($items)) {
		echo "<ol id='ol-available-widgets' class='dd-list'>";
		echo $items;
		echo '</ol>';
	} else {
		echo '<div class="dd-empty"></div>';
	}
	echo '</div> <!--end dd class -->';
	echo '</div> <!-- /#available-widgets -->';
	echo '</div> <!-- /#available-items -->';
	echo '</div><!-- /#widgets-wrapper -->';
	}//end of if slide loop..
} else {
	echo "You have landed here by mistake. Please return to the <a href='?admin-page=5'><u><font color='blue'>home admin page</font></u></a>.";
}

function getMenuBoard($boardNumber) {
	$sql = "SELECT *
			FROM menu_boards
			WHERE board_number = '".$boardNumber."'
			LIMIT 1";
	$result = mysql_query($sql) or die(mysql_error());

	if (mysql_num_rows($result) > 0) {
		return mysql_fetch_assoc($result);
	} else {
		return addMenuBoardRow($boardNumber);
	}
}

function addMenuBoardRow($boardNumber) {
	$sql = "INSERT INTO menu_boards (
				board_number,
				column_count
			) VALUES (
				'".$boardNumber."',
				1
			)";
	mysql_query($sql) or die(mysql_error());
	return getMenuBoard($boardNumber);
}

function updateMenuBoardNumColumns($board, $numColumns) {
	$sql = "UPDATE menu_boards 
			SET column_count = '". mysql_real_escape_string($numColumns)."'
			WHERE board_number = '".$board['board_number']."'";
	mysql_query($sql) or die(mysql_error());
}

function getCategoryName($id) {
	// Get category name
	$qry2 = "SELECT CategoryName 
			FROM menuCategory 
			WHERE RecordKey = '".$id."'";
	$rt2 = mysql_query($qry2);

	if (mysql_num_rows($rt2) < 1) {
		return null;
	}

	$row = mysql_fetch_assoc($rt2);
	return $row['CategoryName'];
}

function getWidgetName($id) {
	// Get widget name
	$qry2 = "SELECT title 
			FROM widgets 
			WHERE recordkey = '".$id."'";
	$rt2 = mysql_query($qry2);

	if (mysql_num_rows($rt2) < 1) {
		return null;
	}

	$row = mysql_fetch_assoc($rt2);
	return $row['title'];
}

function getMenuCategories() {
	$categories = array();

	$sql = "SELECT *
			FROM menuCategory
			ORDER BY CategoryName";
	$result = mysql_query($sql) or die(mysql_error());

	while ($row = mysql_fetch_assoc($result)) {
		$categories[] = $row;
	}

	return $categories;
}

function getCustomCategoryItems($id) {
	$items = array();

	$sql = "SELECT *
			FROM mb_custom_cat
			WHERE cust_cat_key = '".mysql_real_escape_string($id)."'";
	$result = mysql_query($sql) or die(mysql_error());

	while ($row = mysql_fetch_assoc($result)) {
		$items[] = $row;
	}

	return $items;
}

function getMenuBoardSchedule($boardNumber) {
	$boardSchedule = [];

	$sql = "SELECT *
			FROM menu_board_schedule
			WHERE menu_board = '".mysql_real_escape_string($boardNumber)."'
			ORDER BY switch_time, display_board";
	$result = mysql_query($sql) or die(mysql_error());

	while ($row = mysql_fetch_assoc($result)) {
		$boardSchedule[] = $row;
	}

	return $boardSchedule;
}
?>


</div>

<div class='loader'></div>
<div id='backgroundPopup'></div>

<div class='toPopDiv' id='popup_custom_category'>
	<div class='close'></div>
	<span class='ecs_tooltip'>Esc to close <span class='arrow'></span></span>
	<div id='popup_content'> <!--your content start-->
		<h2>Add Custom Category</h2>
		<form id="custom-category-form">
			<h4>Custom Category Details</h4>
			<div>
				<label>Name: </label>
				<input type="text" name="name" value="">
			</div>
			<div>
				<label>Description: </label>
				<input type="text" name="description" value="">
			</div>
			<div style='margin-top:7px;'>
				<label>Price Grid Format: </label>
				<input type="checkbox" name="price_grid_format" value="1">
			</div>
			<div style='margin-top:7px;'>
				<div><strong>Selected Categories</strong></div>
				<div class="selected-categories-list">

				</div>
			</div>
		</form>
		<div class="choose-category-items">
			<h4>Add Category Items</h4>
			<div>
				<label>Category: </label>
				<select name="category">
					<?php foreach (getMenuCategories() as $category): ?>
						<option value="<?php echo $category['RecordKey']; ?>"><?php echo $category['CategoryName']; ?></option> 
					<?php endforeach; ?>
				</select>
			</div>
			<div id="category-items-list">

			</div>
		</div>
		<div class="clearfix"></div>

		<div>
			<button class="cancel-custom-category" type="button">Cancel</button>
			<button class="delete-custom-category" type="button">Delete</button>
			<button class="save-custom-category" type="button">Save</button>
		</div>
		<br />
	</div> <!--your content end-->
</div> <!--toPopup end-->



<!--<script type="text/javascript" src="/<?php echo $admin_folder; ?>/includes/simple-ajax-uploader/SimpleAjaxUploader.min.js"></script>-->
<script type="text/javascript" src="<?php echo $_SESSION['root_path']; ?>/cmsadmin/includes/simple-ajax-uploader/SimpleAjaxUploader.min.js"></script>
<!--<script type="text/javascript" src="../<?php echo $admin_folder; ?>/includes/simple-ajax-uploader/SimpleAjaxUploader.min.js"></script>-->

<script type="text/javascript">


//Code to update monitor-name in database
	$( "#monitor_name" ).change(function() {
  		var monitorName = $('#monitor_name').val();
  		var board = <?php echo $selected_board; ?> ;
  		$.ajax({
			type: 'post',
			url: 'save_menu_board_settings.php',
			data: {action: 'update-monitor-name', monitorName: monitorName, boardNo: board },
			dataType: 'json'
		}).done(function(response) {
		});
	});
//End Code
	var customFormListItem = null;
	var customCategoryFormAction = null;

	$(document).ready(function() {
		<?php if($is_slide){ ?>
		scrollToView();
		$(document).on('scroll', function() {
			scrollToView();
		});


		$(document).on('change', '.changeItemDEscpStat', function(event) {
			event.preventDefault();
			var recodrd = $(this).attr('data-recordkey');

			if( $(this).is(':checked') == true ){

				$.ajax({
					url      : '/cmsadmin/setItemDesc.php',
					type     : 'POST',
					dataType : 'json',
					data     : {
						recordId : recodrd
					},
				}).done(function(res) {
					console.log('check');
					console.log(res);
				});
				
			} else { 

				$.ajax({
					url      : '/cmsadmin/setItemDesc.php',
					type     : 'POST',
					dataType : 'json',
					data     : {
						recordId : recodrd,
						uncheck  : 'uncheck'
					},
				}).done(function(res) {
					console.log('uncheck');
					console.log(res);
				});
			}

		});

		$(document).on('click', '.deleteSlide', function(event) {
			event.preventDefault();
			/* Act on the event */
			if(confirm('Caution: Deleting this slide will remove it from all monitors. Do you wish to proceed?')){
				$.ajax({
					url      : '/cmsadmin/deleteSlide.php',
					type     : 'POST',
					dataType : 'json',
					data: {
						slideId : $(this).data('id')
					},
				}).done(function(res) {

					if(res.msg == 1 ){
						window.top.location.href = "/cmsadmin/index.php?admin-page=10"; 
					} else {
						alert('Something went wrong please try again');
					}

				});
			} else {
				alert('not confimrm');	
			}
		});

		// Init simpleupload
		var btn = document.getElementById('upload-btn'),
		    wrap = document.getElementById('pic-progress-wrap'),
		    picBox = document.getElementById('background-image-preview'),
		    errBox = document.getElementById('errormsg');

		var uploader = new ss.SimpleUpload({
		    button: btn,
		    url: 'upload_menu_board_bg.php',
		    sessionProgressUrl: '/<?php echo $admin_folder; ?>/includes/simple-ajax-uploader/extras/sessionProgress.php',
		    name: 'imgfile',
		    multiple: false,
		    allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
		    accept: 'image/*',
		    debug: true,
		    hoverClass: 'btn-hover',
		    focusClass: 'active',
		    disabledClass: 'disabled',
		    responseType: 'json',
		    onSubmit: function(filename, ext) {
		        var prog = document.createElement('div'),
		            outer = document.createElement('div'),
		            bar = document.createElement('div'),
		            size = document.createElement('div'),
		            self = this;

		        prog.className = 'prog';
		        size.className = 'size';
		        outer.className = 'progress';
		        bar.className = 'bar';

		        outer.appendChild(bar);
		        prog.appendChild(size);
		        prog.appendChild(outer);
		        wrap.appendChild(prog); // 'wrap' is an element on the page

		        self.setProgressBar(bar);
		        self.setProgressContainer(prog);
		        self.setFileSizeBox(size);

		        errBox.innerHTML = '';
		        btn.value = 'Choose another file';
		    },
		    onSizeError: function() {
		        errBox.innerHTML = 'Files may not exceed 500K.';
		    },
		    onExtError: function() {
		        errBox.innerHTML = 'Invalid file type. Please select a PNG, JPG, GIF image.';
		    },
		    onComplete: function(file, response) {
		        if (!response) {
		            errBox.innerHTML = 'Unable to upload file';
		        }
		        if (response.success === true) {
		            picBox.innerHTML = '<img src="/custom/images/menu-boards/' + response.file + '">';
		            $('#image_name').val(response.file);
		            $('#delete-image').show();
		            $('.image-as-bkgd-fields').show();
		            $('#image_as_bkgd').prop('checked', true);
		            toggleImageAsBackgroundContent();
		            saveForm();
		        } else {
		            if (response.msg) {
		                errBox.innerHTML = response.msg;
		            } else {
		                errBox.innerHTML = 'Unable to upload file';
		            }
		        }

		    }
		});

		$('#image_as_bkgd, #scroll_text, #scroll_position, #text_multiplier, #template').change(function() {
			saveForm();
		});
			<?php } ?>

		// Set up sortable lists
        $('.dd').nestable({
            maxDepth: 1,
            group: 1
        }).on('done', function(e, listItem, parentItem) {
            itemsUpdated(listItem, parentItem);
            var test = listItem.attr('data-item-id');
            $('#menu-boards-in-rotation .time_data').hide();
            $('#menu-boards-in-rotation .edit_monitor_slide').hide();
            <?php if ($is_monitor == 1) : ?>
                saveForm_monitors();
            <?php else: ?>
                saveMenuBoard();
            <?php endif; ?>
        });

		$(document).on('click', '.remove-category', function(e) {
			e.preventDefault();
			removeCategory($(this));
			return false;
		});

		$('#available-items h2').click(function(e) {
			expandList($(this).parent());
		});

		$('#num-columns').change(function() {
			updateNumColumns();
		});

		$('#delete-image').click(function() {
			deleteBgImage();
		});

		$('.choose-category-items select[name="category"]').change(function() {
			refreshCustomCategoryItem();
		});

		// Custom Categories
		$(document).on('click', '.add-category-item-btn', function() {
			var id = $(this).data('item-id');
			selectCategoryItem(id);
		});
		$(document).on('click', '.remove-selected-category-item', function() {
			var id = $(this).data('item-id');
			removeSelectedCategoryItem(id);
		});
		$('.cancel-custom-category').click(function() {
			cancelCustomCategory();
		});
		$('.save-custom-category').click(function() {
			saveCustomCategory();
		});
		$(document).on('click', '.edit-custom-category', function() {
			var listItem = $(this).parent('.dd-item');
			editCustomCategory(listItem);
		});

		$('#image_as_bkgd').change(function() {
			toggleImageAsBackgroundContent();
		});

		$('.delete-custom-category').click(function() {
			removeCustomCategory();
		});
	});

	function expandList(listObj) {
		var listContent = listObj.find('.dd');
		if (listContent.hasClass('expanded')) {
			listContent.slideUp(200).removeClass('expanded');
		} else {
			listContent.slideDown(200).addClass('expanded');
			$('#available-items .dd').each(function() {
				var id = $(this).parent().attr('id');
				if (id != listObj.attr('id')) {
					if ($(this).hasClass('expanded')) {
						$(this).slideUp(200).removeClass('expanded');
					}
				}
			});
		}
	}

	function updateNumColumns() {
		var numColumns = $('#num-columns').val();
		if (numColumns == $('#original-num-columns').val()) {
			return false;
		}

		saveMenuBoard(function() {
			window.location = '/cmsadmin/index.php?admin-page=8&slide=<?php echo $selected_board; ?>&num_columns='+numColumns;
		});
	}

	function itemsUpdated(listItem, parentItem) {
		initializeListItem(listItem, parentItem);
		checkForDuplicates();
		checkForEmptyBoards();
		if (listItem.data('item-id') == '9999' && !listItem.data('recordkey')) {
			createCustomCategory();
		} else {
			saveMenuBoard();
		}
	}

	function initializeListItem(listItem, originatedFrom) {
	    var parentItem = listItem.parents('.dd');
		checkIfOriginatedFromAvailableList(listItem, originatedFrom);

		// If list item was moved from a menu board to the available categories list, remove it
		if (parentItem.hasClass('available') && !listItem.hasClass('available-category') && !listItem.hasClass('available-slide') && !listItem.hasClass('available-widget')) {
			listItem.remove();
		}

		<?php if($is_monitor == 1) { ?>

			if (parentItem.hasClass('column') && listItem.find('.remove-icon').length < 1) {
				var newBoard = '';
				var schedule_board = listItem.attr('data-item-id');

				if (parentItem.hasClass('ads')) {
					//newBoard += '<input type="hidden" class="ads" name="ads[]" value="'+schedule_board+'">';
					listItem.append('<span class="edit_popUp_slide"><img src="images/gear-icon.png"></span><input type="hidden" class="ads" name="ads[]" value="'+schedule_board+'">');
				} else {
					if ($('.schedule-checkbox_monitor:checked').val() == 'use_schedule') {
						newBoard += '<input type="hidden" name="schedule_board" value="'+schedule_board+'">';
						newBoard += '<input type="hidden" name="schedule_hour" value="00">';
						newBoard += '<input type="hidden" name="schedule_minute" value="00">';
						newBoard += '<input type="hidden" name="schedule_meridiem" value="am">';
						newBoard += '<input type="hidden" name="boards_in_rotation[]" value="'+schedule_board+'">';
						newBoard += '<span class="time_data"> - 00:00:am</span>';
						listItem.append('<span class="edit_monitor_slide"><img src="images/gear-icon.png"></span>');
					} else {
						newBoard += '<input type="hidden" name="boards_in_rotation[]" value="'+schedule_board+'">';
						newBoard += '<input type="hidden" name="schedule_board" value="'+schedule_board+'">';
					}
				}

				listItem.find('.dd-handle').append(newBoard);

				listItem.append('<span class="remove-icon"><a class="remove-menu-board-in-monitor" href="#"><img src="../images/remove-icon.png" title="Remove from menu board"></a></span>');

			}

		<?php } else { ?>
		// If placed into a menu board, and doesn't have a delete button, add it
			if (parentItem.hasClass('column') && listItem.find('.remove-icon').length < 1) {
				if (listItem.data('item-id') == '9999') {
					listItem.append('<span class="edit-custom-category"><img src="images/gear-icon.png"></span>');
				} else {
					listItem.append('<span class="remove-icon"><a class="remove-category" href="#"><img src="../images/remove-icon.png" title="Remove from menu board"></a></span>');
				}
			}
		<?php } ?>
	}

	function checkIfOriginatedFromAvailableList(listItem, originatedFrom) {
		// If list item moved from available categories list to a menu board, 
		// make a copy of that list item and re-add it to the available 
		// categories in it's previous position
		if (originatedFrom.hasClass('available-categories') && listItem.hasClass('available-category')) {
			var newListItem = listItem.clone();
			var itemNum = newListItem.data('item-num');
			if (itemNum == 1) {
				$('#ol-available-categories').prepend(newListItem);
			} else {
				var prevItemNum = itemNum - 1;
				$('#ol-available-categories').find('#available-category-'+prevItemNum).after(newListItem);
			}

			// Remove classes
			listItem.removeClass('new');
			listItem.removeClass('available-category');
			listItem.removeAttr('id');
		}

		if (originatedFrom.hasClass('available-slides') && listItem.hasClass('available-slide')) {
			var newListItem = listItem.clone();
			var itemNum = newListItem.data('item-num');
			if (itemNum == 1) {
				$('#ol-available-slides').prepend(newListItem);
			} else {
				var prevItemNum = itemNum - 1;
				$('#ol-available-slides').find('#available-slide-'+prevItemNum).after(newListItem);
			}

			// Remove classes
			listItem.removeClass('new');
			listItem.removeClass('available-slide');
			listItem.removeAttr('id');
		}

		// Same for widgets
		if (originatedFrom.hasClass('available-widgets') && listItem.hasClass('available-widget')) {
			var newListItem = listItem.clone();
			var itemNum = newListItem.data('item-num');
			if (itemNum == 1) {
				$('#ol-available-widgets').prepend(newListItem);
			} else {
				var prevItemNum = itemNum - 1;
				$('#ol-available-widgets').find('#available-widget-'+prevItemNum).after(newListItem);
			}

			// Remove classes
			listItem.removeClass('new');
			listItem.removeClass('available-widget');
			listItem.removeAttr('id');
		}

		customFormListItem = listItem;
	}

	function removeCategory(deleteButtonObj) {
		deleteButtonObj.closest('.dd-item').remove();
		checkForEmptyBoards();
		saveMenuBoard();
	}

	function removeCustomCategory() {
		if (!confirm('Are you sure you want to delete this category?')) {
			return false;
		}

		customFormListItem.remove();
		checkForEmptyBoards();
		saveMenuBoard();

		customFormListItem = null;
		customCategoryFormAction = null;

		disablePopup();
	}

	function checkForEmptyBoards() {
		$('.dd').each(function() {
			if ($(this).find('.dd-list').length > 0 && $(this).find('.dd-item').length == 0) {
				$(this).find('.dd-list').remove();
				$(this).append('<div class="dd-empty"></div>');
			}
		});
	}

	function checkForDuplicates() {
		$('.column').each(function(i, menuBoard) {
			var categoryIds = [];
			var widgetIds = [];
			$(menuBoard).find('.dd-item').each(function(ii, listItem) {
				var id = $(listItem).data('item-id');
				if (id == 9999) {
					return 1;
				}
				if ($(listItem).data('type') == 'category') {
					if ($.inArray(id, categoryIds) > -1) {
						$(listItem).remove();
					} else {
						categoryIds.push(id);
					}
				}

				if ($(listItem).data('type') == 'widget') {
					if ($.inArray(id, widgetIds) > -1) {
						$(listItem).remove();
					} else {
						widgetIds.push(id);
					}
				}
			});
		});
	}

	function saveMenuBoard(onDoneCallback) {
		var boardNum = <?php echo $selected_board; ?>;
		//var show_descriptions = <? echo $_REQUEST['show_descriptions']; ?>;
		//alert ("triggered");
		var data = {
			board: boardNum,
			num_columns: $('#num-columns').val(),
			columns: {}
		};
		for (var i = 1; i <= <?php echo $numColumns; ?>; i++) {
			var items = [];
			var columnId = 'column-'+i;
			var column = $('#'+columnId);

			if (column.length > 0 && column.find('.dd-item').length > 0) {
				$.each(column.find('.dd-item'), function() {
					var item = {
						type: $(this).data('type'),
						id: $(this).data('item-id'),
						custom_name: $(this).data('custom-name'),
						custom_description: $(this).data('custom-description'),
						custom_category_items: $(this).data('custom-category-items'),
						price_grid_format: $(this).data('price-grid-format')
					};
					items.push(item);
				});
			} else {
				items = null;
			}

			data['columns'][i] = items;
		}

		$.ajax({
			type: 'post',
			url: 'save_menu_board.php',
			data: data,
			dataType: 'json'
		}).done(function(response) {
			if (onDoneCallback && typeof(onDoneCallback) === "function") {
				onDoneCallback();
			}
		});
	}

	function deleteBgImage() {
		$('#image_name').val('');
		$('#image_as_bkgd').prop('checked', true);
		saveForm(function() {
			$('#background-image-preview').html('');
			$('#delete-image').hide();
			$('.image-as-bkgd-fields').hide();
			toggleImageAsBackgroundContent();
		});
	}


	function saveForm_monitors(onDoneCallback) {
		var boardNum = <?php echo $selected_board; ?>;
		var monitor_name =  $('#monitor_name').val();

		var data = {
			board: boardNum,
			image_name: '',
			scroll_text: '',
			scroll_position: '',
			text_multiplier: '',
			bkgd_color: '',
			template: '',
			monitor_name : monitor_name,
			isMonitor : 1,
			ad_interval: $('select[name="ad_interval"]').val(),
			ad_duration: $('select[name="ad_duration"]').val(),
            refresh_interval: $('select[name="refresh_interval"]').val()
		}

		//if ($('#image_as_bkgd').prop('checked')) {
			data['image_as_bkgd'] = 1;
		//}

		if ($('.schedule-checkbox_monitor:checked').length > 0) {
			data['schedule'] = $('.schedule-checkbox_monitor:checked').val();
		}

		if($('.schedule-checkbox_monitor:checked').val() == 'use_schedule'){
			var i = 0;
			var j = 0;

			$('input[name="boards_in_rotation[]"').each(function() {

				data['boards_in_schedule['+j+'][board]'] = $(this).val();
				j++;

			});
			$('#time-schedule-settings .dd-list .dd-item').each(function() {
				//data['boards_in_schedule['+i+'][board]'] = $(this).find('input[name="schedule_board"]').val();

				data['boards_in_schedule['+i+'][hour]'] = $(this).find('input[name="schedule_hour"]').val();
				data['boards_in_schedule['+i+'][minute]'] = $(this).find('input[name="schedule_minute"]').val();
				data['boards_in_schedule['+i+'][meridiem]'] = $(this).find('input[name="schedule_meridiem"]').val();
				i++;
			});
		}else{
			var k = 0;
			data['boards_in_rotation'] = new Array();
			$('input[name="schedule_board"').each(function() {
				data['boards_in_rotation['+k+']'] = $(this).val();
				k++;
				//data['boards_in_rotation'].push($(this).find('input[name="schedule_board"]').val());
			});

		}

		data['ads'] = [];

		$('input[name="ads[]"]').each(function() {
			data['ads'].push($(this).val());
		});

		$.ajax({
			type: 'post',
			url: 'save_menu_board_settings.php',
			data: data,
			dataType: 'json'
		}).done(function(response) {
			if (response.hasOwnProperty('result') && response.result == 1) {
				if (onDoneCallback && typeof(onDoneCallback) === "function") {
					onDoneCallback();
				}
			} else {
				var message = 'Error saving menu board';
				if (response.hasOwnProperty('message') && response.message.length > 0) {
					message += ': ' + response.message;
				} else {
					message += '.';
				}
				alert(message);
			}
		});
	}


	function saveForm(onDoneCallback) {
		var boardNum = <?php echo $selected_board; ?>;
		var monitor_name =  $('#monitor_name').val();

		var data = {
			board: boardNum,
			image_name: $('#image_name').val(),
			scroll_text: $('#scroll_text').val(),
			scroll_position: $('#scroll_position').val(),
			text_multiplier: $('#text_multiplier').val(),
			bkgd_color: $('#bkgd_color').val(),
			template: $('#template').val(),
			monitor_name: monitor_name,
            refresh_interval: $('select[name="refresh_interval"]').val()
		}

		if ($('#image_as_bkgd').prop('checked')) {
			data['image_as_bkgd'] = 1;
		}

		if ($('.schedule-checkbox:checked').length > 0) {
			data['schedule'] = $('.schedule-checkbox:checked').val();
		}

		data['boards_in_rotation'] = new Array();
		$('input[name="boards_in_rotation[]"').each(function() {
			data['boards_in_rotation'].push($(this).val());
		});

		var i = 0;
		$('.menu-board-in-schedule').each(function() {
			data['boards_in_schedule['+i+'][board]'] = $(this).find('input[name="schedule_board"]').val();
			data['boards_in_schedule['+i+'][hour]'] = $(this).find('input[name="schedule_hour"]').val();
			data['boards_in_schedule['+i+'][minute]'] = $(this).find('input[name="schedule_minute"]').val();
			data['boards_in_schedule['+i+'][meridiem]'] = $(this).find('input[name="schedule_meridiem"]').val();
			i++;
		});

		$.ajax({
			type: 'post',
			url: 'save_menu_board_settings.php',
			data: data,
			dataType: 'json'
		}).done(function(response) {
			if (response.hasOwnProperty('result') && response.result == 1) {
				if (onDoneCallback && typeof(onDoneCallback) === "function") {
					onDoneCallback();
				}
			} else {
				var message = 'Error saving menu board';
				if (response.hasOwnProperty('message') && response.message.length > 0) {
					message += ': ' + response.message;
				} else {
					message += '.';
				}
				alert(message);
			}
		});
	}

	function createCustomCategory() {
		clearCustomCategoryForm();
		refreshCustomCategoryItem();
		$('#popup_custom_category h2').text('Edit Custom Category');
		openPopup('custom_category');
		customCategoryFormAction = 'add';
	}

	function refreshCustomCategoryItem() {
		var categoryId = $('.choose-category-items select[name="category"]').val();

		$.ajax({
			type: 'post',
			url: 'get_menu_category_item.php',
			data: {action: 'get_items_in_category', category: categoryId},
			dataType: 'json'
		}).done(function(response) {
			if (response.hasOwnProperty('result') && response.result == 1 && response.hasOwnProperty('items')) {
				populateCategoryItemList(response.items);
			} else {
				alert('Error getting category items.');
				console.log(response);
			}
		});
	}

	function populateCategoryItemList(items) {
		var list = '';
		$.each(items, function() {
			list += '<div class="category-item">'+this.itemName+' <button class="add-category-item-btn" type="button" data-item-id="'+this.itemKey+'">Add</button></div>';
		});

		$('#category-items-list').html(list);
	}

	function selectCategoryItem(id) {
		$.ajax({
			type: 'post',
			url: 'get_menu_category_item.php',
			data: {action: 'get_item', id: id},
			dataType: 'json'
		}).done(function(response) {
			if (response.hasOwnProperty('result') && response.result == 1 && response.hasOwnProperty('item')) {
				addSelectedCategoryItem(response.item);
			} else {
				alert('Error getting category item.');
				console.log(response);
			}
		});
	}

	function addSelectedCategoryItem(item) {
		var content = '';
		content += '<div class="selected-category" id="selected-category-item-'+item.itemKey+'" data-item-id="'+item.itemKey+'">';
		content += item.itemName;
		content += ' <button class="remove-selected-category-item" data-item-id="'+item.itemKey+'">Remove</button>';
		content += '</div>';

		$('.selected-categories-list').append(content);
	}

	function removeSelectedCategoryItem(id) {
		$('#selected-category-item-'+id).remove();
	}

	function clearCustomCategoryForm() {
		$("#custom-category-form input[type='text']").val('');
		$("#custom-category-form input[type='checkbox']").prop('checked', 0);
		$("#custom-category-form input").val('');
		$('.selected-categories-list').html('');
	}

	function cancelCustomCategory() {
		disablePopup();
		clearCustomCategoryForm();
		if (customFormListItem && customFormListItem == 'add') {
			customFormListItem.remove();
			checkForEmptyBoards();
		}
		customFormListItem = null;
		customCategoryFormAction = null;
	}
	function saveCustomCategory() {
		var name = $('#custom-category-form input[name="name"]').val();
		var description = $('#custom-category-form input[name="description"]').val();
		// Check if name was entered
		if (name.length < 1) {
			alert('Please enter a name.');
			$('#custom-category-form input[name="name"]').focus();
			return false;
		}

		// Check if categories selected
		if ($('.selected-category').length < 1) {
			alert('Please select category items.');
			return false;
		}

		var items = [];

		$('.selected-category').each(function() {
			items.push($(this).data('item-id'));
		});

		items = items.join();

		// Price grid format
		var priceGridFormat = 0;
		if ($('#custom-category-form input[name="price_grid_format"]').prop('checked')) {
			priceGridFormat = 1;
		}

		$(customFormListItem).data('custom-name', name);
		$(customFormListItem).data('custom-description', description);
		$(customFormListItem).data('custom-category-items', items);
		$(customFormListItem).data('price-grid-format', priceGridFormat);
		$(customFormListItem).find('.dd-handle').html(name + ' <span style="font-size:.8em;font-style:italic;color:red;">(Custom)</span>');

		var editIcon = '<span class="edit-custom-category">';
		editIcon += '<img src="images/gear-icon.png">';
		editIcon += '</span>';

		$(customFormListItem).find('.dd-handle').after(editIcon);

		saveMenuBoard();

		disablePopup();
		clearCustomCategoryForm();
		customCategoryFormAction = null;
	}
	function editCustomCategory(listItem) {
		var name = $(listItem).data('custom-name');
		var description = $(listItem).data('custom-description');
		var priceGridFormat = listItem.data('price-grid-format');
		var selectedCategoryItems = listItem.data('custom-category-items');

		$('#popup_custom_category h2').text('Edit Custom Category');
		$('#custom-category-form input[name="name"]').val(name);
		$('#custom-category-form input[name="description"]').val(description);
		if (priceGridFormat) {
			$('#custom-category-form input[name="price_grid_format"]').prop('checked', true);
		} else {
			$('#custom-category-form input[name="price_grid_format"]').prop('checked', false);
		}
		fillSelectedCategoryItemsFromIds(selectedCategoryItems);
		refreshCustomCategoryItem();

		openPopup('custom_category');
		customCategoryFormAction = 'edit';
		customFormListItem = listItem;
	}

	function fillSelectedCategoryItemsFromIds(ids) {
		$('.selected-categories-list').html('');
		$.ajax({
			type: 'post',
			url: 'get_menu_category_item.php',
			data: {action: 'get_items', ids: ids},
			dataType: 'json'
		}).done(function(response) {
			if (response.hasOwnProperty('result') && response.result == 1 && response.hasOwnProperty('items')) {
				$.each(response.items, function(i, item) {
					addSelectedCategoryItem(item);
				});
			} else {
				alert('Error getting category items.');
				console.log(response);
			}
		});
	}

	function toggleImageAsBackgroundContent() {
		var isChecked = $('#image_as_bkgd').prop('checked');
		var hasImage = ($('#image_name').val().length > 0) ? true : false;


		if (isChecked || !hasImage) {
			$('.image-note-enabled').show();
			$('.image-note-disabled').hide();
			$('#widgets-wrapper').show();
		} else {
			$('.image-note-enabled').hide();
			$('.image-note-disabled').show();
			$('#widgets-wrapper').hide();
		}
	}

	// Scroll to view
	var totalHeight = $('#content-one-column').height();
	<?php if($is_slide){ ?>
	function scrollToView() {
		var scrollingDiv = $("#menu-board");
		var margin = $(window).scrollTop();
		var iframeTop = $("#menu-board").position().top - 10;

		if(margin - iframeTop < 0) {
			margin = 0;
		} else {
			margin = margin - iframeTop;
		}
		if (margin < 15) {
			margin = 15;
		}

		if ((margin+scrollingDiv.height()) > totalHeight) {
			margin = totalHeight - scrollingDiv.height() + 55;
		}
		scrollingDiv
			.stop()
			.animate({"marginTop": margin + "px"}, 200 );
	}
	<?php } ?>
	function check(show_descriptions){
	    var cer=document.getElementById("show_descriptions").checked;
	    if(cer){

			//alert("checked");
		    window.location = '?admin-page=8&slide=<?php echo $selected_board; ?>&show_descriptions=yes';
	    } else {
	    	//alert("unchecked");
				window.location = '?admin-page=8&slide=<?php echo $selected_board; ?>&show_descriptions=no';
	    }
	}


	function toggle(show_item_descriptions){
	    var cer=document.getElementById("show_item_descriptions").checked;
	    if(cer){
	        //alert("checked");
				window.location = '?admin-page=8&slide=<?php echo $selected_board; ?>&show_item_descriptions=yes';
	    } else {
	    	//alert("unchecked");
				window.location = '?admin-page=8&slide=<?php echo $selected_board; ?>&show_item_descriptions=no';
	    }
	}


	/** Menu Board Schedule Scripts **/
	var boardsInScheduleNum = 0;
	var scheduleBoardEditing;
	$(document).ready(function() {
		showSelectedScheduleOptions();
		showSelectedScheduleOptions_monitor();

		$('.schedule-checkbox').change(function() {
			if ($(this).attr('value') == 'use_schedule') {
				$('.schedule-checkbox[value="toggle_boards"]').prop('checked', false);
			} else {
				$('.schedule-checkbox[value="use_schedule"]').prop('checked', false);
			}

			showSelectedScheduleOptions();

			saveForm();

		});

		$('.schedule-checkbox_monitor').change(function() {
			if ($(this).attr('value') == 'use_schedule') {
				$('.schedule-checkbox_monitor[value="toggle_boards"]').prop('checked', false);
			} else {
				$('.schedule-checkbox_monitor[value="use_schedule"]').prop('checked', false);
			}

			showSelectedScheduleOptions_monitor();
		});

		$('.schedule-checkbox_monitor').change(function() {
		    if ($('.schedule-checkbox_monitor[value="toggle_boards"]').prop('checked')) {
		        $('.refresh-interval').show();
            } else {
		        $('.refresh-interval').hide();
            }
        });

		$('.menu-board-settings :input').not('#transSchedule').not('#transSchedulePop').change(function() {
			saveForm_monitors();
		});

		$('#add-board-to-rotation').click(function() {
			addBoardToRotation();
		});

		$(document).on('click', '.remove-menu-board-in-rotation', function() {
			$(this).closest('.menu-board-in-rotation').remove();
			saveForm();
		});

		$(document).on('click', '.remove-menu-board-in-schedule', function() {
			$(this).closest('.menu-board-in-schedule').remove();
			saveForm();
		});

		$(document).on('click', '.edit-menu-board-in-schedule', function() {
			scheduleBoardEditing = $(this).closest('.menu-board-in-schedule');
			editMenuBoardInSchedule();
		});

		$(document).on('click', '.edit_monitor_slide', function() {

			scheduleBoardEditing = $(this).closest('.dd-item');
			editMenuBoardInSchedule();
		});

		$(document).on('click', '.edit_popUp_slide', function(e) {
			//alert($(this).next('.ads').val());
			e.preventDefault();
			
			if($(this).next('.ads').val()==undefined){
				//$('#thisboardNo').val($(this).before('.ads').val());
			}else{
		       $('#thisboardNo').val($(this).next('.ads').val());
		    }
		        //$('#thisboardNo1').val($(this).next('.ads').val());
			    $.ajax({

	            url: "save_trans_val.php",
	            type: "POST",
	            dataType: 'json',
	            data: {
	                check_display_board : $('#thisboardNo').val(),
	                check_board_number  : $('#boardNo').val(),
	            },
	            success:function(data)
	            {
	            	var hours=data.hours;
	            	var min=data.min;
	            	var meridiem = data.meridiem;
	            	$('#ad_interval_new option[value="' + hours + '"]').prop('selected', true);
					$('#ad_duration_new option[value="' + min + '"]').prop('selected', true);
					$('#popup-meridiem option[value="' + meridiem + '"]').prop('selected', true);
	            	$('#trigger-edit-popup-modal').click();
	             }
            });
			
		});

		$(document).on('click', '.remove-menu-board-in-monitor', function() {
			$(this).closest('.dd-item').remove();

			if (! $(this).closest('.dd').hasClass('ads')) {
				var current_click = $(this).closest('.dd-item').attr('data-item-num');
				$(document).find(".column.dd [data-item-num='" + current_click + "']").remove();
			}
			//$('*[data-item-num="+'current_click'+"]').remove();
            checkForEmptyBoards();
			saveForm_monitors();
		});


		$('#add_menu_board_to_schedule_modal').popup();
		$('#edit_menu_board_to_schedule_modal').popup();
		$('#edit_menu_board_modal').popup();
	});

	function showSelectedScheduleOptions() {
		if ($('.schedule-checkbox:checked').length > 0) {
			if ($('.schedule-checkbox:checked').val() == 'use_schedule') {
				$("#time-schedule-settings").show();
				$("#rotation-schedule-settings").hide();
			} else {
				$("#time-schedule-settings").hide();
				$("#rotation-schedule-settings").show();
			}
		} else {
			// None selected, hide both
			$("#time-schedule-settings").hide();
			$("#rotation-schedule-settings").hide();
		}
	}

	function showSelectedScheduleOptions_monitor() {
		if ($('.schedule-checkbox_monitor:checked').length > 0) {
			if ($('.schedule-checkbox_monitor:checked').val() == 'use_schedule') {
				$("#time-schedule-settings").show();
				$("#rotation-schedule-settings").hide();
			} else {
				$("#time-schedule-settings").hide();
				$("#rotation-schedule-settings").show();
			}
		} else {
			// None selected, hide both
			$("#time-schedule-settings").hide();
			$("#rotation-schedule-settings").hide();
		}
	}
	function addBoardToRotation() {
		var selectedBoard = $('#select-menu-board-rotation').val();

		var newBoard = '<div class="menu-board-in-rotation">';
		newBoard += '<input type="hidden" name="boards_in_rotation[]" value="'+selectedBoard+'">';
		newBoard += 'Menu Board ' + selectedBoard;
		newBoard += ' <button class="remove-menu-board-in-rotation" type="button">Remove</button>';
		newBoard += '</div>';

		$('#menu-boards-in-rotation').append(newBoard);

		saveForm();
	}
	function addMenuBoardToSchedule() {
		var board = $('#add-to-schedule-board').val();
		var hour = $('#add-to-schedule-hour').val();
		var minute = $('#add-to-schedule-minute').val();
		var meridiem = $('#add-to-schedule-meridiem').val();

		var newBoard = '<div class="menu-board-in-schedule">';
		newBoard += '<input type="hidden" name="schedule_board" value="'+board+'">';
		newBoard += '<input type="hidden" name="schedule_hour" value="'+hour+'">';
		newBoard += '<input type="hidden" name="schedule_minute" value="'+minute+'">';
		newBoard += '<input type="hidden" name="schedule_meridiem" value="'+meridiem+'">';
		newBoard += 'Menu Board '+board+' - '+hour+':'+minute+' '+meridiem;
		newBoard += ' <button class="edit-menu-board-in-schedule edit_menu_board_to_schedule_modal_open" type="button">Edit</button>';
		newBoard += ' <button class="remove-menu-board-in-schedule" type="button">Remove</button>';
		newBoard += '</div>';

		boardsInScheduleNum++;

		$('#menu-boards-in-schedule').append(newBoard);

		saveForm();
		$('#edit_menu_board_to_schedule_modal').popup();
	}


	function addMenuBoardToScheduleMonitor() {
		var board = $('#add-to-schedule-board').val();
		var hour = $('#add-to-schedule-hour').val();
		var minute = $('#add-to-schedule-minute').val();
		var meridiem = $('#add-to-schedule-meridiem').val();

		var newBoard = '<li class="dd-item" data-type="slides" data-item-id="'+board+'" data-item-num="">';
		newBoard += '<input type="hidden" name="schedule_board" value="'+board+'">';
		newBoard += '<input type="hidden" name="schedule_hour" value="'+hour+'">';
		newBoard += '<input type="hidden" name="schedule_minute" value="'+minute+'">';
		newBoard += '<input type="hidden" name="schedule_meridiem" value="'+meridiem+'">';
		newBoard += 'Menu Board '+board+' - '+hour+':'+minute+' '+meridiem;
		newBoard += ' <span class="edit_monitor_slide"><img src="images/gear-icon.png"></span>';
		newBoard += ' <span class="remove-icon"><a class="remove-menu-board-in-monitor" href="#"><img src="../images/remove-icon.png" title="Remove from menu board"></a></span>';
		newBoard += '</div>';

		boardsInScheduleNum++;

		$('#menu-boards-in-schedule').append(newBoard);

		saveForm_monitors();
		//$('#edit_menu_board_to_schedule_modal').popup();
	}

	 function updateMenuBoardMonitor() {
		
		var ad_interval = $('#ad_interval_new').val();
		var ad_duration = $('#ad_duration_new').val();
		var popup_meridiem = $('#popup-meridiem').val();
		var display_board= $('#thisboardNo').val();
		var board_number= $('#boardNo').val();
		
		$.ajax({

            url: "save_trans_val.php",
            type: "POST",
            data: {
                ad_interval   : ad_interval,
                ad_duration   : ad_duration,
                popup_meridiem: popup_meridiem,
                display_board : display_board,
                board_number  : board_number
            },
            success:function()
            {
              $("#edit_menu_board_modal").fadeOut();
		      window.location.reload();
		    }
        });
	}

	function updateMenuBoardToScheduleMonitor() {
		var board = $('#edit-schedule-board').val();
		var hour  = $('#edit-schedule-hour').val();
		var minute = $('#edit-schedule-minute').val();
		var meridiem = $('#edit-schedule-meridiem').val();

		newBoard = '';
		newBoard += '<input type="hidden" name="schedule_board" value="'+board+'">';
		newBoard += '<input type="hidden" name="schedule_hour" value="'+hour+'">';
		newBoard += '<input type="hidden" name="schedule_minute" value="'+minute+'">';
		newBoard += '<input type="hidden" name="schedule_meridiem" value="'+meridiem+'">';
		newBoard += 'Menu Board '+board+' - '+hour+':'+minute+' '+meridiem;
		newBoard += ' <span class="edit_monitor_slide"><img src="images/gear-icon.png"></span>';
		newBoard += ' <span class="remove-icon"><a class="remove-menu-board-in-monitor" href="#"><img src="../images/remove-icon.png" title="Remove from menu board"></a></span>';

		scheduleBoardEditing.html(newBoard);
		saveForm_monitors();
	}


	function updateMenuBoardToSchedule() {
		var board = $('#edit-schedule-board').val();
		var hour = $('#edit-schedule-hour').val();
		var minute = $('#edit-schedule-minute').val();
		var meridiem = $('#edit-schedule-meridiem').val();

		newBoard = '';
		newBoard += '<input type="hidden" name="schedule_board" value="'+board+'">';
		newBoard += '<input type="hidden" name="schedule_hour" value="'+hour+'">';
		newBoard += '<input type="hidden" name="schedule_minute" value="'+minute+'">';
		newBoard += '<input type="hidden" name="schedule_meridiem" value="'+meridiem+'">';
		newBoard += 'Menu Board '+board+' - '+hour+':'+minute+' '+meridiem;
		newBoard += ' <button class="edit-menu-board-in-schedule" type="button">Edit</button>';
		newBoard += ' <button class="remove-menu-board-in-schedule" type="button">Remove</button>';

		scheduleBoardEditing.html(newBoard);
	}
	function editMenuBoardInSchedule() {

		var boardNum = scheduleBoardEditing.find('input[name="schedule_board"]').val();
		var hour = scheduleBoardEditing.find('input[name="schedule_hour"]').val();
		var minute = scheduleBoardEditing.find('input[name="schedule_minute"]').val();
		var meridiem = scheduleBoardEditing.find('input[name="schedule_meridiem"]').val();
		$('#edit-schedule-board').val(boardNum);
		$('#edit-schedule-hour').val(hour);
		$('#edit-schedule-minute').val(minute);
		$('#edit-schedule-meridiem').val(meridiem);

		$('#trigger-edit-schedule-modal').click();
	}
/** End Menu board schedule scripts **/

</script>
<style type="text/css">
	<?php
	if($is_slide == 1){
		?>
		.menu-boards-schedule{
			display: none;
		}
		<?php
	}
if($is_monitor == 1){
	?>
	.dd-list li .remove-icon {
position: absolute;
right: 20px !important;
top: 7px;
}

.edit_monitor_slide {
position: absolute;
right: 50px !important;
top: 6px;
}
#menu-boards-in-schedule  li.dd-item,#menu-boards-in-rotation li.dd-item{
line-height: 33px;
}

#available-items {
 width: 28%;
}
.monitor_schedule_wrapper {
background: #2077A1;
overflow: auto;
padding: 10px 34px;
margin-top: 11px;
border: 1px solid #cccfd2;
border-radius: 15px;
}
.monitor_schedule_wrapper h3,.monitor_schedule_wrapper label {
color: #fff !important;
}
	<?php
}
?>

</style>
<script type="text/javascript">
  $(document).ready(function() {

      
      $('#transSchedule').on('change',function(){
       
        $.ajax({

            url: "save_trans_val.php",
            type: "POST",
            data: {
                transSchedule: $("#transSchedule").val(),
                recKey       : $('#recKey').val(),
            }
        });
      
      });
      $('#transSchedulePop').on('change',function(){
        
        $.ajax({

            url: "save_trans_val.php",
            type: "POST",
            data: {
                transSchedulePop: $("#transSchedulePop").val(),
                recKey       : $('#recKey').val(),
            }
        });
      
      });

      $('#dayofweek').on('change',function(){
        $.ajax({

            url: "save_trans_val.php",
            type: "POST",
            data: {
                dayofweek: $("#dayofweek").val(),
                recKey       : $('#recKey').val(),
            }
        });
      
      });

      $("#start-meridiem").on('change', function() {
			$('#starttime').trigger('change');
	  });
      $('#starttime').on('change',function(){
      	
      	var start_meridiem=$("#start-meridiem").val();

	    $.ajax({

            url: "save_trans_val.php",
            type: "POST",
            data: {
                starttime     : $("#starttime").val(),
                recKey        : $('#recKey').val(),
                start_meridiem: start_meridiem,
            }
         });
      
      });

      $("#end-meridiem").on('change', function() {
			$('#endtime').trigger('change');
	  });
      $('#endtime').on('change',function(){

      	var end_meridiem=$("#end-meridiem").val();
	    
	        $.ajax({

	            url: "save_trans_val.php",
	            type: "POST",
	            data: {
	                endtime       : $("#endtime").val(),
	                recKey        : $('#recKey').val(),
	                end_meridiem  : end_meridiem,
	            }
	        });
       });
});
</script>


<div style="clear: both;">&nbsp;</div>
			  <div style="text-align:center;"><?php echo $bottom_links; ?></div>

Youez - 2016 - github.com/yon3zu
LinuXploit