Skip to content

Instantly share code, notes, and snippets.

View asadaly111's full-sized avatar
🏠
Working from home

Asad Ali asadaly111

🏠
Working from home
View GitHub Profile
@asadaly111
asadaly111 / function.php
Last active October 24, 2016 08:24
Php Essentials File
<?php
/*Site Base url */
session_start();
define("BASEURL","http://localhost/Erp/");
// Finance
define("FINANCE","".BASEURL."module/finance/");
define("SCRIPT","".BASEURL."inc/scripts/");
// Payroll
define("PAYROLL","".BASEURL."module/payroll/");
@asadaly111
asadaly111 / sticky.js
Created April 7, 2016 07:43
Sticky Header
var windowWidth = jQuery(window).width();
if(windowWidth > 768){
jQuery('.menu').addClass("remove-scrol");
jQuery(window).scroll(function() {
if (jQuery(this).scrollTop() > 100){
jQuery('.menu').addClass("sticky");
}
@asadaly111
asadaly111 / ajax.php
Last active November 9, 2016 05:05
Ajax in Php
$('#searhform').submit(function(event) {
event.preventDefault();
var formData = new FormData($(this)[0]);
var url = $(this).attr('action');
$.ajax({
type: 'post',
url: url,
contentType: false,
processData: false,
@asadaly111
asadaly111 / Bootstrap Media Queries
Last active June 6, 2017 06:59
Bootstrap Media Queries
/*bootstrap media queries*/
/*xs*/
@media (min-width: 1px) and (max-width: 767px){
}
/*sm*/
@media (min-width: 768px) and (max-width: 992px){
}
/*MD*/
@asadaly111
asadaly111 / loop.php
Last active October 11, 2018 15:25
WooCommerce Product Loop
//get product url with its id
$url = get_permalink( $product_id );
<?php
$args = array(
'post_type' => 'product',
'product_cat' => 'feature',
'posts_per_page' => 3
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
@asadaly111
asadaly111 / loop.php
Created April 16, 2016 20:22
WooCommerce Category Loop
<?php
/**
* Template Name: Fullwidth
*/
get_header(); ?>
<div class="container">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_post_thumbnail(); ?>
@asadaly111
asadaly111 / pagination.php
Last active May 11, 2017 07:40
Wordpess Pagination without plugin custom pagination by asadaly111
//add in function in function.php
function pagination($pages = '', $range = 4)
{
$showitems = ($range * 2)+1;
global $paged;
if(empty($paged)) $paged = 1;
if($pages == '')
{
@asadaly111
asadaly111 / jquery_snipets.php
Last active August 17, 2017 11:50
Jquery snipets and Sweat Alert for the Notifications functions
//Ajax Delete
swal({
title: "Are you sure ?",
text: "Are you sure you want to delete this Voucher?",
type: "info",
showCancelButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true,
}, function(){
setTimeout(function(){
//Reset Password Message
Your request was processed. You will receive an E-mail with further instructions to set a new password.
//Email for reset Passwrod
Hello,
We were asked to reset your TeamViewer account. Follow the instructions below if this request comes from you.
Ignore the E-Mail if the request to reset your password does not come from you. Don't worry, your account is safe.
Click the following link to set a new password.
@asadaly111
asadaly111 / web.config
Created July 19, 2016 07:25
Error showing in Windows hosting (custome error's)
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<rewrite>