<?php
include("template.php"); 

$siteName = $_GET['siteName'] . " RESPONSE";
 
?>

 <body>
        <header id='header'>
                <?php echo $siteName; ?>
        </header>
        <section id='hyperlinks' class='leftlinks'>
        <?php
        include("mid_template.php");
         printSideLinks($currentPage);
        ?>
        </section>
        <section id='container'>
<?php 
//START WRITING PHP CODE HERE

//Variables
$phone= $_GET['phone'];
$first= $_GET['first'];
$last= $_GET['last'];
$upload= $_GET['upload'];
$account="AC061dfdeaac04466783e164e3efb4c72e";
$token="AUbce970ab2c4841da8e8b902de1f5e05a";

if(isset($upload) and $upload == 'true') {
  echo "upload is set";
}

//If last name is Empty then use first name as Business Name
if(empty($last)) {
  $business= $first;
  $site='"https://storage.opencnam.com/v1/phone/+1'.$phone.'?account_sid='.$account.'&auth_token='.$token.'" -v -d "business='.$business.'&language=eng&class=BUS"';
} else {
  $site='"https://storage.opencnam.com/v1/phone/+1'.$phone.'?account_sid='.$account.'&auth_token='.$token.'" -v -d "first_name='.$first.'&last_name='.$last.'&language=eng&class=BUS"';
}

echo 'Updating phone 1'.$phone.':</br>';
echo '</br>';
echo 'THIS CHANGE WILL REQURE 24 HOURS TO PROPAGATE TO ALL OF OUR SYSTEMS:</br>';

//Since this is not an option echo is the best bet.
echo '</br>';
echo '###################################################################</br>';
//$site='"https://storage.opencnam.com/v1/phone/+1'.$phone.'?account_sid='.$account.'&auth_token='.$token.'" -v -d "first_name='.$first.'&last_name='.$last.'&language=eng&class=BUS"';
$output = shell_exec('curl '.$site);
echo "<pre>$output</pre>";
echo '###################################################################</br>';
echo '</br>';
?>
<!--  </section>     -->                                                                                                                                         
        </section>

<?php
include("footer.php");
?>
