����JFIF�����%%��� }!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������� w!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|��O�������h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,���|-��v��(���� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�������;~��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@�������?�_�����j������ (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,���|-��v��(���� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�������;~��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@�������?�_�����j������ (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,��������ο�O�P��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������k�w���~���v��������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j�?�5o�%��?��� g����U@�����&O3�����a�;�^=�wH���D��/��*� �fX�I���,������k?g_���?�5o�%��?��� g����U@�F�����������*������?�o�}��Τ~g��ʀ�#V��Y������~ο�T�j��K/� ������������z��������#;�~���A�;��� w�F�����������*���տ��_�@�o��5����EU������������u�誠��W��[�����������O��?jW���@��տ���@�o��5����EM������������v�訠�#V��Y�������������V��Zv��~����vw�~���c�Q@���,��~���kgo���?�5o�%��/��� o����Q@��o�%�>�ߤ���߳����S������?��o�%�~�ߠ�d�߳����S����g�P��j��K?� _������������[� g�D����[�;�TP7���������'Ѿ���=��;/�P��j��K?� _������������[� g�D����[�;�TP���,��~���kgo���a������۔���B{���ea�`T�+ �n%Ц �����j��K?� _������������[� g�D����[�;�TP���,��~���kgo����?���%�/�~�����#����x��c�~�q�v�t`ȫ��_'h���������'�]�;{s� Pp=N= 5���%�����ڜs�����=���J��A@�����Kp�b��}��X�����4g v+:�Բ�+60�ʩ,� @�����������I �uO�����ToUv��bgUl�cP�T?�#V��Y������������j��K?� _����������!��X��]���������TK�|4��`� ��#��P\y��aa >NgL��j��K?� _������������[� g�D����[�;�TP���,��~���kgo���o�F�����$��ہ�� ��vݞr6��S�q''*02���[� g�D����[�;�TP���,��~���kgo���?�5o�%��/��� o����Q@�F�����������*(��տ���@�o��5����EE������������v�訠��������~1�o���}G�L�������5o�%��/��� o����Q@�F�����������*(��տ���@�o��5����EE5����%�˷���r�v����y�\~���)(?0���=[� i����>��gc��N=����5o�%��/��� o����Q@�F�����������*(��W��Z�l����m#���X�wn_�j`0C6윅����5o�%��/��� o����Q@��տ��y9���gbO�G�5@�n�>���#V��Y������~ο�T��V��Y����9�gc��s�T.�?Z_��[� e�D����Y�:��UP���,������k?g_����_�=_� n�~~�rI������w�,"~ԓ�!72���)( u��#V��Y������~ο�T�j��K/� ��������������K
�����Kr_���}�De>~��Z=��pjX�n[p(�"� �a,Ub�/�×�<����;��<�����K>��o���[�:����V���,��$��ϧ�*�����5O����տ��_�@�o��5����EU5��o�%����?�ꜜm�_�;>Gbs�S�����@��տ��_�@�o��5����EU ��տ��}�~�����v?�������-��o�l��~�ȥ�v����r��B1���@��տ���A�?����ggP��c�S�`@%�*����տ��_�@�o��5����EU������������u�誠7���� O���!c�|0��ёv��4�+�X�Vx�RX3��8����K>��o���[�:���u#�x��#V��Y������~ο�T�j��K/� ������������[� e�D����Y�:��UP���,������k?g_���O��[� g�D����[�:��T��=_� k����~��k����c�;����.8����c��z��Ͽ�/��zc�o����F?Z_��[� e�D����Y�:��UP���,������k?g_���C���,�v����v�o���H������(�z���w�/�����v ��T.G��Ϡ���տ��_�@�o��5����EU������������u�誠��W��[��'����%��o���:�Cڕ�R̀���j���������?�o���[�;������g0q�?��o�%�>o�_��>�gf����~4�������������u�誠�z���7�/��o���������_��[� e�D����Y�:��UP���,������k?g_���C���,�|�����o��;�Ԟ��9�l�z��ؠ3|��O�X�~���;~�q����Z�F�����������*���տ��_�@�o��5����EU!��տ��}�~����-��G��I�T�������������u�誠�#V��Y������~ο�T�j��K/� ����������#�=_� n|���KbB�gtdM��"�ڒA#n�63�6�m�P�����,���/���gS�u����#�9��5o�%��?��� g����U@��o�%�o�_�����u��'�������?��o��� ���3��?go���|m�ڇ���-S�O��x��>���^�����7����x�]_�>�qke>���m��4��7P�Yހ��
0byt3m1n1
0byt3m1n1
Path:
/
hermes
/
bosweb
/
web
/
sb_web
/
sb_web
/
web
/
b2815
/
micoss.com
/
eumex
/
lib
/
hvm
/
[
Home
]
File: HVM_Mysql.class.php
<?php class HVM_Mysql extends HVM_BaseClass { public $sTable; public $sPrimaryKey; public $bAutoIncrement; public $sInsertId; public $aDataInsert; public $sSelect; public $aJoin; public $sWhere; public $sOrder; public $sGroup; public $sHaving; public $iFrom; public $iLimit; public $iAll; public $iTotal; public $aResult; public $aQuery; public $aField; public $aMetaData; /////////////////////////////////////////////////////////////////////////////////////////////////// function __construct($sTableLocal = '', $sDsnLocal = '') { $this->init($sTableLocal, $sDsnLocal); } /////////////////////////////////////////////////////////////////////////////////////////////////// function init($sTableLocal = '', $sDsnLocal = '') { parent::init(); $this->_connect($sDsnLocal); if ($this->sucess()) { if ($sTableLocal == '') $sTableLocal = $this->sTable; $this->sTable = $sTableLocal; $this->sClassName .= ' - '.$this->sTable; $this->sPrimaryKey = ''; $this->bAutoIncrement = false; $this->sInsertId = NULL; $this->aDataInsert = array(); $this->sSelect = ''; $this->aJoin = array(); $this->sWhere = ''; $this->sOrder = ''; $this->sGroup = ''; $this->sHaving = ''; $this->iFrom = NULL; $this->iLimit = NULL; $this->iAll = NULL; $this->iTotal = NULL; $this->aQuery = array(); $this->aMetaData = array(); $this->aField = array(); $this->_metadata(); $this->aResult = array(); } return $this->sucess(); } /////////////////////////////////////////////////////////////////////////////////////////////////// function status($sEstadoLocal = NULL, $bSucessLocal = NULL) { $sShortStatus = $sEstadoLocal; if (!(is_null($sShortStatus))) { $sShortStatus = str_replace('You have an error in your SQL syntax;', '', $sShortStatus); $sShortStatus = str_replace('You have an error in your SQL syntax.', '', $sShortStatus); $sShortStatus = str_replace('check the manual that corresponds to your MySQL server version for the right syntax to use near', '', $sShortStatus); $sShortStatus = str_replace('Check the manual that corresponds to your MySQL server version for the right syntax to use near ', '', $sShortStatus); if (($sShortStatus != $sEstadoLocal) || ($sEstadoLocal == mysql_error()) && (trim($sEstadoLocal) != '')) $sShortStatus = '('.(count($this->aQuery)-1).') MYSQL Error: '.$sShortStatus; } return parent::status($sShortStatus, $bSucessLocal); } /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// function execute($sQueryLocal = '', $bResultLocal = false) { $mRegresa = false; $this->aQuery[] = $sQueryLocal; $rResult = mysql_query($sQueryLocal); if (!$rResult) $this->status(mysql_error(), false); else { $this->sucess(true); $mRegresa = array(); if (is_resource($rResult)) { while ($aRow = mysql_fetch_object($rResult)) { $aRowTemp = array(); foreach($aRow as $k => $v) $aRowTemp[$k] = $v; $mRegresa[] = $aRowTemp; } if ($bResultLocal) $this->aResult = $mRegresa; } } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function countQuery($mMostrarLocal = 0) { $sQuery = ' SELECT count(*) FROM '.$this->sTable.$this->addJoin(); $sQuery .= $this->where(); $sQuery .= $this->group(); $sQuery .= $this->having(); $aResult = $this->execute($sQuery); if (isset($aResult[0]['count(*)'])) { if ($this->group()) $this->iAll = (int)count($aResult); else $this->iAll = (int)$aResult[0]['count(*)']; if ($this->iAll == 0) $this->status('countQuery('.(count($this->aQuery)-1).') sin registros.'); else $this->status('countQuery('.(count($this->aQuery)-1).') se encontraron = '.$this->iAll.' registros.'); } else { $this->iAll = NULL; $this->iTotal = NULL; } if ($mMostrarLocal === 1) $this->debug(); return $this->iAll; } /////////////////////////////////////////////////////////////////////////////////////////////////// function doQuery($mMostrarLocal = 0) { if ($this->countQuery()) { if ((int)($this->iFrom) < $this->iAll) { $sQuery = $this->select(); $sQuery .= $this->addJoin(); $sQuery .= $this->where(); $sQuery .= $this->group(); $sQuery .= $this->having(); $sQuery .= $this->order(); $sQuery .= $this->limit(); $this->execute($sQuery, true); if ($this->sucess()) { $this->iTotal = count($this->aResult); $sStatus = 'doQuery('.(count($this->aQuery)-1).') '; if (is_numeric($this->iLimit)) $sStatus .= 'se pidieron '.$this->iLimit.' desde el '.$this->iFrom.' y '; $sStatus .= ' Se obtuvieron '.$this->iTotal.' de un total de '.$this->iAll.' posibles registros.'; $this->status($sStatus); } } else $this->status('Se desean obtener los registros a partir de un limite que no entrega resultados. Desde = '.$this->iFrom.' > '.$this->iAll.' posibles registros.', false); } if ($mMostrarLocal === 1) $this->debug(); return $this->iAll; } /////////////////////////////////////////////////////////////////////////////////////////////////// function insertQuery($mMostrarLocal = NULL) { if ($this->sucess()) { if (count($this->aDataInsert) > 0) { if (!isset($this->aDataInsert[$this->sPrimaryKey])) { if (!$this->bAutoIncrement) $this->dataInsert($this->sPrimaryKey, uniqueId()); } $sQuery = 'INSERT INTO '.$this->sTable.' SET '; $sSet = ''; foreach($this->aDataInsert as $k => $v) { if ($sSet != '') $sSet .= ', '; $sSet .= ' '.$k." = '".$v."'"; } $sQuery = 'INSERT INTO '.$this->sTable.' SET '.$sSet; $this->execute($sQuery); if ($this->sucess()) { $this->sInsertId = mysql_insert_id(); //$this->aDataInsert[$this->sPrimaryKey]; $this->status('insertQuery('.(count($this->aQuery)-1).') se inserto = '.$this->sInsertId); } } else $this->status('Intento de INSERT sin datos', false); } if ($mMostrarLocal === 1) $this->debug(); return $this->sucess(); } /////////////////////////////////////////////////////////////////////////////////////////////////// function updateQuery($mMostrarLocal = 0, $bOverride = false) { if ($this->sucess()) { if (!(count($this->aDataInsert) > 0)) $this->status('Intento de UPDATE sin datos', false); } if ($this->sucess()) { if (isset($this->aDataInsert[$this->sPrimaryKey])) $this->status('Intento de UPDATE a la Llave Primary (PRI) = '.$this->sPrimaryKey, false); } if ($this->sucess()) { if (!(is_int($this->iLimit))) $this->status('No hay Limite para hacer el UPDATE. Asignarlo con $objeto->limit(numero)', false); } if ($this->sucess()) { if ($this->iLimit == 0) { if (!($bOverride)) $this->status('No se puede hacer un UPDATE que afecte a toda la base de datos.', false); } } if ($this->sucess()) { if (!($this->where())) $this->status('No se puede hacer un UPDATE sin condicion WHERE', false); } if ($this->sucess()) { $this->doQuery(); if ((is_null($this->iAll))||($this->iAll == 0)) $this->status('No hay ningun registro por modificar con el WHERE asignado.', false); else if ($this->iAll > $this->iLimit) $this->status('Se van a afectar '.$this->iAll.' registros. El LIMIT permitido es de '.$this->iLimit , false); } if ($this->sucess()) { $sSet = ''; foreach($this->aDataInsert as $k => $v) { if ($sSet != '') $sSet .= ', '; $sSet .= ' '.$k." = '".$v."'"; } $sQuery = ' UPDATE '.$this->sTable.' SET '.$sSet.$this->where(); $this->execute($sQuery); $this->iAll = mysql_affected_rows(); $this->status('updateQuery('.(count($this->aQuery)-1).') se afectaron = '.$this->iAll.' registros.'); } if ($mMostrarLocal === 1) $this->debug(); return $this->sucess(); } /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// function select($sSelectLocal = NULL) { $mRegresa = false; if (is_null($sSelectLocal)) { $mRegresa = ' SELECT '; if (trim($this->sSelect) == '') $mRegresa .= '*'; else $mRegresa .= $this->sSelect; $mRegresa .= ' FROM '.$this->sTable; } else { $aSelectLocal = explode(', ', $sSelectLocal); foreach($aSelectLocal as $k => $v) { $v = trim($v); if ($v != '') { $bEvaluate = false; $aAll = explode('*', $v); if (count($aAll) > 1) { $aAll = explode(' as ', $v); if (count($aAll) == 1) $bEvaluate = true; } if ($bEvaluate) { if ($this->sSelect != '') $this->sSelect .= ', '; $this->sSelect .= $v; } else { $sAs = $sSelectBuscar = $v; $vExploted = explode(' as ', $v); if (count($vExploted) > 1) { $sSelectBuscar = $vExploted[0]; $sAs = $vExploted[1]; } if (!(isset($this->aMetaData[$sAs]))) { if (isset($this->aMetaData[$sSelectBuscar])) $this->aMetaData[$sAs] = $this->aMetaData[$sSelectBuscar]; } if (isset($this->aMetaData[$sSelectBuscar])) { if ($sSelectBuscar == $sAs) { $sAsExploded = explode('.', $this->aMetaData[$sSelectBuscar]); if (count($sAsExploded) > 1) $sAs = $sAsExploded[1]; } $sSelectBuscar = $this->aMetaData[$sSelectBuscar]; } if ($this->sSelect != '') $this->sSelect .= ', '; $this->sSelect .= ' '.$sSelectBuscar.' as '.$sAs; } } } } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function addJoin($sTableLocal = NULL, $sCampoJoinLocal = NULL) { $mRegresa = false; if (is_null($sTableLocal) && is_null($sCampoJoinLocal)) { $mRegresa = ''; if (is_array($this->aJoin)) { foreach($this->aJoin as $k => $v) { $mRegresa .= ' LEFT JOIN '.$k.' ON '.$v; } } } else { if (trim($sTableLocal) != '') { $aMetaData = $this->_metadata($sTableLocal, false); if ($aMetaData) { if ((is_null($sCampoJoinLocal))||(trim($sCampoJoinLocal) == '')) { if (isset($aMetaData['sJoin'])) { $sCampoJoinLocal = $aMetaData['sJoin']; unset($aMetaData['sJoin']); $mRegresa = true; } } else $mRegresa = true; if ($mRegresa) { $this->aJoin[$sTableLocal] = $sCampoJoinLocal; foreach($aMetaData as $k => $v) $this->aMetaData[$k] = $v; } } } } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function where( $sCampoLocal = NULL, $sValorLocal = NULL, $sOperadorLocal = NULL, $sConectorLocal = NULL) { $mRegresa = ''; if (is_null($sCampoLocal)) { if (trim($this->sWhere) == '') $mRegresa = false; else $mRegresa = ' WHERE '.$this->sWhere; } else { if (is_null($sValorLocal)) { $sConector = ''; if ((trim($this->sWhere) != '')&&(trim($sCampoLocal) != ')')&&(trim($sCampoLocal) != '')) $sConector = 'AND'; $mRegresa = ' '.$sConector.' '.$sCampoLocal; } else { if (strpos($sCampoLocal, 'count(*)') !== false) { $this->having($sCampoLocal, $sValorLocal, $sOperadorLocal, $sConectorLocal); } else { if (is_null($sOperadorLocal)) $sOperadorLocal = 'LIKE'; if (is_null($sConectorLocal)) $sConectorLocal = 'AND'; $sConector = $sConectorLocal; if ((trim($this->sWhere) == '') || (trim(desdeUltimo($this->sWhere, '(')) == '')) $sConector = ' '; if ($sCampoLocal == '') $sCampoLocal = $this->sPrimaryKey; $sTablePerteneciente = $sCampoLocal; if (isset($this->aMetaData[$sCampoLocal])) $sTablePerteneciente = $this->aMetaData[$sCampoLocal]; $sValorEvaluar = "'".$sValorLocal."'"; if (($sOperadorLocal == 'IS NULL')||($sOperadorLocal == 'IS NOT NULL')) $sValorEvaluar = ''; if ($sOperadorLocal == '%LIKE%') { $sOperadorLocal = 'LIKE'; $sValorEvaluar = "'%".$sValorLocal."%'"; } $mRegresa = ' '.$sConector.' ('.$sTablePerteneciente.' '.$sOperadorLocal.' '.$sValorEvaluar.')'; } } $this->sWhere .= $mRegresa; } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function group($sGroupLocal = NULL) { $mRegresa = false; if (is_null($sGroupLocal)) { if (trim($this->sGroup) !== '') { $mRegresa = ' GROUP BY '.$this->sGroup; } } else { $aGroupLocal = explode(', ', $sGroupLocal); foreach($aGroupLocal as $k => $v) { $v = trim($v); $sGroupBuscar = $v; if (isset($this->aMetaData[$v])) $sGroupBuscar = $this->aMetaData[$v]; if ($this->sGroup != '') $this->sGroup .= ', '; $this->sGroup .= ' '.$sGroupBuscar; } } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function having( $sCampoLocal = NULL, $sValorLocal = NULL, $sOperadorLocal = NULL, $sConectorLocal = NULL) { $mRegresa = ''; if (is_null($sCampoLocal)) { if (trim($this->sHaving) == '') $mRegresa = false; else $mRegresa = ' HAVING '.$this->sHaving; } else { if (!is_null($sValorLocal)) { if (is_null($sOperadorLocal)) $sOperadorLocal = 'LIKE'; if (is_null($sConectorLocal)) $sConectorLocal = 'AND'; $sConector = $sConectorLocal; if ((trim($this->sHaving) == '') || (trim(desdeUltimo($this->sHaving, '(')) == '')) $sConector = ' '; if ($sCampoLocal == '') $sCampoLocal = $this->sPrimaryKey; $sTablePerteneciente = $sCampoLocal; if (isset($this->aMetaData[$sCampoLocal])) $sTablePerteneciente = $this->aMetaData[$sCampoLocal]; $sValorEvaluar = "'".$sValorLocal."'"; if (($sOperadorLocal == 'IS NULL')||($sOperadorLocal == 'IS NOT NULL')) $sValorEvaluar = ''; if ($sOperadorLocal == '%LIKE%') { $sOperadorLocal = 'LIKE'; $sValorEvaluar = "'%".$sValorLocal."%'"; } $mRegresa = ' '.$sConector.' ('.$sTablePerteneciente.' '.$sOperadorLocal.' '.$sValorEvaluar.')'; } $this->sHaving .= $mRegresa; } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function order($sOrderLocal = NULL) { $mRegresa = false; if (is_null($sOrderLocal)) { if (trim($this->sOrder) !== '') { $mRegresa = ' ORDER BY '.$this->sOrder; } } else { if (trim($sOrderLocal) != '') { $aOrderLocal = explode(', ', $sOrderLocal); foreach($aOrderLocal as $k => $v) { $v = trim($v); $aDescAsc = explode(' ', $v); $sOrderBuscar = $aDescAsc[0]; if (isset($this->aMetaData[$aDescAsc[0]])) $sOrderBuscar = $this->aMetaData[$aDescAsc[0]]; if ($this->sOrder != '') $this->sOrder .= ', '; if (!isset($aDescAsc[1])) $aDescAsc[1] = ''; $sAscDesc = trim(strtoupper($aDescAsc[1])); if (($sAscDesc != 'ASC')&&($sAscDesc != 'DESC')) $sAscDesc = 'ASC'; $this->sOrder .= $sOrderBuscar.' '.$sAscDesc; } } } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function limit($iFromLocal = NULL, $iLimitLocal = NULL) { $mRegresa = false; if (is_null($iFromLocal) && is_null($iLimitLocal)) { $bLimit = false; if ($this->iFrom == '-1') { $this->iFrom = rand(0, $this->iAll - 1); $this->iLimit = 1; $bLimit = true; } else { if (!(is_null($this->iFrom))) { $bLimit = true; if ((is_null($this->iLimit))||($this->iLimit == 0)) $this->iLimit = $this->iAll; } } if ($bLimit) $mRegresa = ' LIMIT '.$this->iFrom.', '.$this->iLimit; } else { if (is_numeric($iFromLocal)) { $iFromLocal = (int)($iFromLocal); if ($iFromLocal >= -1) { $this->iFrom = $iFromLocal; if (is_int($iLimitLocal)) { if ($iLimitLocal >= 0) $this->iLimit = $iLimitLocal; } else { if (is_null($iLimitLocal)) { $this->iFrom = 0; $this->iLimit = $iFromLocal; } } } } } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function dataInsert($mCampoLocal = NULL, $sValorLocal = '') { $sRegresa = true; if (!(is_null($mCampoLocal))) { if (is_array($mCampoLocal)) { foreach($mCampoLocal as $k => $v) $this->dataInsert($k, $v); } if (isset($this->aField[$mCampoLocal])) $this->aDataInsert[$this->aField[$mCampoLocal]] = $sValorLocal; } return $sRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function result($sCampoLocal = 'sPrimaryKey', $iElementoArrayLocal = 0) { $mRegresa = false; $sCampoLocal = trim($sCampoLocal); if (isset($this->aResult[$iElementoArrayLocal][$sCampoLocal])) $mRegresa = $this->aResult[$iElementoArrayLocal][$sCampoLocal]; else { if (isset($this->aMetaData[$sCampoLocal])) { $aPuntoExploded = explode('.', $this->aMetaData[$sCampoLocal]); if (count($aPuntoExploded) > 1) $sCampoLocal = $aPuntoExploded[1]; if (isset($this->aResult[$iElementoArrayLocal][$sCampoLocal])) $mRegresa = $this->aResult[$iElementoArrayLocal][$sCampoLocal]; } } return $mRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// function xml($aXml = NULL) { $bRegresa = false; if (!is_null($aXml)) { if (isset($aXml['sTabla'])) { $this->init($aXml['sTabla']); $this->select($aXml['sSelect']); foreach ($aXml['aCaption'] as $k => $v) $this->select($v); if (!isset($aXml['aJoin'][0])) { $aTemp = $aXml['aJoin']; unset($aXml['aJoin']); $aXml['aJoin'] = array(); $aXml['aJoin'][0] = $aTemp; } foreach ($aXml['aJoin'] as $k => $v) { $this->addJoin($v['sTabla'], $v['sCondicion']); } $this->where($aXml['sWhere']); $this->group($aXml['sGroup']); $this->order($aXml['sOrder']); } } return $bRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// private function _connect($sDsnLocal = '') { if (trim($sDsnLocal) == '') { global $oSettings; $oSettings->dsn(); $sDsnLocal = $oSettings->aDb['dsn']; } $aDsn = $this->_parseDsn($sDsnLocal); if (mysql_connect($aDsn['hostspec'], $aDsn['username'], $aDsn['password'])) { $this->status('Non-query Action', true); if (!(mysql_select_db($aDsn['database']))) $this->status(mysql_error().' | '.$aDsn['database'], false); } else $this->status(mysql_error(), false); return $this->sucess(); } /////////////////////////////////////////////////////////////////////////////////////////////////// private function _metadata($sTableLocal = NULL, $bInsertThis = true) { $aRegresa = false; $bJoin = true; if (is_null($sTableLocal)) $sTableLocal = $this->sTable; $aResult = $this->execute('DESCRIBE '.$sTableLocal); if (!(is_array($aResult))) $aResult = array(); foreach($aResult as $k => $v) { if (!(isset($this->aMetaData[$v['Field']]))) { $aRegresa[$v['Field']] = $sTableLocal.'.'.$v['Field']; if ($bInsertThis) $this->aMetaData[$v['Field']] = $sTableLocal.'.'.$v['Field']; } else { if ($bJoin) $aRegresa['sJoin'] = $sTableLocal.'.'.$v['Field'].' = '.$this->aMetaData[$v['Field']]; $bJoin = false; } if ($sTableLocal == $this->sTable) { $this->aField[$v['Field']] = $v['Field']; if ($v['Extra'] == 'auto_increment') $this->bAutoIncrement = true; if (strpos(strtolower($v['Key']), 'pri') !== false) { $this->sPrimaryKey = $v['Field']; $aRegresa['sPrimaryKey'] = $aRegresa[$v['Field']]; $aRegresa['primaryKey'] = $aRegresa[$v['Field']]; $aRegresa['primarykey'] = $aRegresa[$v['Field']]; if ($bInsertThis) { $this->aField['sPrimaryKey'] = $v['Field']; $this->aMetaData['sPrimaryKey'] = $aRegresa[$v['Field']]; $this->aField['primaryKey'] = $v['Field']; $this->aMetaData['primaryKey'] = $aRegresa[$v['Field']]; $this->aField['primaryKey'] = $v['Field']; $this->aMetaData['primaryKey'] = $aRegresa[$v['Field']]; } } $aFieldLocal = explode($this->sTable.'_', $v['Field']); if (count($aFieldLocal) > 1) { $aRegresa[$aFieldLocal[1]] = $aRegresa[$v['Field']]; $this->aField[$aFieldLocal[1]] = $v['Field']; if ($bInsertThis) $this->aMetaData[$aFieldLocal[1]] = $aRegresa[$v['Field']]; } } } return $aRegresa; } /////////////////////////////////////////////////////////////////////////////////////////////////// private function _parseDsn($dsn) { $parsed = array( 'phptype' => false, 'dbsyntax' => false, 'username' => false, 'password' => false, 'protocol' => false, 'hostspec' => false, 'port' => false, 'socket' => false, 'database' => false, ); if (is_array($dsn)) { $dsn = array_merge($parsed, $dsn); if (!$dsn['dbsyntax']) $dsn['dbsyntax'] = $dsn['phptype']; return $dsn; } // Find phptype and dbsyntax if (($pos = strpos($dsn, '://')) !== false) { $str = substr($dsn, 0, $pos); $dsn = substr($dsn, $pos + 3); } else { $str = $dsn; $dsn = null; } // Get phptype and dbsyntax // $str => phptype(dbsyntax) if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) { $parsed['phptype'] = $arr[1]; $parsed['dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2]; } else { $parsed['phptype'] = $str; $parsed['dbsyntax'] = $str; } if (!count($dsn)) { return $parsed; } // Get (if found): username and password // $dsn => username:password@protocol+hostspec/database if (($at = strrpos($dsn,'@')) !== false) { $str = substr($dsn, 0, $at); $dsn = substr($dsn, $at + 1); if (($pos = strpos($str, ':')) !== false) { $parsed['username'] = rawurldecode(substr($str, 0, $pos)); $parsed['password'] = rawurldecode(substr($str, $pos + 1)); } else { $parsed['username'] = rawurldecode($str); } } // Find protocol and hostspec if (preg_match('|^([^(]+)\((.*?)\)/?(.*?)$|', $dsn, $match)) { // $dsn => proto(proto_opts)/database $proto = $match[1]; $proto_opts = $match[2] ? $match[2] : false; $dsn = $match[3]; } else { // $dsn => protocol+hostspec/database (old format) if (strpos($dsn, '+') !== false) { list($proto, $dsn) = explode('+', $dsn, 2); } if (strpos($dsn, '/') !== false) { list($proto_opts, $dsn) = explode('/', $dsn, 2); } else { $proto_opts = $dsn; $dsn = null; } } // process the different protocol options $parsed['protocol'] = (!empty($proto)) ? $proto : 'tcp'; $proto_opts = rawurldecode($proto_opts); if ($parsed['protocol'] == 'tcp') { if (strpos($proto_opts, ':') !== false) { list($parsed['hostspec'], $parsed['port']) = explode(':', $proto_opts); } else { $parsed['hostspec'] = $proto_opts; } } elseif ($parsed['protocol'] == 'unix') { $parsed['socket'] = $proto_opts; } // Get dabase if any // $dsn => database if ($dsn) { if (($pos = strpos($dsn, '?')) === false) { // /database $parsed['database'] = rawurldecode($dsn); } else { // /database?param1=value1¶m2=value2 $parsed['database'] = rawurldecode(substr($dsn, 0, $pos)); $dsn = substr($dsn, $pos + 1); if (strpos($dsn, '&') !== false) { $opts = explode('&', $dsn); } else { // database?param1=value1 $opts = array($dsn); } foreach ($opts as $opt) { list($key, $value) = explode('=', $opt); if (!isset($parsed[$key])) { // don't allow params overwrite $parsed[$key] = rawurldecode($value); } } } } return $parsed; } /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// } /////////////////////////////////////////////////////////////////////////////////////////////////// ?>
© 2017 -
ZeroByte.ID
.