SELECT COUNT(ld_id) FROM `bv_crm_leads` WHERE `ld_delete` = 0 if ( empty($employees) == false ) { foreach ( $employees as $key => $row ) { $key++; $button = $row->us_status ? "bg-success" : "bg-danger"; $userStatus = $row->us_status ? 0 : 1 ; $statusClass = $row->us_status ? "fa-user" : "fa-user-slash" ; if ( in_array($userLevel, [ '2','3']) ) { $userName = ''; $performance = ''; } $result[] = [ 'key' => $key, 'Code' => $row->us_code, 'Name' => $userName, 'Email' => $row->us_email, 'Mobile' => $row->us_phone, 'Country' => country( $row->us_country ), 'Leads' => $row->lead_count , 'Conversion' => $row->conversion_count, 'Period' => target_period( $row->us_period ), 'Achieved' => $achieved[$key - 1], 'Target' => $row->us_target, 'Success_rate' => $average[$key - 1], 'Updated_At' => date('Y-m-d h:i A', strtotime($row->us_updated_at)), 'Actions' => 'us_id).'" class="btn btn-app-update1 bg-warning" title="View / Edit"> / '. ' '. ' ', 'Performance' => $performance ]; } } function filterTopEmployees() { if($('table#example1').length) { $.ajax({ 'url': SITEURL + 'users/top_employees_search', 'method': 'POST', 'data': $('form#top-employee-search').serialize(), 'dataType': 'json', /*'beforeSend': function() { if ( $('div.blockUI').length == 0 ) { $.blockUI({ message : '' }); } }*/ }).done( function( response ) { $('table#example1').dataTable().fnDestroy(); if ( response.userId == '1' ) { if ( response.user_level == '2' ) { console.log(response.result); $('table#example1').dataTable({ "ordering": true, "autoWidth": false, "responsive" : true, "aaData": response.result, "columns": [ { response.result: "key" }, { response.result: "Code" }, { response.result: "Name" }, { response.result: "Email" }, { response.result: "Mobile" }, { response.result: "Country" }, { response.result: "Leads" }, { response.result: "Conversion" }, { response.result: "Period" }, { response.result: "Achieved" }, { response.result: "Target" }, { response.result: "Success_rate" }, { response.result: "Updated_At" }, { response.result: "Actions" }, { response.result: "Performance" } ] }); } else if ( response.user_level == '3' ) { $('table#example1').dataTable({ "ordering": true, "autoWidth": false, "responsive" : true, "aaData": response.result, "columns": [ { "response.result": "key" }, { "response.result": "Code" }, { "response.result": "Name" }, { "response.result": "Email" }, { "response.result": "Mobile" }, { "response.result": "Country" }, { "response.result": "Leads" }, { "response.result": "Conversion" }, { "response.result": "Period" }, { "response.result": "Achieved" }, { "response.result": "Target" }, { "response.result": "Updated_At" }, { "response.result": "Actions" }, { "response.result": "Performance" } ] }); } } else { if ( response.user_level == 2 ) { $('table#example1').dataTable({ "ordering": true, "autoWidth": false, "responsive" : true, "aaData": response.result, "columns": [ { "response.result": "key" }, { "response.result": "Code" }, { "response.result": "Name" }, { "response.result": "Email" }, { "response.result": "Mobile" }, { "response.result": "Country" }, { "response.result": "Leads" }, { "response.result": "Conversion" }, { "response.result": "Period" }, { "response.result": "Achieved" }, { "response.result": "Target" }, { "response.result": "Success_rate" }, { "response.result": "Updated_At" }, { "response.result": "Performance" } ] }); } else if ( response.user_level == 3 ) { $('table#example1').dataTable({ "ordering": true, "autoWidth": false, "responsive" : true, "aaData": response.result, "columns": [ { "response.result": "key" }, { "response.result": "Code" }, { "response.result": "Name" }, { "response.result": "Email" }, { "response.result": "Mobile" }, { "response.result": "Country" }, { "response.result": "Leads" }, { "response.result": "Conversion" }, { "response.result": "Period" }, { "response.result": "Achieved" }, { "response.result": "Target" }, { "response.result": "Updated_At" }, { "response.result": "Performance" } ] }); } } /*$.unblockUI();*/ }); } } function highLevel( $year = '' , $startMonth = '' , $endMonth = '' ) { $this->data = array(); $this->data['notification'] = $notification = $this->model->fetchNotificationByUserLevel(); $this->data['clients'] = $clients = $this->model->fetchClients(true); $this->data['totalBranches'] = $totalBranches = $this->model->fetchBranches('totalBranch'); $this->data['totalUsers'] = $totalUsers = $this->model->fetchUser(); $this->data['activeUsers'] = $this->model->fetchUser('active'); $this->data['inActiveUsers'] = $this->model->fetchUser('inactive'); $this->data['totalLeadsGenerated'] = $leadsCount = $this->model->fetchLeadCount(); $this->data['salesManager'] = $this->model->fetchUserByLevel('3'); $this->data['successUnitManager'] = $this->model->fetchUserByLevel('5'); $this->data['relationshipUnitManager'] = $this->model->fetchUserByLevel('7'); $this->data['successManagers'] = $this->model->fetchUserByLevel('6'); $this->data['relationshipManagerCount'] = $this->model->fetchUserByLevel('8'); $this->data['financeManager'] = $this->model->fetchUserByLevel('4'); $this->data['leadGenerators'] = $this->model->fetchUserByLevel('2'); /*Donut Diagram Service*/ $study = $this->model->fetchServices( $year, 1, $startMonth, $endMonth ); $medical = $this->model->fetchServices( $year, 2, $startMonth, $endMonth ); $immigration = $this->model->fetchServices( $year, 3, $startMonth, $endMonth ); $tour = $this->model->fetchServices( $year, 4, $startMonth, $endMonth ); $services = array($study, $medical, $immigration, $tour); $this->data['servicesCount'] = $servicesCount = json_encode($services); /*Donut Diagram Service*/ $study = $this->model->fetchServices( $year, 1, $startMonth, $endMonth ); $medical = $this->model->fetchServices( $year, 2, $startMonth, $endMonth ); $immigration = $this->model->fetchServices( $year, 3, $startMonth, $endMonth ); $tour = $this->model->fetchServices( $year, 4, $startMonth, $endMonth ); $services = array($study, $medical, $immigration, $tour); $this->data['servicesCount'] = $servicesCount = json_encode($services); /*Progress Diagram Leads */ $this->data['totalLeads'] = $totalLeads = $this->model->fetchLeads( $year,false, $startMonth, $endMonth ); $this->data['leadTotalAverage'] = $this->getPercentage($totalLeads, $totalLeads); /*Leads Won*/ $this->data['leadsWon'] = $leadsWon = $this->model->fetchLeads( $year,4, $startMonth, $endMonth ); $this->data['leadWonAverage'] = $this->getPercentage($totalLeads, $leadsWon); /*Leads Lost*/ $this->data['leadsLost'] = $leadsLost = $this->model->fetchLeads( $year,5, $startMonth, $endMonth ); $this->data['leadLostAverage'] = $this->getPercentage($totalLeads, $leadsLost); /*Leads Pending*/ $this->data['leadsPending'] = $leadsPending = $this->model->fetchLeads( $year,1, $startMonth, $endMonth ); $this->data['leadPendingAverage'] = $this->getPercentage($totalLeads, $leadsPending); /*Leads Contacted*/ $this->data['leadsContacted'] = $leadsContacted = $this->model->fetchLeads( $year,2, $startMonth, $endMonth ); $this->data['leadContactedAverage'] = $this->getPercentage($totalLeads, $leadsContacted); /*invoice*/ $this->data['leadsInvoiced'] = $leadsInvoiced = $this->model->fetchLeads( $year,3, $startMonth, $endMonth ); $this->data['averageInvoice'] = $averageInvoice = $this->getPercentage($totalLeads, $leadsInvoiced); /*Services Bar diagram*/ for ( $i = 01 ;$i <= 12 ;$i++ ) { $studyServices[] = $this->model->fetchServicesByDate( $year.'-'.$i, 1 ); $medicalServices[] = $this->model->fetchServicesByDate( $year.'-'.$i, 2 ); $immigrationServices[] = $this->model->fetchServicesByDate( $year.'-'.$i, 3 ); $tourServices[] = $this->model->fetchServicesByDate( $year.'-'.$i, 4 ); } $this->data['studyServices'] = json_encode($studyServices); $this->data['medicalServices'] = json_encode($medicalServices); $this->data['immigrationServices'] = json_encode($immigrationServices); $this->data['tourServices'] = json_encode($tourServices); /*Bar Diagram Leads*/ $barChartDetails = $this->barChart( $year ); $this->data['leadTotal'] = $barChartDetails['leadTotal']; $this->data['leadWon'] = $barChartDetails['leadWon']; $this->data['leadWonValue'] = $barChartDetails['leadWonValue']; $this->data['leadWonDifference'] = $barChartDetails['leadWonDifference']; /*Line graph Lead value */ for ($i = 01;$i <= 12;$i++) { $month = sprintf("%02d", $i); $leadsWonValue[] = $this->model->fetchLeadValueByMonth($year . '-' . $month, $par2 = 'won'); $leadsTotalValue[] = $this->model->fetchLeadValueByMonth($year . '-' . $month, $par2 = 'total'); } /*Jquery Knob*/ $this->data['pendingLeads'] = $pendingLeads = $this->model->fetchLeadCount($par1 = 'pending'); $this->data['attendingLeads'] = $attendingLeads = $this->model->fetchLeadCount($par1 = 'attending'); $this->data['leadsTotal'] = $this->model->fetchLeadCount(); $this->data['leadsWonValue'] = json_encode($leadsWonValue); $this->data['leadsTotalValue'] = json_encode($leadsTotalValue); return $this->data; } function changeLineValueChart($year = '') { $response = array(); if ($_SERVER['REQUEST_METHOD'] === 'POST') { $year = $_POST['year']; for ( $i = 01; $i <= 12; $i++ ) { $month = sprintf("%02d", $i); $leadsWonValue[] = $this->model->fetchLeadValueByMonth($year . '-' . $month, 'won'); $leadsTotalValue[] = $this->model->fetchLeadValueByMonth($year . '-' . $month, 'total'); } $leadWon = $leadsWonValue; $leadTotal = $leadsTotalValue; $response = ['status' => '200', 'leadTotal' => $leadTotal, 'leadWon' => $leadWon ]; } echo json_encode($response); } دراسة مرحبًا بك في بيتك للدراسة ينسق سلسلة / ملف HTML بمستوى المسافة البادئة المطلوب. قواعد التنسيق غير قابلة للتكوين ولكنها مُحسَّنة بالفعل للحصول على أفضل إخراج ممكن. لاحظ أن المنسق سيحتفظ بالمسافات وعلامات التبويب بين علامات المحتوى مثل div و span لأنه