Posts

all customer due sql query

  SELECT DONORID,DONORNAME,INROLLEDDATE,addresss AS DONORADDRESS, donor_mobile AS DONORMOBILE, INROLLEDMONTH,PAYABLEAMOUNT,paid_amount AS TOTALPAID, (CASE WHEN (PAYABLEAMOUNT-paid_amount)>0 THEN (PAYABLEAMOUNT-paid_amount) ELSE 0 END) AS TOTALDUEAMOUNT, (CASE WHEN (PAYABLEAMOUNT-paid_amount)<0 THEN ABS((PAYABLEAMOUNT-paid_amount)) ELSE 0 END) AS TOTALADVANCE FROM  ( SELECT c.id AS DONORID, CONVERT(YEAR(CONVERT(c.insert_date, DATE)),BINARY) AS INROLLEDYEAR, MONTH(CONVERT(c.insert_date, DATE)) AS MonthNo, MONTHNAME(CONVERT(c.insert_date, DATE)) AS MONTHNAME, CONVERT(c.insert_date, DATE) AS INROLLEDDATE, CURDATE(), FLOOR(DATEDIFF(CURDATE(),CONVERT(c.insert_date, DATE))/30) AS INROLLEDMONTH, FLOOR(DATEDIFF(CURDATE(),CONVERT(c.insert_date, DATE))/30)*c.donor_amount AS PAYABLEAMOUNT, c.donor_name AS DONORNAME, c.addresss,c.donor_district,c.donor_thana,c.donor_mobile,c.donor_type,     c.donor_amount,c.donor_rosid, (CASE WH...

id wise total due sql query

   SELECT DONORID,DONORNAME,INROLLEDDATE,addresss AS DONORADDRESS, donor_mobile AS DONORMOBILE, INROLLEDMONTH,PAYABLEAMOUNT,paid_amount AS TOTALPAID, (CASE WHEN (PAYABLEAMOUNT-paid_amount)>0 THEN (PAYABLEAMOUNT-paid_amount) ELSE 0 END) AS TOTALDUEAMOUNT, (CASE WHEN (PAYABLEAMOUNT-paid_amount)<0 THEN ABS((PAYABLEAMOUNT-paid_amount)) ELSE 0 END) AS TOTALADVANCE FROM  ( SELECT c.id AS DONORID, CONVERT(YEAR(CONVERT(c.insert_date, DATE)),BINARY) AS INROLLEDYEAR, MONTH(CONVERT(c.insert_date, DATE)) AS MonthNo, MONTHNAME(CONVERT(c.insert_date, DATE)) AS MONTHNAME, CONVERT(c.insert_date, DATE) AS INROLLEDDATE, CURDATE(), FLOOR(DATEDIFF(CURDATE(),CONVERT(c.insert_date, DATE))/30) AS INROLLEDMONTH, FLOOR(DATEDIFF(CURDATE(),CONVERT(c.insert_date, DATE))/30)*c.donor_amount AS PAYABLEAMOUNT, c.donor_name AS DONORNAME, c.addresss,c.donor_district,c.donor_thana,c.donor_mobile,c.donor_type,     c.donor_amount,c.donor_rosid, (C...

send email

 https://www.youtube.com/watch?v=FZfneLNyE4o     function do_email ( $msg = NULL , $sub = NULL , $to = NULL , $attachment = NULL ) {         $config = array ();         $config [ 'protocol' ] = "smtp" ;         $config [ 'smtp_host' ] = "ssl://smtp.googlemail.com" ;         $config [ 'smtp_port' ] = "465" ;         $config [ 'smtp_user' ] = "marinersbloodcenter@gmail.com" ;         $config [ 'smtp_pass' ] = "gyhqdnegnqfcqtvu" ;         $config [ 'mailtype' ] = "html" ;         $config [ 'charset' ] = "utf-8" ;         $config [ 'newline' ] = " \r\n " ;         $config [ 'wordwrap' ] = TRUE ;         $this -> load -> library ( 'email' );         $this -> email -> initialize ( $config );         $syst...

ajax-pagination-in-codeigniter

 https://webdamn.com/ajax-pagination-in-codeigniter-with-example/

sms intregation by laravel

  protected function createCustomer(Request $request)     {         $frontDesign=Websitefrontdesign::first();   if($request->password != $request->re_password) { return redirect()->route('register')->with('error_message', 'Password Not Matched,Please Try Again.'); } if($request->customer_email != null) { $customer_email=$request->customer_email;     $checkIfCutomerEmailExist=Customer::where('customer_email',$request->customer_email)->first();     if($checkIfCutomerEmailExist != null)     {     return redirect()->route('register')->with('error_message', 'Email Already Exist Please,Give Differnt Email Address.');     } } else { $customer_email=""; } $checkIfCutomerUserNameExist=Customer::where('customer_username',$request->customer_username)->first();       if($c...

get data by codeiginter

      $this -> data [ 'department' ] = $this -> db -> query ( " SELECT * FROM blog " ) -> result ();

date wise search codeigniter

  if ( ! empty ( $startdate ))         {             $this -> db -> where ( 'DATE(pickupman_received_date) >=' , $startdate );             }         if ( ! empty ( $enddate ))         {                   $this -> db -> where ( 'DATE(pickupman_received_date) <=' , $enddate );               }

laravel - order query

    $data = Order :: query ()             -> where ( 'employeeid' , 'LIKE' , "%{ $employeeid }%" )               -> orderBy ( 'id' , 'DESC' )             -> paginate ( 25 );

laravel where and orwhere query with pagination

    public function SupplierProductReturnSearch ( Request $request ){         // Get the search value from the request         $search = $request -> input ( 'search' );                   // Search in the title and body columns from the posts table         $listings = MainProduct :: query ()             -> where ( 'name' , 'LIKE' , "%{ $search }%" )                       -> orWhere ( 'product_id' , 'LIKE' , "%{ $search }%" )                       -> paginate ( 25 );             // Return the search view with the resluts compacted         return view ( 'front.manager.return-supplier-product' , compact ( 'listings' ));     }

other table connect

        // Load database   $db2 = $this -> load -> database ( 'database2' , TRUE );   // Select records from 2nd database   $db2 -> select ( '*' );   $db2 -> where ( 'id' , $business_id ); $query = $db2 -> get ( 'cld_businesses' );   $bussinessData = $query -> first_row ();

order by and order type

   $this->data['rows'] = $this->batch_model->get_rows(array("table" => "result_control", "limit" => $limit, "offset" => $offset,"order_by"=>"id", "order_type"=>"desc"), array());

number validation by codeiginter form

< div class = "col-sm-3" >     < div >         < label for = "phone_no" class = "control-label" > Contact No. < span class = "text-danger" > * </ span ></ label >         < input type = "number" minlength = "11" maxlength = "11" required id = "phone_no"             value = " <?php echo set_value ( 'phone_no' ); ? > " class = "form-control" name = "phone_no"             placeholder = "Enter Contact No." oninput = " validity . valid || ( value = ''); " />         <?php echo form_error ( 'phone_no' ); ? >     </ div > </ div > <?php $this -> form_validation -> set_error_delimiters ( '<div class="errorValid">' , '</div>' ); $this -> form_validation -> set_rules ( 'phone_no' , 'Contact No ...

mulitple where query codeiginter

      $query = $this -> $db -> select ( '*' ) -> where ([ 'b_cat_id' => $b_cat_id , 'b_s_cat_id' => $b_s_cat_id ]) -> get ( 'web_about' ) -> result ();

add filed in table and delete ospecific field

 ALTER TABLE `company_info` ADD `mail_welcome_template` VARCHAR(255) NULL AFTER `payment_option`;

checkbox checked table data selectd

Image
  < div class = "col-sm-4 form-group" >     < label class = "mt-checkbox" >         < input type = "checkbox" name = "all_donor" value = "1" onclick = " alldonar (); " > All Donor         < span ></ span >     </ label > </ div > <!-- all_donar_Modal --> < div class = "modal fade" id = "all_donar_Modal" tabindex = "-1" role = "dialog" aria-labelledby = "exampleModalCenterTitle"     aria-hidden = "true" >     < div class = "modal-dialog modal-dialog-centered" role = "document" >         < div class = "modal-content" >             < div class = "modal-header" >                 < h5 class = "modal-title" id = "exampleModalCenterTitle" > List of All Donar </ h5 >                 ...

other db connected

    $otherdb = $this -> load -> database ( 'otherdb' , TRUE );         $id = 4 ;     if ( $customeThemeSlug ) {       $save [ 'customeTheme' ] = $customeThemeSlug ;         $this -> db -> where ( 'id' , $id );       $this -> db -> update ( 'company_info' , $save );     }     //   $query = $otherdb->select('*')->get('company_info');     $otherdb -> where ( 'id' , $id );     $otherdb -> update ( 'company_info' , $save );     //   $query = $otherdb->select('*')->get('company_info');     $otherdb -> where ( 'id' , $id );     $otherdb -> update ( 'company_info' , $save ); $db [ 'otherdb' ] = array (     'dsn'   => '' ,     'hostname' => 'localhost' ,     'username' => 'root' ,     'password' => '' ,    ...

git ignore

  # These are some examples of commonly ignored file patterns. # You should customize this list as applicable to your project. # Learn more about .gitignore: #     https://www.atlassian.com/git/tutorials/saving-changes/gitignore # Node artifact files node_modules/ dist/ # Compiled Java class files *.class # Compiled Python bytecode *.py[cod] # Log files *.log # Package files *.jar # Maven target/ application/config/config.php application/config/database.php application/writable/ # JetBrains IDE .idea/ # Unit test reports TEST*.xml # Generated by MacOS .DS_Store # Generated by Windows Thumbs.db # Applications *.app *.exe *.war # Large media files *.mp4 *.tiff *.avi *.flv *.mov *.wmv

forget password

 step1 : view page :   < a href = " <?php echo base_url ( 'login/forgetpassword' ) ? > " > Forget password ? </ a > step 2:  controller     public function forgetpassword (){         $data = array ();         $this -> load -> view ( 'forget_password_view' , $data );     } step:3  forget_password_view         < form action = " <?php echo base_url (); ? > login/emailcheck" method = "post" >             < div   style = " background: url(' <?php echo base_url () . 'src/' ; ? > images/login-bg.png');background-size: 100%;background-repeat: no-repeat;padding: 30px 40px; " >                 < div class = "form-group" >                     < input class = "form-control form-control-solid" type = "e...