A unified approach to the summation and integration formulas for q-hypergeometric functions I