7. NOTES PAYABLE (Tables)
   | 
6 Months Ended | 
Jun. 30, 2017  | 
| Unsecured Note Payable [Member] | 
 
 | 
| Schedule of debt | 
    |   | 
  | 
    Maturity | 
  | 
  | 
    June
    30, 2017 | 
  | 
  | 
    December
    31, 2016 | 
  | 
  | 
    Interest
    Rate | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
      | 
  | 
  | 
      | 
  | 
  | 
      | 
  | 
 
    | Unsecured promissory note payable | 
  | 
      | 
February
                                         1, 2018 | 
  | 
  | 
    $ | 
850,000 | 
  | 
  | 
    $ | 
850,000 | 
  | 
  | 
      | 
12% | 
  | 
 
    | Unamortized original issue
    discount and debt issuance costs | 
  | 
      | 
  | 
  | 
  | 
      | 
(14,167 | 
) | 
  | 
      | 
(26,309 | 
) | 
  | 
      | 
  | 
  | 
 
    | Unamortized
    debt discount - fair value of warrants | 
  | 
      | 
  | 
  | 
  | 
      | 
(77,817 | 
) | 
  | 
      | 
(144,517 | 
) | 
  | 
      | 
  | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
    | Net carrying amount of debt | 
  | 
      | 
  | 
  | 
  | 
      | 
758,016 | 
  | 
  | 
      | 
679,174 | 
  | 
  | 
      | 
  | 
  | 
 
    | Less current portion | 
  | 
      | 
  | 
  | 
  | 
      | 
(758,016 | 
) | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Long-term
    borrowings - net of current portion | 
  | 
      | 
  | 
  | 
  | 
    $ | 
– | 
  | 
  | 
    $ | 
679,174 | 
  | 
  | 
      | 
  | 
  | 
 
 
 | 
| Iliad Note [Member] | Convertible Notes Payable [Member] [Default Label] | 
 
 | 
| Schedule of debt | 
    |   | 
  | 
    June
    30, 2017 | 
  | 
  | 
    December
    31, 2016 | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
      | 
  | 
 
    | Iliad Note (defined below) | 
  | 
    $ | 
587,995 | 
  | 
  | 
    $ | 
1,897,976 | 
  | 
 
    | Iliad Note 2 (defined below) | 
  | 
      | 
762,485 | 
  | 
  | 
      | 
– | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
    |   | 
  | 
    $ | 
1,350,480 | 
  | 
  | 
    $ | 
1,897,976 | 
  | 
 
 
 | 
| SPA [Member] | Convertible Notes Payable [Member] [Default Label] | 
 
 | 
| Schedule of debt | 
    |   | 
  | 
    Maturity | 
  | 
  | 
    June
    30, 2017 | 
  | 
  | 
    December
    31, 2016 | 
  | 
  | 
    Interest
    Rate | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
      | 
  | 
  | 
      | 
  | 
  | 
      | 
  | 
 
    | Secured promissory note payable | 
  | 
      | 
June
                                         24, 2017 | 
  | 
  | 
    $ | 
2,055,000 | 
  | 
  | 
    $ | 
2,055,000 | 
  | 
  | 
      | 
10% | 
  | 
 
    | Interest accrued | 
  | 
      | 
  | 
  | 
  | 
      | 
182,995 | 
  | 
  | 
      | 
128,311 | 
  | 
  | 
      | 
  | 
  | 
 
    | Unamortized original issue
    discount and debt issuance costs | 
  | 
      | 
  | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
(35,335 | 
) | 
  | 
      | 
  | 
  | 
 
    | Conversion of convertible
    promissory notes and accrued interest to common stock | 
  | 
      | 
  | 
  | 
  | 
      | 
(1,650,000 | 
) | 
  | 
      | 
(175,000 | 
) | 
  | 
      | 
  | 
  | 
 
    | Conversion
    of convertible promissory notes and accrued interest to accrued liabilities | 
  | 
      | 
  | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
(75,000 | 
) | 
  | 
      | 
  | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
    | Net carrying amount of debt | 
  | 
      | 
  | 
  | 
  | 
      | 
587,995 | 
  | 
  | 
      | 
1,897,976 | 
  | 
  | 
      | 
  | 
  | 
 
    | Less current portion | 
  | 
      | 
  | 
  | 
  | 
      | 
(587,995 | 
) | 
  | 
      | 
(1,897,976 | 
) | 
  | 
      | 
  | 
  | 
 
    | Long-term borrowings
    - net of current portion | 
  | 
      | 
  | 
  | 
  | 
    $ | 
– | 
  | 
  | 
    $ | 
– | 
  | 
  | 
      | 
  | 
  | 
 
 
 | 
| Schedule of conversions | 
    |   | 
  | 
      | 
  | 
  | 
    2016 | 
  | 
  | 
      | 
  | 
 
    |   | 
  | 
    Maturity | 
  | 
  | 
    Balance | 
  | 
  | 
    Interest
    Rate | 
  | 
 
    | Senior Secured Convertible Promissory Notes: | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
    | Tranche 1 (Note 1) | 
  | 
      | 
May
                                         19, 2016 | 
  | 
  | 
    $ | 
– | 
  | 
  | 
      | 
10% | 
  | 
 
    | Tranche 2 (Note 2) | 
  | 
      | 
June 12, 2016 | 
  | 
  | 
      | 
255,000 | 
  | 
  | 
      | 
10% | 
  | 
 
    | Tranche 3 (Note 3) | 
  | 
      | 
July 24, 2016 | 
  | 
  | 
      | 
510,000 | 
  | 
  | 
      | 
10% | 
  | 
 
    | Tranche 4 (Note 4) | 
  | 
      | 
September
                                         16, 2016 | 
  | 
  | 
      | 
255,000 | 
  | 
  | 
      | 
10% | 
  | 
 
    | Total borrowings | 
  | 
      | 
  | 
  | 
  | 
      | 
1,020,000 | 
  | 
  | 
      | 
  | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
    | Convertible notes converted (Note 1) | 
  | 
      | 
  | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Convertible notes converted (Note 2) | 
  | 
      | 
  | 
  | 
  | 
      | 
(255,000 | 
) | 
  | 
      | 
  | 
  | 
 
    | Convertible notes converted/repaid (Note 3) | 
  | 
      | 
  | 
  | 
  | 
      | 
(510,000 | 
) | 
  | 
      | 
  | 
  | 
 
    | Convertible notes repaid (Note 4) | 
  | 
      | 
  | 
  | 
  | 
      | 
(255,000 | 
) | 
  | 
      | 
  | 
  | 
 
    | Unamortized debt issuance cost | 
  | 
      | 
  | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Unamortized debt discount
    - beneficial conversion feature | 
  | 
      | 
  | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
    | Net carrying amount of debt | 
  | 
      | 
  | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Less current portion | 
  | 
      | 
  | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Long-term borrowings - net of current portion | 
  | 
      | 
  | 
  | 
  | 
    $ | 
– | 
  | 
  | 
      | 
  | 
  | 
 
 
 | 
| Iliad Note 2 [Member] | Convertible Notes Payable [Member] [Default Label] | 
 
 | 
| Schedule of debt | 
    |   | 
  | 
    Maturity | 
  | 
  | 
    June
    30, 2017 | 
  | 
  | 
    December
    31, 2016 | 
  | 
  | 
    Interest
    Rate | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
      | 
  | 
  | 
      | 
  | 
  | 
      | 
  | 
 
    | Secured promissory note payable | 
  | 
      | 
April
                                         30, 2018 | 
  | 
  | 
    $ | 
770,000 | 
  | 
  | 
    $ | 
– | 
  | 
  | 
      | 
8% | 
  | 
 
    | Interest accrued | 
  | 
      | 
  | 
  | 
  | 
      | 
20,983 | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Unamortized original issue discount and debt issuance costs | 
  | 
      | 
  | 
  | 
  | 
      | 
(14,285 | 
) | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Unamortized discount - embedded derivative | 
  | 
      | 
  | 
  | 
  | 
      | 
(14,213 | 
) | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
    |   | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
    | Net carrying amount of debt | 
  | 
      | 
  | 
  | 
  | 
      | 
762,485 | 
  | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Less current portion | 
  | 
      | 
  | 
  | 
  | 
      | 
(762,485 | 
) | 
  | 
      | 
– | 
  | 
  | 
      | 
  | 
  | 
 
    | Long-term borrowings
    - net of current portion | 
  | 
      | 
  | 
  | 
  | 
    $ | 
– | 
  | 
  | 
    $ | 
– | 
  | 
  | 
      | 
  | 
  | 
 
 
 |