I'm making a company phone directory and I'm having a hard time passing the user's phone number into the modal to make it so they can call or text using tel: and mms:. This is what I have and it's definitely not working.
php
<div class="list-block">
<ul>
<?php
$result2 = mysql_query("SELECT * FROM users WHERE terminationDate = '0000-00-00' ORDER BY `firstName`") or die("Query 2 Failed: $result2");
while ($row2 = mysql_fetch_array($result2))
{
echo "
<li>
<a href='?cellPhone=".$row2['cellPhone']."' class='open-3-modal item-link item-content'>
<div class=\"item-media\"><img height=\"30px\" width=\"30px\" src=\"/photos/".$row2['firstName']."_".$row2['lastName'].".jpg\"></div>
<div class='item-inner'>
<div class='item-title'><strong>".$row2['firstName']."</strong> ".$row2['lastName']."</div>
</div>
</a>
</li>
";
}
?>
</ul>
js
<script>$$('.open-3-modal').on('click', function () {
myApp.modal({
title: 'Call or Text',
text: '',
buttons: [
{
text: '<?php $result2 = mysql_query("SELECT * FROM users WHERE terminationDate = '0000-00-00' AND cellPhone = '".$_GET['cellPhone']."'") or die("Query 2 Failed: $result2");
while ($row2 = mysql_fetch_array($result2))
{ echo '<a href="tel:'.$row2['cellPhone'].'" class="tab-link">Call</a>'; } ?>',
},
{
text: '<a href="#" class="tab-link">Text</a>',
},
{
text: 'Cancel',
bold: true,
close: function() {
myApp.alert('Canceled')
}
},
]
})
});
I'm pretty rusty with JS as you can probably tell. What's the best method of passing the information over to jQuery?