Newer
Older
ubFramework / Portal / docroot / user / voip / did.php
@Christopher W. Olsen Christopher W. Olsen on 10 Dec 2017 4 KB Cleaning Up Making It A Sub Module
<?php

/**
 * Copyright (c) 2013 - 2015, 2016 Christopher W. Olsen <cwolsen@uBixStudios.com>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *    This product includes software developed by uBix Technologies.
 * 4. Neither the name of uBix Technologies nor the
 *    names of its contributors may be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY uBix Technologies ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL uBix Technologies BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * $Id: did.php 943 2017-09-07 20:16:43Z reddawg $
 *
 * ***************************************************************************************
 */

/* Main include info */
ini_set ( 'include_path', $_SERVER ['DOCUMENT_ROOT'] . "/include/" );
include ("config.php");

/* Assign the page title */
$ubF->tpl->assign ( "PAGE_TITLE", "Account: VoIP - DID List" );

/* Main defines */
$ubF->tpl->define ( array (
  "index" => "user/wrapper/default.html" 
) );
$ubF->tpl->define ( array (
  "menu" => "user/voip/menu.html" 
) );
$ubF->tpl->define ( array (
  "body" => "user/voip/did.html" 
) );

$ubF->session->Validate ( 'U_V_', 0 );

/*
 *
 * $ubF->tpl->assign ( "ACCOUNTS", $data->libs ['voip']->getAccounts () );
 *
 * if ( !isset ( $form_data ['dtype'] ) )
 * $form_data ['dtype'] = 0;
 *
 * $ubF->tpl->assign ( "DTYPE", $form_data ['dtype'] );
 * $ubF->tpl->assign ( "D_TYPE", $data->libs ['ubf']->vDIDTypes [$form_data ['dtype']] );
 *
 * if ( !isset ( $form_data ['sort_by'] ) )
 * $form_data ['sort_by'] = "did";
 *
 * if ( isset ( $form_data ['sort_key'] ) )
 * $form_data ['sort_by'] = $form_data ['sort_key'];
 *
 * $ubF->tpl->assign ( "SORT_BY", $form_data ['sort_by'] );
 *
 * switch ( $form_data ['sort_by'] ) {
 * case 'caller_id' :
 * $sort_by = "caller_id, did";
 * break;
 * case 'account_number' :
 * $sort_by = "account_number, did";
 * break;
 * case 'e911' :
 * $sort_by = "e911, did";
 * break;
 * case 'cnam' :
 * $sort_by = "cnam, did";
 * break;
 * case 't38' :
 * $sort_by = "t38, did";
 * break;
 * default :
 * $sort_by = "DID";
 * }
 *
 * if ( isset ( $form_data ['account_number'] ) && $form_data ['account_number'] != "" )
 * $query = "SELECT account_number,vdid_id,did,caller_id,e911,cnam,t38 FROM voip_did WHERE type = " . $form_data ['dtype'] . " AND account_number = '" . $form_data ['account_number'] . "' ORDER BY " . $sort_by;
 * else
 * $query = "SELECT account_number,vdid_id,did,caller_id,e911,cnam,t38 FROM voip_did WHERE type = " . $form_data ['dtype'] . " ORDER BY " . $sort_by;
 *
 * $result = $ubF->DB ['main']->query ( $query );
 *
 * if ( $result !== false ) {
 * $rows = "";
 * while ( $qData = $result->fetch_assoc () ) {
 * if ( $qData ['e911'] == 1 )
 * $e911 = "Y";
 * else
 * $e911 = "N";
 *
 * if ( $qData ['cnam'] == 1 )
 * $cnam = "Y";
 * else
 * $cnam = "N";
 *
 * if ( $qData ['t38'] == 1 )
 * $t38 = "Y";
 * else
 * $t38 = "N";
 *
 * $rows .= "<tr><td>" . $qData ['did'] . "</td><td><input type=\"text\" name=\"data[" . $qData ['vdid_id'] . "][caller_id]\" value=\"" . $qData ['caller_id'] . "\" maxlength=\"13\"></td><td>" . $qData ['account_number'] . "</td><td>$e911</td><td>$cnam</td><td>$t38</td></tr>\n";
 * }
 * $ubF->tpl->assign ( "ROWS", $rows );
 * }
 */

/* Parse and print */
$ubF->tpl->parse ( "MENU", "menu" );
$ubF->tpl->parse ( "BODY", "body" );
$ubF->tpl->parse ( "INDEX", "index" );
$ubF->tpl->FastPrint ( "INDEX" );

?>