<?php
if (file_exists(upload_path.'volunteer/' . $employee_ID . '.jpg')) {
$filename = upload_url.'volunteer/' . $employee_ID . '.jpg';
} else {
    $filename = SITE_LINK.'img/profiles/avatar.jpg';
}

//echo"<pre>";
//die(print_r($Content));
?>

<body style="direction:rtl;" onload="window.print()">
    <div class="wrapper">
        <div class="panel ">
            <div class="panel-body">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-xs-3 col-sm-3 col-md-3">
                            <img id="EmployeeImagePreview" src="img/logo_white3.png" data-src="img/logo_white3.png" alt="" width="200" height="200" >

                        </div>
                        <div class=" col-xs-9 col-sm-9 col-md-9 profile-col">
                            <div class="profile-pic">
                                <div class="profile-border" >
                                    <img id="EmployeeImagePreview" src="<?php echo $filename; ?>" data-src="<?php echo $filename; ?>" alt="" >
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-12 col-md-12">
                            <h1 class="text-center"><?php print CommonLanguage::getMessage('volunteer_info') . ' &#91; ' . $Content[0]["Volunteer_Name"] . ' - ' . $Content[0]["Volunteer_Work_ID"] . ' &#93;'; ?></h1>
                        </div>

                    </div>
                </div>
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <h3 class="text-left" style="border:6px solid #4c0870;background-color: #4c0870;color: #fff;"><?php echo CommonLanguage::getMessage('hr_pers') ?></h3>

                            <div class="col-xs-12 col-md-12">
                                <div class="row">
                                    <div class="form-group">
                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('gender'); ?></span>
                                        <div class="col-xs-4 "> <?php echo CommonLanguage::getMessage($Content[0]["Gender_Name"]); ?></div>
                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('blood_type'); ?></span>
                                        <div class="col-xs-4 "><?php echo $Content[0]["Blood_Group_Name"]; ?></div>  
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('dob'); ?></span>
                                        <div class="col-xs-4 "> <?php echo $Content[0]["Volunteer_DOB"]; ?></div>
                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('marital_status'); ?></span>
                                        <div class="col-xs-4 "><?php echo CommonLanguage::getMessage($Content[0]['Merital_Status_Name']); ?></div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('country'); ?></span>
                                        <div class="col-xs-4 "><?php echo $Content[0]["Country_Name"]; ?></div>
                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('city'); ?></span>
                                        <div class="col-xs-4 " ><?php echo $Content[0]["Name"]; ?></div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('home_phone'); ?></span>
                                        <div class="col-xs-4 "><?php echo $Content[0]["Volunteer_HomePhone"]; ?></div>
                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('mobile_phone'); ?></span>
                                        <div class="col-xs-4 "><?php echo $Content[0]["Volunteer_MobilePhone"]; ?></div>

                                    </div>
                                </div>

                                <div class="row">
                                    <div class="form-group">
                                        <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('record_number'); ?></span>
                                        <div class="col-xs-4 "><?php echo $Content[0]["Volunteer_RecordNumber"]; ?></div>

                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('nationality'); ?></span>
                                        <div class="col-xs-4 "><?php echo $Content[0]["Nationality_Name"]; ?></div>  

                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('Email'); ?></span>
                                        <div class="col-xs-4 "><?php echo $Content[0]["Volunteer_Email"]; ?></div>

                                    </div>
                                </div>

                            </div>


                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 <?php echo empty($Content[0]["Volunteer_Problem"]) ? "no-print" : "" ?>">
                            <h3 class="text-left" style="border:6px solid #4c0870;background-color: #4c0870;color: #fff;"><?php echo CommonLanguage::getMessage('hr_pers_prob') ?></h3>

                            <div class="row">
                                <div class="form-group">
                                    <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('child_prob'); ?></span>
                                    <div class="col-xs-4 "> <?php echo $Content[0]["Volunteer_Problem"]; ?></div>
                                </div>
                            </div>



                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 <?php echo (empty($Content[0]["Volunteer_Education"]) && empty($Content[0]["Volunteer_Major"])) ? "no-print" : "" ?>">
                            <h3 class="text-left" style="border:6px solid #4c0870;background-color: #4c0870;color: #fff;"><?php echo CommonLanguage::getMessage('hr_pers_edu') ?></h3>
                            <div class="row">
                                <div class="form-group">
                                    <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('emp_edu'); ?></span>
                                    <div class="col-xs-4 "> <?php echo $Content[0]["Volunteer_Education"]; ?></div>
                                    <span class="col-xs-2 control-label"><?php print CommonLanguage::getMessage('emp_major'); ?></span>
                                    <div class="col-xs-4 "><?php echo $Content[0]["Volunteer_Major"]; ?></div>
                                </div>
                            </div>
                        </div>






                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <h3 class="text-left" style="border:6px solid #4c0870;background-color: #4c0870;color: #fff;"><?php echo CommonLanguage::getMessage('hr_vlnt_work') ?></h3>

                            <div class="row">
                                <div class="form-group">
                                    <span  class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('work_id'); ?></span>
                                    <div class="col-xs-4 "><?php echo $Content[0]["Volunteer_Work_ID"]; ?></div>
                                    <span  class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('working_hours'); ?></span>
                                    <div class="col-xs-4 "><?php echo $Content[0]["working_hours"]; ?></div>

                                </div>
                            </div>


                            <div class="row">
                                <div class="form-group">


                                    <span  class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('start_date'); ?></span>
                                    <div class="col-xs-4 "><?php echo $Content[0]["Volunteer_StartDate"] ?></div>
                                    <span  class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('volunteer_notice'); ?></span>
                                    <div class="col-xs-4 "><?php
                                        $i = 0;
                                        foreach ($Content[0]['volunteer_notice_arr'] as $skills) {
                                            echo $skills . ($i == 0 ? ',' : '');
                                            $i++;
                                        }
                                        ?></div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group">


                                    <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('volunteer_team'); ?></span>
                                    <div class="col-xs-4 "><?php
                                        $i = 0;
                                        foreach ($Content[0]['volunteer_team_arr'] as $skills) {
                                            echo $skills . ($i == 0 ? ',' : '');
                                            $i++;
                                        }
                                        ?></div>
                                    <span  class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('volunteer_skills'); ?></span>
                                    <div class="col-xs-4 "><?php
                                        $i = 0;
                                        foreach ($Content[0]['skills_name_arr'] as $skills) {
                                            echo $skills . ($i == 0 ? ',' : '');
                                            $i++;
                                        }
                                        ?></div>
                                </div>
                            </div>




                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <div class="col-sm-4 col-md-4 col-lg-4" >
                                <h3 class="text-left" style="border:6px solid #4c0870;background-color: #4c0870;color: #fff;"><?php echo CommonLanguage::getMessage('pro_list') ?></h3>
                            </div>  
                            <div class="col-sm-12 col-md-12 col-lg-12">
                                <div class="row">
                                    <?php
                                    $total = 0.0;
                                    for ($i = 0; $i < count($Content[0]['details']); $i++) {
                                        $Current = $Content[0]['details'][$i];
                                        $total += $Content[0]['details'][$i]['vlnt_hours'];
                                        ?>
                                        <div class="col-md-12">
                                            <div class="row">
                                                <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('pro_name'); ?></span>
                                                <div class="col-xs-4 "><?php echo $Current["pro_name"]; ?></div>
                                                <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('Date'); ?></span>
                                                <div class="col-xs-4 "><?php echo $Current["pro_date"]; ?></div>
                                            </div>
                                            <div class="row">
                                                <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('Location'); ?></span>
                                                <div class="col-xs-4 "><?php echo $Current["pro_loc"]; ?></div>
                                                <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('Description'); ?></span>
                                                <div class="col-xs-4 "><?php echo $Current["pro_desc"]; ?></div>
                                            </div>
                                            <div class="row">
                                                <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('pro_link'); ?></span>
                                                <div class="col-xs-4 "><?php echo $Current["pro_link"]; ?></div>
                                                <span class="col-xs-2 control-label "><?php print CommonLanguage::getMessage('hours'); ?></span>
                                                <div class="col-xs-4 "><?php echo $Current["vlnt_hours"]; ?></div>
                                            </div>

                                        </div>
                                    <?php } ?>
                                    <div class="col-md-12">
                                        <span class="col-xs-4 control-label "><?php print CommonLanguage::getMessage('real_work'); ?></span>
                                        <div class="col-xs-6 "><?php
                                            echo $total . ' ' . CommonLanguage::getMessage('hour');
                                            ;
                                            ?></div>
                                    </div>
                                </div>
                            </div>
                        </div>





                    </div>

                </div>
            </div>
        </div>
    </div>
</body>

<script>

    $(function () {

    });
    function PrintElem(elem)
    {
        var mywindow = window.open('', 'PRINT', 'height=600,width=800');

        mywindow.document.write('<html><head><style>.header,.page-sidebar,.breadcrumb{display:none;}</style>');
        mywindow.document.write('</head><body style="direction:rtl;">');
        mywindow.document.write(elem.html());
        mywindow.document.write('</body></html>');

        mywindow.document.close(); // necessary for IE >= 10
        mywindow.focus(); // necessary for IE >= 10*/

        mywindow.print();
        mywindow.close();

        return true;
    }

</script>