function show_student($db, $argv) { $collection = $db->createCollection("students"); if (sizeof($argv) == 2) { $cursor = $collection->find(); $i = 0; foreach ($cursor as $document) { echo "[1m" . $document["login"] . "[0m \t| "; echo $document["name"] . " \t| " . $document["age"] . " \t| "; echo $document["email"] . " \t| " . $document["phone"] . "\n"; $i++; } echo "*" . $i . "*\n"; } else { if (sizeof($argv) == 3) { $cursor = $collection->find(array("login" => $argv[2])); if (verif_login($argv[2], $cursor)) { foreach ($cursor as $document) { show_details($document, $db); } } } else { echo "Usage: ./etna_movies.php show_student [login].\n"; } } }
<style> .single_line{width:80%;background-color: inherit;} .property_info{width:80%;background-color: inherit;} </style> <?php $db = mysql_connect("localhost", 'ahomain', ',O8bOcL6JUXK') or die; // original //$db = mysql_connect("127.0.0.1", 'root', '') or die(); //$db = mysql_connect("127.0.0.1", 'cakejobportal', 'yeTunMpvLPtdeGZ5') or die(); mysql_select_db('ahomain_las_rc', $db); // original if (isset($_POST['show']) && $_POST['show'] == 'lead_details') { show_details($_POST['lead_id'], $_POST['consumer_id']); exit; } function show_details($lead_id, $consumer_id) { $sql = "select * from AHO_Consumers where ID=" . $consumer_id; $q4 = mysql_query($sql) or die(mysql_error()); $request = mysql_fetch_object($q4); $Property_Description = unserialize($request->Property_Description); $Email_ID = $request->Email_ID; $Full_Name = $request->Full_Name; $Receive_Option = $request->Receive_Option; $Registration_Date = $request->Registration_Date; $Phone_No = $request->Phone_No; $find = array("(", ")", "+", "-"); $replace = ''; $phone = str_replace($find, $replace, $Phone_No); if (strlen($phone) == 13) { $phone_no = substr($phone, 0, 3) . '+(' . substr($phone, 3, 3) . ')' . substr($phone, 6, 3) . '-' . substr($phone, 9, 4);