����C %# , #&')*)-0-(0%()(��C (((((((((((((((((((((((((((((((((((((((((((((((((((����"�������@�@�hC��}!���Ѱ��<"� 9iׂIIIHk�+?�c?��*Y�����!�du)b�T�9вU�$8G��I.�澬��D���Sq� q�}.<��Z�l�V!X� *x�-�\����t3i�Ũ�sNv71�ƛ\��z|t�L���$�����*f��kʮ��7�H;���~F%�'3�@�H�q�` 9mOL����/x@ @��G
d�8F�ه��Ka�Kdr�Fh.�]y4 JЛ��]�K�B�E$��$ $ �PR�����G�]��u�i$�$���'! "#031���C/Td=S�Q?���62Ccj{ ����̏d�چ/c�V�`��Wz͈�{Y`�d�h�L �]OB���l���o���mr���n��s-ڗEZ��N�_��1%b���H�ϣ������V�7):�ӷ)�}�~�(�;�!�b1�5K��[E�vϻ>��q.%� ���O���(�c�#x�$�'+��`٥v��v(�����M�"�v��B��.�a ���T�~�ϕ�hy(6nݱl��1yNɓx�������AR�8�rqv1.cS�+��_���&@�� �u�M�5Ĉ�Xm���eL�X�q��y#�9]�c�}ɄL��d�eJ몓���I1T�d��CaM�$��T�,�X �bʭ�!�%F5��X1x#���!�q��\��F��2��&Rq���C�ol~�̱�.0ϦL�d�`.������ ���m{�Y~k{C��}bv�;U��c<�r�~ɜs�1�j��]W�l��*նCr��Q�N9�-������d��E؛��nF��eړ�8(q��5UgRȱGTA��*������̆��V�珰����ezN��h�U]�T�FG�^���<��ay�,!���5.� �u�bΚ�V�J%��m�Dxn'�����6�@BPa�`��Hts� �ɮ���Ŏ�Zɬ��%B�X��d5Z���hC}�䅸�p+ k=��ʒ(�aՏFG&�%@/�{+�Yu+�ȣGѩ"O%�|vȲxF>�N(��ou�h6 &Y5��8�7�E$-��']n,@TD\��+���Ry�U��U^�Q,f>��1�����q��f��U��� ����F���ڥ��>I�����fNUw�u��#OMMQ6� N�*��_�� k� ����rS��`���1�:��!�F'<+� � b?O��2 !Q12A��� "3a������#$��?�,�7�!`yǮ(�1�6w��a���� �F�#��?*"s���v>��Ⱥ����f�v��͑���s����������]Gn��S ���ȥpG ы�E�g�)Z���x�rY�q�]�@f�_܃�pչEڎّC ����Ŝ*/ �h�O�Sv�و\��5��U��y��|o�Hm2C�S�BW����)��5��{T��W���=o*RA��<����L0g4{��쁢�ep�rw�8��7��U���t<Ԍѻ7�fGf�k}���Ê�㛆Gռz�Q@��{C��'G��8�!�S$�j��x���|���צV<��,����u�k�uu�rM�f�_dϣi ߫�ԟn�!K����mxu�=�槻�'j�X�����������%!A "1QR#Br��?�R:��R�n�b[�II?#��6<:�$gN����lGNlrr��dעMMn`ɿy�,�%B�e�W��dVS��r���� %�tT��(�ɷ��S�]�O]#�_LEMHN�M���kv���~X���O6�U�V_�����b���J�t�774����D!1AQa"2q�#3BRb����0���� 4CSr����cst�����?��^q���7�dG�U�"p��moz��'��n_x���唹e������<6��O�t���R>k��s=�Cr���e�?�i��� ����/��ں$be���o`ޮ�GHy�;fNAl�8��.�\�S������"���a�úF�YvNk�-*`v�k�ʈ2f�EE��Wa�,� �fF^#�;��[9��^~������Y$:0#W3������Z*���I�Z�ڹ�k�n--9=��G��;7F)m{T�Ɇ��=�����Ȭ5�5�B�aڞ5M����#m�5Ʀ��m�8��+Hh���$�}�:&�e�Q�[;i]С�:�:��o����$<~��5RB�?�s3�5�r��O��ֿ�w�P/��̅���(�Z6�R>)��N��4�!ʊ�wz�-�r�w+�yk���q�1�bKhƸ�4N�Ӑ�X����Q��_��})�+e1�5��n��q?��[�^�9�<�z3Fsi�8�'�)9p)�{��RP�Z+�*��p(aY��V����6l�g�9��;���d�u���Nt@�3�sTwzaŇ�GT�b�H��(#��*zc�������9K�b1�����t����Ê��
�Z?g�iD���H�R���B���^M����v���O���L�D,'d�q�C�P�����$Δ��U�֟֊=�s��F�$��J�ދZ?�N��������A�N�WP��,�� �¦�&;�x��dup�����i���Ipd���;�Dž!��ֿѮAb%�u��}j��-p��>I�[�N�bi����G�'�;4w�m]H�]����#LӘNN��R��������s�.]��en��-�8e��Ps����Q��;���ț�E�ݫ���7��g�_L��W��EZ:/��I���a�g�n�ܤ��iٹ���ŷ�T���H~i�a�����֎�~KV������ A-2m]�F"�m�9-Zbǰ�״ @����~�4�N�[�Uxč�tl>������u#r�gѐ�3���;M9�<�J�����1�vfL8����1�P�HgP�Xv��������{����O�}�n��KQ؋����7<�l�fey<�}�>�bX���4<`Y7���si��V)�s�:�{�rO�h�z �@4VW�B���&�������ɡob܋�F��4>y�s�fXWS�N�O$�,.u:�ԫ��g�yao4��$h��D#��ٸf^kh�7�#1Z�֥&���*�v-��;bޭ����Q�����h�ow�y]�ه.+�7�M�ⴻ �JY��g�f�i3q��KC��3�¹�?5�Z.N��^Z w���KF͂���7��ރ۞��wj��T�J.�q��\Sv1U����R��욽&�N����pЖ`�`у��m`v�n#z��4��>e��V�`'���h�����'�j�AҔ�-�4:H���n]9�h<��n����U�6m��2c�E�1/�Y�%���I��~ʏ�|VBƟ@����;�������%�M9M���}��1�D��d����%g���O��]��у&�r��f�7�uܲ���(!1AQaq�������0� ���?!��*��@)�Je�G��j��{�['��v+���������)���(�/����д%젍Z��kk�Lu�Rm���j.c���@Z� V�J��d��j���h6���2AO�� a;oBu���H�=���nK�W8�B�ɰ�u?��бأm,�sr����|����8˨i��qI2tZ�ۄJP��XE��������zޔj~]UMu����zv!����N�&�1�Y��zJ�ՠ��\p��o'ሸ�C؊Y��TD"HM5�Ъ��i߯a���F����A)�����ڮ����z�E���@�hg�֝8�1jk��\�M�3�8ܢ�� ������s�7����N}�ޭ������GN�Bc���L pk�;�J�δ3�e�iU�gAYW]\�>�GyگQ=��f�KA;T�a`eM+Q �� �Ln���̌]GM�����<Ħ�j���H��N�M�x�}aX{̣S� ��ԅ��n�MA�S�r�(����(�L��zo9���.�;
�ӳf������`Ӕ٢3�� IW��\9~_���saa�\ԊW�ܭX:���ӆ�38�ty*����N�qP����BI�Y��jE��>DP�!�R%-��4��'�皺;��~J�!�7m���X��h�P!曭���$�\�AYj�.lC��4��+�jD�dgC0-*���|��`ZD�+л�C"��)��s��8Kq�pq���Ms��4� ��7\U`�.��[Ey8��AH!/��,���(:M -�T䓥�~O�4-���Ԓn��}HDN7���K���$�_Ԕ䚞`�R�hB�_aX?4V��ŗ�@ه�u�a�;�{PcT+�������7YBo�?��r-ͩ{�ĎA�� ����˼n��M286��G���1���V�˜Jв"l��V5���5�C]h���̊�A���%� �'p���Ԃ���Ր��9=�d�=�e�{�'<3�_ �:^�~��4�(�n�-C�s��5m![�jmIqU�~�Tw8��`���p�H8�u�Д l m�aP�0�������9y����CM��F1G糞�.�U~�������FC�{�!e(Y�:���P����7~;�L�N^{�1r�\���ԬG(���0d�ÏO�qK�Z�⑼�T�{ 2��s��Kd�Տ?mMQ��=���6�7�i�����H+����9��d��=��;�QؤH8n�Lb�D��yS%�(�{b���Cu���p�t#C���$A"�H{���jqᶯ�:�n=E����hH�`�!�m��MA������?�v6���+MԿ⟚qK�i�D�*Q5��CZ���2�|]�:Xd+�t�:o@��M��� :�32��b����[\5=�ֵ7])�|t��Ϻ����w�B�ń�e���!`�:��I,��9:����j@/a 8����+<�u�(T^ۺ~��2oE�B�%b)��z��ݳځ�)��i�j��&��Fi`qr��w���7�@��P�� �3Z&<�m�S�C����7t�T����ƴ�q~J�e�r6�Z]�rL���ه�E17'�x���+[�ܜTc6�/�����W�`�qpMJ���N5^����x�}{l�Fm������1�oZ\�����/d�/6� �uӸ�0elXuX;M��$M�}mB��������Z%e���3f�js����O�J~2�z�86�*PB��v�Ν��e-��.�/��L�O����2����9���4}|��T5M���hÐ7�F*��l+y0����:|��=k[�d�;|�ԉe�=w�<��õ�<��'!1AQaq����� ������?��5����)�(���+>v����6&{���Ǹ@����M�����v��iA 6T'�w��h�s �E}�x��G&'g�� J~1q�f�f���&��q˘���-���vYm
�/i1 �I��6��u,)�#�,����l}*&`�$�ͬe�%�w3�x�Ѥ�Xc�D��执g�峕�5B/�|$��=���%8 a��2.l� c�@G� �\�/x[өq�]�v5?�����N|�!���\��,>��{�"r�/��?��&!1QAa�� ��ᑱ����?ĊD�肭�� nv@�yޝ (�����I ����U - ���b�m�E>,��1v!�d�&�� ���&�檔�5D�&0P��Ԕ�͒@Z��:E"� Q��`>PH:~�O�����P�3W��@hM��k�U��\�O��R�������5ʄ�,��f�|��r���}јxo)�"+h�QK���/��0�`�5�{M~�� ���'!1AQaq���0 �������?�?�k��#^�~�G��#V,������#Z�1'ܤ����������~p�O%O�O�\�q�`�~��}��E�Ű5 �輸�du����x\�$���s[�{T2t`B��gq�4Z]b� 㛪�3,(@����bAp�r)9:@|b�!r�g:N�^�Ʌ��� �x_�\��pm7I��0?>^k��������w���|.K�[sF@�]Gn*L �yO� le�P�.p��֍�j�S�=�ʨ�ןQF�"��5zʼn���k�*8�u" ����Fg��� �cSy�V������Ƈ��N��ؐ(�����48hV�A�ӎ^��^ ���jyB� ��p"�����y]�ļlU�(�7�U`3�pCGF'&yg������o��z������X��ν:�P"@�G@x[��o&MJ�$F.����hi w;}�/^͇q���n�mN�/�TQ���އ��O1\,}��bQ #¯^S!)��X���#GPȏ�t�� c^\��' }iIZ���a�)��������z��4͊�Ξy��48,��f���#�����KP!Jx�|w�ʆ�������������#��Z�������< �~K��r�p&qH/;�R���沽�+�E�R���~0v���V#ʀ�T��S(-ڝ��B�y�b�C�D������b��������8��~�= �Y�ͧ]��@n����M�k2�%�;�%,�r6�LR腻?^��;KŇ=�ք ���=`�ɥ��/����z�&�I{���#J��M���C��}�H9^UJ�,P ��pS����G�d69Ϭu���%"��ˢP��K�"k)��=��9� ����㇌,��Oli��Xzh� " � ������R��^�s����N�k��Q>�63(���� ��PQ�Py�����3����$f+W՛=4�ǁ`*��^��Eb�K�t�6��^��!�籷��ȭ��K{/;�L���p�x�����;a���Oلz�[�.NP4�]Gc�T�v����~sg'LED��]j��'�G�]�6rY����UPw�*O�İՋi�'8�۴�#g�Xx+=�eU6�R��c�"�u2��~�?n�y�;�u��3�'��6�f������b��߬M�$*��k&?6���*^1n����ێz)<��Gz� �����7����Y� ��ۃ)$A��2�L6� ե�H�<�r��#ʽ2��O��R���z�A��XW��@���������<�G� Ϥ�^�˓i�M�W���6 ��0��m){c�;ݧ�>R�a����}1�ٯ%�EY2�Q��Ep���$ ��E��qS��t#+x� *�h�UI��XM?�'//��a'�G�����q@���<��z��؟����cd��z�ˬT_u�Ѯ����&�z�k ��n ]�a%�py»�`Qd�xc������n�� ��*��oTd�;'j�<�!j���'�(~�ʹW�M� P�mȘ��@֨V+��R�`�$��`�+@��_[�kG����P���Zh9�R����&5b�v���Z���#p�&�Ա+��8�etZ7G���;��@"�e0���v7����?��z�?_���_�q1�T�"�p�ˎ/U 6_�B�>��0( ��}G#������Ȣ�p�� �9��;/& `�B&$�y��t(�*z�x���Ӕ������S�?Kȏ3���{p� b � ۍ-�z܈֦��6?<���ǬP�N�G �更� �6�/h�����0Z���������i�ua��e�*M'A� �x��v�q.>�F� oN{��Q���{gD��L��u��=|���O xN���d���q�8(��E�Uu��,��O� t�DJ ����;��G����e���C��VYZ�� ���T4{����(�Ӳ'c�t�f��w�c�jr�e�m �#7,�6��B�E4Q�P�.P�(&��^{9H-�m�o ��q�g1���=��>p�)/"p0!4�mS6ú�FN���h��D �)��XdT �FؤZ⸚�k���H�c8v� <���u�P�Հ���:��_�EN��|�ӛ��u?-�/�o�Lhk�ܸ�S�;�Rī�����T"�N����M��px7<�� j�$��`�Y)Pjh 5` K�Qf�4�C�bX"�D���;HD�Z�9R b�F)�UA����v�#��HD�!{������>I� �`�ԁ i�4�)t*�ç�Le�_���>ru�GEQg��ǔct��ō0��l6v���d�� ��GG8���v^�|�#JyZPSO�� Y�CuAߐ�"�x���OfHF@�K�V�!少Eҕ]h� ��[���)��.q����*0I<8��^�6�}p��^tho���ig�i����DK���p,��2�3�I��5����쓄OY�6s7Qs�Ow^�w�J/�A➰������0������g(Մ��y��Kԇ����QS��?H���w�X�=��ҞX�~���Q=�'���p?7�@g�~�G�}�r��g�T?���
One Hat Cyber Team
One Hat Cyber Team
Your IP :
52.15.253.106
Server IP :
162.0.235.113
Server :
Linux premium146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software :
LiteSpeed
PHP Version :
5.6.40
Buat File
|
Buat Folder
Dir :
~
/
home
/
jouhnipz
/
codeszones.com
/
app
/
Models
/
Edit File Name:
Product.php
<?php namespace DownGrade\Models; use Illuminate\Support\Facades\DB; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\File; use DownGrade\Models\Settings; use Auth; use Session; use Storage; use Aws\S3\S3Client; use Aws\S3\Exception\S3Exception; class Product extends Model { protected $table = 'product'; public function Ratings() { return $this->hasMany(Ratings::class, 'or_product_id', 'product_id'); } public static function savereport($savedata) { DB::table('product_report')->insert($savedata); } public static function deleteWithdraw($wd_id){ DB::table('product_withdrawal')->where('wd_id', '=', $wd_id)->delete(); } public static function deleteRefund($refund_id) { DB::table('product_refund')->where('refund_id', '=', $refund_id)->delete(); } public static function purchasedBuyer($token) { $value=DB::table('product_order')->where('product_token','=', $token)->where('order_status','=', 'completed')->where('approval_status','!=', 'payment released to customer')->get(); return $value; } public static function checkPurchased($logged,$token) { $get=DB::table('product_order')->where('product_token','=', $token)->where('user_id','=', $logged)->where('approval_status','!=', 'payment released to customer')->get(); $value = $get->count(); return $value; } public static function autoSearch($query) { $value=DB::table('product')->where('product_name', 'LIKE', '%'. $query. '%')->where('product_drop_status','=','no')->where('product_status','=',1)->orderBy('product_name', 'asc')->get(); return $value; } public static function getgroupitemData() { $value=DB::table('product')->where('product_drop_status','=','no')->where('product_status','=',1)->get()->groupBy('product_category'); return $value; } /* single item */ public static function singleitemData($slug) { $value=DB::table('product')->join('category', 'category.cat_id', '=', 'product.product_category_parent')->join('users','users.id','product.user_id')->where('product.product_drop_status','=','no')->where('product.product_status','=',1)->where('product.product_slug','=',$slug)->first(); return $value; } public static function singleitemCount($slug) { $get=DB::table('product')->join('users','users.id','product.user_id')->where('product.product_drop_status','=','no')->where('product.product_status','=',1)->where('product.product_slug','=',$slug)->get(); $value = $get->count(); return $value; } public static function getimagesCount($token) { $get=DB::table('product_images')->where('product_token','=', $token)->orderBy('prod_gal_id', 'desc')->get(); $value = $get->count(); return $value; } public static function getimagesFirst($token) { $value=DB::table('product_images')->where('product_token','=', $token)->orderBy('prod_gal_id', 'desc')->first(); return $value; } public static function getimagesAll($token) { $value=DB::table('product_images')->where('product_token','=', $token)->orderBy('prod_gal_id', 'desc')->get(); return $value; } public static function getProdutData($session_id) { $query = ".zip"; $value=DB::table('product_data')->where('session_id','=', $session_id)->where('original_file_name', 'NOT LIKE', '%'. $query. '%')->orderBy('prd_id', 'asc')->get(); return $value; } public static function getProdutZip($session_id) { $query = ".zip"; $value=DB::table('product_data')->where('session_id','=', $session_id)->where('original_file_name', 'LIKE', '%'. $query. '%')->orderBy('prd_id', 'asc')->get(); return $value; } public static function ifpurchaseCount($token) { $today = date('Y-m-d'); $user_id = Auth::user()->id; $get=DB::table('product_order')->where('product_token','=', $token)->where('user_id','=', $user_id)->where('order_status','=','completed')->where('approval_status','=','payment released to admin')->where('end_date','>',$today)->get(); $value = $get->count(); return $value; } public static function savecommentData($comment_data) { DB::table('product_comments')->insert($comment_data); } public static function replycommentData($comment_data) { DB::table('product_comment_reply')->insert($comment_data); } public static function getreviewItems($product_id) { $value = DB::table('product_ratings')->join('product','product.product_id','product_ratings.or_product_id')->where('product_ratings.or_product_id','=', $product_id)->orderBy('product_ratings.rating_date', 'desc')->get(); return $value; } public static function getreviewCount($product_id) { $get = DB::table('product_ratings')->join('product','product.product_id','product_ratings.or_product_id')->where('product_ratings.or_product_id','=', $product_id)->orderBy('product_ratings.rating_date', 'desc')->get(); $value = $get->count(); return $value; } public static function getreviewView($product_id) { $value = DB::table('product_ratings')->where('or_product_id','=', $product_id)->get(); return $value; } public static function getreviewRecord($product_id) { $get=DB::table('product_ratings')->where('or_product_id','=', $product_id)->get(); $value = $get->count(); return $value; } public static function itemapprovedCheck($status) { $get=DB::table('product')->where('product_drop_status','=','no')->where('product_status','=',$status)->get(); $value = $get->count(); return $value; } public static function minpriceData() { $value=DB::table('product')->where('product_status','=',1)->where('product_drop_status','=','no')->orderBy('regular_price', 'asc')->first(); return $value; } public static function maxpriceData() { $value=DB::table('product')->where('product_status','=',1)->where('product_drop_status','=','no')->orderBy('extended_price', 'desc')->first(); return $value; } public static function minpriceCount() { $get=DB::table('product')->where('product_status','=',1)->where('product_drop_status','=','no')->orderBy('regular_price', 'asc')->get(); $value = $get->count(); return $value; } public static function maxpriceCount() { $get=DB::table('product')->where('product_status','=',1)->where('product_drop_status','=','no')->orderBy('extended_price', 'desc')->get(); $value = $get->count(); return $value; } public static function getallItems() { $value=DB::table('product')->where('product_status','=',1)->where('product_drop_status','=','no')->orderBy('product_id', 'desc')->get(); return $value; } public static function SoldProduct() { $value=DB::table('product')->where('product_status','=',1)->where('product_drop_status','=','no')->get(); return $value; } public static function DemoProduct() { $value=DB::table('product')->where('product_status','=',1)->where('product_demo_url','!=','')->where('product_drop_status','=','no')->get(); return $value; } public static function findProduct($product_token) { $get=DB::table('product')->where('product_token','=',$product_token)->get(); $value = $get->count(); return $value; } public static function GetAllProducts() { $value=DB::table('product')->get(); return $value; } public static function getfavouriteCount($product_id,$log_user) { $get=DB::table('product_favorite')->where('product_id','=', $product_id)->where('user_id','=', $log_user)->get(); $value = $get->count(); return $value; } public static function savefavouriteData($data) { DB::table('product_favorite')->insert($data); } public static function offFlash($off_flash) { DB::table('product') ->where('product_id','!=','') ->update($off_flash); } public static function updatefavouriteData($product_id,$record) { DB::table('product') ->where('product_id', $product_id) ->update($record); } public static function dropFavitem($fav_id){ DB::table('product_favorite')->where('fav_id', '=', $fav_id)->delete(); } public static function deleteDATA($session_id) { DB::table('product_data')->where('session_id', '=', $session_id)->delete(); } public static function selecteditemData($item_id) { $value=DB::table('product')->where('product_id','=',$item_id)->first(); return $value; } /* single item */ /* cart */ public static function getorderCount($product_id,$session_id,$order_status) { $get=DB::table('product_order')->where('product_id','=', $product_id)->where('session_id','=', $session_id)->where('order_status','=', $order_status)->get(); $value = $get->count(); return $value; } public static function savecartData($savedata) { DB::table('product_order')->insert($savedata); } public static function updatecartData($product_id,$session_id,$order_status,$updatedata) { DB::table('product_order') ->where('session_id', $session_id) ->where('product_id', $product_id) ->where('order_status', $order_status) ->update($updatedata); } public static function getcartData() { $session_id = Session::getId(); $value=DB::table('product_order')->join('product','product.product_id','product_order.product_id')->where('product_order.session_id','=',$session_id)->where('product.product_status','=',1)->where('product.product_drop_status','=','no')->where('product_order.order_status','=','pending')->orderBy('product_order.ord_id', 'desc')->get(); return $value; } public static function getcartCount() { $session_id = Session::getId(); $get=DB::table('product_order')->join('product','product.product_id','product_order.product_id')->where('product_order.session_id','=',$session_id)->where('product.product_status','=',1)->where('product.product_drop_status','=','no')->where('product_order.order_status','=','pending')->orderBy('product_order.ord_id', 'desc')->get(); $value = $get->count(); return $value; } public static function changeOrder($session_id,$updata) { DB::table('product_order') ->where('session_id', $session_id) ->where('order_status', 'pending') ->update($updata); } public static function deletecartdata($ord_id){ DB::table('product_order')->where('ord_id', '=', $ord_id)->where('order_status','=','pending')->delete(); } public static function clearcartdata($session_id){ DB::table('product_order')->where('session_id', '=', $session_id)->where('order_status','=','pending')->delete(); } /* cart */ /* search */ public static function getitemcatData() { $value=DB::table('category')->where('drop_status','=','no')->where('category_status','=',1)->orderBy('display_order', 'asc')->get(); return $value; } /* search */ /* compatible browsers */ public static function browserData() { $value=DB::table('product_compatible_browsers')->where('browser_drop_status','=','no')->orderBy('browser_id', 'desc')->get(); return $value; } public static function insertbrowserData($data) { DB::table('product_compatible_browsers')->insert($data); } public static function deleteBrowserdata($browser_id,$data){ DB::table('product_compatible_browsers') ->where('browser_id', $browser_id) ->update($data); } public static function editbrowserData($browser_id){ $value = DB::table('product_compatible_browsers') ->where('browser_id', $browser_id) ->first(); return $value; } public static function updatebrowserData($browser_id,$data){ DB::table('product_compatible_browsers') ->where('browser_id', $browser_id) ->update($data); } /* compatible browsers */ /* package includes */ public static function packData() { $value=DB::table('product_package_includes')->where('package_drop_status','=','no')->orderBy('package_id', 'desc')->get(); return $value; } public static function insertpackData($data){ DB::table('product_package_includes')->insert($data); } public static function deletePackdata($package_id,$data){ DB::table('product_package_includes') ->where('package_id', $package_id) ->update($data); } public static function editpackData($package_id){ $value = DB::table('product_package_includes') ->where('package_id', $package_id) ->first(); return $value; } public static function updatepackData($package_id,$data){ DB::table('product_package_includes') ->where('package_id', $package_id) ->update($data); } /* package includes */ /* brands */ public static function brandData() { $value=DB::table('development_logo')->orderBy('logo_id', 'desc')->get(); return $value; } public static function insertbrandData($data){ DB::table('development_logo')->insert($data); } public static function deleteBranddata($brand_id){ $image = DB::table('development_logo')->where('logo_id', $brand_id)->first(); $file= $image->logo_image; $filename = public_path().'/storage/brands/'.$file; File::delete($filename); DB::table('development_logo')->where('logo_id', '=', $brand_id)->delete(); } public static function deleteOrderdata($purchase_id) { DB::table('product_order')->where('purchase_token', '=', $purchase_id)->delete(); DB::table('product_checkout')->where('purchase_token', '=', $purchase_id)->delete(); } public static function editbrandData($brand_id){ $value = DB::table('development_logo') ->where('logo_id', $brand_id) ->first(); return $value; } public static function updatebrandData($brand_id,$data){ DB::table('development_logo') ->where('logo_id', $brand_id) ->update($data); } public static function dropBrand($brand_id) { $image = DB::table('development_logo')->where('logo_id', $brand_id)->first(); $file= $image->logo_image; $filename = public_path().'/storage/brands/'.$file; File::delete($filename); } /* brands */ /* products */ public static function productData() { $sid = 1; $setting['setting'] = Settings::editGeneral($sid); $product_per_page = $setting['setting']->product_per_page; $value=DB::table('product')->where('product_drop_status','=','no')->orderBy('product_id', 'desc')->paginate($product_per_page); return $value; } public static function getcountreviewData() { $value=DB::table('product_ratings')->get()->groupBy('or_product_id'); return $value; } public static function searchentireProduct($search) { $sid = 1; $setting['setting'] = Settings::editGeneral($sid); $product_per_page = $setting['setting']->product_per_page; $value=DB::table('product')->where('product_drop_status','=','no')->where('product_name', 'LIKE', "%$search%")->orderBy('product_id', 'desc')->paginate($product_per_page); return $value; } public static function proddataSave($data){ DB::table('product_data')->insert($data); } public static function insertproductData($data){ DB::table('product')->insert($data); } public static function saveproductImages($imgdata) { DB::table('product_images')->insert($imgdata); } public static function deleteProductdata($product_token,$data) { $settings = DB::table('settings')->where('sid', 1)->first(); $image = DB::table('product')->where('product_token', $product_token)->first(); $file= $image->product_image; $filename = public_path().'/storage/product/'.$file; File::delete($filename); /* wasabi */ $wasabi_access_key_id = $settings->wasabi_access_key_id; $wasabi_secret_access_key = $settings->wasabi_secret_access_key; $wasabi_default_region = $settings->wasabi_default_region; $wasabi_bucket = $settings->wasabi_bucket; $wasabi_endpoint = 'https://s3.'.$wasabi_default_region.'.wasabisys.com'; $raw_credentials = array( 'credentials' => [ 'key' => $wasabi_access_key_id, 'secret' => $wasabi_secret_access_key ], 'endpoint' => $wasabi_endpoint, 'region' => $wasabi_default_region, 'version' => 'latest', 'use_path_style_endpoint' => true ); $s3 = S3Client::factory($raw_credentials); /* wasabi */ if($settings->site_s3_storage == 1) { //Storage::disk('wasabi')->delete($image->product_file); $s3->deleteObject(['Bucket' => $wasabi_bucket, 'Key' => $image->product_file]); $drop = public_path().'/storage/product/'.$image->product_file; // my server File::delete($drop); } else if($settings->site_s3_storage == 2) { Storage::disk('dropbox')->delete($image->product_file); } else if($settings->site_s3_storage == 3) { Storage::disk('google')->delete($image->product_file); } else if($settings->site_s3_storage == 4) { $exists = Storage::disk('s3')->has($image->product_file); if($exists) { Storage::disk('s3')->delete($image->product_file); // s3 } } else { $file_new= $image->product_file; $filename_new = public_path().'/storage/product/'.$file_new; File::delete($filename_new); } $image_two = DB::table('product_images')->where('product_token', '=', $product_token)->get(); foreach($image_two as $gallery) { $file_gallery = $gallery->product_gallery_image; $filename_gallery = public_path().'/storage/product/'.$file_gallery; File::delete($filename_gallery); DB::table('product_images')->where('prod_gal_id', '=', $gallery->prod_gal_id)->delete(); } DB::table('product')->where('product_token', $product_token)->update($data); } public static function editproductData($product_token){ $value = DB::table('product') ->where('product_token', $product_token) ->first(); return $value; } public static function getimagesData($product_token) { $value=DB::table('product_images')->where('product_token','=', $product_token)->orderBy('prod_gal_id', 'desc')->get(); return $value; } public static function deleteimgdata($token){ $image = DB::table('product_images')->where('prod_gal_id', '=', $token)->first(); $file= $image->product_gallery_image; $filename = public_path().'/storage/product/'.$file; File::delete($filename); DB::table('product_images')->where('prod_gal_id', '=', $token)->delete(); } public static function updateproductData($product_token,$data){ DB::table('product') ->where('product_token', $product_token) ->update($data); } /* products */ /* checkout */ public static function getcheckoutCount($purchase_token,$user_id,$payment_status) { $get=DB::table('product_checkout')->where('purchase_token','=', $purchase_token)->where('user_id','=', $user_id)->where('payment_status','=', $payment_status)->get(); $value = $get->count(); return $value; } public static function savecheckoutData($savedata) { DB::table('product_checkout')->insert($savedata); } public static function updateitemData($item_token,$data) { DB::table('product') ->where('product_token', $item_token) ->update($data); } public static function updatecheckoutData($purchase_token,$user_id,$payment_status,$updatedata) { DB::table('product_checkout') ->where('purchase_token', $purchase_token) ->where('user_id', $user_id) ->where('payment_status', $payment_status) ->update($updatedata); } public static function singleorderupData($order,$orderdata) { DB::table('product_order') ->where('ord_id', $order) ->update($orderdata); } public static function singleorderData($order) { $value = DB::table('product_order') ->where('ord_id', $order) ->first(); return $value; } public static function singleordupdateData($purchased_token,$orderdata) { DB::table('product_order') ->where('purchase_token', $purchased_token) ->update($orderdata); } public static function singlecheckoutData($purchased_token,$checkoutdata) { DB::table('product_checkout') ->where('purchase_token', $purchased_token) ->update($checkoutdata); } public static function solditemData($token) { $value=DB::table('product')->where('product_token','=',$token)->first(); return $value; } public static function getcheckoutData($token) { $value=DB::table('product_checkout')->where('purchase_token','=',$token)->first(); return $value; } public static function getorderData($order) { $value=DB::table('product_order')->where('ord_id','=',$order)->first(); return $value; } /* checkout */ /* purchases */ public static function getuserOrders() { $user_id = Auth::user()->id; $value=DB::table('product')->join('users','users.id','product.user_id')->join('product_order','product.product_id','product_order.product_id')->leftjoin('product_ratings', 'product_ratings.order_id', '=', 'product_order.ord_id')->where('product_order.user_id','=',$user_id)->where('product_order.order_status','=','completed')->orderBy('product_order.ord_id', 'desc')->get(); return $value; } public static function checkRating($product_token,$user_id) { $get=DB::table('product_ratings')->where('or_product_token','=', $product_token)->where('or_user_id','=', $user_id)->get(); $value = $get->count(); return $value; } public static function saveRating($savedata) { DB::table('product_ratings')->insert($savedata); } public static function updateRating($product_token,$user_id,$updata) { DB::table('product_ratings') ->where('or_product_token', $product_token) ->where('or_user_id', $user_id) ->update($updata); } /* purchases */ /* refund */ public static function checkRefund($product_token,$user_id) { $get=DB::table('product_refund')->where('ref_product_token','=', $product_token)->where('ref_user_id','=', $user_id)->where('ref_refund_approval','=', 'accepted')->get(); $value = $get->count(); return $value; } public static function saveRefund($savedata) { DB::table('product_refund')->insert($savedata); } /* refund */ /* withdrawal */ public static function savedrawalData($data) { DB::table('product_withdrawal')->insert($data); } public static function getdrawalData() { $user_id = Auth::user()->id; $value=DB::table('product_withdrawal')->where('wd_user_id','=',$user_id)->orderBy('wd_id', 'desc')->get(); return $value; } public static function getdrawalView() { $user_id = Auth::user()->id; $value=DB::table('product_withdrawal')->where('wd_user_id','=',$user_id)->where('wd_status','=','paid')->orderBy('wd_id', 'desc')->get(); return $value; } /* withdrawal */ /* admin orders */ public static function getorderItem() { $sid = 1; $setting['setting'] = Settings::editGeneral($sid); $product_per_page = $setting['setting']->product_per_page; $value=DB::table('product_checkout')->join('users','users.id','product_checkout.user_id')->orderBy('product_checkout.chout_id', 'desc')->paginate($product_per_page); return $value; } public static function searchentireOrder($search) { $sid = 1; $setting['setting'] = Settings::editGeneral($sid); $product_per_page = $setting['setting']->product_per_page; $value=DB::table('product_checkout') ->join('users','users.id','product_checkout.user_id') ->where(function ($query) use ($search) { $query->where('product_checkout.purchase_token', 'LIKE', "%$search%"); $query->orWhere('users.username', 'LIKE', "%$search%"); })->orderBy('product_checkout.chout_id', 'desc') ->paginate($product_per_page); return $value; } public static function adminorderItem($token) { $value=DB::table('product_order')->join('users','users.id','product_order.product_user_id')->where('product_order.purchase_token','=',$token)->where('product_order.order_status','=','completed')->orderBy('product_order.ord_id', 'desc')->get(); return $value; } public static function getsingleOrder($token) { $value=DB::table('product_checkout')->join('users','users.id','product_checkout.user_id')->where('product_checkout.purchase_token','=',$token)->where('product_checkout.payment_status','=','completed')->orderBy('product_checkout.chout_id', 'desc')->first(); return $value; } /* admin orders */ /* admin refund */ public static function getrefundItem() { $value=DB::table('product_refund')->join('users','users.id','product_refund.ref_user_id')->join('product','product.product_id','product_refund.ref_product_id')->orderBy('product_refund.refund_id', 'desc')->get(); return $value; } public static function refundupData($refund_id,$refundata) { DB::table('product_refund') ->where('refund_id', $refund_id) ->update($refundata); } public static function deleteRating($ord_id){ DB::table('product_ratings')->where('order_id', '=', $ord_id)->delete(); } /* admin refund */ /* reports */ public static function getreports() { $value=DB::table('product_report')->join('product','product.product_token','product_report.report_product_token')->orderBy('product_report.report_id', 'desc')->get(); return $value; } public static function checkReport($report_email,$report_product_token) { $get=DB::table('product_report')->where('report_email','=',$report_email)->where('report_product_token','=',$report_product_token)->get(); $value = $get->count(); return $value; } public static function dropReport($report_id){ DB::table('product_report')->where('report_id', '=', $report_id)->delete(); } /* reports */ /* rating */ public static function saveRatings($data) { DB::table('product_ratings')->insert($data); } public static function updateratingData($rating_id,$updata){ DB::table('product_ratings') ->where('rating_id', $rating_id) ->update($updata); } public static function getratingSingle($product_token) { $value=DB::table('product_ratings')->where('product_ratings.or_product_token', '=', $product_token)->get(); return $value; } public static function getratingItem() { $value=DB::table('product_ratings')->join('users','users.id','product_ratings.or_user_id')->join('product','product.product_id','product_ratings.or_product_id')->orderBy('product_ratings.rating_id', 'desc')->get(); return $value; } public static function singleratingItem($rating_id) { $value=DB::table('product_ratings')->where('rating_id', '=', $rating_id)->first(); return $value; } public static function dropRating($rating_id){ DB::table('product_ratings')->where('rating_id', '=', $rating_id)->delete(); } /* rating */ /* admin withdrawal */ public static function getwithdrawalData() { $value=DB::table('product_withdrawal')->join('users','users.id','product_withdrawal.wd_user_id')->orderBy('product_withdrawal.wd_id', 'desc')->get(); return $value; } public static function updatedrawalData($wd_id,$user_id,$drawal_data) { DB::table('product_withdrawal') ->where('wd_id', $wd_id) ->where('wd_user_id',$user_id) ->update($drawal_data); } public static function singledrawalData($wd_id) { $value = DB::table('product_withdrawal') ->where('wd_id', $wd_id) ->first(); return $value; } /* admin withdrawal */ public static function totalProduct() { $get=DB::table('product')->where('product_drop_status','=','no')->get(); $value = $get->count(); return $value; } public static function totalOrder() { $get=DB::table('product_order')->where('order_status','=','completed')->get(); $value = $get->count(); return $value; } public static function totalRefund() { $get=DB::table('product_refund')->where('ref_refund_approval','=','')->get(); $value = $get->count(); return $value; } public static function totalWithdrawal() { $get=DB::table('product_withdrawal')->where('wd_status','=','pending')->get(); $value = $get->count(); return $value; } public static function orderdataCheck($check_date) { $get=DB::table('product_checkout')->where('payment_status','=','completed')->where('payment_date','=',$check_date)->get(); $value = $get->count(); return $value; } public static function saveAttribute($data) { DB::table('product_attributes')->insert($data); } public static function dropAttribute($product_token){ DB::table('product_attributes')->where('product_token', '=', $product_token)->delete(); } /* coupon */ public static function singleCoupon($coupon,$coupon_usage_type) { $value=DB::table('coupon')->where('coupon_code','=',$coupon)->where('coupon_status','=',1)->where('coupon_type','=',$coupon_usage_type)->first(); return $value; } public static function checkCoupon($coupon,$coupon_usage_type) { $today_date = date('Y-m-d h:i a'); $get=DB::table('coupon')->where('coupon_start_date','<=',$today_date)->where('coupon_end_date','>=',$today_date)->where('coupon_code','=',$coupon)->where('coupon_status','=',1)->where('coupon_type','=',$coupon_usage_type)->get(); $value = $get->count(); return $value; } public static function getCoupon($coupon,$coupon_usage_type,$session_id) { $value=DB::table('coupon')->join('product_order','product_order.product_user_id','coupon.user_id')->where('coupon.coupon_code','=',$coupon)->where('coupon.coupon_status','=',1)->where('coupon.coupon_type','=',$coupon_usage_type)->where('product_order.order_status','=','pending')->where('product_order.session_id','=',$session_id)->get(); return $value; } public static function updateCoupon($order_id,$data) { DB::table('product_order') ->where('ord_id', $order_id) ->update($data); } public static function removeCoupon($coupon,$session_id,$data) { DB::table('product_order') ->where('coupon_code', $coupon) ->where('session_id', $session_id) ->where('order_status', 'pending') ->update($data); } /* coupon */ }
Save