<html> <head> <?php require_once '../model/cardModel.php'; $cardModel = new cardModel(); $listeU = 0; $listeU = $cardModel->Afficher(0); if (isset($_POST['action'])) { if (count($listeU) != 0) { echo "<span class='new badge'>" . count($listeU) . "</span>"; } } ?> <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1"/> <!--Let browser know website is optimized for mobile--> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <!-- Compiled and minified CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/css/materialize.min.css"> <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js"></script> <!-- Compiled and minified JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/js/materialize.min.js"></script> </head> <body> <table> <thead> <tr> <th>ID</th> <th>CIN</th>
<?php require_once '../model/cardModel.php'; $card = new card(); $cardModel = new cardModel(); $prenom = $_POST['prenom']; $nom = $_POST['nom']; $cin = $_POST['cin']; $sexe = $_POST['sexe']; $date_naissance = $_POST['date_naissance_submit']; $adress = $_POST['adresse'] . ' ' . $_POST['zipcode'] . ' ' . $_POST['delegation'] . ' ' . $_POST['gouvernorat']; $yd_mail = $_POST['yd_mail']; $email = $_POST['email']; $statut = $_POST['statut']; $target_dir = "../view/images/Resources/photo/"; $target_file = $target_dir . basename($_FILES["file"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file, PATHINFO_EXTENSION); // Check if image file is a actual image or fake image if (isset($_POST["submit"])) { $check = getimagesize($_FILES["file"]["tmp_name"]); if ($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; } } // Check if file already exists if (file_exists($target_file)) {
$client->setApplicationName("Members"); $directory = new Google_Service_Directory($client); if (isset($_SESSION['service_token']) && $_SESSION['service_token']) { $client->setAccessToken($_SESSION['service_token']); } $key = file_get_contents($key_file_location); $cred = new Google_Auth_AssertionCredentials($service_account_name, array('https://www.googleapis.com/auth/admin.directory.user'), $key); $cred->sub = "*****@*****.**"; $client->setAssertionCredentials($cred); if ($client->getAuth()->isAccessTokenExpired()) { $client->getAuth()->refreshTokenWithAssertion($cred); } $_SESSION['service_token'] = $client->getAccessToken(); //end Auth require_once '../model/cardModel.php'; $cardModel = new cardModel(); $cardModel->setEtatOne($_GET['cin']); $user_info = $cardModel->Retrive($_GET['cin']); $id_user_1 = $user_info[0]["id_card"]; $prenom = $user_info[0]["prenom"]; $nom = $user_info[0]['nom']; $yd_mail = $user_info[0]['yd_mail']; $email = $user_info[0]['email']; if ($yd_mail == 0 || strpos($email, '@youthdecides.org') === FALSE) { $new_nom = str_replace(" ", "", strtolower($nom)); $new_prenom = str_replace(" ", "", strtolower($prenom)); $password = getMeRandomPwd(8); $password_b_u = $password; //create an accout google // SET UP THE USER/USERNAME OBJECTS $user = new Google_Service_Directory_User();
<?php if (isset($_GET['file'])) { require_once 'pdf/fpdf.php'; require_once 'pdf/fpdi.php'; require_once '../model/cardModel.php'; $name = $_GET['file']; $pdf = new FPDI(); $pdf->AddPage("Landscape", array(85.59999999999999, 53.98)); //Set the source PDF file if ($_GET['statut'] == 'junior') { $pagecount = $pdf->setSourceFile("YDCard/Junior.pdf"); } elseif ($_GET['statut'] == 'senior') { $pagecount = $pdf->setSourceFile("YDCard/Senior.pdf"); } elseif ($_GET['statut'] == 'sponsor') { $pagecount = $pdf->setSourceFile("YDCard/Sponsor.pdf"); } //Import the first page of the file $tppl = $pdf->importPage(1); $pdf->useTemplate($tppl); //Use this page as template // use the imported page and place it at point 20,30 with a width of 170 mm $pdf->Image($_GET['file_path'], 5, 40, 10, 10, 'png'); $path = 'userCard/' . $name . '.pdf'; $pdf->Output($path, "F"); header('location:../view/index.php'); $cardModel = new cardModel(); $cardModel->activateCard($path, $name); } else { header('location:../view/index.php'); }