Exemple #1
0
<?php

error_reporting(1);
include "../model/classUsers.php";
include "../model/commonFunctions.php";
$userObj = new users();
$cfObj = new commonFunctions();
$m = new MongoClient();
$db = $m->nextfax;
$collection = $db->nf_user;
$document = array("first_name" => "lambda", "last_name" => "admin", "email_id" => "*****@*****.**", "password" => $cfObj->generatePassword('admin'), "description" => "testing purpose", "profile_pic" => "", "mobile" => "564635453", "fax" => "", "user_type" => "AU", "created_date" => $cfObj->createDate(), "modified_date" => "", "status" => "A");
//$document = array("first_name" => "Hema","last_name" => "Sundar","email_id"=>"*****@*****.**","password" => $cfObj->generatePassword('123456'),"description"=>"testing purpose","profile_pic"=>"","mobile"=>"564635453","fax"=>"","user_type"=>"EU","created_date"=>$cfObj->createDate(),"modified_date"=>"","status"=>"A");
$collection->insert($document);
//$collection->update(array("title"=>"firstName"), array('$set'=>array("first_name"=>'test')));
if ($_POST['submit'] == "SignUp") {
    $Fname = $_POST['FName'];
    $FieldNames = array("FirstName" => $_POST['FName'], "LastName" => "Lambda", "email" => "*****@*****.**", "password" => "{$var}", "online" => true);
    $collection->insert($FieldNames);
}
if ($_POST['submit'] == "Login") {
    $Chusers = $userObj->checkAuthentication();
    $email = $_POST['usermail'];
    $PWD = base64_encode($_POST['Upassword']);
    $resUser = $collection->find(array("email" => "{$email}", "password" => "{$PWD}"));
    foreach ($resUser as $UserData) {
        echo @$UserData["FirstName"] . "\n";
    }
}
$wwwe = $collection->find()->limit(10)->skip(15);
//echo json_encode($wwwe);
foreach ($wwwe as $rData) {
    $UsrWghtRoutID[$i] = $row['UsrWghtRoutID'];
    $UsrWghtExerID[$i] = $row['UsrWghtExerID'];
    $UsrWghtSessID[$i] = $row['UsrWghtSessID'];
    $UsrWghtDate[$i] = $row['UsrWghtDate'];
    $MuscleGrpName[$i] = $row['MuscleGrpName'];
    $UsrExerName[$i] = $row['UsrExerName'];
    $UsrSetsQTY[$i] = $row['UsrSetsQTY'];
    $UsrWghtSet[$i] = array($row['UsrWghtSet1'], $row['UsrWghtSet2'], $row['UsrWghtSet3'], $row['UsrWghtSet4'], $row['UsrWghtSet5'], $row['UsrWghtSet6'], $row['UsrWghtSet7'], $row['UsrWghtSet8'], $row['UsrWghtSet9'], $row['UsrWghtSet10']);
    $UsrRepSet[$i] = array($row['UsrRepSet1'], $row['UsrRepSet2'], $row['UsrRepSet3'], $row['UsrRepSet4'], $row['UsrRepSet5'], $row['UsrRepSet6'], $row['UsrRepSet7'], $row['UsrRepSet8'], $row['UsrRepSet9'], $row['UsrRepSet10']);
    $i++;
}
## Find highest number in UsrSetsQTY column, add 1
$maxSets = max($UsrSetsQTY) + 1;
$current_url = $_SERVER['PHP_SELF'];
## Create new instance of common functions ##
$displayData = new commonFunctions();
## Start HTML page
echo "<html><head>" . "<title>show workout</title>" . "</head>" . "<body>" . "<center><h4>Show Workout</h4></center>";
## There are two modes view (for viewing data) and modify for modifing data
## If we are in view mode display the following code. ##
if (!$modify) {
    echo "<table border=1>";
    echo "<tr><td><a href=\"{$current_url}?modify=1\">modify records</a></td></tr>\n";
    echo "<tr>";
    /*## Display the tabs on top for view all and all muscle groups related to the workout.
      This enables users to view all workout records. */
    ##
    echo "<td><a href=\"{$current_url}\">View All</a></td>\n";
    $displayData->displayMuscGrpSelect($MuscleGrpName, $current_url, $num);
    echo "</tr>";
    /*## Display musclegroup headings.  Heading is only displayed once per muscle group */
<?php

require_once 'classes/config.php';
require_once 'classes/admin.php';
require_once 'classes/commonFunctions.php';
$obj = new Admin();
$obj2 = new commonFunctions();
if (!$obj->isAdminLoggedIn()) {
    header("Location: login.php");
    exit(0);
} else {
    $admin_id = $_SESSION['admin_id'];
}
$error = false;
$err_msg = "";
$msg = '';
$err_msg_start = '<div class="alert">
					  <button type="button" class="close btn-warning" data-dismiss="alert">&times;</button>
					  <strong>';
$err_msg_end = '</strong></div>';
if (isset($_POST['btnSubmit'])) {
    $username = strip_tags(trim($_POST['username']));
    $email = trim($_POST['email']);
    $fname = strip_tags(trim($_POST['fname']));
    $lname = strip_tags(trim($_POST['lname']));
    $bday = trim($_POST['bday']);
    $bmonth = trim($_POST['bmonth']);
    $byear = trim($_POST['byear']);
    $gender = trim($_POST['gender']);
    $address = trim($_POST['address']);
    $contact_no = trim($_POST['contact_no']);
<?php

session_start();
/*error_reporting(E_ALL);
ini_set("display_errors", 1);*/
$siteurl = $_SERVER['DOCUMENT_ROOT'] . "/nf";
include $siteurl . "/controller/faxController.php";
include $siteurl . "/model/commonFunctions.php";
include $siteurl . "/model/PDFMerger.php";
$pdf1 = new PDFMerger();
$cfObj = new commonFunctions();
$faxObjCon = new faxController();
$faxObj = new faxModel();
// Database Connection
$mC = new MongoClient();
$db = $mC->nf;
if ($_POST['submit_reply'] == "reply") {
    require_once 'tcpdf/tcpdf.php';
    // create new PDF document
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document information
    // $pdf->SetCreator(PDF_CREATOR);
    // $pdf->SetAuthor('Nicola Asuni');
    // $pdf->SetTitle('TCPDF Example 001');
    // $pdf->SetSubject('TCPDF Tutorial');
    // $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // set default header data
    // $pdf->SetHeaderData('../../../assets/img/gallery/Image01.jpg', PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', "Sample", array(0,64,255), array(0,64,128));
    $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
    // set header and footer fonts
    // $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$i = 0;
while ($row = $showNewWorkout->fetch_array()) {
    $UsrSetsID[$i] = $row['UsrSetsID'];
    $UsrSetsUsrID[$i] = $row['UsrSetsUsrID'];
    $UsrSetsRoutID[$i] = $row['UsrSetsRoutID'];
    $UsrSetsQty[$i] = $row['UsrSetsQty'];
    $UsrExerName[$i] = $row['UsrExerName'];
    $UsrRoutName[$i] = $row['UsrRoutName'];
    $MuscleGrpName[$i] = $row['MuscleGrpName'];
    $i++;
}
## Find highest number in UsrSetsQTY column, add 1
$maxSets = max($UsrSetsQty) + 1;
$current_url = $_SERVER['PHP_SELF'];
## Create new instance of common functions ##
$displayData = new commonFunctions();
## Start HTML page
echo "<html><head>" . "<title>Insert Workout</title>" . "</head>" . "<body>" . "<center><h4>Insert Workout</h4></center>";
echo "<form method=\"POST\" action=\"updateworkout.php\">";
echo "<table border=\"1\">" . "<tr>";
## Display Header Information, part of this commns from our functions class ##
echo "<td><a href=\"{$current_url}\">View All</a></td>\n";
$displayData->displayMuscGrpSelect($MuscleGrpName, $current_url, $num);
echo "</tr>";
/*## Display musclegroup headings.  Heading is only displayed once per muscle group */
##
for ($i = 0; $i < $num; $i++) {
    $sameGrp = $i - 1;
    $g = 1;
    $setNum = max($UsrSetsQty);
    if (!$viewOnly) {